diff options
| author | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 19:04:24 +0500 |
|---|---|---|
| committer | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 19:04:24 +0500 |
| commit | 793fa5a91f24358aa7ce21abf6ee4e93a17b04ee (patch) | |
| tree | e81d1e60ffdf068ac1e93e8d36d9c2046b2d7c50 /fluid/proj/undo.cxx | |
| parent | b4995f979d127cea667b4e2b71c91e9db4ab52ef (diff) | |
wip
Diffstat (limited to 'fluid/proj/undo.cxx')
| -rw-r--r-- | fluid/proj/undo.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fluid/proj/undo.cxx b/fluid/proj/undo.cxx index d3444c91a..829b2d4d4 100644 --- a/fluid/proj/undo.cxx +++ b/fluid/proj/undo.cxx @@ -47,11 +47,11 @@ extern Fl_Window* the_panel; -fld::proj::Undo::Undo(fld::Project &p) +Undo::Undo(Project &p) : proj_( p ) { } -fld::proj::Undo::~Undo() { +Undo::~Undo() { // TODO: delete old undo files when calling the destructor. } @@ -60,7 +60,7 @@ fld::proj::Undo::~Undo() { // The filename is constructed in a static internal buffer and // this buffer is overwritten by every call of this function. // The return value is a pointer to this internal string. -char *fld::proj::Undo::filename(int level) { +char *Undo::filename(int level) { if (!path_len_) { Fluid.preferences.getUserdataPath(path_, sizeof(path_)); path_len_ = (unsigned int)strlen(path_); @@ -75,7 +75,7 @@ char *fld::proj::Undo::filename(int level) { // Redo menu callback -void fld::proj::Undo::redo() { +void Undo::redo() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; @@ -91,7 +91,7 @@ void fld::proj::Undo::redo() { widget_browser->new_list(); } int reload_panel = (the_panel && the_panel->visible()); - if (!fld::io::read_file(proj_, filename(current_ + 1), 0)) { + if (!read_file(proj_, filename(current_ + 1), 0)) { // Unable to read checkpoint file, don't redo... widget_browser->rebuild(); proj_.update_settings_dialog(); @@ -119,7 +119,7 @@ void fld::proj::Undo::redo() { } // Undo menu callback -void fld::proj::Undo::undo() { +void Undo::undo() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; @@ -130,7 +130,7 @@ void fld::proj::Undo::undo() { } if (current_ == last_) { - fld::io::write_file(proj_, filename(current_)); + write_file(proj_, filename(current_)); } suspend(); @@ -142,7 +142,7 @@ void fld::proj::Undo::undo() { widget_browser->new_list(); } int reload_panel = (the_panel && the_panel->visible()); - if (!fld::io::read_file(proj_, filename(current_ - 1), 0)) { + if (!read_file(proj_, filename(current_ - 1), 0)) { // Unable to read checkpoint file, don't undo... widget_browser->rebuild(); proj_.update_settings_dialog(); @@ -180,7 +180,7 @@ void fld::proj::Undo::undo() { \param[in] type set a new type, or set to 0 to clear the once_type without setting a checkpoint \return 1 if the checkpoint was set, 0 if this is a repeating event */ -int fld::proj::Undo::checkpoint(OnceType type) { +int Undo::checkpoint(OnceType type) { if (type == FLD_UNDO_ONCETYPE_ALWAYS) { once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; return 0; @@ -197,7 +197,7 @@ int fld::proj::Undo::checkpoint(OnceType type) { } // Save current file to undo buffer -void fld::proj::Undo::checkpoint() { +void Undo::checkpoint() { // printf("checkpoint(): current_=%d, paused_=%d, modflag=%d\n", // current_, paused_, modflag); @@ -210,7 +210,7 @@ void fld::proj::Undo::checkpoint() { // Save the current UI to a checkpoint file... const char *file = filename(current_); - if (!fld::io::write_file(proj_, file)) { + if (!write_file(proj_, file)) { // Don't attempt to do undo stuff if we can't write a checkpoint file... perror(file); return; @@ -231,7 +231,7 @@ void fld::proj::Undo::checkpoint() { } // Clear undo buffer -void fld::proj::Undo::clear() { +void Undo::clear() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); // Remove old checkpoint files... @@ -251,19 +251,19 @@ void fld::proj::Undo::clear() { } // Resume undo checkpoints -void fld::proj::Undo::resume() { +void Undo::resume() { paused_--; } // Suspend undo checkpoints -void fld::proj::Undo::suspend() { +void Undo::suspend() { paused_++; } -void fld::proj::Undo::undo_cb(Fl_Widget *, void *) { +void Undo::undo_cb(Fl_Widget *, void *) { Fluid.proj.undo.undo(); } -void fld::proj::Undo::redo_cb(Fl_Widget *, void *) { +void Undo::redo_cb(Fl_Widget *, void *) { Fluid.proj.undo.redo(); } |
