Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

mainundo.h

Go to the documentation of this file.
00001 #ifndef MAINUNDO_H
00002 #define MAINUNDO_H
00003 
00004 
00005 #include "bctimer.inc"
00006 #include "linklist.h"
00007 #include "mwindow.inc"
00008 
00009 #include <stdint.h>
00010 
00011 
00012 class UndoStackItem;
00013 class MainUndoStackItem;
00014 
00015 
00016 class MainUndo
00017 {
00018 public:
00019         MainUndo(MWindow *mwindow);
00020         ~MainUndo();
00021 
00022    // Use this function for UndoStackItem subclasses with custom
00023    // undo and redo functions.  All fields including description must
00024    // be populated before calling this function.
00025    void push_undo_item(UndoStackItem *item);
00026 
00027         void update_undo(char *description, 
00028                 uint32_t load_flags, 
00029                 void *creator = 0,
00030                 int changes_made = 1);
00031 
00032 // alternatively, call this one after the change
00033         void push_state(char *description, uint32_t load_flags, void* creator);
00034 
00035 // Used in undo and redo to reset the creators in all the records.
00036         void reset_creators();
00037 
00038         int undo();
00039         int redo();
00040 
00041 private:
00042         List<UndoStackItem> undo_stack;
00043         List<UndoStackItem> redo_stack;
00044         MainUndoStackItem* new_entry;   // for setting the after buffer
00045 
00046         MWindow *mwindow;
00047         Timer *last_update;
00048         char* data_after;       // the state after a change
00049 
00050         void capture_state();
00051         void prune_undo();
00052         bool ignore_push(char *description, uint32_t load_flags, void* creator);
00053 
00054         friend class MainUndoStackItem;
00055 };
00056 
00057 #endif

Generated on Sun Jan 8 13:38:56 2006 for Cinelerra-svn by  doxygen 1.4.4