diff options
| author | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 02:33:41 +0500 |
|---|---|---|
| committer | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 02:33:41 +0500 |
| commit | 43e0a37906afabb0b3b091b8d3eac9a910cae50c (patch) | |
| tree | d2a037c2bf0dc395fddb08e32ebfcf2795503b7c /fluid/panels | |
| parent | 4ce4967c33d56e4b56d85d11fe0e0be91e159f5d (diff) | |
wip
Diffstat (limited to 'fluid/panels')
| -rw-r--r-- | fluid/panels/codeview_panel.cxx | 38 | ||||
| -rw-r--r-- | fluid/panels/settings_panel.cxx | 179 | ||||
| -rw-r--r-- | fluid/panels/template_panel.cxx | 6 | ||||
| -rw-r--r-- | fluid/panels/widget_panel.cxx | 34 | ||||
| -rw-r--r-- | fluid/panels/widget_panel/Grid_Child_Tab.cxx | 6 | ||||
| -rw-r--r-- | fluid/panels/widget_panel/Grid_Tab.cxx | 20 |
6 files changed, 145 insertions, 138 deletions
diff --git a/fluid/panels/codeview_panel.cxx b/fluid/panels/codeview_panel.cxx index 3c46715bd..728ee986c 100644 --- a/fluid/panels/codeview_panel.cxx +++ b/fluid/panels/codeview_panel.cxx @@ -26,9 +26,9 @@ #include <FL/Fl_Tabs.H> #include <FL/Fl_Button.H> #include "../src/flstring.h" -static char *cv_source_filename = nullptr; -static char *cv_header_filename = nullptr; -static char *cv_design_filename = nullptr; +static char *cv_source_filename = 0; +static char *cv_header_filename = 0; +static char *cv_design_filename = 0; int cv_code_choice; extern void select_only(Node *o); extern void reveal_in_browser(Node *t); @@ -156,17 +156,17 @@ void update_codeview_cb(class Fl_Button*, void*) { if (!cv_source_filename) { cv_source_filename = (char*)malloc(FL_PATH_MAX); - fl_strlcpy(cv_source_filename, Fluid.get_tmpdir().c_str(), FL_PATH_MAX); + fl_strlcpy(cv_source_filename, Fluid.get_tmpdir(), FL_PATH_MAX); fl_strlcat(cv_source_filename, "codeview_tmp.cxx", FL_PATH_MAX); } if (!cv_header_filename) { cv_header_filename = (char*)malloc(FL_PATH_MAX); - fl_strlcpy(cv_header_filename, Fluid.get_tmpdir().c_str(), FL_PATH_MAX); + fl_strlcpy(cv_header_filename, Fluid.get_tmpdir(), FL_PATH_MAX); fl_strlcat(cv_header_filename, "codeview_tmp.h", FL_PATH_MAX); } if (!cv_design_filename) { cv_design_filename = (char*)malloc(FL_PATH_MAX); - fl_strlcpy(cv_design_filename, Fluid.get_tmpdir().c_str(), FL_PATH_MAX); + fl_strlcpy(cv_design_filename, Fluid.get_tmpdir(), FL_PATH_MAX); fl_strlcat(cv_design_filename, "codeview_tmp.fl", FL_PATH_MAX); } @@ -178,18 +178,20 @@ void update_codeview_cb(class Fl_Button*, void*) { } else if (cv_strings->visible_r()) { static const char *exts[] = { ".txt", ".po", ".msg" }; char fn[FL_PATH_MAX+1]; - fl_strlcpy(fn, Fluid.get_tmpdir().c_str(), FL_PATH_MAX); + fl_strlcpy(fn, Fluid.get_tmpdir(), FL_PATH_MAX); fl_strlcat(fn, "strings", FL_PATH_MAX); - fl_filename_setext(fn, FL_PATH_MAX, exts[static_cast<int>(Fluid.proj.i18n.type)]); + fl_filename_setext(fn, FL_PATH_MAX, exts[(int)(Fluid.proj.i18n.type)]); fld::io::write_strings(Fluid.proj, fn); int top = cv_strings->top_line(); cv_strings->buffer()->loadfile(fn); cv_strings->scroll(top, 0); } else if (cv_source->visible_r() || cv_header->visible_r()) { - std::string code_file_name_bak = Fluid.proj.code_file_name; - Fluid.proj.code_file_name = cv_source_filename; - std::string header_file_name_bak = Fluid.proj.header_file_name; - Fluid.proj.header_file_name = cv_header_filename; + char code_file_name_bak[FL_PATH_MAX]; + fl_strlcpy(code_file_name_bak, Fluid.proj.code_file_name(), FL_PATH_MAX); + Fluid.proj.set_code_file_name(cv_source_filename); + char header_file_name_bak[FL_PATH_MAX]; + fl_strlcpy(header_file_name_bak, Fluid.proj.header_file_name(), FL_PATH_MAX); + Fluid.proj.set_header_file_name(cv_header_filename); // generate the code and load the files fld::io::Code_Writer f(Fluid.proj); @@ -208,8 +210,8 @@ void update_codeview_cb(class Fl_Button*, void*) { update_codeview_position(); } - Fluid.proj.code_file_name = code_file_name_bak; - Fluid.proj.header_file_name = header_file_name_bak; + Fluid.proj.set_code_file_name(code_file_name_bak); + Fluid.proj.set_header_file_name(header_file_name_bak); } } @@ -284,7 +286,7 @@ Fl_Button *cv_find_text_case=(Fl_Button *)0; Fl_Input *cv_find_text=(Fl_Input *)0; static void cb_cv_find_text(Fl_Input* o, void*) { - Fl_Text_Display *e = nullptr; + Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -305,7 +307,7 @@ static void cb_cv_find_text(Fl_Input* o, void*) { } static void cb_(Fl_Button*, void*) { - Fl_Text_Display *e = nullptr; + Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -330,7 +332,7 @@ static void cb_(Fl_Button*, void*) { } static void cb_1(Fl_Button*, void*) { - Fl_Text_Display *e = nullptr; + Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -356,7 +358,7 @@ static void cb_1(Fl_Button*, void*) { static void cb_Reveal(Fl_Button*, void*) { if (codeview_panel && codeview_panel->visible()) { - Node *node = nullptr; + Node *node = 0; if (cv_source->visible_r()) node = Fluid.proj.tree.find_in_text(0, cv_source->insert_position()); else if (cv_header->visible_r()) diff --git a/fluid/panels/settings_panel.cxx b/fluid/panels/settings_panel.cxx index e108e57e4..3b32fc665 100644 --- a/fluid/panels/settings_panel.cxx +++ b/fluid/panels/settings_panel.cxx @@ -24,7 +24,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; @@ -371,10 +371,10 @@ Fl_Input *header_file_input=(Fl_Input *)0; static void cb_header_file_input(Fl_Input* o, void* v) { if (v == LOAD) { - o->value(Fluid.proj.header_file_name.c_str()); + o->value(Fluid.proj.header_file_name()); } else { - if (strcmp(Fluid.proj.header_file_name.c_str(), o->value())) { - Fluid.proj.header_file_name = o->value(); + if (strcmp(Fluid.proj.header_file_name(), o->value())) { + Fluid.proj.set_header_file_name(o->value()); Fluid.proj.set_modflag(1); } } @@ -384,10 +384,10 @@ Fl_Input *code_file_input=(Fl_Input *)0; static void cb_code_file_input(Fl_Input* o, void* v) { if (v == LOAD) { - o->value(Fluid.proj.code_file_name.c_str()); + o->value(Fluid.proj.code_file_name()); } else { - if (strcmp(Fluid.proj.code_file_name.c_str(), o->value())) { - Fluid.proj.code_file_name = o->value(); + if (strcmp(Fluid.proj.code_file_name(), o->value())) { + Fluid.proj.set_code_file_name(o->value()); Fluid.proj.set_modflag(1); } } @@ -410,10 +410,10 @@ Fl_Input *include_guard_input=(Fl_Input *)0; static void cb_include_guard_input(Fl_Input* o, void* v) { if (v == LOAD) { - o->value(Fluid.proj.include_guard.c_str()); + o->value(Fluid.proj.include_guard()); } else { - if (strcmp(Fluid.proj.include_guard.c_str(), o->value())) { - Fluid.proj.include_guard = o->value(); + if (strcmp(Fluid.proj.include_guard(), o->value())) { + Fluid.proj.set_include_guard(o->value()); Fluid.proj.set_modflag(1); } } @@ -510,11 +510,11 @@ Fl_Choice *layout_choice=(Fl_Choice *)0; static void cb_layout_choice(Fl_Choice* o, void* v) { if (v == LOAD) { - o->value(Fluid.layout_list.current_suite()); + o->value(Fluid.layout_list->current_suite()); } else { int index = o->value(); - Fluid.layout_list.current_suite(index); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->current_suite(index); + Fluid.layout_list->update_dialogs(); } } @@ -526,24 +526,25 @@ Fl_Menu_Item menu_layout_choice[] = { static void cb_2(Fl_Button*, void* v) { // Clone the current layout suite + char old_name[256]; if (v == LOAD) return; - std::string old_name = "Copy of "; - old_name.append(Fluid.layout_list[Fluid.layout_list.current_suite()].name_); - const char *new_name = fl_input("Enter a name for the new layout:", old_name.c_str()); - if (new_name == nullptr) + snprintf(old_name, sizeof(old_name), "Copy of %s", + (*Fluid.layout_list)[Fluid.layout_list->current_suite()].name_); + const char *new_name = fl_input("Enter a name for the new layout:", old_name); + if (new_name == 0) return; - Fluid.layout_list.add(new_name); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->add(new_name); + Fluid.layout_list->update_dialogs(); } Fl_Menu_Button *w_layout_menu=(Fl_Menu_Button *)0; static void cb_w_layout_menu(Fl_Menu_Button*, void* v) { if (v == LOAD) { - fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; if (suite.storage_ == FLD_TOOL_STORE_INTERNAL) { w_layout_menu_rename->deactivate(); for (int i=1; i<4; i++) w_layout_menu_storage[i]->deactivate(); @@ -553,44 +554,44 @@ static void cb_w_layout_menu(Fl_Menu_Button*, void* v) { for (int i=1; i<4; i++) w_layout_menu_storage[i]->activate(); w_layout_menu_delete->activate(); } - w_layout_menu_storage[static_cast<int>(suite.storage_)]->setonly(menu_w_layout_menu); + w_layout_menu_storage[(int)(suite.storage_)]->setonly(menu_w_layout_menu); } } static void cb_w_layout_menu_rename(Fl_Menu_*, void*) { // Rename the current layout suite - std::string old_name = Fluid.layout_list[Fluid.layout_list.current_suite()].name_; - const char *new_name = fl_input("Enter a new name for the layout:", old_name.c_str()); - if (new_name == nullptr) + const char *old_name = (*Fluid.layout_list)[Fluid.layout_list->current_suite()].name_; + const char *new_name = fl_input("Enter a new name for the layout:", old_name); + if (new_name == 0) return; - Fluid.layout_list.rename(new_name); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->rename(new_name); + Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_storage(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_INTERNAL); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_storage1(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_USER); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_storage2(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_PROJECT); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_storage3(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_FILE); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_load(Fl_Menu_*, void*) { @@ -603,33 +604,35 @@ static void cb_w_layout_menu_load(Fl_Menu_*, void*) { if (fnfc.show() != 0) return; const char *new_filename = fnfc.filename(); if (!new_filename) return; - Fluid.layout_list.load(new_filename); - //Fluid.layout_list.current_suite(n); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->load(new_filename); + //Fluid.layout_list->current_suite(n); + Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_save(Fl_Menu_*, void*) { // Give the user a file chooser with a suggested name + char path[FL_PATH_MAX]; Fl_Native_File_Chooser fnfc; fnfc.title("Save Layout Settings:"); fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); fnfc.options(Fl_Native_File_Chooser::SAVEAS_CONFIRM | Fl_Native_File_Chooser::USE_FILTER_EXT); fnfc.filter("FLUID Layouts\t*.fll\n"); - std::string filename = Fluid.layout_list.filename_; - fnfc.directory(fl_filename_path_str(filename).c_str()); - fnfc.preset_file(fl_filename_name_str(filename).c_str()); + const char *filename = Fluid.layout_list->filename_.c_str(); + fl_filename_path(path, FL_PATH_MAX, filename); + fnfc.directory(path); + fnfc.preset_file(fl_filename_name(filename)); if (fnfc.show() != 0) return; const char *new_filename = fnfc.filename(); if (!new_filename) return; - Fluid.layout_list.filename_ = new_filename; - Fluid.layout_list.save(new_filename); + Fluid.layout_list->filename_ = new_filename; + Fluid.layout_list->save(new_filename); } static void cb_w_layout_menu_delete(Fl_Menu_*, void*) { // remove the current suite - Fluid.layout_list.remove(Fluid.layout_list.current_suite()); - Fluid.layout_list.update_dialogs(); + Fluid.layout_list->remove(Fluid.layout_list->current_suite()); + Fluid.layout_list->update_dialogs(); } Fl_Menu_Item menu_w_layout_menu[] = { @@ -894,7 +897,7 @@ static void cb_w_settings_shell_list(Fl_Browser* o, void* v) { w_settings_shell_list_selected = 0; for (int i=0; i<g_shell_config->list_size; i++) { Fd_Shell_Command *cmd = g_shell_config->list[i]; - o->add(cmd->name.c_str()); + o->add(cmd->name); if (cmd->storage == FLD_TOOL_STORE_USER) o->icon(i+1, w_settings_shell_fd_user->image()); else if (cmd->storage == FLD_TOOL_STORE_PROJECT) @@ -927,7 +930,7 @@ static void cb_a(Fl_Button*, void* v) { int selected = w_settings_shell_list_selected; Fd_Shell_Command *cmd = new Fd_Shell_Command("new shell command"); g_shell_config->insert(selected, cmd); - w_settings_shell_list->insert(selected+1, cmd->name.c_str()); + w_settings_shell_list->insert(selected+1, cmd->name); w_settings_shell_list->deselect(); w_settings_shell_list->value(selected+1); if (cmd->storage == FLD_TOOL_STORE_USER) { @@ -957,7 +960,7 @@ static void cb_w_settings_shell_dup(Fl_Button* o, void* v) { if (!selected) return; Fd_Shell_Command *cmd = new Fd_Shell_Command(g_shell_config->list[selected-1]); g_shell_config->insert(selected, cmd); - w_settings_shell_list->insert(selected+1, cmd->name.c_str()); + w_settings_shell_list->insert(selected+1, cmd->name); w_settings_shell_list->deselect(); w_settings_shell_list->value(selected+1); if (cmd->storage == FLD_TOOL_STORE_USER) { @@ -986,7 +989,7 @@ static void cb_w_settings_shell_remove(Fl_Button* o, void* v) { } else { if (!selected) return; int ret = fl_choice("Delete the shell command\n\"%s\"?\n\nThis can not be undone.", - "Delete", "Cancel", nullptr, g_shell_config->list[selected-1]->name.c_str()); + "Delete", "Cancel", 0, g_shell_config->list[selected-1]->name); if (ret==1) return; if (g_shell_config->at(selected-1)->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1); g_shell_config->remove(selected-1); @@ -1064,14 +1067,14 @@ static void cb_Name(Fl_Input* o, void* v) { int selected = w_settings_shell_list_selected; if (v == LOAD) { if (selected) { - o->value(g_shell_config->list[selected-1]->name.c_str()); + o->value(g_shell_config->list[selected-1]->name); } else { o->value(""); } } else { if (selected) { Fd_Shell_Command *cmd = g_shell_config->list[selected-1]; - cmd->name = o->value(); + cmd->set_name(o->value()); w_settings_shell_list->text(selected, o->value()); if (cmd->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1); } @@ -1082,14 +1085,14 @@ static void cb_Menu(Fl_Input* o, void* v) { int selected = w_settings_shell_list_selected; if (v == LOAD) { if (selected) { - o->value(g_shell_config->list[selected-1]->label.c_str()); + o->value(g_shell_config->list[selected-1]->label); } else { o->value(""); } } else { if (selected) { Fd_Shell_Command *cmd = g_shell_config->list[selected-1]; - cmd->label = o->value(); + cmd->set_label(o->value()); cmd->update_shell_menu(); if (cmd->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1); } @@ -1134,7 +1137,7 @@ static void cb_Store(Fl_Choice* o, void* v) { fld::Tool_Store ts = (fld::Tool_Store)(o->mvalue()->argument()); if (cmd->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1); cmd->storage = ts; - //w_settings_shell_list->text(selected, cmd->name.c_str()); + //w_settings_shell_list->text(selected, cmd->name); if (cmd->storage == FLD_TOOL_STORE_USER) w_settings_shell_list->icon(selected, w_settings_shell_fd_user->image()); else if (cmd->storage == FLD_TOOL_STORE_PROJECT) @@ -1194,14 +1197,16 @@ static void cb_w_settings_shell_command(Fl_Text_Editor* o, void* v) { int selected = w_settings_shell_list_selected; if (v == LOAD) { if (selected) { - o->buffer()->text(g_shell_config->list[selected-1]->command.c_str()); + o->buffer()->text(g_shell_config->list[selected-1]->command); } else { o->buffer()->text(""); } } else { if (selected) { Fd_Shell_Command *cmd = g_shell_config->list[selected-1]; - cmd->command = o->buffer()->text(); + char *txt = o->buffer()->text(); + cmd->set_command(txt); + free(txt); if (cmd->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1); } } @@ -1226,7 +1231,7 @@ static void cb_w_settings_shell_text_macros(Fl_Menu_Button* o, void*) { int pos = w_settings_shell_command->insert_position(); w_settings_shell_command->buffer()->insert(pos, word); } - w_settings_shell_command->do_callback(w_settings_shell_command, (void*)nullptr); + w_settings_shell_command->do_callback(w_settings_shell_command, (void*)0); } } @@ -2446,18 +2451,18 @@ Fl_Choice *w_settings_user_commenttext=(Fl_Choice *)0; static void cb_Reset(Fl_Button* o, void* v) { if (v == LOAD) return; - Node_Browser::label_color = 72; - Node_Browser::label_font = FL_HELVETICA; - Node_Browser::class_color = FL_FOREGROUND_COLOR; - Node_Browser::class_font = FL_HELVETICA_BOLD; - Node_Browser::func_color = FL_FOREGROUND_COLOR; - Node_Browser::func_font = FL_HELVETICA; - Node_Browser::name_color = FL_FOREGROUND_COLOR; - Node_Browser::name_font = FL_HELVETICA; - Node_Browser::code_color = FL_FOREGROUND_COLOR; - Node_Browser::code_font = FL_HELVETICA; - Node_Browser::comment_color = FL_DARK_GREEN; - Node_Browser::comment_font = FL_DARK_GREEN; + fld::widget::Node_Browser::label_color = 72; + fld::widget::Node_Browser::label_font = FL_HELVETICA; + fld::widget::Node_Browser::class_color = FL_FOREGROUND_COLOR; + fld::widget::Node_Browser::class_font = FL_HELVETICA_BOLD; + fld::widget::Node_Browser::func_color = FL_FOREGROUND_COLOR; + fld::widget::Node_Browser::func_font = FL_HELVETICA; + fld::widget::Node_Browser::name_color = FL_FOREGROUND_COLOR; + fld::widget::Node_Browser::name_font = FL_HELVETICA; + fld::widget::Node_Browser::code_color = FL_FOREGROUND_COLOR; + fld::widget::Node_Browser::code_font = FL_HELVETICA; + fld::widget::Node_Browser::comment_color = FL_DARK_GREEN; + fld::widget::Node_Browser::comment_font = FL_DARK_GREEN; o->parent()->do_callback(o->parent(), LOAD); widget_browser->redraw(); widget_browser->save_prefs(); @@ -2466,7 +2471,7 @@ static void cb_Reset(Fl_Button* o, void* v) { static void cb_Close(Fl_Button*, void*) { if (g_shell_config) g_shell_config->write(Fluid.preferences, FLD_TOOL_STORE_USER); - Fluid.layout_list.write(Fluid.preferences, FLD_TOOL_STORE_USER); + Fluid.layout_list->write(Fluid.preferences, FLD_TOOL_STORE_USER); settings_window->hide(); } @@ -3422,17 +3427,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::label_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::label_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 112, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::label_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::label_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 112, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::label_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::label_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3448,17 +3453,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::class_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::class_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 137, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::class_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::class_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 137, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::class_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::class_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3474,17 +3479,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::func_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::func_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 162, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::func_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::func_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 162, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::func_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::func_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3500,17 +3505,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::name_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::name_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 187, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::name_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::name_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 187, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::name_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::name_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3526,17 +3531,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::code_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::code_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 212, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::code_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::code_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 212, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::code_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::code_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3552,17 +3557,17 @@ Fl_Double_Window* make_settings_window() { w_settings_user_commenttext->labelfont(1); w_settings_user_commenttext->labelsize(12); w_settings_user_commenttext->textsize(11); - w_settings_user_commenttext->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::comment_font)); + w_settings_user_commenttext->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::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(271, 237, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::comment_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::comment_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 237, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::comment_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::comment_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); diff --git a/fluid/panels/template_panel.cxx b/fluid/panels/template_panel.cxx index 7c2a9ac2b..12800e09c 100644 --- a/fluid/panels/template_panel.cxx +++ b/fluid/panels/template_panel.cxx @@ -84,7 +84,7 @@ static void cb_template_browser(Fl_Browser*, void*) { char pngfile[1024], *ext; strlcpy(pngfile, flfile, sizeof(pngfile)); - if ((ext = strrchr(pngfile, '.')) == nullptr) return; + if ((ext = strrchr(pngfile, '.')) == 0) return; strcpy(ext, ".png"); img = Fl_Shared_Image::get(pngfile); @@ -183,7 +183,7 @@ void template_clear() { void *filename; for (i = 1; i <= template_browser->size(); i ++) { - if ((filename = template_browser->data(i)) != nullptr) free(filename); + if ((filename = template_browser->data(i)) != 0) free(filename); } template_browser->deselect(); @@ -208,7 +208,7 @@ void template_delete_cb(Fl_Button *, void *) { char pngfile[1024], *ext; strlcpy(pngfile, flfile, sizeof(pngfile)); - if ((ext = strrchr(pngfile, '.')) != nullptr) { + if ((ext = strrchr(pngfile, '.')) != 0) { strcpy(ext, ".png"); fl_unlink(pngfile); } diff --git a/fluid/panels/widget_panel.cxx b/fluid/panels/widget_panel.cxx index 195ddc533..897cec6cc 100644 --- a/fluid/panels/widget_panel.cxx +++ b/fluid/panels/widget_panel.cxx @@ -572,7 +572,7 @@ void run_image_panel() { Fl_Shared_Image *img = (Fl_Shared_Image*)image_panel_data->user_data(); if (img) { img->release(); - image_panel_data->user_data(nullptr); + image_panel_data->user_data(0); } //fl ▲ ----------~~--~==~=-=-----------~-=~~==~=-=-=~--=~--=~ ▲ fl// } @@ -629,7 +629,7 @@ static void cb_widget_image_input(Fl_Input* o, void* v) { if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { o->activate(); - o->value(((Widget_Node*)current_widget)->image_name().c_str()); + o->value(((Widget_Node*)current_widget)->image_name()); } else o->deactivate(); } else { int mod = 0; @@ -679,7 +679,7 @@ static void cb_widget_deimage_input(Fl_Input* o, void* v) { if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { o->activate(); - o->value(((Widget_Node*)current_widget)->inactive_name().c_str()); + o->value(((Widget_Node*)current_widget)->inactive_name()); } else o->deactivate(); } else { int mod = 0; @@ -1195,7 +1195,7 @@ static void cb_Left(Fl_Value_Input* o, void* v) { [](Fl_Flex *w, Fl_Value_Input* i) -> void { int v; - w->margin(&v, nullptr, nullptr, nullptr); + w->margin(&v, 0, 0, 0); i->value((double)v); }, [](Fl_Flex *w, int new_value) -> int @@ -1219,7 +1219,7 @@ static void cb_Top(Fl_Value_Input* o, void* v) { [](Fl_Flex *w, Fl_Value_Input* i) -> void { int v; - w->margin(nullptr, &v, nullptr, nullptr); + w->margin(0, &v, 0, 0); i->value((double)v); }, [](Fl_Flex *w, int new_value) @@ -1243,7 +1243,7 @@ static void cb_Right(Fl_Value_Input* o, void* v) { [](Fl_Flex *w, Fl_Value_Input* i) -> void { int v; - w->margin(nullptr, nullptr, &v, nullptr); + w->margin(0, 0, &v, 0); i->value((double)v); }, [](Fl_Flex *w, int new_value) -> int @@ -1267,7 +1267,7 @@ static void cb_Bottom(Fl_Value_Input* o, void* v) { [](Fl_Flex *w, Fl_Value_Input* i) -> void { int v; - w->margin(nullptr, nullptr, nullptr, &v); + w->margin(0, 0, 0, &v); i->value((double)v); }, [](Fl_Flex *w, int new_value) -> int @@ -1702,7 +1702,7 @@ static void cb_wp_gui_tooltip(Fl_Input* o, void* v) { if (v == LOAD) { if (current_widget->is_widget()) { o->activate(); - o->value(((Widget_Node*)current_widget)->tooltip().c_str()); + o->value(((Widget_Node*)current_widget)->tooltip()); } else { o->deactivate(); } @@ -2172,7 +2172,7 @@ static void cb_e(Fl_Input* o, void* v) { o->deactivate(); } else { o->activate(); - o->value(current_widget->subclass().c_str()); + o->value(current_widget->subclass()); } } else { int mod = 0; @@ -2189,8 +2189,8 @@ static void cb_e(Fl_Input* o, void* v) { static void cb_f(Fl_Choice* o, void* v) { //fl ▼ ---------------------- callback ~~---=--=-=~=-=-~-~~~~ ▼ fl// static Fl_Menu_Item empty_type_menu[] = { - {"Normal",0,nullptr,(void*)nullptr}, - {nullptr}}; + {"Normal",0,0,(void*)0}, + {0}}; if (v == LOAD) { Fl_Menu_Item* m = current_widget->subtypes(); @@ -2303,7 +2303,7 @@ static void cb_v_input(Fl_Input* o, void* v) { //fl ▼ ---------------------- callback ~~-==~=~-~~==-=--~~--= ▼ fl// int n = fl_int(o->user_data()); if (v == LOAD) { - o->value(current_widget->extra_code(n).c_str()); + o->value(current_widget->extra_code(n)); } else { int mod = 0; const char *c = o->value(); @@ -2453,7 +2453,7 @@ static void cb_14(Fl_Input_Choice* o, void* v) { const char *c = o->value(); const char *d = c_check(c); if (!*c) o->value(dflt); - else if (!strcmp(c,dflt)) c = nullptr; + else if (!strcmp(c,dflt)) c = 0; if (!d) { if (c && *c && c[strlen(c)-1] != '*' && strcmp(c,"long")) d = "must be pointer or long"; @@ -2631,7 +2631,7 @@ static void cb_fileopen(Fl_Button*, void* v) { if (v != LOAD) { Fluid.proj.enter_project_dir(); const char *fn = fl_file_chooser("Load Inline Data", - nullptr, wp_data_filename->value(), 1); + 0, wp_data_filename->value(), 1); Fluid.proj.leave_project_dir(); if (fn) { if (strcmp(fn, wp_data_filename->value())) { @@ -2754,7 +2754,7 @@ static void cb_comment_predefined_2(Fl_Menu_Button* o, void* v) { fl_message("Please select an entry from this menu first."); } else if (fl_choice("Are you sure that you want to delete the entry\n" "\"%s\"\nfrom the database?", "Cancel", "Delete", - nullptr, itempath)) { + 0, itempath)) { Fl_Preferences db(Fl_Preferences::USER_L, "fltk.org", "fluid_comments"); db.deleteEntry(itempath); o->remove(last_selected_item); @@ -2793,8 +2793,8 @@ static void cb_comment_load_2(Fl_Button*, void* v) { // load a comment from disk if (v != LOAD) { fl_file_chooser_ok_label("Load"); - const char *fname = fl_file_chooser("Pick a comment", nullptr, nullptr); - fl_file_chooser_ok_label(nullptr); + const char *fname = fl_file_chooser("Pick a comment", 0, 0); + fl_file_chooser_ok_label(0); if (fname) { if (comment_tabs_name->buffer()->loadfile(fname)) { fl_alert("Error loading file\n%s", fname); diff --git a/fluid/panels/widget_panel/Grid_Child_Tab.cxx b/fluid/panels/widget_panel/Grid_Child_Tab.cxx index d39f46477..674b17bd7 100644 --- a/fluid/panels/widget_panel/Grid_Child_Tab.cxx +++ b/fluid/panels/widget_panel/Grid_Child_Tab.cxx @@ -485,8 +485,8 @@ void Grid_Child_Tab::grid_child_cb(fld::widget::Formula_Input* i, void* v, int w case 9: v = cell->col(); break; case 10: v = cell->rowspan(); break; case 11: v = cell->colspan(); break; - case 12: cell->minimum_size(&v, nullptr); break; - case 13: cell->minimum_size(nullptr, &v); break; + case 12: cell->minimum_size(&v, 0); break; + case 13: cell->minimum_size(0, &v); break; } } i->value(v); @@ -495,7 +495,7 @@ void Grid_Child_Tab::grid_child_cb(fld::widget::Formula_Input* i, void* v, int w int v2 = -2, old_v = -2, v = i->value(); if (i==widget_grid_row_input) v2 = widget_grid_col_input->value(); if (i==widget_grid_col_input) v2 = widget_grid_row_input->value(); - Fl_Grid::Cell *new_cell = nullptr; + Fl_Grid::Cell *new_cell = 0; if (cell) { switch (what & 0x00ff) { case 8: old_v = cell->row(); v2 = cell->col(); break; diff --git a/fluid/panels/widget_panel/Grid_Tab.cxx b/fluid/panels/widget_panel/Grid_Tab.cxx index 756d957ac..4730f0789 100644 --- a/fluid/panels/widget_panel/Grid_Tab.cxx +++ b/fluid/panels/widget_panel/Grid_Tab.cxx @@ -109,11 +109,11 @@ void Grid_Tab::cb_Left_i(Fl_Value_Input* o, void* v) { if (!grid) return; int m = 0; if (v == LOAD) { - grid->margin(&m, nullptr, nullptr, nullptr); + grid->margin(&m, 0, 0, 0); o->value(m); } else { int m = (int)o->value(), old_m; - grid->margin(&old_m, nullptr, nullptr, nullptr); + grid->margin(&old_m, 0, 0, 0); if (m != old_m) { Fluid.proj.undo.checkpoint(); grid->margin(m, -1, -1, -1); @@ -131,11 +131,11 @@ void Grid_Tab::cb_Top_i(Fl_Value_Input* o, void* v) { if (!grid) return; int m = 0; if (v == LOAD) { - grid->margin(nullptr, &m, nullptr, nullptr); + grid->margin(0, &m, 0, 0); o->value(m); } else { int m = (int)o->value(), old_m; - grid->margin(nullptr, &old_m, nullptr, nullptr); + grid->margin(0, &old_m, 0, 0); if (m != old_m) { Fluid.proj.undo.checkpoint(); grid->margin(-1, m, -1, -1); @@ -153,11 +153,11 @@ void Grid_Tab::cb_Right_i(Fl_Value_Input* o, void* v) { if (!grid) return; int m = 0; if (v == LOAD) { - grid->margin(nullptr, nullptr, &m, nullptr); + grid->margin(0, 0, &m, 0); o->value(m); } else { int m = (int)o->value(), old_m; - grid->margin(nullptr, nullptr, &old_m, nullptr); + grid->margin(0, 0, &old_m, 0); if (m != old_m) { Fluid.proj.undo.checkpoint(); grid->margin(-1, -1, m, -1); @@ -175,11 +175,11 @@ void Grid_Tab::cb_Bottom_i(Fl_Value_Input* o, void* v) { if (!grid) return; int m = 0; if (v == LOAD) { - grid->margin(nullptr, nullptr, nullptr, &m); + grid->margin(0, 0, 0, &m); o->value(m); } else { int m = (int)o->value(), old_m; - grid->margin(nullptr, nullptr, nullptr, &old_m); + grid->margin(0, 0, 0, &old_m); if (m != old_m) { Fluid.proj.undo.checkpoint(); grid->margin(-1, -1, -1, m); @@ -197,7 +197,7 @@ void Grid_Tab::cb_Row_i(Fl_Value_Input* o, void* v) { if (!grid) return; if (v == LOAD) { int m = 0; - grid->gap(&m, nullptr); + grid->gap(&m, 0); o->value(m); } else { int m = (int)o->value(), old_m, m2; @@ -219,7 +219,7 @@ void Grid_Tab::cb_Col_i(Fl_Value_Input* o, void* v) { if (!grid) return; if (v == LOAD) { int m = 0; - grid->gap(nullptr, &m); + grid->gap(0, &m); o->value(m); } else { int m = (int)o->value(), old_m, m2; |
