source: golgotha/src/maxtool/sdk_inc/hold.h @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1/**********************************************************************
2 *<
3        FILE: hold.h
4
5        DESCRIPTION:
6
7        CREATED BY: Dan Silva
8
9        HISTORY:
10
11 *>     Copyright (c) 1994, All Rights Reserved.
12 **********************************************************************/
13
14#ifndef __HOLD__H__
15#define __HOLD__H__
16
17class HoldStore;
18class RestoreObj {
19        friend class HoldStore;
20                RestoreObj *next,*prev;
21        public:
22                RestoreObj() { next = prev = NULL; }
23                virtual ~RestoreObj() {};
24                virtual void Restore(int isUndo)=0;
25                virtual void Redo()=0;
26                virtual int Size() { return 1; }
27                virtual void EndHold() { }
28                virtual TSTR Description() { return TSTR(_T("---")); }
29        };
30
31class Hold {
32        HoldStore *holdStore, *holdList;
33        int undoEnabled;
34        int superLevel;
35        HoldStore *ResetStore();
36        void Init();
37        public:
38                CoreExport Hold();
39                CoreExport ~Hold();
40                CoreExport void Put(RestoreObj *rob);
41                CoreExport void Begin();
42                CoreExport void Suspend();        // temporarly suspend holding
43                CoreExport void Resume();    // resume holding
44                CoreExport int  Holding();  // are we holding?
45                CoreExport void DisableUndo();  // prevents Undo when Accept is called.
46                CoreExport void EnableUndo();
47                CoreExport void Restore();  // Restore changes from holdStore.
48                CoreExport void Release();  // Tosses out holdStore.
49
50                // 3 ways to terminate the Begin()...
51                CoreExport void End();  // toss holdStore.
52                CoreExport void Accept(int nameID); // record Undo (if enabled), End();
53                CoreExport void Accept(TCHAR *name);
54                CoreExport void Cancel();   // Restore changes, End()
55
56                //             
57                // Group several Begin-End lists into a single Super-group.
58                CoreExport void SuperBegin();
59                CoreExport void SuperAccept(int nameID);
60                CoreExport void SuperAccept(TCHAR *name);
61                CoreExport void SuperCancel();
62        };
63
64
65
66extern CoreExport Hold theHold;
67
68void CoreExport EnableUndoDebugPrintout(BOOL onoff);
69
70
71#endif //__HOLD__H__
Note: See TracBrowser for help on using the repository browser.