summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fluid/CMakeLists.txt4
-rw-r--r--fluid/app/fluid.cxx2
-rw-r--r--fluid/app/undo.cxx2
-rw-r--r--fluid/io/file.cxx2
-rw-r--r--fluid/nodes/Fl_Function_Type.cxx2
-rw-r--r--fluid/nodes/Fl_Grid_Type.cxx2
-rw-r--r--fluid/nodes/Fl_Group_Type.cxx2
-rw-r--r--fluid/nodes/Fl_Menu_Type.cxx2
-rw-r--r--fluid/nodes/Fl_Type.cxx4
-rw-r--r--fluid/nodes/Fl_Window_Type.cxx2
-rw-r--r--fluid/panels/function_panel.cxx2
-rw-r--r--fluid/panels/function_panel.fl2
-rw-r--r--fluid/panels/settings_panel.cxx37
-rw-r--r--fluid/panels/settings_panel.fl43
-rw-r--r--fluid/panels/settings_panel.h2
-rw-r--r--fluid/tools/autodoc.cxx2
-rw-r--r--fluid/widgets/Bin_Button.cxx2
-rw-r--r--fluid/widgets/Node_Browser.cxx (renamed from fluid/widgets/widget_browser.cxx)89
-rw-r--r--fluid/widgets/Node_Browser.h (renamed from fluid/widgets/widget_browser.h)65
19 files changed, 140 insertions, 128 deletions
diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt
index afde756aa..e4977a8ce 100644
--- a/fluid/CMakeLists.txt
+++ b/fluid/CMakeLists.txt
@@ -56,7 +56,7 @@ set(CPPFILES
widgets/Formula_Input.cxx
widgets/Bin_Button.cxx
widgets/Style_Parser.cxx
- widgets/widget_browser.cxx
+ widgets/Node_Browser.cxx
)
# List header files in Apple's Xcode IDE
@@ -96,7 +96,7 @@ set(HEADERFILES
widgets/Formula_Input.h
widgets/Bin_Button.h
widgets/Style_Parser.h
- widgets/widget_browser.h
+ widgets/Node_Browser.h
)
# Add ExternalCodeEditor: platform specific files
diff --git a/fluid/app/fluid.cxx b/fluid/app/fluid.cxx
index e9d473fb2..baa3c9afb 100644
--- a/fluid/app/fluid.cxx
+++ b/fluid/app/fluid.cxx
@@ -33,7 +33,7 @@
#include "rsrcs/pixmaps.h"
#include "app/shell_command.h"
#include "tools/autodoc.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl.H>
#ifdef __APPLE__
diff --git a/fluid/app/undo.cxx b/fluid/app/undo.cxx
index eb5001468..f5e5fbbac 100644
--- a/fluid/app/undo.cxx
+++ b/fluid/app/undo.cxx
@@ -20,7 +20,7 @@
#include "io/file.h"
#include "nodes/Fl_Type.h"
#include "nodes/Fl_Widget_Type.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
diff --git a/fluid/io/file.cxx b/fluid/io/file.cxx
index b697325dc..ba1afeb1b 100644
--- a/fluid/io/file.cxx
+++ b/fluid/io/file.cxx
@@ -31,7 +31,7 @@
#include "nodes/Fl_Grid_Type.h"
#include "nodes/Fl_Window_Type.h"
#include "panels/settings_panel.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
diff --git a/fluid/nodes/Fl_Function_Type.cxx b/fluid/nodes/Fl_Function_Type.cxx
index 1f0a4fea5..f8845dcdd 100644
--- a/fluid/nodes/Fl_Function_Type.cxx
+++ b/fluid/nodes/Fl_Function_Type.cxx
@@ -25,7 +25,7 @@
#include "nodes/Fl_Group_Type.h"
#include "panels/function_panel.h"
#include "rsrcs/comments.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/fl_string_functions.h>
#include <FL/Fl_File_Chooser.H>
diff --git a/fluid/nodes/Fl_Grid_Type.cxx b/fluid/nodes/Fl_Grid_Type.cxx
index ea2232305..c2a803c19 100644
--- a/fluid/nodes/Fl_Grid_Type.cxx
+++ b/fluid/nodes/Fl_Grid_Type.cxx
@@ -21,7 +21,7 @@
#include "app/undo.h"
#include "io/file.h"
#include "io/code.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include "widgets/Formula_Input.h"
#include <FL/Fl_Grid.H>
diff --git a/fluid/nodes/Fl_Group_Type.cxx b/fluid/nodes/Fl_Group_Type.cxx
index a7ab20473..dc602e870 100644
--- a/fluid/nodes/Fl_Group_Type.cxx
+++ b/fluid/nodes/Fl_Group_Type.cxx
@@ -25,7 +25,7 @@
#include "app/Fd_Snap_Action.h"
#include "io/file.h"
#include "io/code.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
diff --git a/fluid/nodes/Fl_Menu_Type.cxx b/fluid/nodes/Fl_Menu_Type.cxx
index 2fb80fec2..145f0082d 100644
--- a/fluid/nodes/Fl_Menu_Type.cxx
+++ b/fluid/nodes/Fl_Menu_Type.cxx
@@ -30,7 +30,7 @@
#include "io/code.h"
#include "nodes/Fl_Window_Type.h"
#include "widgets/Formula_Input.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl.H>
#include <FL/fl_message.H>
diff --git a/fluid/nodes/Fl_Type.cxx b/fluid/nodes/Fl_Type.cxx
index 56a15175e..02b95888e 100644
--- a/fluid/nodes/Fl_Type.cxx
+++ b/fluid/nodes/Fl_Type.cxx
@@ -107,7 +107,7 @@
#include "nodes/Fl_Window_Type.h"
#include "nodes/Fl_Group_Type.h"
#include "rsrcs/pixmaps.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl.H>
#include <FL/Fl_Browser_.H>
@@ -739,7 +739,7 @@ void Fl_Type::add(Fl_Type *anchor, Strategy strategy) {
\param[in] g pointer to a node within the tree
*/
void Fl_Type::insert(Fl_Type *g) {
- // 'this' is not in the Widget_Browser, so we must run the linked list to find the last entry
+ // 'this' is not in the Node_Browser, so we must run the linked list to find the last entry
Fl_Type *end = this;
while (end->next) end = end->next;
// 'this' will get the same parent as 'g'
diff --git a/fluid/nodes/Fl_Window_Type.cxx b/fluid/nodes/Fl_Window_Type.cxx
index c26191b72..7de2ba3dc 100644
--- a/fluid/nodes/Fl_Window_Type.cxx
+++ b/fluid/nodes/Fl_Window_Type.cxx
@@ -30,7 +30,7 @@
#include "nodes/Fl_Grid_Type.h"
#include "panels/settings_panel.h"
#include "panels/widget_panel.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl.H>
#include <FL/Fl_Overlay_Window.H>
diff --git a/fluid/panels/function_panel.cxx b/fluid/panels/function_panel.cxx
index 34f67b881..4ef8fac64 100644
--- a/fluid/panels/function_panel.cxx
+++ b/fluid/panels/function_panel.cxx
@@ -23,7 +23,7 @@
#include "nodes/factory.h"
#include "rsrcs/pixmaps.h"
#include "widgets/Bin_Button.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
/**
Allow widget navigation on text fields with Tab.
diff --git a/fluid/panels/function_panel.fl b/fluid/panels/function_panel.fl
index b63b4bf50..7adb2ecea 100644
--- a/fluid/panels/function_panel.fl
+++ b/fluid/panels/function_panel.fl
@@ -43,7 +43,7 @@ decl {\#include "rsrcs/pixmaps.h"} {private local
decl {\#include "widgets/Bin_Button.h"} {private global
}
-decl {\#include "widgets/widget_browser.h"} {private local
+decl {\#include "widgets/Node_Browser.h"} {private local
}
Function {use_tab_navigation(int, Fl_Text_Editor*)} {
diff --git a/fluid/panels/settings_panel.cxx b/fluid/panels/settings_panel.cxx
index a0e2092a8..fd67676c6 100644
--- a/fluid/panels/settings_panel.cxx
+++ b/fluid/panels/settings_panel.cxx
@@ -23,6 +23,7 @@
#include <FL/fl_ask.H>
#include "../src/flstring.h"
#include <string.h>
+using namespace fld::widget;
void scheme_cb(Fl_Scheme_Choice *, void *);
int w_settings_shell_list_selected;
@@ -3355,16 +3356,16 @@ Fl_Double_Window* make_settings_window() {
o->labelfont(1);
o->labelsize(11);
o->textsize(11);
- o->callback((Fl_Callback*)cb_Comments, (void*)(&Widget_Browser::label_font));
+ o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::label_font));
Fl_Group::current()->resizable(o);
o->menu(fontmenu);
} // Fl_Choice* o
{ Fl_Button* o = new Fl_Button(251, 112, 51, 20);
o->labelsize(11);
- o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Widget_Browser::label_color));
+ o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::label_color));
} // Fl_Button* o
{ Fl_Menu_Button* o = new Fl_Menu_Button(302, 112, 18, 20);
- o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Widget_Browser::label_color));
+ o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::label_color));
o->menu(colormenu);
} // Fl_Menu_Button* o
o->end();
@@ -3377,16 +3378,16 @@ Fl_Double_Window* make_settings_window() {
o->labelfont(1);
o->labelsize(11);
o->textsize(11);
- o->callback((Fl_Callback*)cb_Comments, (void*)(&Widget_Browser::class_font));
+ o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::class_font));
Fl_Group::current()->resizable(o);
o->menu(fontmenu);
} // Fl_Choice* o
{ Fl_Button* o = new Fl_Button(251, 137, 51, 20);
o->labelsize(11);
- o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Widget_Browser::class_color));
+ o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::class_color));
} // Fl_Button* o
{ Fl_Menu_Button* o = new Fl_Menu_Button(302, 137, 18, 20);
- o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Widget_Browser::class_color));
+ o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::class_color));
o->menu(colormenu);
} // Fl_Menu_Button* o
o->end();
@@ -3399,16 +3400,16 @@ Fl_Double_Window* make_settings_window() {
o->labelfont(1);
o->labelsize(11);
o->textsize(11);
- o->callback((Fl_Callback*)cb_Comments, (void*)(&Widget_Browser::func_font));
+ o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::func_font));
Fl_Group::current()->resizable(o);
o->menu(fontmenu);
} // Fl_Choice* o
{ Fl_Button* o = new Fl_Button(251, 162, 51, 20);
o->labelsize(11);
- o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Widget_Browser::func_color));
+ o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::func_color));
} // Fl_Button* o
{ Fl_Menu_Button* o = new Fl_Menu_Button(302, 162, 18, 20);
- o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Widget_Browser::func_color));
+ o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::func_color));
o->menu(colormenu);
} // Fl_Menu_Button* o
o->end();
@@ -3421,16 +3422,16 @@ Fl_Double_Window* make_settings_window() {
o->labelfont(1);
o->labelsize(11);
o->textsize(11);
- o->callback((Fl_Callback*)cb_Comments, (void*)(&Widget_Browser::name_font));
+ o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::name_font));
Fl_Group::current()->resizable(o);
o->menu(fontmenu);
} // Fl_Choice* o
{ Fl_Button* o = new Fl_Button(251, 187, 51, 20);
o->labelsize(11);
- o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Widget_Browser::name_color));
+ o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::name_color));
} // Fl_Button* o
{ Fl_Menu_Button* o = new Fl_Menu_Button(302, 187, 18, 20);
- o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Widget_Browser::name_color));
+ o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::name_color));
o->menu(colormenu);
} // Fl_Menu_Button* o
o->end();
@@ -3443,16 +3444,16 @@ Fl_Double_Window* make_settings_window() {
o->labelfont(1);
o->labelsize(11);
o->textsize(11);
- o->callback((Fl_Callback*)cb_Comments, (void*)(&Widget_Browser::code_font));
+ o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::code_font));
Fl_Group::current()->resizable(o);
o->menu(fontmenu);
} // Fl_Choice* o
{ Fl_Button* o = new Fl_Button(251, 212, 51, 20);
o->labelsize(11);
- o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Widget_Browser::code_color));
+ o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::code_color));
} // Fl_Button* o
{ Fl_Menu_Button* o = new Fl_Menu_Button(302, 212, 18, 20);
- o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Widget_Browser::code_color));
+ o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::code_color));
o->menu(colormenu);
} // Fl_Menu_Button* o
o->end();
@@ -3465,16 +3466,16 @@ Fl_Double_Window* make_settings_window() {
w_settings_user_commenttext->labelfont(1);
w_settings_user_commenttext->labelsize(11);
w_settings_user_commenttext->textsize(11);
- w_settings_user_commenttext->callback((Fl_Callback*)cb_Comments, (void*)(&Widget_Browser::comment_font));
+ w_settings_user_commenttext->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::comment_font));
Fl_Group::current()->resizable(w_settings_user_commenttext);
o->menu(fontmenu);
} // Fl_Choice* w_settings_user_commenttext
{ Fl_Button* o = new Fl_Button(251, 237, 51, 20);
o->labelsize(11);
- o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Widget_Browser::comment_color));
+ o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::comment_color));
} // Fl_Button* o
{ Fl_Menu_Button* o = new Fl_Menu_Button(302, 237, 18, 20);
- o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Widget_Browser::comment_color));
+ o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::comment_color));
o->menu(colormenu);
} // Fl_Menu_Button* o
o->end();
diff --git a/fluid/panels/settings_panel.fl b/fluid/panels/settings_panel.fl
index a53e96b4b..fad6580af 100644
--- a/fluid/panels/settings_panel.fl
+++ b/fluid/panels/settings_panel.fl
@@ -64,7 +64,7 @@ decl {\#include "app/shell_command.h"} {public global
decl {\#include "tools/fluid_filename.h"} {public local
}
-decl {\#include "widgets/widget_browser.h"} {public global
+decl {\#include "widgets/Node_Browser.h"} {public global
}
decl {\#include <FL/Fl_Text_Buffer.H>} {public local
@@ -88,12 +88,15 @@ decl {\#include <FL/Fl_Tooltip.H>} {private global
decl {\#include <FL/fl_ask.H>} {private global
}
-decl {\#include "../src/flstring.h"} {selected private global
+decl {\#include "../src/flstring.h"} {private global
}
decl {\#include <string.h>} {private global
}
+decl {using namespace fld::widget;} {selected private global
+}
+
decl {void init_scheme(void);} {
comment {// initialize the scheme from preferences} public global
}
@@ -1677,19 +1680,19 @@ if (v == LOAD) {
} {
Fl_Choice {} {
label {Label:}
- user_data {&Widget_Browser::label_font}
+ user_data {&Node_Browser::label_font}
callback cb_Comments open
xywh {100 112 151 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu[];}
code1 {o->menu(fontmenu);}
} {}
Fl_Button {} {
- user_data {&Widget_Browser::label_color}
+ user_data {&Node_Browser::label_color}
callback cb_Color_Chip
xywh {251 112 51 20} labelsize 11
}
Fl_Menu_Button {} {
- user_data {&Widget_Browser::label_color}
+ user_data {&Node_Browser::label_color}
callback cb_Color_Choice open
xywh {302 112 18 20}
code0 {extern Fl_Menu_Item colormenu[];}
@@ -1702,19 +1705,19 @@ if (v == LOAD) {
} {
Fl_Choice {} {
label {Class:}
- user_data {&Widget_Browser::class_font}
+ user_data {&Node_Browser::class_font}
callback cb_Comments open
xywh {100 137 151 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu[];}
code1 {o->menu(fontmenu);}
} {}
Fl_Button {} {
- user_data {&Widget_Browser::class_color}
+ user_data {&Node_Browser::class_color}
callback cb_Color_Chip
xywh {251 137 51 20} labelsize 11
}
Fl_Menu_Button {} {
- user_data {&Widget_Browser::class_color}
+ user_data {&Node_Browser::class_color}
callback cb_Color_Choice open
xywh {302 137 18 20}
code0 {extern Fl_Menu_Item colormenu[];}
@@ -1727,19 +1730,19 @@ if (v == LOAD) {
} {
Fl_Choice {} {
label {Function:}
- user_data {&Widget_Browser::func_font}
+ user_data {&Node_Browser::func_font}
callback cb_Comments open
xywh {100 162 151 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu[];}
code1 {o->menu(fontmenu);}
} {}
Fl_Button {} {
- user_data {&Widget_Browser::func_color}
+ user_data {&Node_Browser::func_color}
callback cb_Color_Chip
xywh {251 162 51 20} labelsize 11
}
Fl_Menu_Button {} {
- user_data {&Widget_Browser::func_color}
+ user_data {&Node_Browser::func_color}
callback cb_Color_Choice open
xywh {302 162 18 20}
code0 {extern Fl_Menu_Item colormenu[];}
@@ -1752,19 +1755,19 @@ if (v == LOAD) {
} {
Fl_Choice {} {
label {Name:}
- user_data {&Widget_Browser::name_font}
+ user_data {&Node_Browser::name_font}
callback cb_Comments open
xywh {100 187 151 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu[];}
code1 {o->menu(fontmenu);}
} {}
Fl_Button {} {
- user_data {&Widget_Browser::name_color}
+ user_data {&Node_Browser::name_color}
callback cb_Color_Chip
xywh {251 187 51 20} labelsize 11
}
Fl_Menu_Button {} {
- user_data {&Widget_Browser::name_color}
+ user_data {&Node_Browser::name_color}
callback cb_Color_Choice open
xywh {302 187 18 20}
code0 {extern Fl_Menu_Item colormenu[];}
@@ -1777,19 +1780,19 @@ if (v == LOAD) {
} {
Fl_Choice {} {
label {Code:}
- user_data {&Widget_Browser::code_font}
+ user_data {&Node_Browser::code_font}
callback cb_Comments open
xywh {100 212 151 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu[];}
code1 {o->menu(fontmenu);}
} {}
Fl_Button {} {
- user_data {&Widget_Browser::code_color}
+ user_data {&Node_Browser::code_color}
callback cb_Color_Chip
xywh {251 212 51 20} labelsize 11
}
Fl_Menu_Button {} {
- user_data {&Widget_Browser::code_color}
+ user_data {&Node_Browser::code_color}
callback cb_Color_Choice open
xywh {302 212 18 20}
code0 {extern Fl_Menu_Item colormenu[];}
@@ -1802,19 +1805,19 @@ if (v == LOAD) {
} {
Fl_Choice w_settings_user_commenttext {
label {Comments:}
- user_data {&Widget_Browser::comment_font}
+ user_data {&Node_Browser::comment_font}
callback cb_Comments open
xywh {100 237 151 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu[];}
code1 {o->menu(fontmenu);}
} {}
Fl_Button {} {
- user_data {&Widget_Browser::comment_color}
+ user_data {&Node_Browser::comment_color}
callback cb_Color_Chip
xywh {251 237 51 20} labelsize 11
}
Fl_Menu_Button {} {
- user_data {&Widget_Browser::comment_color}
+ user_data {&Node_Browser::comment_color}
callback cb_Color_Choice open
xywh {302 237 18 20}
code0 {extern Fl_Menu_Item colormenu[];}
diff --git a/fluid/panels/settings_panel.h b/fluid/panels/settings_panel.h
index 918e69c8a..c26b165c5 100644
--- a/fluid/panels/settings_panel.h
+++ b/fluid/panels/settings_panel.h
@@ -23,7 +23,7 @@
#include "app/Fd_Snap_Action.h"
#include "app/shell_command.h"
#include "tools/fluid_filename.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl_Text_Buffer.H>
#include <FL/Fl_Text_Display.H>
#include <FL/fl_string_functions.h>
diff --git a/fluid/tools/autodoc.cxx b/fluid/tools/autodoc.cxx
index 59f9a7b27..857c5c12b 100644
--- a/fluid/tools/autodoc.cxx
+++ b/fluid/tools/autodoc.cxx
@@ -26,7 +26,7 @@
#include "panels/function_panel.h"
#include "panels/settings_panel.h"
#include "panels/codeview_panel.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Enumerations.H>
#include <FL/fl_draw.H>
diff --git a/fluid/widgets/Bin_Button.cxx b/fluid/widgets/Bin_Button.cxx
index cc351085d..308d12234 100644
--- a/fluid/widgets/Bin_Button.cxx
+++ b/fluid/widgets/Bin_Button.cxx
@@ -19,7 +19,7 @@
#include "app/fluid.h"
#include "nodes/factory.h"
#include "nodes/Fl_Window_Type.h"
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include <FL/Fl_Button.H>
#include <FL/Fl_Window.H>
diff --git a/fluid/widgets/widget_browser.cxx b/fluid/widgets/Node_Browser.cxx
index 9f7c8ff6c..fafe236cf 100644
--- a/fluid/widgets/widget_browser.cxx
+++ b/fluid/widgets/Node_Browser.cxx
@@ -14,7 +14,7 @@
// https://www.fltk.org/bugs.php
//
-#include "widgets/widget_browser.h"
+#include "widgets/Node_Browser.h"
#include "app/fluid.h"
#include "nodes/Fl_Widget_Type.h"
@@ -24,8 +24,18 @@
#include <FL/Fl_Browser_.H>
#include <FL/fl_draw.H>
+
+// ---- global variables
+
+/// Global access to the widget browser.
+fld::widget::Node_Browser *widget_browser = nullptr;
+
+using namespace fld;
+using namespace fld::widget;
+
+
/**
- \class Widget_Browser
+ \class Node_Browser
A widget that displays the nodes in the widget tree.
@@ -36,25 +46,21 @@
\see Fl_Type
*/
-// ---- global variables
-
-/// Global access to the widget browser.
-Widget_Browser *widget_browser = NULL;
// ---- static variables
-Fl_Color Widget_Browser::label_color = 72;
-Fl_Font Widget_Browser::label_font = FL_HELVETICA;
-Fl_Color Widget_Browser::class_color = FL_FOREGROUND_COLOR;
-Fl_Font Widget_Browser::class_font = FL_HELVETICA_BOLD;
-Fl_Color Widget_Browser::func_color = FL_FOREGROUND_COLOR;
-Fl_Font Widget_Browser::func_font = FL_HELVETICA;
-Fl_Color Widget_Browser::name_color = FL_FOREGROUND_COLOR;
-Fl_Font Widget_Browser::name_font = FL_HELVETICA;
-Fl_Color Widget_Browser::code_color = FL_FOREGROUND_COLOR;
-Fl_Font Widget_Browser::code_font = FL_HELVETICA;
-Fl_Color Widget_Browser::comment_color = FL_DARK_GREEN;
-Fl_Font Widget_Browser::comment_font = FL_HELVETICA;
+Fl_Color Node_Browser::label_color = 72;
+Fl_Font Node_Browser::label_font = FL_HELVETICA;
+Fl_Color Node_Browser::class_color = FL_FOREGROUND_COLOR;
+Fl_Font Node_Browser::class_font = FL_HELVETICA_BOLD;
+Fl_Color Node_Browser::func_color = FL_FOREGROUND_COLOR;
+Fl_Font Node_Browser::func_font = FL_HELVETICA;
+Fl_Color Node_Browser::name_color = FL_FOREGROUND_COLOR;
+Fl_Font Node_Browser::name_font = FL_HELVETICA;
+Fl_Color Node_Browser::code_color = FL_FOREGROUND_COLOR;
+Fl_Font Node_Browser::code_font = FL_HELVETICA;
+Fl_Color Node_Browser::comment_color = FL_DARK_GREEN;
+Fl_Font Node_Browser::comment_font = FL_HELVETICA;
// ---- global functions
@@ -69,7 +75,7 @@ void redraw_browser() {
Shortcut to create the widget browser.
*/
Fl_Widget *make_widget_browser(int x,int y,int w,int h) {
- return (widget_browser = new Widget_Browser(x,y,w,h));
+ return (widget_browser = new Node_Browser(x,y,w,h));
}
/**
@@ -193,10 +199,10 @@ static char *copy_trunc(char *p, const char *str, int maxl, int quote, int trunc
return p;
}
-// ---- Widget_Browser implementation
+// ---- Node_Browser implementation
/**
- Create a new instance of the Widget_Browser widget.
+ Create a new instance of the Node_Browser widget.
Fluid currently generates only one instance of this browser. If we want
to use multiple browser at some point, we need to refactor a few global
@@ -207,11 +213,8 @@ static char *copy_trunc(char *p, const char *str, int maxl, int quote, int trunc
\todo It would be nice to be able to grab one or more nodes and move them
within the hierarchy.
*/
-Widget_Browser::Widget_Browser(int X,int Y,int W,int H,const char*l) :
- Fl_Browser_(X,Y,W,H,l),
- pushedtitle(NULL),
- saved_h_scroll_(0),
- saved_v_scroll_(0)
+Node_Browser::Node_Browser(int X,int Y,int W,int H,const char*l) :
+ Fl_Browser_(X,Y,W,H,l)
{
type(FL_MULTI_BROWSER);
Fl_Widget::callback(callback_stub);
@@ -222,7 +225,7 @@ Widget_Browser::Widget_Browser(int X,int Y,int W,int H,const char*l) :
Override the method to find the first item in the list of elements.
\return the first item
*/
-void *Widget_Browser::item_first() const {
+void *Node_Browser::item_first() const {
return Fl_Type::first;
}
@@ -231,7 +234,7 @@ void *Widget_Browser::item_first() const {
\param l this item
\return the next item, irregardless of tree depth, or NULL at the end
*/
-void *Widget_Browser::item_next(void *l) const {
+void *Node_Browser::item_next(void *l) const {
return ((Fl_Type*)l)->next;
}
@@ -240,7 +243,7 @@ void *Widget_Browser::item_next(void *l) const {
\param l this item
\return the previous item, irregardless of tree depth, or NULL at the start
*/
-void *Widget_Browser::item_prev(void *l) const {
+void *Node_Browser::item_prev(void *l) const {
return ((Fl_Type*)l)->prev;
}
@@ -250,7 +253,7 @@ void *Widget_Browser::item_prev(void *l) const {
\return 1 if selected, 0 if not
\todo what is the difference between selected and new_selected, and why do we do this?
*/
-int Widget_Browser::item_selected(void *l) const {
+int Node_Browser::item_selected(void *l) const {
return ((Fl_Type*)l)->new_selected;
}
@@ -259,7 +262,7 @@ int Widget_Browser::item_selected(void *l) const {
\param l this item
\param[in] v 1 if selecting, 0 if not
*/
-void Widget_Browser::item_select(void *l,int v) {
+void Node_Browser::item_select(void *l,int v) {
((Fl_Type*)l)->new_selected = v;
}
@@ -268,7 +271,7 @@ void Widget_Browser::item_select(void *l,int v) {
\param l this item
\return height in FLTK units (used to be pixels before high res screens)
*/
-int Widget_Browser::item_height(void *l) const {
+int Node_Browser::item_height(void *l) const {
Fl_Type *t = (Fl_Type*)l;
if (t->visible) {
if (show_comments && t->comment())
@@ -283,7 +286,7 @@ int Widget_Browser::item_height(void *l) const {
Override the method to return the estimated height of all items.
\return height in FLTK units
*/
-int Widget_Browser::incr_height() const {
+int Node_Browser::incr_height() const {
return textsize() + 5 + linespacing();
}
@@ -308,7 +311,7 @@ int Widget_Browser::incr_height() const {
\param X,Y these give the position in window coordinates of the top left
corner of this line
*/
-void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const {
+void Node_Browser::item_draw(void *v, int X, int Y, int, int) const {
// cast to a more general type
Fl_Type *l = (Fl_Type *)v;
@@ -451,7 +454,7 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const {
\param v this item
\return width in FLTK units
*/
-int Widget_Browser::item_width(void *v) const {
+int Node_Browser::item_width(void *v) const {
char buf[500]; // edit buffer: large enough to hold 80 UTF-8 chars + nul
@@ -486,7 +489,7 @@ int Widget_Browser::item_width(void *v) const {
/**
Callback to tell the Fluid UI when the list of selected items changed.
*/
-void Widget_Browser::callback() {
+void Node_Browser::callback() {
selection_changed((Fl_Type*)selection());
}
@@ -504,7 +507,7 @@ void Widget_Browser::callback() {
\param[in] e the incoming event type
\return 0 if the event is not supported, and 1 if the event was "used up"
*/
-int Widget_Browser::handle(int e) {
+int Node_Browser::handle(int e) {
static Fl_Type *title;
Fl_Type *l;
int X,Y,W,H; bbox(X,Y,W,H);
@@ -571,7 +574,7 @@ int Widget_Browser::handle(int e) {
/**
Save the current scrollbar position during rebuild.
*/
-void Widget_Browser::save_scroll_position() {
+void Node_Browser::save_scroll_position() {
saved_h_scroll_ = hposition();
saved_v_scroll_ = vposition();
}
@@ -579,7 +582,7 @@ void Widget_Browser::save_scroll_position() {
/**
Restore the previous scrollbar position after rebuild.
*/
-void Widget_Browser::restore_scroll_position() {
+void Node_Browser::restore_scroll_position() {
hposition(saved_h_scroll_);
vposition(saved_v_scroll_);
}
@@ -589,7 +592,7 @@ void Widget_Browser::restore_scroll_position() {
This clears internal caches, recalculates the scroll bar sizes, and
sends a redraw() request to the widget.
*/
-void Widget_Browser::rebuild() {
+void Node_Browser::rebuild() {
save_scroll_position();
new_list();
damage(FL_DAMAGE_SCROLL);
@@ -601,7 +604,7 @@ void Widget_Browser::rebuild() {
Rebuild the browser layout and make sure that the given item is visible.
\param[in] inNode pointer to a widget node derived from Fl_Type.
*/
-void Widget_Browser::display(Fl_Type *inNode) {
+void Node_Browser::display(Fl_Type *inNode) {
if (!inNode) {
// Alternative: find the first (last?) visible selected item.
return;
@@ -635,7 +638,7 @@ void Widget_Browser::display(Fl_Type *inNode) {
vposition(newV);
}
-void Widget_Browser::load_prefs() {
+void Node_Browser::load_prefs() {
int c;
Fl_Preferences p(fluid_prefs, "widget_browser");
p.get("label_color", c, 72); label_color = c;
@@ -652,7 +655,7 @@ void Widget_Browser::load_prefs() {
p.get("comment_font", c, FL_HELVETICA); comment_font = c;
}
-void Widget_Browser::save_prefs() {
+void Node_Browser::save_prefs() {
Fl_Preferences p(fluid_prefs, "widget_browser");
p.set("label_color", (int)label_color);
p.set("label_font", (int)label_font);
diff --git a/fluid/widgets/widget_browser.h b/fluid/widgets/Node_Browser.h
index 86c60777c..5ac74b50a 100644
--- a/fluid/widgets/widget_browser.h
+++ b/fluid/widgets/Node_Browser.h
@@ -1,7 +1,7 @@
//
// Widget Browser code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2021 by Bill Spitzak and others.
+// Copyright 1998-2025 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -14,50 +14,42 @@
// https://www.fltk.org/bugs.php
//
-#ifndef _FLUID_WIDGET_BROWSER_H
-#define _FLUID_WIDGET_BROWSER_H
+#ifndef FLUID_WIDGETS_NODE_BROWSER_H
+#define FLUID_WIDGETS_NODE_BROWSER_H
#include <FL/Fl_Browser_.H>
class Fl_Type;
-class Widget_Browser;
-extern Widget_Browser *widget_browser;
+namespace fld {
+namespace widget {
-extern void redraw_browser();
-extern Fl_Widget *make_widget_browser(int x,int y,int w,int h);
-extern void redraw_widget_browser(Fl_Type *caller);
-extern void select(Fl_Type *o, int v);
-extern void select_only(Fl_Type *o);
-extern void deselect();
-extern void reveal_in_browser(Fl_Type *t);
-
-class Widget_Browser : public Fl_Browser_
+class Node_Browser : public Fl_Browser_
{
friend class Fl_Type;
static void callback_stub(Fl_Widget *o, void *) {
- ((Widget_Browser *)o)->callback();
+ ((Node_Browser *)o)->callback();
}
- Fl_Type* pushedtitle;
- int saved_h_scroll_;
- int saved_v_scroll_;
+ Fl_Type* pushedtitle { nullptr };
+ int saved_h_scroll_ { 0 };
+ int saved_v_scroll_ { 0 };
// required routines for Fl_Browser_ subclass:
- void *item_first() const FL_OVERRIDE;
- void *item_next(void *) const FL_OVERRIDE;
- void *item_prev(void *) const FL_OVERRIDE;
- int item_selected(void *) const FL_OVERRIDE;
- void item_select(void *,int) FL_OVERRIDE;
- int item_width(void *) const FL_OVERRIDE;
- int item_height(void *) const FL_OVERRIDE;
- void item_draw(void *,int,int,int,int) const FL_OVERRIDE;
- int incr_height() const FL_OVERRIDE;
+ void *item_first() const override;
+ void *item_next(void *) const override;
+ void *item_prev(void *) const override;
+ int item_selected(void *) const override;
+ void item_select(void *,int) override;
+ int item_width(void *) const override;
+ int item_height(void *) const override;
+ void item_draw(void *,int,int,int,int) const override;
+ int incr_height() const override;
public:
- Widget_Browser(int,int,int,int,const char * =NULL);
- int handle(int) FL_OVERRIDE;
+ Node_Browser(int,int,int,int,const char * = nullptr);
+ int handle(int) override;
void callback();
void save_scroll_position();
void restore_scroll_position();
@@ -81,4 +73,17 @@ public:
static Fl_Font comment_font;
};
-#endif // _FLUID_WIDGET_BROWSER_H
+} // namespace widget
+} // namespace fld
+
+extern void redraw_browser();
+extern Fl_Widget *make_widget_browser(int x,int y,int w,int h);
+extern void redraw_widget_browser(Fl_Type *caller);
+extern void select(Fl_Type *o, int v);
+extern void select_only(Fl_Type *o);
+extern void deselect();
+extern void reveal_in_browser(Fl_Type *t);
+
+extern fld::widget::Node_Browser *widget_browser;
+
+#endif // FLUID_WIDGETS_NODE_BROWSER_H