Index: trunk/src/event.h =================================================================== --- trunk/src/event.h (revision 2255) +++ trunk/src/event.h (revision 2256) @@ -1,8 +1,9 @@ typedef enum { - EVENT_GUI_INIT, /* finished initializing the GUI called right before the main loop of the GUI; args: (void) */ - EVENT_CLI_ENTER, /* the user pressed enter on a CLI command - called before parsing the line for actions; args: (str commandline) */ - - EVENT_last /* not a real event */ + EVENT_GUI_INIT, /* finished initializing the GUI called right before the main loop of the GUI; args: (void) */ + EVENT_CLI_ENTER, /* the user pressed enter on a CLI command - called before parsing the line for actions; args: (str commandline) */ + EVENT_SAVE_PRE, /* called before saving the design */ + EVENT_SAVE_POST, /* called after saving the design */ + EVENT_last /* not a real event */ } event_id_t; /* Maximum number of arguments for an event handler, auto-set argv[0] included */ Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 2255) +++ trunk/src/plug_io.c (revision 2256) @@ -100,6 +100,7 @@ #include "hid_actions.h" #include "hid_flags.h" #include "plugins.h" +#include "event.h" plug_io_t *plug_io_chain = NULL; @@ -236,8 +237,11 @@ int res; plug_io_t *p = find_writer(fmt); - if (p != NULL) + if (p != NULL) { + event(EVENT_SAVE_PRE, "s", fmt); res = p->write_pcb(p, f); + event(EVENT_SAVE_POST, "s", fmt); + } plug_io_err(res, "write pcb", NULL); return res; }