2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
\r
5 This file is part of GtkRadiant.
\r
7 GtkRadiant is free software; you can redistribute it and/or modify
\r
8 it under the terms of the GNU General Public License as published by
\r
9 the Free Software Foundation; either version 2 of the License, or
\r
10 (at your option) any later version.
\r
12 GtkRadiant is distributed in the hope that it will be useful,
\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 GNU General Public License for more details.
\r
17 You should have received a copy of the GNU General Public License
\r
18 along with GtkRadiant; if not, write to the Free Software
\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
25 #define UNDO_MAJOR "undo"
\r
28 typedef void (*PFN_UNDOSTART) (char *operation);
\r
30 typedef void (*PFN_UNDOEND) (void);
\r
31 //add brush to the undo
\r
32 typedef void (*PFN_UNDOADDBRUSH) (brush_t *pBrush);
\r
33 //end a brush after the operation is performed
\r
34 typedef void (*PFN_UNDOENDBRUSH) (brush_t *pBrush);
\r
35 //add a list with brushes to the undo
\r
36 typedef void (*PFN_UNDOADDBRUSHLIST) (brush_t *brushlist);
\r
37 //end a list with brushes after the operation is performed
\r
38 typedef void (*PFN_UNDOENDBRUSHLIST) (brush_t *brushlist);
\r
39 //add entity to undo
\r
40 typedef void (*PFN_UNDOADDENTITY) (entity_t *entity);
\r
41 //end an entity after the operation is performed
\r
42 typedef void (*PFN_UNDOENDENTITY) (entity_t *entity);
\r
43 //undo last operation (bSilent == true -> will not print the "undone blah blah message")
\r
44 typedef void (*PFN_UNDO) (unsigned char bSilent);
\r
45 //redo last undone operation
\r
46 typedef void (*PFN_REDO) (void);
\r
47 //get the undo Id of the next undo (0 if none available)
\r
48 typedef int (*PFN_GETUNDOID) (void);
\r
49 //returns true if there is something to be undone available
\r
50 typedef int (*PFN_UNDOAVAILABLE) (void);
\r
51 //returns true if there is something to redo available
\r
52 typedef int (*PFN_REDOAVAILABLE) (void);
\r
54 struct _QERUndoTable
\r
57 PFN_UNDOSTART m_pfnUndo_Start;
\r
58 PFN_UNDOEND m_pfnUndo_End;
\r
59 PFN_UNDOADDBRUSH m_pfnUndo_AddBrush;
\r
60 PFN_UNDOENDBRUSH m_pfnUndo_EndBrush;
\r
61 PFN_UNDOADDBRUSHLIST m_pfnUndo_AddBrushList;
\r
62 PFN_UNDOENDBRUSHLIST m_pfnUndo_EndBrushList;
\r
63 PFN_UNDOADDENTITY m_pfnUndo_AddEntity;
\r
64 PFN_UNDOENDENTITY m_pfnUndo_EndEntity;
\r
65 PFN_UNDO m_pfnUndo_Undo;
\r
66 PFN_REDO m_pfnUndo_Redo;
\r
67 PFN_GETUNDOID m_pfnUndo_GetUndoId;
\r
68 PFN_UNDOAVAILABLE m_pfnUndo_UndoAvailable;
\r
69 PFN_REDOAVAILABLE m_pfnUndo_RedoAvailable;
\r
72 #ifdef USE_UNDOTABLE_DEFINE
\r
73 #ifndef __UNDOTABLENAME
\r
74 #define __UNDOTABLENAME g_UndoTable
\r
76 #define Undo_Start __UNDOTABLENAME.m_pfnUndo_Start
\r
77 #define Undo_End __UNDOTABLENAME.m_pfnUndo_End
\r
78 #define Undo_AddBrush __UNDOTABLENAME.m_pfnUndo_AddBrush
\r
79 #define Undo_EndBrush __UNDOTABLENAME.m_pfnUndo_EndBrush
\r
80 #define Undo_AddBrushList __UNDOTABLENAME.m_pfnUndo_AddBrushList
\r
81 #define Undo_EndBrushList __UNDOTABLENAME.m_pfnUndo_EndBrushList
\r
82 #define Undo_AddEntity __UNDOTABLENAME.m_pfnUndo_AddEntity
\r
83 #define Undo_EndEntity __UNDOTABLENAME.m_pfnUndo_EndEntity
\r