summaryrefslogtreecommitdiff
path: root/fluid/nodes/factory.cxx
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 02:33:41 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 02:33:41 +0500
commit43e0a37906afabb0b3b091b8d3eac9a910cae50c (patch)
treed2a037c2bf0dc395fddb08e32ebfcf2795503b7c /fluid/nodes/factory.cxx
parent4ce4967c33d56e4b56d85d11fe0e0be91e159f5d (diff)
wip
Diffstat (limited to 'fluid/nodes/factory.cxx')
-rw-r--r--fluid/nodes/factory.cxx234
1 files changed, 117 insertions, 117 deletions
diff --git a/fluid/nodes/factory.cxx b/fluid/nodes/factory.cxx
index 90a1c4687..792a9ff72 100644
--- a/fluid/nodes/factory.cxx
+++ b/fluid/nodes/factory.cxx
@@ -89,11 +89,11 @@
// ---- Browser_Base ----
static Fl_Menu_Item browser_base_type_menu[] = {
- {"No Select", 0, nullptr, (void*)nullptr},
- {"Select", 0, nullptr, (void*)FL_SELECT_BROWSER},
- {"Hold", 0, nullptr, (void*)FL_HOLD_BROWSER},
- {"Multi", 0, nullptr, (void*)FL_MULTI_BROWSER},
- {nullptr}
+ {"No Select", 0, 0, (void*)0},
+ {"Select", 0, 0, (void*)FL_SELECT_BROWSER},
+ {"Hold", 0, 0, (void*)FL_HOLD_BROWSER},
+ {"Multi", 0, 0, (void*)FL_MULTI_BROWSER},
+ {0}
};
/**
@@ -361,9 +361,9 @@ Valuator_Node Valuator_Node::prototype;
// ---- Counter ----
static Fl_Menu_Item counter_type_menu[] = {
- { "Normal", 0, nullptr, (void*)nullptr },
- { "Simple", 0, nullptr, (void*)FL_SIMPLE_COUNTER },
- { nullptr }
+ { "Normal", 0, 0, (void*)0 },
+ { "Simple", 0, 0, (void*)FL_SIMPLE_COUNTER },
+ { 0 }
};
/**
@@ -441,10 +441,10 @@ Adjuster_Node Adjuster_Node::prototype;
// ---- Dial ----
static Fl_Menu_Item dial_type_menu[] = {
- { "Dot", 0, nullptr, (void*)nullptr },
- { "Line", 0, nullptr, (void*)FL_LINE_DIAL },
- { "Fill", 0, nullptr, (void*)FL_FILL_DIAL },
- { nullptr }
+ { "Dot", 0, 0, (void*)0 },
+ { "Line", 0, 0, (void*)FL_LINE_DIAL },
+ { "Fill", 0, 0, (void*)FL_FILL_DIAL },
+ { 0 }
};
/**
@@ -478,9 +478,9 @@ Dial_Node Dial_Node::prototype;
// ---- Roller ----
static Fl_Menu_Item roller_type_menu[] = {
- { "Vertical", 0, nullptr, (void*)nullptr },
- { "Horizontal", 0, nullptr, (void*)FL_HORIZONTAL },
- { nullptr }
+ { "Vertical", 0, 0, (void*)0 },
+ { "Horizontal", 0, 0, (void*)FL_HORIZONTAL },
+ { 0 }
};
/**
@@ -516,13 +516,13 @@ Roller_Node Roller_Node::prototype;
// ---- Slider ----
static Fl_Menu_Item slider_type_menu[] = {
- { "Vertical", 0, nullptr, (void*)nullptr },
- { "Horizontal", 0, nullptr, (void*)FL_HOR_SLIDER },
- { "Vert Fill", 0, nullptr, (void*)FL_VERT_FILL_SLIDER },
- { "Horz Fill", 0, nullptr, (void*)FL_HOR_FILL_SLIDER },
- { "Vert Knob", 0, nullptr, (void*)FL_VERT_NICE_SLIDER },
- { "Horz Knob", 0, nullptr, (void*)FL_HOR_NICE_SLIDER },
- { nullptr }
+ { "Vertical", 0, 0, (void*)0 },
+ { "Horizontal", 0, 0, (void*)FL_HOR_SLIDER },
+ { "Vert Fill", 0, 0, (void*)FL_VERT_FILL_SLIDER },
+ { "Horz Fill", 0, 0, (void*)FL_HOR_FILL_SLIDER },
+ { "Vert Knob", 0, 0, (void*)FL_VERT_NICE_SLIDER },
+ { "Horz Knob", 0, 0, (void*)FL_HOR_NICE_SLIDER },
+ { 0 }
};
/**
@@ -560,9 +560,9 @@ Slider_Node Slider_Node::prototype;
// ---- Scrollbar ----
static Fl_Menu_Item scrollbar_type_menu[] = {
- { "Vertical", 0, nullptr, (void*)nullptr },
- { "Horizontal", 0, nullptr, (void*)FL_HOR_SLIDER },
- { nullptr }
+ { "Vertical", 0, 0, (void*)0 },
+ { "Horizontal", 0, 0, (void*)FL_HOR_SLIDER },
+ { 0 }
};
/**
@@ -718,12 +718,12 @@ Value_Output_Node Value_Output_Node::prototype;
// ---- Input ----
static Fl_Menu_Item input_type_menu[] = {
- { "Normal", 0, nullptr, (void*)nullptr },
- { "Multiline", 0, nullptr, (void*)FL_MULTILINE_INPUT },
- { "Secret", 0, nullptr, (void*)FL_SECRET_INPUT },
- { "Int", 0, nullptr, (void*)FL_INT_INPUT },
- { "Float", 0, nullptr, (void*)FL_FLOAT_INPUT },
- {nullptr}
+ { "Normal", 0, 0, (void*)0 },
+ { "Multiline", 0, 0, (void*)FL_MULTILINE_INPUT },
+ { "Secret", 0, 0, (void*)FL_SECRET_INPUT },
+ { "Int", 0, 0, (void*)FL_INT_INPUT },
+ { "Float", 0, 0, (void*)FL_FLOAT_INPUT },
+ {0}
};
/**
@@ -790,7 +790,7 @@ public:
typedef Input_Node super;
static File_Input_Node prototype;
private:
- Fl_Menu_Item *subtypes() override { return nullptr; } // Don't inherit.
+ Fl_Menu_Item *subtypes() override { return 0; } // Don't inherit.
public:
void ideal_size(int &w, int &h) override {
auto layout = Fluid.proj.layout;
@@ -816,9 +816,9 @@ File_Input_Node File_Input_Node::prototype;
// ---- Output ----
static Fl_Menu_Item output_type_menu[] = {
- { "Normal", 0, nullptr, (void*)FL_NORMAL_OUTPUT },
- { "Multiline", 0, nullptr, (void*)FL_MULTILINE_OUTPUT },
- { nullptr }
+ { "Normal", 0, 0, (void*)FL_NORMAL_OUTPUT },
+ { "Multiline", 0, 0, (void*)FL_MULTILINE_OUTPUT },
+ { 0 }
};
/**
@@ -936,7 +936,7 @@ Text_Editor_Node Text_Editor_Node::prototype;
/** Use this terminal instead of Fl_Terminal to capture resize actions. */
class Fl_Terminal_Proxy : public Fl_Terminal {
public:
- Fl_Terminal_Proxy(int x, int y, int w, int h, const char *l=nullptr)
+ Fl_Terminal_Proxy(int x, int y, int w, int h, const char *l=0)
: Fl_Terminal(x, y, w, h, l) { }
void print_sample_text() {
clear_screen_home(false);
@@ -955,7 +955,7 @@ public:
Fl_Font tfont_;
int tsize_;
Fl_Color tcolor_;
- Fl_Batchmode_Terminal(int x, int y, int w, int h, const char *l=nullptr)
+ Fl_Batchmode_Terminal(int x, int y, int w, int h, const char *l=0)
: Fl_Group(x, y, w, h, l)
{ // set the defaults that Fl_Terminal would set
box(FL_DOWN_BOX);
@@ -987,7 +987,7 @@ public:
// Older .fl files with Fl_Simple_Terminal will create a Fl_Terminal instead.
const char *alt_type_name() override { return "Fl_Simple_Terminal"; }
Fl_Widget *widget(int x, int y, int w, int h) override {
- Fl_Widget *ret = nullptr;
+ Fl_Widget *ret = 0;
if (Fluid.batch_mode) {
ret = new Fl_Batchmode_Terminal(x, y, w, h);
} else {
@@ -1123,9 +1123,9 @@ Progress_Node Progress_Node::prototype;
// ---- Spinner ----
static Fl_Menu_Item spinner_type_menu[] = {
- { "Integer", 0, nullptr, (void*)FL_INT_INPUT },
- { "Float", 0, nullptr, (void*)FL_FLOAT_INPUT },
- { nullptr }
+ { "Integer", 0, 0, (void*)FL_INT_INPUT },
+ { "Float", 0, 0, (void*)FL_FLOAT_INPUT },
+ { 0 }
};
/**
@@ -1273,7 +1273,7 @@ static Node *known_types[] = {
lower case 't' in type.
\param[in] strategy add after current or as last child
\param[in] and_open if set to true, call open() on the widget after creating it
- \return the newly created type or nullptr
+ \return the newly created type or 0
\see add_new_widget_from_file(const char*, int)
add_new_widget_from_user(Node*, int)
@@ -1403,7 +1403,7 @@ Node *add_new_widget_from_user(Node *inPrototype, Strategy strategy, bool and_op
\param[in] inName find the right prototype by this name
\param[in] strategy where to add the node
\param[in] and_open if set to true, call open() on the widget after creating it
- \return the newly created type or nullptr
+ \return the newly created type or 0
\see add_new_widget_from_file(const char*, int)
add_new_widget_from_user(Node*, int)
@@ -1414,14 +1414,14 @@ Node *add_new_widget_from_user(const char *inName, Strategy strategy, bool and_o
if (prototype)
return add_new_widget_from_user(prototype, strategy, and_open);
else
- return nullptr;
+ return 0;
}
/**
Callback for all non-widget menu items.
*/
static void cbf(Fl_Widget *, void *v) {
- Node *t = nullptr;
+ Node *t = 0;
if (Fluid.proj.tree.current && Fluid.proj.tree.current->can_have_children())
t = ((Node*)v)->make(Strategy::AS_LAST_CHILD);
else
@@ -1436,7 +1436,7 @@ static void cbf(Fl_Widget *, void *v) {
wants to create.
*/
static void cb(Fl_Widget *, void *v) {
- Node *t = nullptr;
+ Node *t = 0;
if (Fluid.proj.tree.current && Fluid.proj.tree.current->can_have_children())
t = add_new_widget_from_user((Node*)v, Strategy::AS_LAST_CHILD);
else
@@ -1449,7 +1449,7 @@ static void cb(Fl_Widget *, void *v) {
defined further up in this file.
*/
Fl_Menu_Item New_Menu[] = {
- {"Code",0,nullptr,nullptr,FL_SUBMENU},
+ {"Code",0,0,0,FL_SUBMENU},
{"Function/Method",0,cbf,(void*)&Function_Node::prototype},
{"Code",0,cbf,(void*)&Code_Node::prototype},
{"Code Block",0,cbf,(void*)&CodeBlock_Node::prototype},
@@ -1459,70 +1459,70 @@ Fl_Menu_Item New_Menu[] = {
{"Widget Class",0,cb,(void*)&Widget_Class_Node::prototype},
{"Comment",0,cbf,(void*)&Comment_Node::prototype},
{"Inlined Data",0,cbf,(void*)&Data_Node::prototype},
- {nullptr},
- {"Group",0,nullptr,nullptr,FL_SUBMENU},
- {nullptr,0,cb,(void*)&Window_Node::prototype},
- {nullptr,0,cb,(void*)&Group_Node::prototype},
- {nullptr,0,cb,(void*)&Pack_Node::prototype},
- {nullptr,0,cb,(void*)&Flex_Node::prototype},
- {nullptr,0,cb,(void*)&Tabs_Node::prototype},
- {nullptr,0,cb,(void*)&Scroll_Node::prototype},
- {nullptr,0,cb,(void*)&Tile_Node::prototype},
- {nullptr,0,cb,(void*)&Wizard_Node::prototype},
- {nullptr,0,cb,(void*)&Grid_Node::prototype},
- {nullptr},
- {"Buttons",0,nullptr,nullptr,FL_SUBMENU},
- {nullptr,0,cb,(void*)&Button_Node::prototype},
- {nullptr,0,cb,(void*)&Return_Button_Node::prototype},
- {nullptr,0,cb,(void*)&Light_Button_Node::prototype},
- {nullptr,0,cb,(void*)&Check_Button_Node::prototype},
- {nullptr,0,cb,(void*)&Repeat_Button_Node::prototype},
- {nullptr,0,cb,(void*)&Round_Button_Node::prototype},
- {nullptr},
- {"Valuators",0,nullptr,nullptr,FL_SUBMENU},
- {nullptr,0,cb,(void*)&Slider_Node::prototype},
- {nullptr,0,cb,(void*)&Scrollbar_Node::prototype},
- {nullptr,0,cb,(void*)&Value_Slider_Node::prototype},
- {nullptr,0,cb,(void*)&Adjuster_Node::prototype},
- {nullptr,0,cb,(void*)&Counter_Node::prototype},
- {nullptr,0,cb,(void*)&Spinner_Node::prototype},
- {nullptr,0,cb,(void*)&Dial_Node::prototype},
- {nullptr,0,cb,(void*)&Roller_Node::prototype},
- {nullptr,0,cb,(void*)&Value_Input_Node::prototype},
- {nullptr,0,cb,(void*)&Value_Output_Node::prototype},
- {nullptr},
- {"Text",0,nullptr,nullptr,FL_SUBMENU},
- {nullptr,0,cb,(void*)&Input_Node::prototype},
- {nullptr,0,cb,(void*)&Output_Node::prototype},
- {nullptr,0,cb,(void*)&Text_Editor_Node::prototype},
- {nullptr,0,cb,(void*)&Text_Display_Node::prototype},
- {nullptr,0,cb,(void*)&File_Input_Node::prototype},
- {nullptr,0,cb,(void*)&Terminal_Node::prototype},
- {nullptr},
- {"Menus",0,nullptr,nullptr,FL_SUBMENU},
- {nullptr,0,cb,(void*)&Menu_Bar_Node::prototype},
- {nullptr,0,cb,(void*)&Menu_Button_Node::prototype},
- {nullptr,0,cb,(void*)&Choice_Node::prototype},
- {nullptr,0,cb,(void*)&Input_Choice_Node::prototype},
- {nullptr,0,cb, (void*)&Submenu_Node::prototype},
- {nullptr,0,cb, (void*)&Menu_Item_Node::prototype},
+ {0},
+ {"Group",0,0,0,FL_SUBMENU},
+ {0,0,cb,(void*)&Window_Node::prototype},
+ {0,0,cb,(void*)&Group_Node::prototype},
+ {0,0,cb,(void*)&Pack_Node::prototype},
+ {0,0,cb,(void*)&Flex_Node::prototype},
+ {0,0,cb,(void*)&Tabs_Node::prototype},
+ {0,0,cb,(void*)&Scroll_Node::prototype},
+ {0,0,cb,(void*)&Tile_Node::prototype},
+ {0,0,cb,(void*)&Wizard_Node::prototype},
+ {0,0,cb,(void*)&Grid_Node::prototype},
+ {0},
+ {"Buttons",0,0,0,FL_SUBMENU},
+ {0,0,cb,(void*)&Button_Node::prototype},
+ {0,0,cb,(void*)&Return_Button_Node::prototype},
+ {0,0,cb,(void*)&Light_Button_Node::prototype},
+ {0,0,cb,(void*)&Check_Button_Node::prototype},
+ {0,0,cb,(void*)&Repeat_Button_Node::prototype},
+ {0,0,cb,(void*)&Round_Button_Node::prototype},
+ {0},
+ {"Valuators",0,0,0,FL_SUBMENU},
+ {0,0,cb,(void*)&Slider_Node::prototype},
+ {0,0,cb,(void*)&Scrollbar_Node::prototype},
+ {0,0,cb,(void*)&Value_Slider_Node::prototype},
+ {0,0,cb,(void*)&Adjuster_Node::prototype},
+ {0,0,cb,(void*)&Counter_Node::prototype},
+ {0,0,cb,(void*)&Spinner_Node::prototype},
+ {0,0,cb,(void*)&Dial_Node::prototype},
+ {0,0,cb,(void*)&Roller_Node::prototype},
+ {0,0,cb,(void*)&Value_Input_Node::prototype},
+ {0,0,cb,(void*)&Value_Output_Node::prototype},
+ {0},
+ {"Text",0,0,0,FL_SUBMENU},
+ {0,0,cb,(void*)&Input_Node::prototype},
+ {0,0,cb,(void*)&Output_Node::prototype},
+ {0,0,cb,(void*)&Text_Editor_Node::prototype},
+ {0,0,cb,(void*)&Text_Display_Node::prototype},
+ {0,0,cb,(void*)&File_Input_Node::prototype},
+ {0,0,cb,(void*)&Terminal_Node::prototype},
+ {0},
+ {"Menus",0,0,0,FL_SUBMENU},
+ {0,0,cb,(void*)&Menu_Bar_Node::prototype},
+ {0,0,cb,(void*)&Menu_Button_Node::prototype},
+ {0,0,cb,(void*)&Choice_Node::prototype},
+ {0,0,cb,(void*)&Input_Choice_Node::prototype},
+ {0,0,cb, (void*)&Submenu_Node::prototype},
+ {0,0,cb, (void*)&Menu_Item_Node::prototype},
{"Checkbox Menu Item",0,cb, (void*)&Checkbox_Menu_Item_Node::prototype},
{"Radio Menu Item",0,cb, (void*)&Radio_Menu_Item_Node::prototype},
- {nullptr},
- {"Browsers",0,nullptr,nullptr,FL_SUBMENU},
- {nullptr,0,cb,(void*)&Browser_Node::prototype},
- {nullptr,0,cb,(void*)&Check_Browser_Node::prototype},
- {nullptr,0,cb,(void*)&File_Browser_Node::prototype},
- {nullptr,0,cb,(void*)&Tree_Node::prototype},
- {nullptr,0,cb,(void*)&Help_View_Node::prototype},
- {nullptr,0,cb,(void*)&Table_Node::prototype},
- {nullptr},
- {"Other",0,nullptr,nullptr,FL_SUBMENU},
- {nullptr,0,cb,(void*)&Box_Node::prototype},
- {nullptr,0,cb,(void*)&Clock_Node::prototype},
- {nullptr,0,cb,(void*)&Progress_Node::prototype},
- {nullptr},
- {nullptr}};
+ {0},
+ {"Browsers",0,0,0,FL_SUBMENU},
+ {0,0,cb,(void*)&Browser_Node::prototype},
+ {0,0,cb,(void*)&Check_Browser_Node::prototype},
+ {0,0,cb,(void*)&File_Browser_Node::prototype},
+ {0,0,cb,(void*)&Tree_Node::prototype},
+ {0,0,cb,(void*)&Help_View_Node::prototype},
+ {0,0,cb,(void*)&Table_Node::prototype},
+ {0},
+ {"Other",0,0,0,FL_SUBMENU},
+ {0,0,cb,(void*)&Box_Node::prototype},
+ {0,0,cb,(void*)&Clock_Node::prototype},
+ {0,0,cb,(void*)&Progress_Node::prototype},
+ {0},
+ {0}};
#include <FL/Fl_Multi_Label.H>
@@ -1532,8 +1532,8 @@ Fl_Menu_Item New_Menu[] = {
The icon may be null. If ic is null only the text is assigned
to the label and Fl_Multi_Label is not used.
\param[in] mi pointer to tme menu item that will be modified
- \param[in] ic icon for the menu, may be nullptr
- \param[in] txt new label text, may *not* be nullptr, will not be copied
+ \param[in] ic icon for the menu, may be 0
+ \param[in] txt new label text, may *not* be 0, will not be copied
*/
static void make_iconlabel(Fl_Menu_Item *mi, Fl_Image *ic, const char *txt)
{
@@ -1580,12 +1580,12 @@ void fill_in_New_Menu() {
Find the correct prototype for a given type name.
\param[in] inName a C string that must match type_name() or alt_type_name() of
one of the known Node classes.
- \return the matching prototype or nullptr
+ \return the matching prototype or 0
*/
Node *typename_to_prototype(const char *inName)
{
- if (inName==nullptr || *inName==0)
- return nullptr;
+ if (inName==0 || *inName==0)
+ return 0;
for (unsigned i = 0; i < sizeof(known_types)/sizeof(*known_types); i++) {
Node *prototype = known_types[i];
if (fl_ascii_strcasecmp(inName, prototype->type_name())==0)
@@ -1593,7 +1593,7 @@ Node *typename_to_prototype(const char *inName)
if (fl_ascii_strcasecmp(inName, prototype->alt_type_name())==0)
return prototype;
}
- return nullptr;
+ return 0;
}
/**
@@ -1605,7 +1605,7 @@ Node *typename_to_prototype(const char *inName)
\param[in] inName a C string that described the type we want
\param[in] strategy add after current or as last child
- \return the node that was created or nullptr
+ \return the node that was created or 0
\see add_new_widget_from_file(const char*, int)
add_new_widget_from_user(Node*, int)
add_new_widget_from_user(const char*, int)
@@ -1613,7 +1613,7 @@ Node *typename_to_prototype(const char *inName)
Node *add_new_widget_from_file(const char *inName, Strategy strategy) {
Node *prototype = typename_to_prototype(inName);
if (!prototype)
- return nullptr;
+ return 0;
Node *new_node = prototype->make(strategy);
return new_node;
}