4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "bctimer.inc"
29 #include "filexml.inc"
30 #include "mwindow.inc"
31 #include "undostack.inc"
37 MainUndo(MWindow *mwindow);
40 // For tweeking operations:
41 // If a pair of update_undo_before and update_undo_after are called
42 // within a certain time limit and the creator is nonzero and equal,
43 // the before undo is discarded and the previous after undo is replaced.
44 void update_undo_before(const char *description = "",
46 void update_undo_after(const char *description,
48 int changes_made = 1);
50 // Used in undo and redo to reset the creators in all the records.
51 void reset_creators();
56 // load_flags for the next undo/redo stack item
57 int undo_load_flags();
58 int redo_load_flags();
59 void dump(FILE *fp=stdout);
64 // Entry point for all update commands
65 void update_undo_entry(const char *description,
69 int load_from_undo(FileXML *file, uint32_t load_flags);
71 // Placing the before & after undo operations in the same stack makes the
72 // compression more efficient.
73 // So even numbers are before and odd numbers are after
74 UndoStack *undo_stack;
75 UndoStackItem *next_undo();
76 UndoStackItem *next_redo();
78 // loads undo from the stringfile to the project
79 int load_undo_before(FileXML *file, uint32_t load_flags);
80 int load_undo_after(FileXML *file, uint32_t load_flags);