1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
// =============================================================== //
// //
// File : gb_undo.h //
// Purpose : //
// //
// Institute of Microbiology (Technical University Munich) //
// http://www.arb-home.de/ //
// //
// =============================================================== //
#ifndef GB_UNDO_H
#define GB_UNDO_H
#ifndef GB_LOCAL_H
#include "gb_local.h"
#endif
struct gb_transaction_save;
struct g_b_undo_list;
enum g_b_undo_entry_type {
GB_UNDO_ENTRY_TYPE_DELETED,
GB_UNDO_ENTRY_TYPE_CREATED,
GB_UNDO_ENTRY_TYPE_MODIFY,
GB_UNDO_ENTRY_TYPE_MODIFY_ARRAY
};
struct g_b_undo_gbd {
GBQUARK key;
GBDATA *gbd;
};
struct g_b_undo_entry {
g_b_undo_list *father;
g_b_undo_entry *next;
short type;
short flag;
GBDATA *source; // The original(changed) element or father(of deleted)
int gbm_index;
long sizeof_this;
union {
gb_transaction_save *ts;
g_b_undo_gbd gs;
} d;
};
struct g_b_undo_header {
g_b_undo_list *stack;
long sizeof_this; // the size of all existing undos
long nstack; // number of available undos
};
struct g_b_undo_list {
g_b_undo_header *father;
g_b_undo_entry *entries;
g_b_undo_list *next;
long time_of_day; // the begin of the transaction
long sizeof_this; // the size of one undo
};
struct g_b_undo_mgr {
long max_size_of_all_undos;
g_b_undo_list *valid_u;
g_b_undo_header *u; // undo
g_b_undo_header *r; // redo
};
#else
#error gb_undo.h included twice
#endif // GB_UNDO_H
|