summaryrefslogtreecommitdiff
path: root/fluid/proj/undo.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/proj/undo.cxx')
-rw-r--r--fluid/proj/undo.cxx34
1 files changed, 16 insertions, 18 deletions
diff --git a/fluid/proj/undo.cxx b/fluid/proj/undo.cxx
index e4ee89bf6..d3444c91a 100644
--- a/fluid/proj/undo.cxx
+++ b/fluid/proj/undo.cxx
@@ -47,15 +47,11 @@
extern Fl_Window* the_panel;
-using namespace fld;
-using namespace fld::proj;
-
-
-Undo::Undo(Project &p)
+fld::proj::Undo::Undo(fld::Project &p)
: proj_( p )
{ }
-Undo::~Undo() {
+fld::proj::Undo::~Undo() {
// TODO: delete old undo files when calling the destructor.
}
@@ -64,7 +60,7 @@ 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 *Undo::filename(int level) {
+char *fld::proj::Undo::filename(int level) {
if (!path_len_) {
Fluid.preferences.getUserdataPath(path_, sizeof(path_));
path_len_ = (unsigned int)strlen(path_);
@@ -79,7 +75,7 @@ char *Undo::filename(int level) {
// Redo menu callback
-void Undo::redo() {
+void fld::proj::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;
@@ -123,7 +119,7 @@ void Undo::redo() {
}
// Undo menu callback
-void Undo::undo() {
+void fld::proj::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;
@@ -155,7 +151,8 @@ void Undo::undo() {
return;
}
if (reload_panel) {
- for (Node *t = Fluid.proj.tree.first; t; t=t->next) {
+ Node *t;
+ for (t = Fluid.proj.tree.first; t; t=t->next) {
if (t->is_widget() && t->selected) {
t->open();
break;
@@ -183,7 +180,7 @@ void 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 Undo::checkpoint(OnceType type) {
+int fld::proj::Undo::checkpoint(OnceType type) {
if (type == FLD_UNDO_ONCETYPE_ALWAYS) {
once_type_ = FLD_UNDO_ONCETYPE_ALWAYS;
return 0;
@@ -200,7 +197,7 @@ int Undo::checkpoint(OnceType type) {
}
// Save current file to undo buffer
-void Undo::checkpoint() {
+void fld::proj::Undo::checkpoint() {
// printf("checkpoint(): current_=%d, paused_=%d, modflag=%d\n",
// current_, paused_, modflag);
@@ -234,11 +231,12 @@ void Undo::checkpoint() {
}
// Clear undo buffer
-void Undo::clear() {
+void fld::proj::Undo::clear() {
// int undo_item = main_menubar->find_index(undo_cb);
// int redo_item = main_menubar->find_index(redo_cb);
// Remove old checkpoint files...
- for (int i = 0; i <= max_; i ++) {
+ int i;
+ for (i = 0; i <= max_; i ++) {
fl_unlink(filename(i));
}
@@ -253,19 +251,19 @@ void Undo::clear() {
}
// Resume undo checkpoints
-void Undo::resume() {
+void fld::proj::Undo::resume() {
paused_--;
}
// Suspend undo checkpoints
-void Undo::suspend() {
+void fld::proj::Undo::suspend() {
paused_++;
}
-void Undo::undo_cb(Fl_Widget *, void *) {
+void fld::proj::Undo::undo_cb(Fl_Widget *, void *) {
Fluid.proj.undo.undo();
}
-void Undo::redo_cb(Fl_Widget *, void *) {
+void fld::proj::Undo::redo_cb(Fl_Widget *, void *) {
Fluid.proj.undo.redo();
}