summaryrefslogtreecommitdiff
path: root/fluid/nodes
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 19:04:24 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 19:04:24 +0500
commit793fa5a91f24358aa7ce21abf6ee4e93a17b04ee (patch)
treee81d1e60ffdf068ac1e93e8d36d9c2046b2d7c50 /fluid/nodes
parentb4995f979d127cea667b4e2b71c91e9db4ab52ef (diff)
wip
Diffstat (limited to 'fluid/nodes')
-rw-r--r--fluid/nodes/Button_Node.cxx24
-rw-r--r--fluid/nodes/Button_Node.h4
-rw-r--r--fluid/nodes/Function_Node.cxx181
-rw-r--r--fluid/nodes/Function_Node.h66
-rw-r--r--fluid/nodes/Grid_Node.cxx12
-rw-r--r--fluid/nodes/Grid_Node.h12
-rw-r--r--fluid/nodes/Group_Node.cxx14
-rw-r--r--fluid/nodes/Group_Node.h10
-rw-r--r--fluid/nodes/Menu_Node.cxx22
-rw-r--r--fluid/nodes/Menu_Node.h22
-rw-r--r--fluid/nodes/Node.cxx32
-rw-r--r--fluid/nodes/Node.h36
-rw-r--r--fluid/nodes/Tree.cxx14
-rw-r--r--fluid/nodes/Tree.h6
-rw-r--r--fluid/nodes/Widget_Node.cxx60
-rw-r--r--fluid/nodes/Widget_Node.h18
-rw-r--r--fluid/nodes/Window_Node.cxx36
-rw-r--r--fluid/nodes/Window_Node.h16
-rw-r--r--fluid/nodes/factory.cxx60
19 files changed, 282 insertions, 363 deletions
diff --git a/fluid/nodes/Button_Node.cxx b/fluid/nodes/Button_Node.cxx
index 877c5588d..1b4cbe2e5 100644
--- a/fluid/nodes/Button_Node.cxx
+++ b/fluid/nodes/Button_Node.cxx
@@ -57,17 +57,17 @@ Fl_Menu_Item *Button_Node::subtypes() {
}
void Button_Node::ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->labelsize + 8;
w = layout->labelsize * 4 + 8;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
Fl_Widget *Button_Node::widget(int x, int y, int w, int h) {
return new Fl_Button(x, y, w, h, "Button");
}
-void Button_Node::write_properties(fld::io::Project_Writer &f) {
+void Button_Node::write_properties(Project_Writer &f) {
Widget_Node::write_properties(f);
Fl_Button *btn = (Fl_Button*)o;
if (btn->compact()) {
@@ -76,7 +76,7 @@ void Button_Node::write_properties(fld::io::Project_Writer &f) {
}
}
-void Button_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Button_Node::read_property(Project_Reader &f, const char *c) {
Fl_Button *btn = (Fl_Button*)o;
if (!strcmp(c, "compact")) {
btn->compact((uchar)atol(f.read_word()));
@@ -95,10 +95,10 @@ void Button_Node::copy_properties() {
// ---- Return Button ----
void Return_Button_Node::ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->labelsize + 8;
w = layout->labelsize * 4 + 8 + h; // make room for the symbol
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
Fl_Widget *Return_Button_Node::widget(int x, int y, int w, int h) {
@@ -120,10 +120,10 @@ Repeat_Button_Node Repeat_Button_Node::prototype;
// ---- Light Button ----
void Light_Button_Node::ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->labelsize + 8;
w = layout->labelsize * 4 + 8 + layout->labelsize; // make room for the light
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
Fl_Widget *Light_Button_Node::widget(int x, int y, int w, int h) {
@@ -136,10 +136,10 @@ Light_Button_Node Light_Button_Node::prototype;
// ---- Check Button ----
void Check_Button_Node::ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->labelsize + 8;
w = layout->labelsize * 4 + 8 + layout->labelsize; // make room for the symbol
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
Fl_Widget *Check_Button_Node::widget(int x, int y, int w, int h) {
@@ -152,10 +152,10 @@ Check_Button_Node Check_Button_Node::prototype;
// ---- Round Button ----
void Round_Button_Node::ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->labelsize + 8;
w = layout->labelsize * 4 + 8 + layout->labelsize; // make room for the symbol
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
Fl_Widget *Round_Button_Node::widget(int x, int y, int w, int h) {
diff --git a/fluid/nodes/Button_Node.h b/fluid/nodes/Button_Node.h
index 4ee88d1e1..eab3a1d40 100644
--- a/fluid/nodes/Button_Node.h
+++ b/fluid/nodes/Button_Node.h
@@ -38,8 +38,8 @@ public:
int is_button() const { return 1; }
Type type() const { return FLD_NODE_TYPE_Button; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Button) ? true : super::is_a(inType); }
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
void copy_properties();
};
diff --git a/fluid/nodes/Function_Node.cxx b/fluid/nodes/Function_Node.cxx
index daf5822c0..c5dcf7596 100644
--- a/fluid/nodes/Function_Node.cxx
+++ b/fluid/nodes/Function_Node.cxx
@@ -227,7 +227,7 @@ Node *Function_Node::make(Strategy strategy) {
- "C" is written if we want a C signature instead of C++
- "return_type" is followed by the return type of the function
*/
-void Function_Node::write_properties(fld::io::Project_Writer &f) {
+void Function_Node::write_properties(Project_Writer &f) {
Node::write_properties(f);
switch (public_) {
case 0: f.write_string("private"); break;
@@ -244,7 +244,7 @@ void Function_Node::write_properties(fld::io::Project_Writer &f) {
Read function specific properties fron an .fl file.
\param[in] c read from this string
*/
-void Function_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Function_Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"private")) {
public_ = 0;
} else if (!strcmp(c,"protected")) {
@@ -321,9 +321,9 @@ static void clean_function_for_implementation(char *out, const char *function_na
/**
Write the code for the source and the header file.
This writes the code that goes \b before all children of this class.
- \see write_code2(fld::io::Code_Writer& f)
+ \see write_code2(Code_Writer& f)
*/
-void Function_Node::write_code1(fld::io::Code_Writer& f) {
+void Function_Node::write_code1(Code_Writer& f) {
constructor=0;
havewidgets = 0;
Node *child;
@@ -457,9 +457,9 @@ void Function_Node::write_code1(fld::io::Code_Writer& f) {
/**
Write the code for the source and the header file.
This writes the code that goes \b after all children of this class.
- \see write_code1(fld::io::Code_Writer& f)
+ \see write_code1(Code_Writer& f)
*/
-void Function_Node::write_code2(fld::io::Code_Writer& f) {
+void Function_Node::write_code2(Code_Writer& f) {
Node *child;
const char *var = "w";
char havechildren = 0;
@@ -556,7 +556,7 @@ void Code_Node::open() {
/**
Grab changes from an external editor and write this node.
*/
-void Code_Node::write(fld::io::Project_Writer &f) {
+void Code_Node::write(Project_Writer &f) {
// External editor changes? If so, load changes into ram, update mtime/size
if ( handle_editor_changes() == 1 ) {
Fluid.main_window->redraw(); // tell fluid to redraw; edits may affect tree's contents
@@ -567,7 +567,7 @@ void Code_Node::write(fld::io::Project_Writer &f) {
/**
Write the code block with the correct indentation.
*/
-void Code_Node::write_code1(fld::io::Code_Writer& f) {
+void Code_Node::write_code1(Code_Writer& f) {
// External editor changes? If so, load changes into ram, update mtime/size
if ( handle_editor_changes() == 1 ) {
Fluid.main_window->redraw(); // tell fluid to redraw; edits may affect tree's contents
@@ -673,7 +673,7 @@ Node *CodeBlock_Node::make(Strategy strategy) {
- "after" is followed by the code that comes after the children
The "before" code is stored in the name() field.
*/
-void CodeBlock_Node::write_properties(fld::io::Project_Writer &f) {
+void CodeBlock_Node::write_properties(Project_Writer &f) {
Node::write_properties(f);
if (end_code()[0]) {
f.write_string("after");
@@ -684,7 +684,7 @@ void CodeBlock_Node::write_properties(fld::io::Project_Writer &f) {
/**
Read the node specific properties.
*/
-void CodeBlock_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void CodeBlock_Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"after")) {
end_code(f.read_word());
} else {
@@ -702,7 +702,7 @@ void CodeBlock_Node::open() {
/**
Write the "before" code.
*/
-void CodeBlock_Node::write_code1(fld::io::Code_Writer& f) {
+void CodeBlock_Node::write_code1(Code_Writer& f) {
const char* c = name();
f.write_c("%s%s {\n", f.indent(), c ? c : "");
f.indentation++;
@@ -711,7 +711,7 @@ void CodeBlock_Node::write_code1(fld::io::Code_Writer& f) {
/**
Write the "after" code.
*/
-void CodeBlock_Node::write_code2(fld::io::Code_Writer& f) {
+void CodeBlock_Node::write_code2(Code_Writer& f) {
f.indentation--;
if (end_code()[0])
f.write_c("%s} %s\n", f.indent(), end_code());
@@ -775,7 +775,7 @@ Node *Decl_Node::make(Strategy strategy) {
- "private"/"public"/"protected"
- "local"/"global" if this is static or not
*/
-void Decl_Node::write_properties(fld::io::Project_Writer &f) {
+void Decl_Node::write_properties(Project_Writer &f) {
Node::write_properties(f);
switch (public_) {
case 0: f.write_string("private"); break;
@@ -791,7 +791,7 @@ void Decl_Node::write_properties(fld::io::Project_Writer &f) {
/**
Read the specific properties.
*/
-void Decl_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Decl_Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"public")) {
public_ = 1;
} else if (!strcmp(c,"private")) {
@@ -819,7 +819,7 @@ void Decl_Node::open() {
\todo There are a lot of side effect in this node depending on the given text
and the parent node. They need to be understood and documented.
*/
-void Decl_Node::write_code1(fld::io::Code_Writer& f) {
+void Decl_Node::write_code1(Code_Writer& f) {
const char* c = name();
if (!c) return;
// handle a few keywords differently if inside a class
@@ -934,7 +934,7 @@ Node *Data_Node::make(Strategy strategy) {
- "filename" followed by the filename of the file to inline
- "textmode" if data is written in ASCII vs. binary
*/
-void Data_Node::write_properties(fld::io::Project_Writer &f) {
+void Data_Node::write_properties(Project_Writer &f) {
Decl_Node::write_properties(f);
if (filename()[0]) {
f.write_string("filename");
@@ -943,28 +943,19 @@ void Data_Node::write_properties(fld::io::Project_Writer &f) {
switch (output_format_) {
case 1: f.write_string("textmode"); break;
case 2: f.write_string("compressed"); break;
- case 3: f.write_string("std_binary"); break;
- case 4: f.write_string("std_textmode"); break;
- case 5: f.write_string("std_compressed"); break;
}
}
/**
Read specific properties.
*/
-void Data_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Data_Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"filename")) {
storestring(f.read_word(), filename_, 1);
} else if (!strcmp(c,"textmode")) {
output_format_ = 1;
} else if (!strcmp(c,"compressed")) {
output_format_ = 2;
- } else if (!strcmp(c,"std_binary")) {
- output_format_ = 3;
- } else if (!strcmp(c,"std_textmode")) {
- output_format_ = 4;
- } else if (!strcmp(c,"std_compressed")) {
- output_format_ = 5;
} else {
Decl_Node::read_property(f, c);
}
@@ -980,7 +971,7 @@ void Data_Node::open() {
/**
Write the content of the external file inline into the source code.
*/
-void Data_Node::write_code1(fld::io::Code_Writer& f) {
+void Data_Node::write_code1(Code_Writer& f) {
const char *message = 0;
const char *c = name();
if (!c) return;
@@ -1002,7 +993,7 @@ void Data_Node::write_code1(fld::io::Code_Writer& f) {
if (nData) {
data = (char*)calloc(nData, 1);
if (fread(data, nData, 1, f)==0) { /* use default */ }
- if ((output_format_ == 2) || (output_format_ == 5)) {
+ if (output_format_ == 2) {
uncompressedDataSize = nData;
uLong nzData = compressBound(nData);
Bytef *zdata = (Bytef*)::malloc(nzData);
@@ -1020,47 +1011,27 @@ void Data_Node::write_code1(fld::io::Code_Writer& f) {
}
if (is_in_class()) {
f.write_public(public_);
- if ((output_format_ == 1) || (output_format_ == 4)) {
+ if (output_format_ == 1) {
f.write_c("\n");
write_comment_c(f);
- if (output_format_ == 1) {
- f.write_h("%sstatic const char *%s;\n", f.indent(1), c);
- f.write_c("const char *%s::%s = /* text inlined from %s */\n", class_name(1), c, fn);
- } else {
- f.write_h_once("#include <string>");
- f.write_h("%sstatic const std::string %s;\n", f.indent(1), c);
- f.write_c("const std::string %s::%s = /* text inlined from %s */\n", class_name(1), c, fn);
- }
+ f.write_h("%sstatic const char *%s;\n", f.indent(1), c);
+ f.write_c("const char *%s::%s = /* text inlined from %s */\n", class_name(1), c, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cstring(data, nData);
- } else if ((output_format_ == 2) || (output_format_ == 5)) {
+ } else if (output_format_ == 2) {
f.write_h("%sstatic int %s_size;\n", f.indent(1), c);
f.write_c("\n");
write_comment_c(f);
f.write_c("int %s::%s_size = %d;\n", class_name(1), c, uncompressedDataSize);
- if (output_format_ == 2) {
- f.write_h("%sstatic unsigned char %s[%d];\n", f.indent(1), c, nData);
- f.write_c("unsigned char %s::%s[%d] = /* data compressed and inlined from %s */\n", class_name(1), c, nData, fn);
- } else {
- f.write_h_once("#include <stdint.h>");
- f.write_h_once("#include <vector>");
- f.write_h("%sstatic std::vector<uint8_t> %s;\n", f.indent(1), c);
- f.write_c("std::vector<uint8_t> %s::%s = /* data compressed and inlined from %s */\n", class_name(1), c, fn);
- }
+ f.write_h("%sstatic unsigned char %s[%d];\n", f.indent(1), c, nData);
+ f.write_c("unsigned char %s::%s[%d] = /* data compressed and inlined from %s */\n", class_name(1), c, nData, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cdata(data, nData);
} else {
f.write_c("\n");
write_comment_c(f);
- if (output_format_ == 0) {
- f.write_h("%sstatic unsigned char %s[%d];\n", f.indent(1), c, nData);
- f.write_c("unsigned char %s::%s[%d] = /* data inlined from %s */\n", class_name(1), c, nData, fn);
- } else {
- f.write_h_once("#include <stdint.h>");
- f.write_h_once("#include <vector>");
- f.write_h("%sstatic std::vector<uint8_t> %s;\n", f.indent(1), c);
- f.write_c("std::vector<uint8_t> %s::%s = /* data inlined from %s */\n", class_name(1), c, fn);
- }
+ f.write_h("%sstatic unsigned char %s[%d];\n", f.indent(1), c, nData);
+ f.write_c("unsigned char %s::%s[%d] = /* data inlined from %s */\n", class_name(1), c, nData, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cdata(data, nData);
}
@@ -1069,47 +1040,27 @@ void Data_Node::write_code1(fld::io::Code_Writer& f) {
// the "header only" option does not apply here!
if (public_) {
if (static_) {
- if ((output_format_ == 1) || (output_format_ == 4)) {
+ if (output_format_ == 1) {
f.write_c("\n");
write_comment_c(f);
- if (output_format_ == 1) {
- f.write_h("extern const char *%s;\n", c);
- f.write_c("const char *%s = /* text inlined from %s */\n", c, fn);
- } else {
- f.write_h_once("#include <string>");
- f.write_h("extern const std::string %s;\n", c);
- f.write_c("const std::string %s = /* text inlined from %s */\n", c, fn);
- }
+ f.write_h("extern const char *%s;\n", c);
+ f.write_c("const char *%s = /* text inlined from %s */\n", c, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cstring(data, nData);
- } else if ((output_format_ == 2) || (output_format_ == 5)) {
+ } else if (output_format_ == 2) {
f.write_h("extern int %s_size;\n", c);
f.write_c("\n");
write_comment_c(f);
f.write_c("int %s_size = %d;\n", c, uncompressedDataSize);
- if (output_format_ == 2) {
- f.write_h("extern unsigned char %s[%d];\n", c, nData);
- f.write_c("unsigned char %s[%d] = /* data compressed and inlined from %s */\n", c, nData, fn);
- } else {
- f.write_h_once("#include <stdint.h>");
- f.write_h_once("#include <vector>");
- f.write_h("extern std::vector<uint8_t> %s;\n", c);
- f.write_c("std::vector<uint8_t> %s = /* data compressed and inlined from %s */\n", c, fn);
- }
+ f.write_h("extern unsigned char %s[%d];\n", c, nData);
+ f.write_c("unsigned char %s[%d] = /* data compressed and inlined from %s */\n", c, nData, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cdata(data, nData);
} else {
f.write_c("\n");
write_comment_c(f);
- if (output_format_ == 0) {
- f.write_h("extern unsigned char %s[%d];\n", c, nData);
- f.write_c("unsigned char %s[%d] = /* data inlined from %s */\n", c, nData, fn);
- } else {
- f.write_h_once("#include <stdint.h>");
- f.write_h_once("#include <vector>");
- f.write_h("extern std::vector<uint8_t> %s;\n", c);
- f.write_c("std::vector<uint8_t> %s = /* data inlined from %s */\n", c, fn);
- }
+ f.write_h("extern unsigned char %s[%d];\n", c, nData);
+ f.write_c("unsigned char %s[%d] = /* data inlined from %s */\n", c, nData, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cdata(data, nData);
}
@@ -1125,41 +1076,21 @@ void Data_Node::write_code1(fld::io::Code_Writer& f) {
} else {
f.write_c("\n");
write_comment_c(f);
- if ((output_format_ == 1) || (output_format_ == 4)) {
- if (output_format_ == 1) {
- if (static_) f.write_c("static ");
- f.write_c("const char *%s = /* text inlined from %s */\n", c, fn);
- } else {
- f.write_c_once("#include <string>");
- if (static_) f.write_c("static ");
- f.write_c("const std::string %s = /* text inlined from %s */\n", c, fn);
- }
+ if (output_format_ == 1) {
+ if (static_) f.write_c("static ");
+ f.write_c("const char *%s = /* text inlined from %s */\n", c, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cstring(data, nData);
- } else if ((output_format_ == 2) || (output_format_ == 5)) {
+ } else if (output_format_ == 2) {
if (static_) f.write_c("static ");
f.write_c("int %s_size = %d;\n", c, uncompressedDataSize);
- if (output_format_ == 2) {
- if (static_) f.write_c("static ");
- f.write_c("unsigned char %s[%d] = /* data compressed and inlined from %s */\n", c, nData, fn);
- } else {
- f.write_c_once("#include <stdint.h>");
- f.write_c_once("#include <vector>");
- if (static_) f.write_c("static ");
- f.write_c("std::vector<uint8_t> %s = /* data compressed and inlined from %s */\n", c, fn);
- }
+ if (static_) f.write_c("static ");
+ f.write_c("unsigned char %s[%d] = /* data compressed and inlined from %s */\n", c, nData, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cdata(data, nData);
} else {
- if (output_format_ == 0) {
- if (static_) f.write_c("static ");
- f.write_c("unsigned char %s[%d] = /* data inlined from %s */\n", c, nData, fn);
- } else {
- f.write_c_once("#include <stdint.h>");
- f.write_c_once("#include <vector>");
- if (static_) f.write_c("static ");
- f.write_c("std::vector<uint8_t> %s = /* data inlined from %s */\n", c, fn);
- }
+ if (static_) f.write_c("static ");
+ f.write_c("unsigned char %s[%d] = /* data inlined from %s */\n", c, nData, fn);
if (message) f.write_c("#error %s %s\n", message, fn);
f.write_cdata(data, nData);
}
@@ -1234,7 +1165,7 @@ Node *DeclBlock_Node::make(Strategy strategy) {
- "public"/"protected"
- "after" followed by the second code block.
*/
-void DeclBlock_Node::write_properties(fld::io::Project_Writer &f) {
+void DeclBlock_Node::write_properties(Project_Writer &f) {
Node::write_properties(f);
// deprecated
if (is_public()) f.write_string("public");
@@ -1248,7 +1179,7 @@ void DeclBlock_Node::write_properties(fld::io::Project_Writer &f) {
/**
Read the specific properties.
*/
-void DeclBlock_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void DeclBlock_Node::read_property(Project_Reader &f, const char *c) {
if(!strcmp(c,"public")) {
write_map_ |= CODE_IN_HEADER;
} else if(!strcmp(c,"protected")) {
@@ -1273,7 +1204,7 @@ void DeclBlock_Node::open() {
Write the \b before static code to the source file, and to the header file if declared public.
The before code is stored in the name() field.
*/
-void DeclBlock_Node::write_static(fld::io::Code_Writer& f) {
+void DeclBlock_Node::write_static(Code_Writer& f) {
const char* c = name();
if (c && *c) {
if (write_map_ & STATIC_IN_HEADER)
@@ -1286,7 +1217,7 @@ void DeclBlock_Node::write_static(fld::io::Code_Writer& f) {
/**
Write the \b after static code to the source file, and to the header file if declared public.
*/
-void DeclBlock_Node::write_static_after(fld::io::Code_Writer& f) {
+void DeclBlock_Node::write_static_after(Code_Writer& f) {
if (end_code()[0]) {
if (write_map_ & STATIC_IN_HEADER)
f.write_h("%s\n", end_code());
@@ -1299,7 +1230,7 @@ void DeclBlock_Node::write_static_after(fld::io::Code_Writer& f) {
Write the \b before code to the source file, and to the header file if declared public.
The before code is stored in the name() field.
*/
-void DeclBlock_Node::write_code1(fld::io::Code_Writer& f) {
+void DeclBlock_Node::write_code1(Code_Writer& f) {
const char* c = name();
if (c && *c) {
if (write_map_ & CODE_IN_HEADER)
@@ -1312,7 +1243,7 @@ void DeclBlock_Node::write_code1(fld::io::Code_Writer& f) {
/**
Write the \b after code to the source file, and to the header file if declared public.
*/
-void DeclBlock_Node::write_code2(fld::io::Code_Writer& f) {
+void DeclBlock_Node::write_code2(Code_Writer& f) {
if (end_code()[0]) {
if (write_map_ & CODE_IN_HEADER)
f.write_h("%s\n", end_code());
@@ -1363,7 +1294,7 @@ Node *Comment_Node::make(Strategy strategy) {
- "in_source"/"not_in_source" if the comment will be written to the source code
- "in_header"/"not_in_header" if the comment will be written to the header file
*/
-void Comment_Node::write_properties(fld::io::Project_Writer &f) {
+void Comment_Node::write_properties(Project_Writer &f) {
Node::write_properties(f);
if (in_c_) f.write_string("in_source"); else f.write_string("not_in_source");
if (in_h_) f.write_string("in_header"); else f.write_string("not_in_header");
@@ -1372,7 +1303,7 @@ void Comment_Node::write_properties(fld::io::Project_Writer &f) {
/**
Read extra properties.
*/
-void Comment_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Comment_Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"in_source")) {
in_c_ = 1;
} else if (!strcmp(c,"not_in_source")) {
@@ -1418,7 +1349,7 @@ void Comment_Node::open() {
/**
Write the comment to the files.
*/
-void Comment_Node::write_code1(fld::io::Code_Writer& f) {
+void Comment_Node::write_code1(Code_Writer& f) {
const char* c = name();
if (!c) return;
if (!in_c_ && !in_h_) return;
@@ -1514,7 +1445,7 @@ Node *Class_Node::make(Strategy strategy) {
- ":" followed by the super class
- "private"/"protected"
*/
-void Class_Node::write_properties(fld::io::Project_Writer &f) {
+void Class_Node::write_properties(Project_Writer &f) {
Node::write_properties(f);
if (base_class()[0]) {
f.write_string(":");
@@ -1529,7 +1460,7 @@ void Class_Node::write_properties(fld::io::Project_Writer &f) {
/**
Read additional properties.
*/
-void Class_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Class_Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"private")) {
public_ = 0;
} else if (!strcmp(c,"protected")) {
@@ -1551,7 +1482,7 @@ void Class_Node::open() {
/**
Write the header code that declares this class.
*/
-void Class_Node::write_code1(fld::io::Code_Writer& f) {
+void Class_Node::write_code1(Code_Writer& f) {
parent_class = current_class;
current_class = this;
write_public_state = 0;
@@ -1570,7 +1501,7 @@ void Class_Node::write_code1(fld::io::Code_Writer& f) {
/**
Write the header code that ends the declaration of this class.
*/
-void Class_Node::write_code2(fld::io::Code_Writer& f) {
+void Class_Node::write_code2(Code_Writer& f) {
f.write_h("};\n");
current_class = parent_class;
}
diff --git a/fluid/nodes/Function_Node.h b/fluid/nodes/Function_Node.h
index cc1444a26..528e3a5a0 100644
--- a/fluid/nodes/Function_Node.h
+++ b/fluid/nodes/Function_Node.h
@@ -60,8 +60,8 @@ public:
~Function_Node();
Node *make(Strategy strategy);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
void open();
int ismain() {return name_ == 0;}
const char *type_name() {return "Function";}
@@ -71,8 +71,8 @@ public:
int is_public() const;
Type type() const { return FLD_NODE_TYPE_Function; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Function) ? true : super::is_a(inType); }
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
int has_signature(const char *, const char*) const;
const char *return_type() const { return return_type_ ? return_type_ : ""; }
void return_type(const char *t) { storestring(t, return_type_); }
@@ -101,9 +101,9 @@ public:
~Code_Node() = default;
Node *make(Strategy strategy);
- void write(fld::io::Project_Writer &f);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f) { }
+ void write(Project_Writer &f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f) { }
void open();
const char *type_name() {return "code";}
int is_code_block() const {return 0;}
@@ -137,8 +137,8 @@ public:
~CodeBlock_Node();
Node *make(Strategy strategy);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
void open();
const char *type_name() {return "codeblock";}
int is_code_block() const {return 1;}
@@ -146,8 +146,8 @@ public:
int is_public() const { return -1; }
Type type() const { return FLD_NODE_TYPE_CodeBlock; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_CodeBlock) ? true : super::is_a(inType); }
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
const char *end_code() const { return end_code_ ? end_code_ : ""; }
void end_code(const char *c) { storestring(c, end_code_); }
};
@@ -169,12 +169,12 @@ public:
~Decl_Node() = default;
Node *make(Strategy strategy);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f) { }
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f) { }
void open();
const char *type_name() {return "decl";}
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
int is_public() const;
Type type() const { return FLD_NODE_TYPE_Decl; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Decl) ? true : super::is_a(inType); }
@@ -201,12 +201,12 @@ public:
~Data_Node();
Node *make(Strategy strategy);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f) {}
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f) {}
void open();
const char *type_name() {return "data";}
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
Type type() const { return FLD_NODE_TYPE_Data; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Data) ? true : super::is_a(inType); }
void filename(const char *fn) { storestring(fn, filename_); }
@@ -238,14 +238,14 @@ public:
~DeclBlock_Node();
Node *make(Strategy strategy);
- void write_static(fld::io::Code_Writer& f);
- void write_static_after(fld::io::Code_Writer& f);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_static(Code_Writer& f);
+ void write_static_after(Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
void open();
const char *type_name() {return "declblock";}
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
int can_have_children() const {return 1;}
int is_decl_block() const {return 1;}
int is_public() const;
@@ -275,12 +275,12 @@ public:
~Comment_Node() = default;
Node *make(Strategy strategy);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f) { }
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f) { }
void open();
const char *type_name() {return "comment";}
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
int is_public() const { return 1; }
Type type() const { return FLD_NODE_TYPE_Comment; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Comment) ? true : super::is_a(inType); }
@@ -312,8 +312,8 @@ public:
Class_Node* parent_class; // save class if nested
Node *make(Strategy strategy);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
void open();
const char *type_name() {return "class";}
int can_have_children() const {return 1;}
@@ -322,8 +322,8 @@ public:
int is_public() const;
Type type() const { return FLD_NODE_TYPE_Class; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Class) ? true : super::is_a(inType); }
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
/** Get base class access and name. */
const char *base_class() const { return base_class_ ? base_class_ : ""; }
diff --git a/fluid/nodes/Grid_Node.cxx b/fluid/nodes/Grid_Node.cxx
index 6759c33f2..d33e72cb1 100644
--- a/fluid/nodes/Grid_Node.cxx
+++ b/fluid/nodes/Grid_Node.cxx
@@ -348,7 +348,7 @@ void Grid_Node::copy_properties_for_children() {
d->layout();
}
-void Grid_Node::write_properties(fld::io::Project_Writer &f)
+void Grid_Node::write_properties(Project_Writer &f)
{
super::write_properties(f);
Fl_Grid* grid = (Fl_Grid*)o;
@@ -413,7 +413,7 @@ void Grid_Node::write_properties(fld::io::Project_Writer &f)
}
}
-void Grid_Node::read_property(fld::io::Project_Reader &f, const char *c)
+void Grid_Node::read_property(Project_Reader &f, const char *c)
{
Fl_Grid* grid = (Fl_Grid*)o;
int i;
@@ -464,7 +464,7 @@ void Grid_Node::read_property(fld::io::Project_Reader &f, const char *c)
}
}
-void Grid_Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate) {
+void Grid_Node::write_parent_properties(Project_Writer &f, Node *child, bool encapsulate) {
Fl_Grid *grid;
Fl_Widget *child_widget;
Fl_Grid::Cell *cell;
@@ -511,7 +511,7 @@ void Grid_Node::write_parent_properties(fld::io::Project_Writer &f, Node *child,
// NOTE: we have to do this in a loop just as ::read_property() in case a new
// property is added. In the current setup, all the remaining properties
// will be skipped
-void Grid_Node::read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property) {
+void Grid_Node::read_parent_property(Project_Reader &f, Node *child, const char *property) {
if (!child->is_true_widget()) {
super::read_parent_property(f, child, property);
return;
@@ -550,7 +550,7 @@ void Grid_Node::read_parent_property(fld::io::Project_Reader &f, Node *child, co
}
}
-void Grid_Node::write_code1(fld::io::Code_Writer& f) {
+void Grid_Node::write_code1(Code_Writer& f) {
const char *var = name() ? name() : "o";
Fl_Grid* grid = (Fl_Grid*)o;
Widget_Node::write_code1(f);
@@ -614,7 +614,7 @@ void Grid_Node::write_code1(fld::io::Code_Writer& f) {
}
}
-void Grid_Node::write_code2(fld::io::Code_Writer& f) {
+void Grid_Node::write_code2(Code_Writer& f) {
const char *var = name() ? name() : "o";
Fl_Grid* grid = (Fl_Grid*)o;
bool first_cell = true;
diff --git a/fluid/nodes/Grid_Node.h b/fluid/nodes/Grid_Node.h
index 3caf77354..62fdea11c 100644
--- a/fluid/nodes/Grid_Node.h
+++ b/fluid/nodes/Grid_Node.h
@@ -57,16 +57,16 @@ public:
Fl_Widget *widget(int X,int Y,int W,int H);
Type type() const { return FLD_NODE_TYPE_Grid; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Grid) ? true : super::is_a(inType); }
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
- void write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate);
- void read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
+ void write_parent_properties(Project_Writer &f, Node *child, bool encapsulate);
+ void read_parent_property(Project_Reader &f, Node *child, const char *property);
Fl_Widget *enter_live_mode(int top=0);
void leave_live_mode();
void copy_properties();
void copy_properties_for_children();
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
void add_child(Node*, Node*);
void move_child(Node*, Node*);
void remove_child(Node*);
diff --git a/fluid/nodes/Group_Node.cxx b/fluid/nodes/Group_Node.cxx
index d4dc93780..7ba2b8b84 100644
--- a/fluid/nodes/Group_Node.cxx
+++ b/fluid/nodes/Group_Node.cxx
@@ -197,14 +197,14 @@ void Group_Node::ideal_size(int &w, int &h) {
w = 140;
h = 140;
}
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
-void Group_Node::write_code1(fld::io::Code_Writer& f) {
+void Group_Node::write_code1(Code_Writer& f) {
Widget_Node::write_code1(f);
}
-void Group_Node::write_code2(fld::io::Code_Writer& f) {
+void Group_Node::write_code2(Code_Writer& f) {
const char *var = name() ? name() : "o";
write_extra_code(f);
f.write_c("%s%s->end();\n", f.indent(), var);
@@ -357,7 +357,7 @@ void Flex_Node::copy_properties_for_children() {
d->layout();
}
-void Flex_Node::write_properties(fld::io::Project_Writer &f)
+void Flex_Node::write_properties(Project_Writer &f)
{
Group_Node::write_properties(f);
Fl_Flex* flex = (Fl_Flex*)o;
@@ -383,7 +383,7 @@ void Flex_Node::write_properties(fld::io::Project_Writer &f)
}
}
-void Flex_Node::read_property(fld::io::Project_Reader &f, const char *c)
+void Flex_Node::read_property(Project_Reader &f, const char *c)
{
Fl_Flex* flex = (Fl_Flex*)o;
suspend_auto_layout = 1;
@@ -433,7 +433,7 @@ void Flex_Node::postprocess_read()
suspend_auto_layout = 0;
}
-void Flex_Node::write_code2(fld::io::Code_Writer& f) {
+void Flex_Node::write_code2(Code_Writer& f) {
const char *var = name() ? name() : "o";
Fl_Flex* flex = (Fl_Flex*)o;
int lm, tm, rm, bm;
@@ -725,7 +725,7 @@ Fl_Widget *Table_Node::enter_live_mode(int) {
void Table_Node::ideal_size(int &w, int &h) {
w = 160;
h = 120;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
// ---- Tabs_Node --------------------------------------------------- MARK: -
diff --git a/fluid/nodes/Group_Node.h b/fluid/nodes/Group_Node.h
index bf630815c..957bbbdd7 100644
--- a/fluid/nodes/Group_Node.h
+++ b/fluid/nodes/Group_Node.h
@@ -56,8 +56,8 @@ public:
Fl_Widget *widget(int X,int Y,int W,int H) {
Fl_Group_Proxy *g = new Fl_Group_Proxy(X,Y,W,H); Fl_Group::current(0); return g;}
Widget_Node *_make() {return new Group_Node();}
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
void add_child(Node*, Node*);
void move_child(Node*, Node*);
void remove_child(Node*);
@@ -122,13 +122,13 @@ public:
Fl_Flex *g = new Fl_Flex_Proxy(X,Y,W,H); Fl_Group::current(0); return g;}
Type type() const { return FLD_NODE_TYPE_Flex; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Flex) ? true : super::is_a(inType); }
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
Fl_Widget *enter_live_mode(int top=0);
void copy_properties();
void copy_properties_for_children();
void postprocess_read();
- void write_code2(fld::io::Code_Writer& f);
+ void write_code2(Code_Writer& f);
// void add_child(Node*, Node*);
// void move_child(Node*, Node*);
void remove_child(Node*);
diff --git a/fluid/nodes/Menu_Node.cxx b/fluid/nodes/Menu_Node.cxx
index 6f837a9ba..b45015bea 100644
--- a/fluid/nodes/Menu_Node.cxx
+++ b/fluid/nodes/Menu_Node.cxx
@@ -302,7 +302,7 @@ int isdeclare(const char *c);
// Search backwards to find the parent menu button and return it's name.
// Also put in i the index into the button's menu item array belonging
// to this menu item.
-const char* Menu_Item_Node::menu_name(fld::io::Code_Writer& f, int& i) {
+const char* Menu_Item_Node::menu_name(Code_Writer& f, int& i) {
i = 0;
Node* t = prev;
while (t && t->is_a(FLD_NODE_TYPE_Menu_Item)) {
@@ -317,7 +317,7 @@ const char* Menu_Item_Node::menu_name(fld::io::Code_Writer& f, int& i) {
return f.unique_id(t, "menu", t->name(), t->label());
}
-void Menu_Item_Node::write_static(fld::io::Code_Writer& f) {
+void Menu_Item_Node::write_static(Code_Writer& f) {
if (image && label() && label()[0]) {
f.write_h_once("#include <FL/Fl.H>");
f.write_h_once("#include <FL/Fl_Multi_Label.H>");
@@ -451,7 +451,7 @@ void Menu_Item_Node::write_static(fld::io::Code_Writer& f) {
f.write_c("Fl_Menu_Item* %s::%s = %s::%s + %d;\n", k, c, k, n, i);
} else {
// if the name is an array, only define the array.
- // The actual assignment is in write_code1(fld::io::Code_Writer& f)
+ // The actual assignment is in write_code1(Code_Writer& f)
f.write_c("Fl_Menu_Item* %s::%s;\n", k, c);
}
}
@@ -473,7 +473,7 @@ int Menu_Item_Node::flags() {
return i;
}
-void Menu_Item_Node::write_item(fld::io::Code_Writer& f) {
+void Menu_Item_Node::write_item(Code_Writer& f) {
static const char * const labeltypes[] = {
"FL_NORMAL_LABEL",
"FL_NO_LABEL",
@@ -548,7 +548,7 @@ void Menu_Item_Node::write_item(fld::io::Code_Writer& f) {
f.write_c("},\n");
}
-void start_menu_initialiser(fld::io::Code_Writer& f, int &initialized, const char *name, int index) {
+void start_menu_initialiser(Code_Writer& f, int &initialized, const char *name, int index) {
if (!initialized) {
initialized = 1;
f.write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", f.indent(), name, index);
@@ -556,7 +556,7 @@ void start_menu_initialiser(fld::io::Code_Writer& f, int &initialized, const cha
}
}
-void Menu_Item_Node::write_code1(fld::io::Code_Writer& f) {
+void Menu_Item_Node::write_code1(Code_Writer& f) {
int i; const char* mname = menu_name(f, i);
if (!prev->is_a(FLD_NODE_TYPE_Menu_Item)) {
@@ -652,7 +652,7 @@ void Menu_Item_Node::write_code1(fld::io::Code_Writer& f) {
}
}
-void Menu_Item_Node::write_code2(fld::io::Code_Writer&) {}
+void Menu_Item_Node::write_code2(Code_Writer&) {}
////////////////////////////////////////////////////////////////
// This is the base class for widgets that contain a menu (ie
@@ -744,7 +744,7 @@ Node* Menu_Base_Node::click_test(int, int) {
return this;
}
-void Menu_Manager_Node::write_code2(fld::io::Code_Writer& f) {
+void Menu_Manager_Node::write_code2(Code_Writer& f) {
if (next && next->is_a(FLD_NODE_TYPE_Menu_Item)) {
f.write_c("%s%s->menu(%s);\n", f.indent(), name() ? name() : "o",
f.unique_id(this, "menu", name(), label()));
@@ -860,7 +860,7 @@ const char *Menu_Bar_Node::sys_menubar_proxy_name() {
}
-void Menu_Bar_Node::write_static(fld::io::Code_Writer& f) {
+void Menu_Bar_Node::write_static(Code_Writer& f) {
super::write_static(f);
if (is_sys_menu_bar()) {
f.write_h_once("#include <FL/Fl_Sys_Menu_Bar.H>");
@@ -880,7 +880,7 @@ void Menu_Bar_Node::write_static(fld::io::Code_Writer& f) {
}
}
-void Menu_Bar_Node::write_code1(fld::io::Code_Writer& f) {
+void Menu_Bar_Node::write_code1(Code_Writer& f) {
super::write_code1(f);
if (is_sys_menu_bar() && is_in_class()) {
f.write_c("%s((%s*)%s)->_parent_class = (void*)this;\n",
@@ -888,7 +888,7 @@ void Menu_Bar_Node::write_code1(fld::io::Code_Writer& f) {
}
}
-//void Menu_Bar_Node::write_code2(fld::io::Code_Writer& f) {
+//void Menu_Bar_Node::write_code2(Code_Writer& f) {
// super::write_code2(f);
//}
diff --git a/fluid/nodes/Menu_Node.h b/fluid/nodes/Menu_Node.h
index b0e46afca..66232cbef 100644
--- a/fluid/nodes/Menu_Node.h
+++ b/fluid/nodes/Menu_Node.h
@@ -60,12 +60,12 @@ public:
int is_button() const {return 1;} // this gets shortcut to work
Fl_Widget* widget(int,int,int,int) {return 0;}
Widget_Node* _make() {return 0;}
- virtual const char* menu_name(fld::io::Code_Writer& f, int& i);
+ virtual const char* menu_name(Code_Writer& f, int& i);
int flags();
- void write_static(fld::io::Code_Writer& f);
- void write_item(fld::io::Code_Writer& f);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_static(Code_Writer& f);
+ void write_item(Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
int is_true_widget() const { return 0; }
Type type() const { return FLD_NODE_TYPE_Menu_Item; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Menu_Item) ? true : super::is_a(inType); }
@@ -141,10 +141,10 @@ class Menu_Manager_Node : public Widget_Node
typedef Widget_Node super;
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->textsize_not_null() + 8;
w = layout->textsize_not_null() * 6 + 8;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
int can_have_children() const {return 1;}
int menusize;
@@ -154,7 +154,7 @@ public:
void move_child(Node*, Node*) { build_menu(); }
void remove_child(Node*) { build_menu();}
Node* click_test(int x, int y) = 0;
- void write_code2(fld::io::Code_Writer& f);
+ void write_code2(Code_Writer& f);
void copy_properties() = 0;
Type type() const { return FLD_NODE_TYPE_Menu_Manager_; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Menu_Manager_) ? true : super::is_a(inType); }
@@ -294,9 +294,9 @@ public:
const char *alt_type_name() {return "fltk::MenuBar";}
Fl_Widget *widget(int X,int Y,int W,int H) {return new Fl_Menu_Bar(X,Y,W,H);}
Widget_Node *_make() {return new Menu_Bar_Node();}
- void write_static(fld::io::Code_Writer& f);
- void write_code1(fld::io::Code_Writer& f);
-// void write_code2(fld::io::Code_Writer& f);
+ void write_static(Code_Writer& f);
+ void write_code1(Code_Writer& f);
+// void write_code2(Code_Writer& f);
Type type() const { return FLD_NODE_TYPE_Menu_Bar; }
bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Menu_Bar) ? true : super::is_a(inType); }
int is_sys_menu_bar();
diff --git a/fluid/nodes/Node.cxx b/fluid/nodes/Node.cxx
index 79bd04b3b..8bcad077d 100644
--- a/fluid/nodes/Node.cxx
+++ b/fluid/nodes/Node.cxx
@@ -895,7 +895,7 @@ void Node::move_before(Node* g) {
// write a widget and all its children:
-void Node::write(fld::io::Project_Writer &f) {
+void Node::write(Project_Writer &f) {
if (f.write_codeview()) proj1_start = (int)ftell(f.file()) + 1;
if (f.write_codeview()) proj2_start = (int)ftell(f.file()) + 1;
f.write_indent(level);
@@ -927,7 +927,7 @@ void Node::write(fld::io::Project_Writer &f) {
if (f.write_codeview()) proj2_end = (int)ftell(f.file());
}
-void Node::write_properties(fld::io::Project_Writer &f) {
+void Node::write_properties(Project_Writer &f) {
// repeat this for each attribute:
if (Fluid.proj.write_mergeback_data && uid_) {
f.write_word("uid");
@@ -961,7 +961,7 @@ void Node::write_properties(fld::io::Project_Writer &f) {
if (selected) f.write_word("selected");
}
-void Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"uid")) {
const char *hex = f.read_word();
int x = 0;
@@ -1026,13 +1026,13 @@ void Node::read_property(fld::io::Project_Reader &f, const char *c) {
Lastly, this method should call the super class to give it a chance to append
its own properties.
- \see Grid_Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate)
+ \see Grid_Node::write_parent_properties(Project_Writer &f, Node *child, bool encapsulate)
\param[in] f the project file writer
\param[in] child write properties for this child, make sure it has the correct type
\param[in] encapsulate write the `parent_properties {}` block if true before writing any properties
*/
-void Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate) {
+void Node::write_parent_properties(Project_Writer &f, Node *child, bool encapsulate) {
(void)f; (void)child; (void)encapsulate;
// nothing to do here
// put the following code into your implementation of write_parent_properties
@@ -1059,14 +1059,14 @@ void Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool
method reads back those properties. This function is virtual, so if a Type
does not support a property, it will propagate to its super class.
- \see Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate)
- \see Grid_Node::read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property)
+ \see Node::write_parent_properties(Project_Writer &f, Node *child, bool encapsulate)
+ \see Grid_Node::read_parent_property(Project_Reader &f, Node *child, const char *property)
\param[in] f the project file writer
\param[in] child read properties for this child
\param[in] property the name of a property, or "}" when we reach the end of the list
*/
-void Node::read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property) {
+void Node::read_parent_property(Project_Reader &f, Node *child, const char *property) {
(void)child;
f.read_error("Unknown parent property \"%s\"", property);
}
@@ -1078,7 +1078,7 @@ int Node::read_fdesign(const char*, const char*) {return 0;}
Write a comment into the header file.
\param[in] pre indent the comment by this string
*/
-void Node::write_comment_h(fld::io::Code_Writer& f, const char *pre)
+void Node::write_comment_h(Code_Writer& f, const char *pre)
{
if (comment() && *comment()) {
f.write_h("%s/**\n", pre);
@@ -1101,7 +1101,7 @@ void Node::write_comment_h(fld::io::Code_Writer& f, const char *pre)
/**
Write a comment into the source file.
*/
-void Node::write_comment_c(fld::io::Code_Writer& f, const char *pre)
+void Node::write_comment_c(Code_Writer& f, const char *pre)
{
if (comment() && *comment()) {
f.write_c("%s/**\n", pre);
@@ -1126,7 +1126,7 @@ void Node::write_comment_c(fld::io::Code_Writer& f, const char *pre)
/**
Write a comment into the source file.
*/
-void Node::write_comment_inline_c(fld::io::Code_Writer& f, const char *pre)
+void Node::write_comment_inline_c(Code_Writer& f, const char *pre)
{
if (comment() && *comment()) {
const char *s = comment();
@@ -1207,7 +1207,7 @@ int Node::user_defined(const char* cbname) const {
return 0;
}
-const char *Node::callback_name(fld::io::Code_Writer& f) {
+const char *Node::callback_name(Code_Writer& f) {
if (is_name(callback())) return callback();
return f.unique_id(this, "cb", name(), label());
}
@@ -1260,18 +1260,18 @@ bool Node::is_in_class() const {
return false;
}
-void Node::write_static(fld::io::Code_Writer&) {
+void Node::write_static(Code_Writer&) {
}
-void Node::write_static_after(fld::io::Code_Writer&) {
+void Node::write_static_after(Code_Writer&) {
}
-void Node::write_code1(fld::io::Code_Writer& f) {
+void Node::write_code1(Code_Writer& f) {
f.write_h("// Header for %s\n", title());
f.write_c("// Code for %s\n", title());
}
-void Node::write_code2(fld::io::Code_Writer&) {
+void Node::write_code2(Code_Writer&) {
}
/** Set a uid that is unique within the project.
diff --git a/fluid/nodes/Node.h b/fluid/nodes/Node.h
index a20dd7258..91a1ad84f 100644
--- a/fluid/nodes/Node.h
+++ b/fluid/nodes/Node.h
@@ -26,15 +26,9 @@ class Node;
class Group_Node;
class Window_Node;
-namespace fld {
-namespace io {
-
class Project_Reader;
class Project_Writer;
-} // namespace io
-} // namespace fld
-
/**
Declare where a new type is placed and how to create it.
@@ -53,8 +47,8 @@ class Project_Writer;
Add a hierarchy of Types
void Node::add(Node *p, Strategy strategy)
int read_file(const char *filename, int merge, Strategy strategy)
- Node *fld::io::Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options)
- int fld::io::Project_Reader::read_project(const char *filename, int merge, Strategy strategy)
+ Node *Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options)
+ int Project_Reader::read_project(const char *filename, int merge, Strategy strategy)
*/
typedef struct Strategy {
enum Flags {
@@ -195,7 +189,7 @@ public: // things that should not be public:
Node *first_child();
Node *factory;
- const char *callback_name(fld::io::Code_Writer& f);
+ const char *callback_name(Code_Writer& f);
// text positions of this type in code, header, and project file (see codeview)
int code_static_start, code_static_end;
@@ -256,22 +250,22 @@ public:
virtual void open(); // what happens when you double-click
// read and write data to a saved file:
- virtual void write(fld::io::Project_Writer &f);
- virtual void write_properties(fld::io::Project_Writer &f);
- virtual void read_property(fld::io::Project_Reader &f, const char *);
- virtual void write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate);
- virtual void read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property);
+ virtual void write(Project_Writer &f);
+ virtual void write_properties(Project_Writer &f);
+ virtual void read_property(Project_Reader &f, const char *);
+ virtual void write_parent_properties(Project_Writer &f, Node *child, bool encapsulate);
+ virtual void read_parent_property(Project_Reader &f, Node *child, const char *property);
virtual int read_fdesign(const char*, const char*);
virtual void postprocess_read() { }
// write code, these are called in order:
- virtual void write_static(fld::io::Code_Writer& f); // write static stuff to .c file
- virtual void write_static_after(fld::io::Code_Writer& f); // write static stuff after children
- virtual void write_code1(fld::io::Code_Writer& f); // code and .h before children
- virtual void write_code2(fld::io::Code_Writer& f); // code and .h after children
- void write_comment_h(fld::io::Code_Writer& f, const char *ind=""); // write the commentary text into the header file
- void write_comment_c(fld::io::Code_Writer& f, const char *ind=""); // write the commentary text into the source file
- void write_comment_inline_c(fld::io::Code_Writer& f, const char *ind=0); // write the commentary text
+ virtual void write_static(Code_Writer& f); // write static stuff to .c file
+ virtual void write_static_after(Code_Writer& f); // write static stuff after children
+ virtual void write_code1(Code_Writer& f); // code and .h before children
+ virtual void write_code2(Code_Writer& f); // code and .h after children
+ void write_comment_h(Code_Writer& f, const char *ind=""); // write the commentary text into the header file
+ void write_comment_c(Code_Writer& f, const char *ind=""); // write the commentary text into the source file
+ void write_comment_inline_c(Code_Writer& f, const char *ind=0); // write the commentary text
// live mode
virtual Fl_Widget *enter_live_mode(int top=0); // build widgets needed for live mode
diff --git a/fluid/nodes/Tree.cxx b/fluid/nodes/Tree.cxx
index e11c399e2..5ac203ff6 100644
--- a/fluid/nodes/Tree.cxx
+++ b/fluid/nodes/Tree.cxx
@@ -19,7 +19,7 @@
#include "Project.h"
-fld::node::Tree::Iterator::Iterator(Node *t, bool only_selected)
+Tree::Iterator::Iterator(Node *t, bool only_selected)
: type_(t)
, only_selected_(only_selected)
{
@@ -32,7 +32,7 @@ fld::node::Tree::Iterator::Iterator(Node *t, bool only_selected)
}
}
-fld::node::Tree::Iterator &fld::node::Tree::Iterator::operator++() {
+Tree::Iterator &Tree::Iterator::operator++() {
if (only_selected_) {
do {
type_ = type_->next;
@@ -43,7 +43,7 @@ fld::node::Tree::Iterator &fld::node::Tree::Iterator::operator++() {
return *this;
}
-fld::node::Tree::WIterator::WIterator(Node *t, bool only_selected)
+Tree::WIterator::WIterator(Node *t, bool only_selected)
: type_(t)
, only_selected_(only_selected)
{
@@ -60,7 +60,7 @@ fld::node::Tree::WIterator::WIterator(Node *t, bool only_selected)
}
}
-fld::node::Tree::WIterator& fld::node::Tree::WIterator::operator++() {
+Tree::WIterator& Tree::WIterator::operator++() {
if (only_selected_) {
do {
type_ = type_->next;
@@ -74,7 +74,7 @@ fld::node::Tree::WIterator& fld::node::Tree::WIterator::operator++() {
}
-fld::node::Tree::Tree(Project &proj)
+Tree::Tree(Project &proj)
: proj_(proj)
{ (void)proj_; }
@@ -87,7 +87,7 @@ fld::node::Tree::Tree(Project &proj)
\param[in] uid any number between 0 and 65535
\return the node with this uid, or 0 if not found
*/
-Node *fld::node::Tree::find_by_uid(unsigned short uid) {
+Node *Tree::find_by_uid(unsigned short uid) {
for (Node *tp: all_nodes()) {
if (tp->get_uid() == uid) return tp;
}
@@ -101,7 +101,7 @@ Node *fld::node::Tree::find_by_uid(unsigned short uid) {
\param[in] crsr cursor position in text
\return the node we found or 0
*/
-Node *fld::node::Tree::find_in_text(int text_type, int crsr) {
+Node *Tree::find_in_text(int text_type, int crsr) {
for (Node *node: all_nodes()) {
switch (text_type) {
case 0:
diff --git a/fluid/nodes/Tree.h b/fluid/nodes/Tree.h
index b166c7f0b..052553fa2 100644
--- a/fluid/nodes/Tree.h
+++ b/fluid/nodes/Tree.h
@@ -21,12 +21,8 @@
class Node;
-namespace fld {
-
class Project;
-namespace node {
-
class Tree {
// A class that can iterate over the entire scene graph.
@@ -99,8 +95,6 @@ public:
Node *find_in_text(int text_type, int crsr);
};
-} // namespace node
-} // namespace fld
#endif // FLUID_NODES_TREE_H
diff --git a/fluid/nodes/Widget_Node.cxx b/fluid/nodes/Widget_Node.cxx
index 757155335..51ccf8bb0 100644
--- a/fluid/nodes/Widget_Node.cxx
+++ b/fluid/nodes/Widget_Node.cxx
@@ -98,7 +98,7 @@ const char* subclassname(Node* l) {
void Widget_Node::ideal_size(int &w, int &h) {
w = 120;
h = 100;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
/**
@@ -461,88 +461,88 @@ void label_cb(Fl_Input* i, void* v) {
int widget_i = 0;
-static int vars_i_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_i_cb(const Formula_Input*, void* v) {
return widget_i;
}
-static int vars_x_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_x_cb(const Formula_Input*, void* v) {
Node* t = (Node*)v;
if (t->is_widget())
return ((Widget_Node*)t)->o->x();
return 0;
}
-static int vars_y_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_y_cb(const Formula_Input*, void* v) {
Node* t = (Node*)v;
if (t->is_widget())
return ((Widget_Node*)t)->o->y();
return 0;
}
-static int vars_w_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_w_cb(const Formula_Input*, void* v) {
Node* t = (Node*)v;
if (t->is_widget())
return ((Widget_Node*)t)->o->w();
return 0;
}
-static int vars_h_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_h_cb(const Formula_Input*, void* v) {
Node* t = (Node*)v;
if (t->is_widget())
return ((Widget_Node*)t)->o->h();
return 0;
}
-static int vars_px_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_px_cb(const Formula_Input*, void* v) {
Node* t = ((Node*)v)->parent;
if (t && t->is_widget())
return ((Widget_Node*)t)->o->x();
return 0;
}
-static int vars_py_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_py_cb(const Formula_Input*, void* v) {
Node* t = ((Node*)v)->parent;
if (t && t->is_widget())
return ((Widget_Node*)t)->o->y();
return 0;
}
-static int vars_pw_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_pw_cb(const Formula_Input*, void* v) {
Node* t = ((Node*)v)->parent;
if (t && t->is_widget())
return ((Widget_Node*)t)->o->w();
return 0;
}
-static int vars_ph_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_ph_cb(const Formula_Input*, void* v) {
Node* t = ((Node*)v)->parent;
if (t && t->is_widget())
return ((Widget_Node*)t)->o->h();
return 0;
}
-static int vars_sx_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_sx_cb(const Formula_Input*, void* v) {
Node* t = ((Node*)v)->prev_sibling();
if (t && t->is_widget())
return ((Widget_Node*)t)->o->x();
return 0;
}
-static int vars_sy_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_sy_cb(const Formula_Input*, void* v) {
Node* t = ((Node*)v)->prev_sibling();
if (t && t->is_widget())
return ((Widget_Node*)t)->o->y();
return 0;
}
-static int vars_sw_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_sw_cb(const Formula_Input*, void* v) {
Node* t = ((Node*)v)->prev_sibling();
if (t && t->is_widget())
return ((Widget_Node*)t)->o->w();
return 0;
}
-static int vars_sh_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_sh_cb(const Formula_Input*, void* v) {
Node* t = ((Node*)v)->prev_sibling();
if (t && t->is_widget())
return ((Widget_Node*)t)->o->h();
@@ -571,27 +571,27 @@ static void calculate_bbox(Node* p) {
}
}
-static int vars_cx_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_cx_cb(const Formula_Input*, void* v) {
calculate_bbox((Node*)v);
return bbox_x;
}
-static int vars_cy_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_cy_cb(const Formula_Input*, void* v) {
calculate_bbox((Node*)v);
return bbox_y;
}
-static int vars_cw_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_cw_cb(const Formula_Input*, void* v) {
calculate_bbox((Node*)v);
return bbox_r - bbox_x;
}
-static int vars_ch_cb(const fld::widget::Formula_Input*, void* v) {
+static int vars_ch_cb(const Formula_Input*, void* v) {
calculate_bbox((Node*)v);
return bbox_b - bbox_y;
}
-fld::widget::Formula_Input_Vars widget_vars[] = {
+Formula_Input_Vars widget_vars[] = {
{ "i", vars_i_cb }, // zero based counter of selected widgets
{ "x", vars_x_cb }, // position and size of current widget
{ "y", vars_y_cb },
@@ -1566,7 +1566,7 @@ int isdeclare(const char* c) {
return 0;
}
-void Widget_Node::write_static(fld::io::Code_Writer& f) {
+void Widget_Node::write_static(Code_Writer& f) {
const char* t = subclassname(this);
const char* sc = subclass();
if (!sc || !sc[0] || (is_class() && strncmp(t, "Fl_", 3)==0)) {
@@ -1659,7 +1659,7 @@ void Widget_Node::write_static(fld::io::Code_Writer& f) {
}
}
-void Widget_Node::write_code1(fld::io::Code_Writer& f) {
+void Widget_Node::write_code1(Code_Writer& f) {
const char* t = subclassname(this);
const char* c = array_name(this);
if (c) {
@@ -1787,7 +1787,7 @@ void Widget_Node::write_code1(fld::io::Code_Writer& f) {
write_widget_code(f);
}
-void Widget_Node::write_color(fld::io::Code_Writer& f, const char* field, Fl_Color color) {
+void Widget_Node::write_color(Code_Writer& f, const char* field, Fl_Color color) {
const char* color_name = 0;
switch (color) {
case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break;
@@ -1825,8 +1825,8 @@ void Widget_Node::write_color(fld::io::Code_Writer& f, const char* field, Fl_Col
}
}
-// this is split from write_code1(fld::io::Code_Writer& f) for Window_Node:
-void Widget_Node::write_widget_code(fld::io::Code_Writer& f) {
+// this is split from write_code1(Code_Writer& f) for Window_Node:
+void Widget_Node::write_widget_code(Code_Writer& f) {
Fl_Widget* tplate = ((Widget_Node*)factory)->o;
const char* var = is_class() ? "this" : name() ? name() : "o";
@@ -2033,27 +2033,27 @@ void Widget_Node::write_widget_code(fld::io::Code_Writer& f) {
}
}
-void Widget_Node::write_extra_code(fld::io::Code_Writer& f) {
+void Widget_Node::write_extra_code(Code_Writer& f) {
int n;
for (n =0; n < NUM_EXTRA_CODE; n++)
if (extra_code(n) && extra_code(n)[0] && !isdeclare(extra_code(n)))
f.write_c("%s%s\n", f.indent(), extra_code(n));
}
-void Widget_Node::write_block_close(fld::io::Code_Writer& f) {
+void Widget_Node::write_block_close(Code_Writer& f) {
f.indentation--;
f.write_c("%s} // %s* %s\n", f.indent(), subclassname(this),
name() ? name() : "o");
}
-void Widget_Node::write_code2(fld::io::Code_Writer& f) {
+void Widget_Node::write_code2(Code_Writer& f) {
write_extra_code(f);
write_block_close(f);
}
////////////////////////////////////////////////////////////////
-void Widget_Node::write_properties(fld::io::Project_Writer &f) {
+void Widget_Node::write_properties(Project_Writer &f) {
Node::write_properties(f);
f.write_indent(level+1);
switch (public_) {
@@ -2188,7 +2188,7 @@ void Widget_Node::write_properties(fld::io::Project_Writer &f) {
}
}
-void Widget_Node::read_property(fld::io::Project_Reader &f, const char* c) {
+void Widget_Node::read_property(Project_Reader &f, const char* c) {
int x,y,w,h; Fl_Font ft; int s; Fl_Color cc;
if (!strcmp(c,"private")) {
public_ = 0;
@@ -2401,7 +2401,7 @@ int Widget_Node::read_fdesign(const char* propname, const char* value) {
if (!strcmp(propname,"box")) {
float x,y,w,h;
if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) {
- if (fld::io::fdesign_flip) {
+ if (fdesign_flip) {
Node* p;
for (p = parent; p && !p->is_a(FLD_NODE_TYPE_Window); p = p->parent) {/*empty*/}
if (p && p->is_widget()) y = ((Widget_Node*)p)->o->h()-(y+h);
diff --git a/fluid/nodes/Widget_Node.h b/fluid/nodes/Widget_Node.h
index 6259c079a..901315390 100644
--- a/fluid/nodes/Widget_Node.h
+++ b/fluid/nodes/Widget_Node.h
@@ -69,13 +69,13 @@ protected:
/// disabling the output of the "hide" property by the Widget Type.
uchar override_visible_;
- void write_static(fld::io::Code_Writer& f);
- void write_code1(fld::io::Code_Writer& f);
- void write_widget_code(fld::io::Code_Writer& f);
- void write_extra_code(fld::io::Code_Writer& f);
- void write_block_close(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
- void write_color(fld::io::Code_Writer& f, const char*, Fl_Color);
+ void write_static(Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_widget_code(Code_Writer& f);
+ void write_extra_code(Code_Writer& f);
+ void write_block_close(Code_Writer& f);
+ void write_code2(Code_Writer& f);
+ void write_color(Code_Writer& f, const char*, Fl_Color);
/// Pointer to widget representing this node in live mode.
Fl_Widget* live_widget;
@@ -145,8 +145,8 @@ public:
int is_true_widget() const { return 1; }
int is_public() const;
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
int read_fdesign(const char*, const char*);
Fl_Widget* enter_live_mode(int top=0);
diff --git a/fluid/nodes/Window_Node.cxx b/fluid/nodes/Window_Node.cxx
index 5cdda615d..a4fef0976 100644
--- a/fluid/nodes/Window_Node.cxx
+++ b/fluid/nodes/Window_Node.cxx
@@ -81,7 +81,7 @@ void i18n_type_cb(Fl_Choice *c, void *v) {
c->value(static_cast<int>(Fluid.proj.i18n.type));
} else {
Fluid.proj.undo.checkpoint();
- Fluid.proj.i18n.type = static_cast<fld::I18n_Type>(c->value());
+ Fluid.proj.i18n.type = static_cast<I18n_Type>(c->value());
Fluid.proj.set_modflag(1);
}
switch (Fluid.proj.i18n.type) {
@@ -344,7 +344,7 @@ void Window_Node::ideal_size(int &w, int &h) {
Fl::screen_work_area(sx, sy, sw, sh, screen);
w = MIN(w, sw*3/4); h = MIN(h, sh*3/4);
}
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
@@ -364,7 +364,7 @@ void Overlay_Window::resize(int X,int Y,int W,int H) {
if (X!=x() || Y!=y() || W!=w() || H!=h()) {
// Set a checkpoint on the first resize event, ignore further resizes until
// a different type of checkpoint is triggered.
- if (Fluid.proj.undo.checkpoint(fld::proj::FLD_UNDO_ONCETYPE_WINDOW_RESIZE))
+ if (Fluid.proj.undo.checkpoint(FLD_UNDO_ONCETYPE_WINDOW_RESIZE))
Fluid.proj.set_modflag(1);
}
@@ -410,8 +410,8 @@ void Window_Node::newdx() {
break;
}
}
- fld::app::Snap_Data data = { mydx, mydy, bx, by, br, bt, drag, 4, 4, mydx, mydy, (Widget_Node*)selection, this };
- fld::app::Snap_Action::check_all(data);
+ Snap_Data data = { mydx, mydy, bx, by, br, bt, drag, 4, 4, mydx, mydy, (Widget_Node*)selection, this };
+ Snap_Action::check_all(data);
if (data.x_dist < 4) mydx = data.dx_out;
if (data.y_dist < 4) mydy = data.dy_out;
}
@@ -663,8 +663,8 @@ void Window_Node::draw_overlay() {
fl_rectf(mysx,myst-5,5,5);
if (Fluid.show_guides && (drag & (FD_DRAG|FD_TOP|FD_LEFT|FD_BOTTOM|FD_RIGHT))) {
- fld::app::Snap_Data data = { dx, dy, sx, sy, sr, st, drag, 4, 4, dx, dy, (Widget_Node*)selection, this};
- fld::app::Snap_Action::draw_all(data);
+ Snap_Data data = { dx, dy, sx, sy, sr, st, drag, 4, 4, dx, dy, (Widget_Node*)selection, this};
+ Snap_Action::draw_all(data);
}
}
@@ -1182,9 +1182,9 @@ int Window_Node::handle(int event) {
if (Fl::event_state(FL_COMMAND)) {
int x_step, y_step;
if (drag & (FD_RIGHT|FD_BOTTOM))
- fld::app::Snap_Action::get_resize_stepsize(x_step, y_step);
+ Snap_Action::get_resize_stepsize(x_step, y_step);
else
- fld::app::Snap_Action::get_move_stepsize(x_step, y_step);
+ Snap_Action::get_move_stepsize(x_step, y_step);
dx *= x_step;
dy *= y_step;
}
@@ -1219,7 +1219,7 @@ int Window_Node::handle(int event) {
Write the C++ code that comes before the children of the window are written.
\param f the source code output stream
*/
-void Window_Node::write_code1(fld::io::Code_Writer& f) {
+void Window_Node::write_code1(Code_Writer& f) {
Widget_Node::write_code1(f);
}
@@ -1228,7 +1228,7 @@ void Window_Node::write_code1(fld::io::Code_Writer& f) {
Write the C++ code that comes after the children of the window are written.
\param f the source code output stream
*/
-void Window_Node::write_code2(fld::io::Code_Writer& f) {
+void Window_Node::write_code2(Code_Writer& f) {
const char *var = is_class() ? "this" : name() ? name() : "o";
// make the window modal or non-modal
if (modal) {
@@ -1263,7 +1263,7 @@ void Window_Node::write_code2(fld::io::Code_Writer& f) {
write_block_close(f);
}
-void Window_Node::write_properties(fld::io::Project_Writer &f) {
+void Window_Node::write_properties(Project_Writer &f) {
Widget_Node::write_properties(f);
if (modal) f.write_string("modal");
else if (non_modal) f.write_string("non_modal");
@@ -1274,7 +1274,7 @@ void Window_Node::write_properties(fld::io::Project_Writer &f) {
if (o->visible() || override_visible_) f.write_string("visible");
}
-void Window_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Window_Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"modal")) {
modal = 1;
} else if (!strcmp(c,"non_modal")) {
@@ -1362,7 +1362,7 @@ Node *Widget_Class_Node::make(Strategy strategy) {
return myo;
}
-void Widget_Class_Node::write_properties(fld::io::Project_Writer &f) {
+void Widget_Class_Node::write_properties(Project_Writer &f) {
Window_Node::write_properties(f);
if (wc_relative==1)
f.write_string("position_relative");
@@ -1370,7 +1370,7 @@ void Widget_Class_Node::write_properties(fld::io::Project_Writer &f) {
f.write_string("position_relative_rescale");
}
-void Widget_Class_Node::read_property(fld::io::Project_Reader &f, const char *c) {
+void Widget_Class_Node::read_property(Project_Reader &f, const char *c) {
if (!strcmp(c,"position_relative")) {
wc_relative = 1;
} else if (!strcmp(c,"position_relative_rescale")) {
@@ -1393,9 +1393,9 @@ static const char *trimclassname(const char *n) {
}
-void Widget_Class_Node::write_code1(fld::io::Code_Writer& f) {
+void Widget_Class_Node::write_code1(Code_Writer& f) {
#if 0
- Widget_Node::write_code1(fld::io::Code_Writer& f);
+ Widget_Node::write_code1(Code_Writer& f);
#endif // 0
current_widget_class = this;
@@ -1463,7 +1463,7 @@ void Widget_Class_Node::write_code1(fld::io::Code_Writer& f) {
Write the C++ code that comes after the children of the window are written.
\param f the source code output stream
*/
-void Widget_Class_Node::write_code2(fld::io::Code_Writer& f) {
+void Widget_Class_Node::write_code2(Code_Writer& f) {
// make the window modal or non-modal
if (modal) {
f.write_c("%sset_modal();\n", f.indent());
diff --git a/fluid/nodes/Window_Node.h b/fluid/nodes/Window_Node.h
index 3c916576d..744847666 100644
--- a/fluid/nodes/Window_Node.h
+++ b/fluid/nodes/Window_Node.h
@@ -70,8 +70,8 @@ protected:
void newposition(Widget_Node *,int &x,int &y,int &w,int &h);
int handle(int);
void setlabel(const char *);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
Widget_Node *_make() {return 0;} // we don't call this
Fl_Widget *widget(int,int,int,int) {return 0;}
int recalc; // set by fix_overlay()
@@ -108,8 +108,8 @@ public:
void fix_overlay(); // Update the bounding box, etc
uchar *read_image(int &ww, int &hh); // Read an image of the window
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
int read_fdesign(const char*, const char*);
void add_child(Node*, Node*);
@@ -145,11 +145,11 @@ public:
char write_public_state; // true when public: has been printed
char wc_relative; // if 1, reposition all children, if 2, reposition and resize
- void write_properties(fld::io::Project_Writer &f);
- void read_property(fld::io::Project_Reader &f, const char *);
+ void write_properties(Project_Writer &f);
+ void read_property(Project_Reader &f, const char *);
- void write_code1(fld::io::Code_Writer& f);
- void write_code2(fld::io::Code_Writer& f);
+ void write_code1(Code_Writer& f);
+ void write_code2(Code_Writer& f);
Node *make(Strategy strategy);
const char *type_name() {return "widget_class";}
Type type() const { return FLD_NODE_TYPE_Widget_Class; }
diff --git a/fluid/nodes/factory.cxx b/fluid/nodes/factory.cxx
index c901c9945..06c8eee90 100644
--- a/fluid/nodes/factory.cxx
+++ b/fluid/nodes/factory.cxx
@@ -122,7 +122,7 @@ public:
void ideal_size(int &w, int &h) {
w = 120;
h = 160;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Browser_"; }
const char *alt_type_name() { return "fltk::Browser_"; }
@@ -257,7 +257,7 @@ public:
void ideal_size(int &w, int &h) {
w = 120;
h = 160;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Tree"; }
const char *alt_type_name() { return "fltk::TreeBrowser"; }
@@ -312,7 +312,7 @@ public:
void ideal_size(int &w, int &h) {
w = 160;
h = 120;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Help_View"; }
const char *alt_type_name() { return "fltk::HelpView"; }
@@ -392,10 +392,10 @@ private:
}
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->textsize_not_null() + 8;
w = layout->textsize_not_null() * 4 + 4 * h; // make room for the arrows
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Counter"; }
const char *alt_type_name() { return "fltk::Counter"; }
@@ -422,10 +422,10 @@ public:
static Adjuster_Node prototype;
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->labelsize + 8;
w = 3 * h;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Adjuster"; }
const char *alt_type_name() { return "fltk::Adjuster"; }
@@ -462,7 +462,7 @@ private:
public:
void ideal_size(int &w, int &h) {
w = 60; h = 60;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Dial"; }
const char *alt_type_name() { return "fltk::Dial"; }
@@ -497,10 +497,10 @@ private:
Fl_Menu_Item *subtypes() { return roller_type_menu; }
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
w = layout->labelsize + 8;
h = 4 * w;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Roller"; }
const char *alt_type_name() { return "fltk::Roller"; }
@@ -541,10 +541,10 @@ private:
Fl_Menu_Item *subtypes() { return slider_type_menu; }
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
w = layout->labelsize + 8;
h = 4 * w;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Slider"; }
const char *alt_type_name() { return "fltk::Slider"; }
@@ -651,10 +651,10 @@ private:
}
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->textsize_not_null() + 8;
w = layout->textsize_not_null() * 4 + 8;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Value_Input"; }
const char *alt_type_name() { return "fltk::ValueInput"; }
@@ -694,10 +694,10 @@ private:
}
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->textsize_not_null() + 8;
w = layout->textsize_not_null() * 4 + 8;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Value_Output"; }
const char *alt_type_name() { return "fltk::ValueOutput"; }
@@ -753,10 +753,10 @@ private:
}
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->textsize_not_null() + 8;
w = layout->textsize_not_null() * 6 + 8;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Input"; }
const char *alt_type_name() { return "fltk::Input"; }
@@ -795,10 +795,10 @@ private:
Fl_Menu_Item *subtypes() { return 0; } // Don't inherit.
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->textsize_not_null() + 8 + 10; // Directoy bar is additional 10 pixels high
w = layout->textsize_not_null() * 10 + 8;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_File_Input"; }
const char *alt_type_name() { return "fltk::FileInput"; }
@@ -879,10 +879,10 @@ private:
}
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->textsize_not_null() * 4 + 8;
w = layout->textsize_not_null() * 10 + 8;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Text_Display"; }
const char *alt_type_name() { return "fltk::TextDisplay"; }
@@ -1045,7 +1045,7 @@ public:
public:
void ideal_size(int &w, int &h) {
w = 100; h = 100;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Box"; }
const char *alt_type_name() { return "fltk::Widget"; }
@@ -1074,7 +1074,7 @@ public:
public:
void ideal_size(int &w, int &h) {
w = 80; h = 80;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Clock"; }
const char *alt_type_name() { return "fltk::Clock"; }
@@ -1103,10 +1103,10 @@ public:
static Progress_Node prototype;
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->labelsize + 8;
w = layout->labelsize * 12;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Progress"; }
const char *alt_type_name() { return "fltk::ProgressBar"; }
@@ -1155,10 +1155,10 @@ private:
}
public:
void ideal_size(int &w, int &h) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
h = layout->textsize_not_null() + 8;
w = layout->textsize_not_null() * 4 + 8;
- fld::app::Snap_Action::better_size(w, h);
+ Snap_Action::better_size(w, h);
}
const char *type_name() { return "Fl_Spinner"; }
const char *alt_type_name() { return "fltk::Spinner"; }
@@ -1284,11 +1284,11 @@ static Node *known_types[] = {
Node *add_new_widget_from_user(Node *inPrototype, Strategy strategy, bool and_open) {
Fluid.proj.undo.checkpoint();
Fluid.proj.undo.suspend();
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
Node *t = ((Node*)inPrototype)->make(strategy);
if (t) {
if (t->is_widget() && !t->is_a(FLD_NODE_TYPE_Window)) {
- fld::app::Layout_Preset *layout = Fluid.proj.layout;
+ Layout_Preset *layout = Fluid.proj.layout;
Widget_Node *wt = (Widget_Node *)t;
bool changed = false;