Index: trunk/src/event.h =================================================================== --- trunk/src/event.h (revision 20454) +++ trunk/src/event.h (revision 20455) @@ -46,6 +46,8 @@ PCB_EVENT_LIBRARY_CHANGED, /* called after a change in the footprint lib (used to be the LibraryChanged action) */ PCB_EVENT_FONT_CHANGED, /* called when a font has changed; argument is the font ID */ + PCB_EVENT_UNDO_POST, /* called after an undo/redo operation; argument is an integer pcb_undo_ev_t */ + PCB_EVENT_NEW_PSTK, /* called when a new padstack is created */ PCB_EVENT_BUSY, /* called before CPU-intensive task begins */ Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 20454) +++ trunk/src/undo.c (revision 20455) @@ -52,6 +52,7 @@ #include "data.h" #include "draw.h" #include "error.h" +#include "event.h" #include "insert.h" #include "polygon.h" #include "remove.h" @@ -119,6 +120,8 @@ else if (pcb_undo_and_draw) pcb_draw(); + pcb_event(PCB_EVENT_UNDO_POST, "i", PCB_UNDO_EV_UNDO); + return res; } @@ -161,6 +164,8 @@ else if (pcb_undo_and_draw) pcb_draw(); + pcb_event(PCB_EVENT_UNDO_POST, "i", PCB_UNDO_EV_REDO); + return res; } @@ -210,8 +215,10 @@ */ void pcb_undo_clear_list(pcb_bool Force) { - if (pcb_uundo.num_undo && (Force || pcb_gui->confirm_dialog("OK to clear 'undo' buffer?", 0))) + if (pcb_uundo.num_undo && (Force || pcb_gui->confirm_dialog("OK to clear 'undo' buffer?", 0))) { uundo_list_clear(&pcb_uundo); + pcb_event(PCB_EVENT_UNDO_POST, "i", PCB_UNDO_EV_CLEAR_LIST); + } } /* --------------------------------------------------------------------------- @@ -247,6 +254,7 @@ void pcb_undo_truncate_from(uundo_serial_t sfirst) { uundo_list_truncate_from(&pcb_uundo, sfirst); + pcb_event(PCB_EVENT_UNDO_POST, "i", PCB_UNDO_EV_TRUNCATE); } int undo_check(void) Index: trunk/src/undo.h =================================================================== --- trunk/src/undo.h (revision 20454) +++ trunk/src/undo.h (revision 20455) @@ -35,6 +35,13 @@ /* Temporary for compatibility */ #include "undo_old.h" +typedef enum pcb_undo_ev_e { + PCB_UNDO_EV_UNDO, + PCB_UNDO_EV_REDO, + PCB_UNDO_EV_CLEAR_LIST, + PCB_UNDO_EV_TRUNCATE +} pcb_undo_ev_t; + void *pcb_undo_alloc(pcb_board_t *pcb, const uundo_oper_t *oper, size_t data_len); int pcb_undo(pcb_bool); int pcb_redo(pcb_bool);