summaryrefslogtreecommitdiff
path: root/fluid/proj
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/proj')
-rw-r--r--fluid/proj/align_widget.cxx23
-rw-r--r--fluid/proj/mergeback.cxx9
-rw-r--r--fluid/proj/undo.cxx34
3 files changed, 34 insertions, 32 deletions
diff --git a/fluid/proj/align_widget.cxx b/fluid/proj/align_widget.cxx
index 8056de429..0877c35f0 100644
--- a/fluid/proj/align_widget.cxx
+++ b/fluid/proj/align_widget.cxx
@@ -52,7 +52,8 @@ void align_widget_cb(Fl_Widget*, void *user_data)
BREAK_ON_FIRST;
}
if (left!=max)
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ Node *o;
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -82,7 +83,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
if (left!=max)
{
int center2 = left+right;
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -109,7 +110,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
BREAK_ON_FIRST;
}
if (right!=min)
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -135,7 +136,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
BREAK_ON_FIRST;
}
if (top!=max)
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -165,7 +166,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
if (top!=max)
{
int center2 = top+bot;
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -192,7 +193,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
BREAK_ON_FIRST;
}
if (bot!=min)
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -227,7 +228,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
{
wdt = wdt/n*n; // make sure that all gaps are the same, possibly moving the rightmost widget
int cnt = 0, wsum = 0;
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -264,7 +265,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
{
hgt = hgt/n*n; // make sure that all gaps are the same, possibly moving the rightmost widget
int cnt = 0, hsum = 0;
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -294,7 +295,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
BREAK_ON_FIRST;
}
if (wdt!=min)
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -320,7 +321,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
BREAK_ON_FIRST;
}
if (hgt!=min)
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
@@ -348,7 +349,7 @@ void align_widget_cb(Fl_Widget*, void *user_data)
BREAK_ON_FIRST;
}
if (hgt!=min)
- for (Node *o = Fluid.proj.tree.first; o; o = o->next)
+ for (o = Fluid.proj.tree.first; o; o = o->next)
if (o->selected && o->is_widget())
{
if (!changed) {
diff --git a/fluid/proj/mergeback.cxx b/fluid/proj/mergeback.cxx
index bb7ef5504..2d553aedb 100644
--- a/fluid/proj/mergeback.cxx
+++ b/fluid/proj/mergeback.cxx
@@ -304,7 +304,8 @@ void Mergeback::analyse_code(unsigned long code_crc, unsigned long tag_crc, int
*/
uint32_t Mergeback::decode_trichar32(const char *text) {
uint32_t word = 0;
- for (int i=30; i>=0; i-=3) {
+ int i;
+ for (i =30; i>=0; i-=3) {
char a = *text++;
if (a==0) break;
char b = *text++;
@@ -335,7 +336,8 @@ uint32_t Mergeback::decode_trichar32(const char *text) {
*/
void Mergeback::print_trichar32(FILE *out, uint32_t value) {
static const char *lut[] = { "--", "-~", "~-", "~~", "-=", "=-", "~=", "=~" };
- for (int i=30; i>=0; i-=3) fputs(lut[(value>>i)&7], out);
+ int i;
+ for (i =30; i>=0; i-=3) fputs(lut[(value>>i)&7], out);
}
/**
@@ -365,7 +367,8 @@ bool Mergeback::read_tag(const char *tag, Tag *prev_type, uint16_t *uid, uint32_
if (strncmp(tag, "▼", 3)==0) tag += 3; // E2 96 BC
if (*tag==' ') tag += 1;
uint32_t w1 = decode_trichar32(tag); // Read the first word
- for (int i=0; i<32; i++) if (*tag++ == 0) return false;
+ int i;
+ for (i =0; i<32; i++) if (*tag++ == 0) return false;
uint32_t w2 = decode_trichar32(tag); // Read the second word
// Return the decoded values
*prev_type = static_cast<Tag>((w1>>16) & 0xff);
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();
}