source: branches/species/ARBDB/gb_undo.h

Last change on this file was 19654, checked in by westram, 5 weeks ago
  • reintegrates 'macros' into 'trunk'
    • improves program termination (#867)
      • introduces MacroExitor classes
        • handles confirmation (to quit)
        • waits for macros to finish, then exits w/o confirmation
        • provides specialized termination for different programs via derived classes
          • has been implemented for "normal" arb and merge-tool.
      • introduces ARB_disconnect_from_db
        • generalizes code to terminate all interconnections between GUI, database and macro-ability
        • allow to install atdisconnect-callbacks
          • usable by modules operating on a database; allow to inform module that database will vanish.
        • now used by all arb applications to disconnect from all their database(s), except the properties.
    • fixes some broken behavior
      • merge-tool
        • crashed when quitting via macro
        • wrong restarts, if originally started with arguments,
      • importer
        • failed to record/playback macros
        • crashed in modules operating on the temporary import database
      • database browser
        • crashed on disappearing database
  • adds: log:branches/macros@19620:19653
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : gb_undo.h                                         //
4//   Purpose   :                                                   //
5//                                                                 //
6//   Institute of Microbiology (Technical University Munich)       //
7//   http://www.arb-home.de/                                       //
8//                                                                 //
9// =============================================================== //
10
11#ifndef GB_UNDO_H
12#define GB_UNDO_H
13
14#ifndef GB_LOCAL_H
15#include "gb_local.h"
16#endif
17
18struct gb_transaction_save;
19struct g_b_undo_list;
20
21enum g_b_undo_entry_type {
22    GB_UNDO_ENTRY_TYPE_DELETED,
23    GB_UNDO_ENTRY_TYPE_CREATED,
24    GB_UNDO_ENTRY_TYPE_MODIFY,
25    GB_UNDO_ENTRY_TYPE_MODIFY_ARRAY
26};
27
28struct g_b_undo_gbd {
29    GBQUARK  key;
30    GBDATA  *gbd;
31};
32
33struct g_b_undo_entry {
34    g_b_undo_list  *father;
35    g_b_undo_entry *next;
36    short           type; // = same values as enum g_b_undo_entry_type
37    short           flag;
38
39    GBDATA *source;                                 // The original(changed) element or father(of deleted)
40    int     gbm_index;
41    long    sizeof_this;
42    union {
43        gb_transaction_save *ts;
44        g_b_undo_gbd         gs;
45    } d;
46};
47
48struct g_b_undo_header {
49    g_b_undo_list *stack;
50    long           sizeof_this;                     // the size of all existing undos
51    long           nstack;                          // number of available undos
52};
53
54struct g_b_undo_list {
55    g_b_undo_header *father;
56    g_b_undo_entry  *entries;
57    g_b_undo_list   *next;
58    long             time_of_day;                   // the begin of the transaction
59    long             sizeof_this;                   // the size of one undo
60};
61
62struct g_b_undo_mgr {
63    long             max_size_of_all_undos;
64    g_b_undo_list   *valid_u;
65    g_b_undo_header *u;                             // undo
66    g_b_undo_header *r;                             // redo
67};
68
69#else
70#error gb_undo.h included twice
71#endif // GB_UNDO_H
Note: See TracBrowser for help on using the repository browser.