From 88b00fd546faa6e5ff0e1a30cf01b0422e66d48e Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Sun, 28 Nov 2021 13:29:13 +0100 Subject: [PATCH] add undo function pointers --- src/xinit.c | 5 +++++ src/xschem.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/xinit.c b/src/xinit.c index b7eaa499..3f4f1294 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -586,6 +586,11 @@ void alloc_xschem_data(const char *top_path) xctx->undo_initialized = 0; /* in_memory_undo */ #endif xctx->time_last_modify = 0; + xctx->push_undo_ptr = &push_undo; + xctx->pop_undo_ptr = &pop_undo; + xctx->delete_undo_ptr = &delete_undo; + xctx->clear_undo_ptr = &clear_undo; + } void delete_schematic_data(void) diff --git a/src/xschem.h b/src/xschem.h index 958ec499..35f29311 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -713,6 +713,10 @@ typedef struct { int fill_pattern; int draw_window; time_t time_last_modify; + void (*push_undo_ptr)(void); + void (*pop_undo_ptr)(int, int); + void (*delete_undo_ptr)(void); + void (*clear_undo_ptr)(void); } Xschem_ctx; struct Lcc { /* used for symbols containing schematics as instances (LCC, Local Custom Cell) */