diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-02-10 17:13:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-10 17:13:20 +0100 |
| commit | 7f87c847ba8ec976c6ad345942f9867658a89ab2 (patch) | |
| tree | 00717f3197ea9d2d76c45207dd4f468b2ee201cb /FL/Fl_Text_Buffer.H | |
| parent | 72f860438170638d6aa492b477a59ff88b565d9d (diff) | |
Unlimited undo/redo for Fl_Input_ and Fl_Text_Buffer (#558) (#676)
Diffstat (limited to 'FL/Fl_Text_Buffer.H')
| -rw-r--r-- | FL/Fl_Text_Buffer.H | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H index e3e131ef1..dabe5677a 100644 --- a/FL/Fl_Text_Buffer.H +++ b/FL/Fl_Text_Buffer.H @@ -1,7 +1,7 @@ // // Header file for Fl_Text_Buffer class. // -// Copyright 2001-2021 by Bill Spitzak and others. +// Copyright 2001-2023 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under // the LGPL for the FLTK library granted by Mark Edel. // @@ -61,6 +61,7 @@ #include "Fl_Export.H" +class Fl_Text_Undo_Action_List; class Fl_Text_Undo_Action; /** @@ -327,6 +328,11 @@ public: int undo(int *cp=0); /** + Redo previous undo action. + */ + int redo(int *cp=0); + + /** Lets the undo system know if we can undo changes */ void canUndo(char flag=1); @@ -813,6 +819,11 @@ protected: */ void update_selections(int pos, int nDeleted, int nInserted); + /** + Apply the current undo/redo operation, called from undo() or redo(). + */ + int apply_undo(Fl_Text_Undo_Action* action, int* cursorPos); + Fl_Text_Selection mPrimary; /**< highlighted areas */ Fl_Text_Selection mSecondary; /**< highlighted areas */ Fl_Text_Selection mHighlight; /**< highlighted areas */ @@ -841,6 +852,8 @@ protected: bytes and should only be increased if frequent and large changes in buffer size are expected */ Fl_Text_Undo_Action* mUndo; /**< local undo event */ + Fl_Text_Undo_Action_List* mUndoList; /**< List of undo event */ + Fl_Text_Undo_Action_List* mRedoList; /**< List of redo event */ }; #endif |
