diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-02-19 21:42:32 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-02-19 21:42:32 +0000 |
commit | 2e32d44e7165775936beae5d9ef636ff9d3f2bd2 (patch) | |
tree | 8153bc399994aabf6e1c41c2d8332e4e8c4ddb78 /indra/llui/llundo.h | |
parent | db0f5847ea8b96b3c1ac08e7aeb43d83daacb8e4 (diff) |
merge svn+ssh://svn.lindenlab.com/svn/linden/qa/combo-merge-ui-2008-02-13 -r 79986 : 80178 -> release.
QAR-290 = QAR-271 + QAR-191
Diffstat (limited to 'indra/llui/llundo.h')
-rw-r--r-- | indra/llui/llundo.h | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/indra/llui/llundo.h b/indra/llui/llundo.h index 8b982978f5..99f0f59116 100644 --- a/indra/llui/llundo.h +++ b/indra/llui/llundo.h @@ -1,6 +1,6 @@ /** * @file llundo.h - * @brief LLUndo class header file + * @brief Generic interface for undo/redo circular buffer. * * $LicenseInfo:firstyear=2000&license=viewergpl$ * @@ -32,34 +32,24 @@ #ifndef LL_LLUNDO_H #define LL_LLUNDO_H -class LLUndoAction -{ - friend class LLUndoBuffer; -protected: - S32 mClusterID; -protected: - LLUndoAction(): mClusterID(0) {}; - virtual ~LLUndoAction(){}; - -public: - static LLUndoAction *create() { return NULL; } - - virtual void undo() = 0; - virtual void redo() = 0; - virtual void cleanup() {}; -}; class LLUndoBuffer { -protected: - LLUndoAction **mActions; // array of pointers to undoactions - S32 mNumActions; // total number of actions in ring buffer - S32 mNextAction; // next action to perform undo/redo on - S32 mLastAction; // last action actually added to undo buffer - S32 mFirstAction; // beginning of ring buffer (don't undo any further) - S32 mOperationID; // current operation id, for undoing and redoing in clusters - public: + class LLUndoAction + { + friend class LLUndoBuffer; + public: + virtual void undo() = 0; + virtual void redo() = 0; + virtual void cleanup() {}; + protected: + LLUndoAction(): mClusterID(0) {}; + virtual ~LLUndoAction(){}; + private: + S32 mClusterID; + }; + LLUndoBuffer( LLUndoAction (*create_func()), S32 initial_count ); virtual ~LLUndoBuffer(); @@ -70,6 +60,14 @@ public: BOOL canRedo() { return (mNextAction != mLastAction); } void flushActions(); + +private: + LLUndoAction **mActions; // array of pointers to undoactions + S32 mNumActions; // total number of actions in ring buffer + S32 mNextAction; // next action to perform undo/redo on + S32 mLastAction; // last action actually added to undo buffer + S32 mFirstAction; // beginning of ring buffer (don't undo any further) + S32 mOperationID; // current operation id, for undoing and redoing in clusters }; #endif //LL_LLUNDO_H |