diff options
| author | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 19:04:24 +0500 |
|---|---|---|
| committer | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 19:04:24 +0500 |
| commit | 793fa5a91f24358aa7ce21abf6ee4e93a17b04ee (patch) | |
| tree | e81d1e60ffdf068ac1e93e8d36d9c2046b2d7c50 /fluid | |
| parent | b4995f979d127cea667b4e2b71c91e9db4ab52ef (diff) | |
wip
Diffstat (limited to 'fluid')
84 files changed, 1266 insertions, 1481 deletions
diff --git a/fluid/Fluid.cxx b/fluid/Fluid.cxx index 7d838d11a..d751c1051 100644 --- a/fluid/Fluid.cxx +++ b/fluid/Fluid.cxx @@ -64,7 +64,7 @@ #endif -fld::Application Fluid; +Application Fluid; /** @@ -97,8 +97,8 @@ static void external_editor_timer(void*) { /** Create the Fluid application. */ -fld::Application::Application() -: current_project_(new fld::Project()), +Application::Application() +: current_project_(new Project()), tmpdir_create_called(0), preferences(Fl_Preferences::USER_L, "fltk.org", "fluid"), layout_list(0), @@ -133,7 +133,7 @@ fld::Application::Application() /** Destructor. */ -fld::Application::~Application() { +Application::~Application() { delete current_project_; } @@ -141,7 +141,7 @@ fld::Application::~Application() { /** Start Fluid. */ -int fld::Application::run(int argc, char **argv) { +int Application::run(int argc, char **argv) { setlocale(LC_ALL, ""); setlocale(LC_NUMERIC, "C"); @@ -197,7 +197,7 @@ int fld::Application::run(int argc, char **argv) { } } proj.undo.suspend(); - if (c && !fld::io::read_file(proj, c, 0)) { + if (c && !read_file(proj, c, 0)) { if (batch_mode) { fprintf(stderr, "%s : %s\n", c, strerror(errno)); exit(1); @@ -218,7 +218,7 @@ int fld::Application::run(int argc, char **argv) { } if (args.update_file) { - fld::io::write_file(proj, c, 0); + write_file(proj, c, 0); if (!args.compile_file) exit(0); } @@ -258,7 +258,7 @@ int fld::Application::run(int argc, char **argv) { /** Exit Fluid. */ -void fld::Application::quit() { +void Application::quit() { if (shell_command_running()) { int choice = fl_choice("Previous shell command still running!", "Cancel", "Exit", 0); @@ -314,7 +314,7 @@ void fld::Application::quit() { /** Return the working directory path at application launch. */ -const char *fld::Application::launch_path() const { +const char *Application::launch_path() const { return launch_path_; } @@ -322,7 +322,7 @@ const char *fld::Application::launch_path() const { /** Generate a path to a directory for temporary data storage. */ -void fld::Application::create_tmpdir() { +void Application::create_tmpdir() { if (tmpdir_create_called) return; tmpdir_create_called = 1; @@ -381,7 +381,7 @@ void fld::Application::create_tmpdir() { /** Delete the temporary directory and all its contents. */ -void fld::Application::delete_tmpdir() { +void Application::delete_tmpdir() { if (!tmpdir_create_called) return; if (tmpdir_path_[0] == '\0') @@ -412,7 +412,7 @@ void fld::Application::delete_tmpdir() { /** Return the path to a temporary directory for this instance of Fluid. */ -const char *fld::Application::get_tmpdir() { +const char *Application::get_tmpdir() { if (!tmpdir_create_called) create_tmpdir(); return tmpdir_path_; @@ -422,7 +422,7 @@ const char *fld::Application::get_tmpdir() { /** Return the path and filename of a temporary file for cut or duplicated data. */ -const char *fld::Application::cutfname(int which) { +const char *Application::cutfname(int which) { static char name[2][FL_PATH_MAX]; static char beenhere = 0; @@ -441,7 +441,7 @@ const char *fld::Application::cutfname(int which) { /** Clear the current project and create a new, empty one. */ -int fld::Application::new_project(int user_must_confirm) { +int Application::new_project(int user_must_confirm) { if ((user_must_confirm) && (confirm_project_clear() == 0)) return 0; @@ -458,7 +458,7 @@ int fld::Application::new_project(int user_must_confirm) { /** Open a file chooser and load an existing project file. */ -int fld::Application::open_project_file(const char *filename_arg) { +int Application::open_project_file(const char *filename_arg) { if (confirm_project_clear() == 0) return 0; @@ -484,7 +484,7 @@ int fld::Application::open_project_file(const char *filename_arg) { /** Load a project from the given file name and path. */ -int fld::Application::merge_project_file(const char *filename_arg) { +int Application::merge_project_file(const char *filename_arg) { int is_a_merge = (!proj.tree.empty()); const char *title = is_a_merge ? "Merge Project File" : "Open Project File"; @@ -506,7 +506,7 @@ int fld::Application::merge_project_file(const char *filename_arg) { proj.set_filename(c); if (is_a_merge) proj.undo.checkpoint(); proj.undo.suspend(); - if (!fld::io::read_file(proj, c, is_a_merge)) { + if (!read_file(proj, c, is_a_merge)) { proj.undo.resume(); widget_browser->rebuild(); proj.update_settings_dialog(); @@ -533,7 +533,7 @@ int fld::Application::merge_project_file(const char *filename_arg) { /** Save the current design to the file given by filename. */ -void fld::Application::save_project_file(void *v) { +void Application::save_project_file(void *v) { flush_text_widgets(); Fl_Native_File_Chooser fnfc; const char *c = proj.proj_filename; @@ -566,7 +566,7 @@ void fld::Application::save_project_file(void *v) { #endif if (v != (void *)2) proj.set_filename(c); } - if (!fld::io::write_file(proj, c)) { + if (!write_file(proj, c)) { fl_alert("Error writing %s: %s", c, strerror(errno)); return; } @@ -581,13 +581,13 @@ void fld::Application::save_project_file(void *v) { /** Reload the file set by filename, replacing the current design. */ -void fld::Application::revert_project() { +void Application::revert_project() { if (proj.modflag) { if (!fl_choice("This user interface has been changed. Really revert?", "Cancel", "Revert", 0)) return; } proj.undo.suspend(); - if (!fld::io::read_file(proj, proj.proj_filename, 0)) { + if (!read_file(proj, proj.proj_filename, 0)) { proj.undo.resume(); widget_browser->rebuild(); proj.update_settings_dialog(); @@ -605,7 +605,7 @@ void fld::Application::revert_project() { /** Open the template browser and load a new file from templates. */ -int fld::Application::new_project_from_template() { +int Application::new_project_from_template() { if (new_project(1) == 0) return 0; @@ -676,12 +676,12 @@ int fld::Application::new_project_from_template() { fclose(outfile); proj.undo.suspend(); - fld::io::read_file(proj, cutfname(1), 0); + read_file(proj, cutfname(1), 0); fl_unlink(cutfname(1)); proj.undo.resume(); } else { proj.undo.suspend(); - fld::io::read_file(proj, tname, 0); + read_file(proj, tname, 0); proj.undo.resume(); } } @@ -698,7 +698,7 @@ int fld::Application::new_project_from_template() { /** Open the dialog to allow the user to print the current window. */ -void fld::Application::print_snapshots() { +void Application::print_snapshots() { int w, h, ww, hh; int frompage, topage; int num_windows = 0; @@ -760,14 +760,14 @@ void fld::Application::print_snapshots() { /** Generate the C++ source and header filenames and write those files. */ -int fld::Application::write_code_files(int dont_show_completion_dialog) { +int Application::write_code_files(int dont_show_completion_dialog) { flush_text_widgets(); if (!proj.proj_filename) { save_project_file(0); if (!proj.proj_filename) return 1; } - fld::io::Code_Writer f(proj); + Code_Writer f(proj); char code_path[FL_PATH_MAX], code_name[FL_PATH_MAX]; char header_path[FL_PATH_MAX], header_name[FL_PATH_MAX]; @@ -809,13 +809,13 @@ int fld::Application::write_code_files(int dont_show_completion_dialog) { } -void fld::Application::cut_selected() { +void Application::cut_selected() { if (!proj.tree.current) { fl_beep(); return; } flush_text_widgets(); - if (!fld::io::write_file(proj, cutfname(), 1)) { + if (!write_file(proj, cutfname(), 1)) { fl_message("Can't write %s: %s", cutfname(), strerror(errno)); return; } @@ -830,7 +830,7 @@ void fld::Application::cut_selected() { } -void fld::Application::copy_selected() { +void Application::copy_selected() { flush_text_widgets(); if (!proj.tree.current) { fl_beep(); @@ -838,14 +838,14 @@ void fld::Application::copy_selected() { } flush_text_widgets(); ipasteoffset = 10; - if (!fld::io::write_file(proj, cutfname(), 1)) { + if (!write_file(proj, cutfname(), 1)) { fl_message("Can't write %s: %s", cutfname(), strerror(errno)); return; } } -void fld::Application::paste_from_clipboard() { +void Application::paste_from_clipboard() { pasteoffset = ipasteoffset; proj.undo.checkpoint(); proj.undo.suspend(); @@ -855,7 +855,7 @@ void fld::Application::paste_from_clipboard() { strategy = Strategy::FROM_FILE_AS_LAST_CHILD; } } - if (!fld::io::read_file(proj, cutfname(), 1, strategy)) { + if (!read_file(proj, cutfname(), 1, strategy)) { widget_browser->rebuild(); fl_message("Can't read %s: %s", cutfname(), strerror(errno)); } @@ -867,7 +867,7 @@ void fld::Application::paste_from_clipboard() { } -void fld::Application::duplicate_selected() { +void Application::duplicate_selected() { if (!proj.tree.current) { fl_beep(); return; @@ -888,7 +888,7 @@ void fld::Application::duplicate_selected() { if (new_insert) proj.tree.current = new_insert; - if (!fld::io::write_file(proj, cutfname(1), 1)) { + if (!write_file(proj, cutfname(1), 1)) { fl_message("Can't write %s: %s", cutfname(1), strerror(errno)); return; } @@ -896,7 +896,7 @@ void fld::Application::duplicate_selected() { pasteoffset = 0; proj.undo.checkpoint(); proj.undo.suspend(); - if (!fld::io::read_file(proj, cutfname(1), 1, Strategy::FROM_FILE_AFTER_CURRENT)) { + if (!read_file(proj, cutfname(1), 1, Strategy::FROM_FILE_AFTER_CURRENT)) { fl_message("Can't read %s: %s", cutfname(1), strerror(errno)); } fl_unlink(cutfname(1)); @@ -906,7 +906,7 @@ void fld::Application::duplicate_selected() { } -void fld::Application::delete_selected() { +void Application::delete_selected() { if (!proj.tree.current) { fl_beep(); return; @@ -922,7 +922,7 @@ void fld::Application::delete_selected() { } -void fld::Application::edit_selected() { +void Application::edit_selected() { if (!proj.tree.current) { fl_message("Please select a widget"); return; @@ -931,7 +931,7 @@ void fld::Application::edit_selected() { } -void fld::Application::sort_selected() { +void Application::sort_selected() { proj.undo.checkpoint(); sort((Node*)0); widget_browser->rebuild(); @@ -939,7 +939,7 @@ void fld::Application::sort_selected() { } -void fld::Application::toggle_widget_bin() { +void Application::toggle_widget_bin() { if (!widgetbin_panel) { make_widgetbin(); if (!position_window(widgetbin_panel, "widgetbin_pos", 1, 320, 30)) return; @@ -955,7 +955,7 @@ void fld::Application::toggle_widget_bin() { } -void fld::Application::show_help(const char *name) { +void Application::show_help(const char *name) { const char *docdir; char helpname[FL_PATH_MAX]; @@ -1016,13 +1016,13 @@ void fld::Application::show_help(const char *name) { } -void fld::Application::about() { +void Application::about() { if (!about_panel) make_about_panel(); about_panel->show(); } -void fld::Application::make_main_window() { +void Application::make_main_window() { if (!batch_mode) { preferences.get("show_guides", show_guides, 1); preferences.get("show_restricted", show_restricted, 1); @@ -1040,7 +1040,7 @@ void fld::Application::make_main_window() { o->box(FL_FLAT_BOX); o->tooltip("Double-click to view or change an item."); main_window->resizable(o); - main_menubar = new fld::widget::App_Menu_Bar(0, 0, FLD_BROWSERWIDTH, FLD_MENUHEIGHT); + main_menubar = new App_Menu_Bar(0, 0, FLD_BROWSERWIDTH, FLD_MENUHEIGHT); main_menubar->menu(main_menu); save_item = (Fl_Menu_Item*)main_menubar->find_item(menu_file_save_cb); history_item = (Fl_Menu_Item*)main_menubar->find_item(menu_file_open_history_cb); @@ -1063,7 +1063,7 @@ void fld::Application::make_main_window() { } -void fld::Application::open_project_filechooser(char *result, int result_size, const char *title) { +void Application::open_project_filechooser(char *result, int result_size, const char *title) { result[0] = '\0'; Fl_Native_File_Chooser dialog; dialog.title(title); @@ -1081,7 +1081,7 @@ void fld::Application::open_project_filechooser(char *result, int result_size, c } -int fld::Application::confirm_project_clear() { +int Application::confirm_project_clear() { if (proj.modflag == 0) return 1; switch (fl_choice("This project has unsaved changes. Do you want to save\n" "the project file before proceeding?", @@ -1097,7 +1097,7 @@ int fld::Application::confirm_project_clear() { } -void fld::Application::flush_text_widgets() { +void Application::flush_text_widgets() { if (Fl::focus() && (Fl::focus()->top_window() == the_panel)) { Fl_Widget *old_focus = Fl::focus(); Fl::focus(0); @@ -1106,7 +1106,7 @@ void fld::Application::flush_text_widgets() { } -char fld::Application::position_window(Fl_Window *w, const char *prefsName, int Visible, int X, int Y, int W, int H) { +char Application::position_window(Fl_Window *w, const char *prefsName, int Visible, int X, int Y, int W, int H) { Fl_Preferences pos(preferences, prefsName); if (prevpos_button->value()) { pos.get("x", X, X); @@ -1124,7 +1124,7 @@ char fld::Application::position_window(Fl_Window *w, const char *prefsName, int } -void fld::Application::save_position(Fl_Window *w, const char *prefsName) { +void Application::save_position(Fl_Window *w, const char *prefsName) { Fl_Preferences pos(preferences, prefsName); pos.set("x", w->x()); pos.set("y", w->y()); @@ -1134,7 +1134,7 @@ void fld::Application::save_position(Fl_Window *w, const char *prefsName) { } -void fld::Application::set_scheme(const char *new_scheme) { +void Application::set_scheme(const char *new_scheme) { if (batch_mode) return; @@ -1150,7 +1150,7 @@ void fld::Application::set_scheme(const char *new_scheme) { } -void fld::Application::init_scheme() { +void Application::init_scheme() { int scheme_index = 0; char *scheme_name = 0; preferences.get("scheme_name", scheme_name, "XXX"); @@ -1175,7 +1175,7 @@ void fld::Application::init_scheme() { #ifdef __APPLE__ -void fld::Application::apple_open_cb(const char *c) { +void Application::apple_open_cb(const char *c) { Fluid.open_project_file(c); } #endif diff --git a/fluid/Fluid.h b/fluid/Fluid.h index 4e5a053a4..1449d3c03 100644 --- a/fluid/Fluid.h +++ b/fluid/Fluid.h @@ -44,14 +44,8 @@ class Fl_Button; class Fl_Check_Button; class Fl_Help_Dialog; -namespace fld { -namespace app { class Layout_List; -} -namespace widget { class App_Menu_Bar; -} - class Project; class Application { @@ -72,11 +66,11 @@ public: // Member Variables /// Application wide preferences Fl_Preferences preferences; /// Project history. - app::History history; + History history; /// Command line arguments - app::Args args; + Args args; /// List of available layouts - app::Layout_List *layout_list; + Layout_List *layout_list; /// Set, if Fluid runs in batch mode, and no user interface is activated. int batch_mode; @@ -105,7 +99,7 @@ public: // Member Variables // TODO: make this into a class: app::GUI Fl_Window *main_window; static Fl_Menu_Item main_menu[]; - fld::widget::App_Menu_Bar *main_menubar; + App_Menu_Bar *main_menubar; Fl_Menu_Item *save_item; Fl_Menu_Item *history_item; Fl_Menu_Item *widgetbin_item; @@ -199,9 +193,7 @@ public: // Methods #endif }; -} // namespace fld - -extern fld::Application Fluid; +extern Application Fluid; #endif // FLUID_FLUID_H diff --git a/fluid/Project.cxx b/fluid/Project.cxx index 51cbbde27..10e4cea5c 100644 --- a/fluid/Project.cxx +++ b/fluid/Project.cxx @@ -35,7 +35,7 @@ /** Initialize a new project. */ -fld::Project::Project() +Project::Project() : undo(*this), tree(*this), i18n(*this), @@ -53,7 +53,7 @@ fld::Project::Project() in_project_dir(0), modflag(0), modflag_c(0), - layout(app::default_layout_preset) + layout(default_layout_preset) { app_work_dir_[0] = '\0'; set_header_file_name(".h"); @@ -64,7 +64,7 @@ fld::Project::Project() /** Clear all project resources. */ -fld::Project::~Project() { +Project::~Project() { if (header_file_name_) free(header_file_name_); if (code_file_name_) free(code_file_name_); if (include_guard_) free(include_guard_); @@ -74,7 +74,7 @@ fld::Project::~Project() { /** Reset all project setting to create a new empty project. */ -void fld::Project::reset() { +void Project::reset() { ::delete_all(); i18n.reset(); @@ -93,7 +93,7 @@ void fld::Project::reset() { /** Tell the project and i18n tab of the settings dialog to refresh themselves. */ -void fld::Project::update_settings_dialog() { +void Project::update_settings_dialog() { if (settings_window) { w_settings_project_tab->do_callback(w_settings_project_tab, LOAD); w_settings_i18n_tab->do_callback(w_settings_i18n_tab, LOAD); @@ -102,17 +102,17 @@ void fld::Project::update_settings_dialog() { // Setters for string members -void fld::Project::set_header_file_name(const char *name) { +void Project::set_header_file_name(const char *name) { if (header_file_name_) free(header_file_name_); header_file_name_ = name ? strdup(name) : 0; } -void fld::Project::set_code_file_name(const char *name) { +void Project::set_code_file_name(const char *name) { if (code_file_name_) free(code_file_name_); code_file_name_ = name ? strdup(name) : 0; } -void fld::Project::set_include_guard(const char *guard) { +void Project::set_include_guard(const char *guard) { if (include_guard_) free(include_guard_); include_guard_ = guard ? strdup(guard) : 0; } @@ -122,7 +122,7 @@ void fld::Project::set_include_guard(const char *guard) { \param[out] buf buffer to store result (ends with '/') \param[in] bufsize size of buffer */ -void fld::Project::projectfile_path(char *buf, int bufsize) const { +void Project::projectfile_path(char *buf, int bufsize) const { buf[0] = '\0'; if (!proj_filename) return; @@ -139,7 +139,7 @@ void fld::Project::projectfile_path(char *buf, int bufsize) const { Get the project file name including extension, for example `test.fl`. \return the file name without path */ -const char *fld::Project::projectfile_name() const { +const char *Project::projectfile_name() const { if (!proj_filename) return 0; return fl_filename_name(proj_filename); } @@ -149,7 +149,7 @@ const char *fld::Project::projectfile_name() const { \param[out] buf buffer to store result (ends with '/') \param[in] bufsize size of buffer */ -void fld::Project::codefile_path(char *buf, int bufsize) const { +void Project::codefile_path(char *buf, int bufsize) const { buf[0] = '\0'; char path[FL_PATH_MAX]; @@ -172,7 +172,7 @@ void fld::Project::codefile_path(char *buf, int bufsize) const { \param[out] buf buffer to store result \param[in] bufsize size of buffer */ -void fld::Project::codefile_name(char *buf, int bufsize) const { +void Project::codefile_name(char *buf, int bufsize) const { buf[0] = '\0'; const char *name = fl_filename_name(code_file_name_); @@ -196,7 +196,7 @@ void fld::Project::codefile_name(char *buf, int bufsize) const { \param[out] buf buffer to store result (ends with '/') \param[in] bufsize size of buffer */ -void fld::Project::headerfile_path(char *buf, int bufsize) const { +void Project::headerfile_path(char *buf, int bufsize) const { buf[0] = '\0'; char path[FL_PATH_MAX]; @@ -219,7 +219,7 @@ void fld::Project::headerfile_path(char *buf, int bufsize) const { \param[out] buf buffer to store result \param[in] bufsize size of buffer */ -void fld::Project::headerfile_name(char *buf, int bufsize) const { +void Project::headerfile_name(char *buf, int bufsize) const { buf[0] = '\0'; const char *name = fl_filename_name(header_file_name_); @@ -243,7 +243,7 @@ void fld::Project::headerfile_name(char *buf, int bufsize) const { \param[out] buf buffer to store result (ends with '/') \param[in] bufsize size of buffer */ -void fld::Project::stringsfile_path(char *buf, int bufsize) const { +void Project::stringsfile_path(char *buf, int bufsize) const { if (Fluid.batch_mode) { strlcpy(buf, Fluid.launch_path(), bufsize); } else { @@ -256,7 +256,7 @@ void fld::Project::stringsfile_path(char *buf, int bufsize) const { \param[out] buf buffer to store result \param[in] bufsize size of buffer */ -void fld::Project::stringsfile_name(char *buf, int bufsize) const { +void Project::stringsfile_name(char *buf, int bufsize) const { buf[0] = '\0'; if (!proj_filename) return; @@ -279,7 +279,7 @@ void fld::Project::stringsfile_name(char *buf, int bufsize) const { \param[out] buf buffer to store result \param[in] bufsize size of buffer */ -void fld::Project::basename(char *buf, int bufsize) const { +void Project::basename(char *buf, int bufsize) const { buf[0] = '\0'; if (!proj_filename) return; @@ -304,7 +304,7 @@ void fld::Project::basename(char *buf, int bufsize) const { \see leave_project_dir(), pwd, in_project_dir */ -void fld::Project::enter_project_dir() { +void Project::enter_project_dir() { if (in_project_dir < 0) { fprintf(stderr, "** Fluid internal error: enter_project_dir() calls unmatched\n"); return; @@ -338,7 +338,7 @@ void fld::Project::enter_project_dir() { Change the current working directory to the previous directory. \see enter_project_dir(), pwd, in_project_dir */ -void fld::Project::leave_project_dir() { +void Project::leave_project_dir() { if (in_project_dir == 0) { fprintf(stderr, "** Fluid internal error: leave_project_dir() calls unmatched\n"); return; @@ -356,7 +356,7 @@ void fld::Project::leave_project_dir() { /** Clear the project filename. */ -void fld::Project::clear_filename() { +void Project::clear_filename() { set_filename(0); } @@ -364,7 +364,7 @@ void fld::Project::clear_filename() { Set the filename of the current .fl design. \param[in] c the new absolute filename and path (may be NULL to clear) */ -void fld::Project::set_filename(const char *c) { +void Project::set_filename(const char *c) { if (proj_filename) free((void *)proj_filename); proj_filename = (c && *c) ? strdup(c) : 0; @@ -377,7 +377,7 @@ void fld::Project::set_filename(const char *c) { /** Write the strings that are used in i18n. */ -void fld::Project::write_strings() { +void Project::write_strings() { Fluid.flush_text_widgets(); if (!proj_filename) { Fluid.save_project_file(0); @@ -392,7 +392,7 @@ void fld::Project::write_strings() { char filename[FL_PATH_MAX]; snprintf(filename, FL_PATH_MAX, "%s%s", path, name); - int x = fld::io::write_strings(*this, filename); + int x = ::write_strings(*this, filename); if (Fluid.batch_mode) { if (x) { fprintf(stderr, "%s : %s\n", filename, strerror(errno)); @@ -425,7 +425,7 @@ void fld::Project::write_strings() { \param[in] mfc default -1 to let \c mf control \c modflag_c, 0 to mark the code files current, 1 to mark it out of date. -2 to ignore changes to mf. */ -void fld::Project::set_modflag(int mf, int mfc) { +void Project::set_modflag(int mf, int mfc) { const char *code_ext = 0; char new_title[FL_PATH_MAX]; diff --git a/fluid/Project.h b/fluid/Project.h index f920c6ff3..e68ad6d4e 100644 --- a/fluid/Project.h +++ b/fluid/Project.h @@ -27,12 +27,8 @@ // ---- project class declaration -namespace fld { - -namespace app { - class Layout_Preset; - extern Layout_Preset *default_layout_preset; -} // namespace app +class Layout_Preset; +extern Layout_Preset *default_layout_preset; /** Data and settings for a FLUID project file. @@ -41,13 +37,13 @@ class Project { public: // Member Variables // Undo actions for this Project. - proj::Undo undo; + Undo undo; // Manage the node tree of the project. - node::Tree tree; + Tree tree; // Project internationalization. - proj::I18n i18n; + I18n i18n; /// If set, generate code to include the header file form the c++ file int include_H_from_C; @@ -83,7 +79,7 @@ public: // Member Variables int modflag_c; /// Currently used layout preset. - app::Layout_Preset *layout; + Layout_Preset *layout; public: // Methods Project(); @@ -122,6 +118,4 @@ public: // Methods void set_modflag(int mf, int mfc = -1); }; -} // namespace fld - #endif // FLUID_PROJECT_H diff --git a/fluid/app/Image_Asset.cxx b/fluid/app/Image_Asset.cxx index 36fa4d443..31847a416 100644 --- a/fluid/app/Image_Asset.cxx +++ b/fluid/app/Image_Asset.cxx @@ -109,7 +109,7 @@ static struct { \param fmt short name of file contents for error message \return 0 if the file could not be opened or read */ -size_t Image_Asset::write_static_binary(fld::io::Code_Writer& f, const char* fmt) { +size_t Image_Asset::write_static_binary(Code_Writer& f, const char* fmt) { size_t nData = 0; Fluid.proj.enter_project_dir(); FILE *in = fl_fopen(filename(), "rb"); @@ -143,7 +143,7 @@ size_t Image_Asset::write_static_binary(fld::io::Code_Writer& f, const char* fmt \param fmt short name of file contents for error message \return 0 if the file could not be opened or read */ -size_t Image_Asset::write_static_text(fld::io::Code_Writer& f, const char* fmt) { +size_t Image_Asset::write_static_text(Code_Writer& f, const char* fmt) { size_t nData = 0; Fluid.proj.enter_project_dir(); FILE *in = fl_fopen(filename(), "rb"); @@ -180,7 +180,7 @@ size_t Image_Asset::write_static_text(fld::io::Code_Writer& f, const char* fmt) \param fmt short name of file contents for error message \return 0 if the file could not be opened or read */ -void Image_Asset::write_static_rgb(fld::io::Code_Writer& f, const char* idata_name) { +void Image_Asset::write_static_rgb(Code_Writer& f, const char* idata_name) { // Write image data... f.write_c("\n"); f.write_c_once("#include <FL/Fl_Image.H>\n"); @@ -206,7 +206,7 @@ void Image_Asset::write_static_rgb(fld::io::Code_Writer& f, const char* idata_na \param f Write code to this C++ source code file \param compressed write data in the original compressed file format */ -void Image_Asset::write_static(fld::io::Code_Writer& f, int compressed) { +void Image_Asset::write_static(Code_Writer& f, int compressed) { if (!image_) return; const char *idata_name = f.unique_id(this, "idata", fl_filename_name(filename()), 0); if (initializer_function_) free(initializer_function_); @@ -340,7 +340,7 @@ void Image_Asset::write_static(fld::io::Code_Writer& f, int compressed) { \param f The C++ source code file to write the warning message to. \param fmt The format string for the image file type. */ -void Image_Asset::write_file_error(fld::io::Code_Writer& f, const char *fmt) { +void Image_Asset::write_file_error(Code_Writer& f, const char *fmt) { f.write_c("#warning Cannot read %s file \"%s\": %s\n", fmt, filename(), strerror(errno)); Fluid.proj.enter_project_dir(); f.write_c("// Searching in path \"%s\"\n", fl_getcwd(0, FL_PATH_MAX)); @@ -367,7 +367,7 @@ void Image_Asset::write_file_error(fld::io::Code_Writer& f, const char *fmt) { \param image_class Name of the Fl_Image class, for example Fl_GIF_Image. \param format Format string for additional parameters for the constructor. */ -void Image_Asset::write_initializer(fld::io::Code_Writer& f, const char *image_class, const char *format, ...) { +void Image_Asset::write_initializer(Code_Writer& f, const char *image_class, const char *format, ...) { va_list ap; va_start(ap, format); f.write_c("static Fl_Image *%s() {\n", initializer_function_); @@ -395,7 +395,7 @@ void Image_Asset::write_initializer(fld::io::Code_Writer& f, const char *image_c \param var Name of the Fl_Widget or Fl_Menu_Item to attach the image to. \param inactive If true, use deimage() instead of image(). */ -void Image_Asset::write_code(fld::io::Code_Writer& f, int bind, const char *var, int inactive) { +void Image_Asset::write_code(Code_Writer& f, int bind, const char *var, int inactive) { if (image_) { f.write_c("%s%s->%s%s( %s() );\n", f.indent(), @@ -421,7 +421,7 @@ void Image_Asset::write_code(fld::io::Code_Writer& f, int bind, const char *var, \param f Write the C++ code to this file. \param inactive Unused. */ -void Image_Asset::write_inline(fld::io::Code_Writer& f, int inactive) { +void Image_Asset::write_inline(Code_Writer& f, int inactive) { (void)inactive; if (image_) { f.write_c("%s()", initializer_function_); diff --git a/fluid/app/Image_Asset.h b/fluid/app/Image_Asset.h index 1d6909a70..c393109d3 100644 --- a/fluid/app/Image_Asset.h +++ b/fluid/app/Image_Asset.h @@ -38,20 +38,20 @@ private: // member variables private: // methods Image_Asset(const char *name); // no public constructor ~Image_Asset(); // no public destructor - size_t write_static_binary(fld::io::Code_Writer& f, const char* fmt); - size_t write_static_text(fld::io::Code_Writer& f, const char* fmt); - void write_static_rgb(fld::io::Code_Writer& f, const char* idata_name); + size_t write_static_binary(Code_Writer& f, const char* fmt); + size_t write_static_text(Code_Writer& f, const char* fmt); + void write_static_rgb(Code_Writer& f, const char* idata_name); public: // methods static Image_Asset* find(const char *); void dec_ref(); // reference counting & automatic free void inc_ref(); Fl_Shared_Image *image() const { return image_; } - void write_static(fld::io::Code_Writer& f, int compressed); - void write_initializer(fld::io::Code_Writer& f, const char *type_name, const char *format, ...); - void write_code(fld::io::Code_Writer& f, int bind, const char *var, int inactive = 0); - void write_inline(fld::io::Code_Writer& f, int inactive = 0); - void write_file_error(fld::io::Code_Writer& f, const char *fmt); + void write_static(Code_Writer& f, int compressed); + void write_initializer(Code_Writer& f, const char *type_name, const char *format, ...); + void write_code(Code_Writer& f, int bind, const char *var, int inactive = 0); + void write_inline(Code_Writer& f, int inactive = 0); + void write_file_error(Code_Writer& f, const char *fmt); const char *filename() const { return filename_ ? filename_ : ""; } }; diff --git a/fluid/app/Menu.cxx b/fluid/app/Menu.cxx index 54db5801f..fc5fad4b2 100644 --- a/fluid/app/Menu.cxx +++ b/fluid/app/Menu.cxx @@ -49,7 +49,7 @@ void about_cb(Fl_Widget *, void *) { Fluid.about(); } void help_cb(Fl_Widget *, void *) { Fluid.show_help("fluid.html"); } -static void save_template_cb(Fl_Widget *, void *) { fld::app::save_template(); } +static void save_template_cb(Fl_Widget *, void *) { save_template(); } void mergeback_cb(Fl_Widget *, void *); void manual_cb(Fl_Widget *, void *) { @@ -85,7 +85,7 @@ void toggle_widgetbin_cb(Fl_Widget *, void *) { Fluid.toggle_widget_bin(); } \todo Shortcuts are all over the place (Alt, Ctrl, Command, Shift-Ctrl, function keys), and there should be a help page listing all shortcuts. */ -Fl_Menu_Item fld::Application::main_menu[] = { +Fl_Menu_Item Application::main_menu[] = { {"&File",0,0,0,FL_SUBMENU}, {"&New", FL_COMMAND+'n', menu_file_new_cb}, {"&Open...", FL_COMMAND+'o', menu_file_open_cb}, @@ -113,8 +113,8 @@ Fl_Menu_Item fld::Application::main_menu[] = { {"&Quit", FL_COMMAND+'q', exit_cb}, {0}, {"&Edit",0,0,0,FL_SUBMENU}, - {"&Undo", FL_COMMAND+'z', fld::proj::Undo::undo_cb}, - {"&Redo", FL_COMMAND+FL_SHIFT+'z', fld::proj::Undo::redo_cb, 0, FL_MENU_DIVIDER}, + {"&Undo", FL_COMMAND+'z', Undo::undo_cb}, + {"&Redo", FL_COMMAND+FL_SHIFT+'z', Undo::redo_cb, 0, FL_MENU_DIVIDER}, {"C&ut", FL_COMMAND+'x', cut_cb}, {"&Copy", FL_COMMAND+'c', copy_cb}, {"&Paste", FL_COMMAND+'v', paste_cb}, diff --git a/fluid/app/Snap_Action.cxx b/fluid/app/Snap_Action.cxx index 39a328b24..db68d6dd1 100644 --- a/fluid/app/Snap_Action.cxx +++ b/fluid/app/Snap_Action.cxx @@ -45,10 +45,10 @@ void select_layout_suite_cb(Fl_Widget *, void *user_data); -int fld::app::Snap_Action::eex = 0; -int fld::app::Snap_Action::eey = 0; +int Snap_Action::eex = 0; +int Snap_Action::eey = 0; -static fld::app::Layout_Preset fltk_app = { +static Layout_Preset fltk_app = { 15, 15, 15, 15, 0, 0, // window: l, r, t, b, gx, gy 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy 25, 25, // tabs: t, b @@ -56,7 +56,7 @@ static fld::app::Layout_Preset fltk_app = { 20, 4, 8, // widget_y: min, inc, gap 0, 14, -1, 14 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset fltk_dlg = { +static Layout_Preset fltk_dlg = { 10, 10, 10, 10, 0, 0, // window: l, r, t, b, gx, gy 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy 20, 20, // tabs: t, b @@ -64,7 +64,7 @@ static fld::app::Layout_Preset fltk_dlg = { 20, 5, 5, // widget_y: min, inc, gap 0, 11, -1, 11 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset fltk_tool = { +static Layout_Preset fltk_tool = { 10, 10, 10, 10, 0, 0, // window: l, r, t, b, gx, gy 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy 18, 18, // tabs: t, b @@ -73,7 +73,7 @@ static fld::app::Layout_Preset fltk_tool = { 0, 10, -1, 10 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset grid_app = { +static Layout_Preset grid_app = { 12, 12, 12, 12, 12, 12, // window: l, r, t, b, gx, gy 12, 12, 12, 12, 12, 12, // group: l, r, t, b, gx, gy 24, 24, // tabs: t, b @@ -82,7 +82,7 @@ static fld::app::Layout_Preset grid_app = { 0, 14, -1, 14 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset grid_dlg = { +static Layout_Preset grid_dlg = { 10, 10, 10, 10, 10, 10, // window: l, r, t, b, gx, gy 10, 10, 10, 10, 10, 10, // group: l, r, t, b, gx, gy 20, 20, // tabs: t, b @@ -91,7 +91,7 @@ static fld::app::Layout_Preset grid_dlg = { 0, 12, -1, 12 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset grid_tool = { +static Layout_Preset grid_tool = { 8, 8, 8, 8, 8, 8, // window: l, r, t, b, gx, gy 8, 8, 8, 8, 8, 8, // group: l, r, t, b, gx, gy 16, 16, // tabs: t, b @@ -100,9 +100,9 @@ static fld::app::Layout_Preset grid_tool = { 0, 10, -1, 10 // labelfont/size, textfont/size }; -fld::app::Layout_Preset *fld::app::default_layout_preset = &fltk_app; +Layout_Preset *default_layout_preset = &fltk_app; -static fld::app::Layout_Suite static_suite_list[] = { +static Layout_Suite static_suite_list[] = { { (char*)"FLTK", (char*)"@fd_beaker FLTK", { &fltk_app, &fltk_dlg, &fltk_tool }, FLD_TOOL_STORE_INTERNAL }, { (char*)"Grid", (char*)"@fd_beaker Grid", { &grid_app, &grid_dlg, &grid_tool }, FLD_TOOL_STORE_INTERNAL } }; @@ -154,12 +154,12 @@ void edit_layout_preset_cb(Fl_Button *w, void *user_data) { } } -// ---- fld::app::Layout_Suite ------------------------------------------------ MARK: - +// ---- Layout_Suite ------------------------------------------------ MARK: - /** Write presets to a Preferences database. */ -void fld::app::Layout_Preset::write(Fl_Preferences &prefs) { +void Layout_Preset::write(Fl_Preferences &prefs) { assert(this); Fl_Preferences p_win(prefs, "Window"); p_win.set("left_margin", left_window_margin); @@ -199,7 +199,7 @@ void fld::app::Layout_Preset::write(Fl_Preferences &prefs) { /** Read presets from a Preferences database. */ -void fld::app::Layout_Preset::read(Fl_Preferences &prefs) { +void Layout_Preset::read(Fl_Preferences &prefs) { assert(this); Fl_Preferences p_win(prefs, "Window"); p_win.get("left_margin", left_window_margin, 15); @@ -239,7 +239,7 @@ void fld::app::Layout_Preset::read(Fl_Preferences &prefs) { /** Write presets to an .fl project file. */ -void fld::app::Layout_Preset::write(fld::io::Project_Writer *out) { +void Layout_Preset::write(Project_Writer *out) { out->write_string(" preset { 1\n"); // preset format version out->write_string(" %d %d %d %d %d %d\n", left_window_margin, right_window_margin, @@ -261,7 +261,7 @@ void fld::app::Layout_Preset::write(fld::io::Project_Writer *out) { /** Read presets from an .fl project file. */ -void fld::app::Layout_Preset::read(fld::io::Project_Reader *in) { +void Layout_Preset::read(Project_Reader *in) { const char *key; key = in->read_word(1); if (key && !strcmp(key, "{")) { @@ -317,7 +317,7 @@ void fld::app::Layout_Preset::read(fld::io::Project_Reader *in) { /** Return the preferred text size, but make sure it's not 0. */ -int fld::app::Layout_Preset::textsize_not_null() { +int Layout_Preset::textsize_not_null() { // try the user selected text size if (textsize > 0) return textsize; // if the user did not set one, try the label size @@ -327,12 +327,12 @@ int fld::app::Layout_Preset::textsize_not_null() { } -// ---- fld::app::Layout_Suite ------------------------------------------------ MARK: - +// ---- Layout_Suite ------------------------------------------------ MARK: - /** Write a presets suite to a Preferences database. */ -void fld::app::Layout_Suite::write(Fl_Preferences &prefs) { +void Layout_Suite::write(Fl_Preferences &prefs) { assert(this); assert(name_); prefs.set("name", name_); @@ -347,7 +347,7 @@ void fld::app::Layout_Suite::write(Fl_Preferences &prefs) { /** Read a presets suite from a Preferences database. */ -void fld::app::Layout_Suite::read(Fl_Preferences &prefs) { +void Layout_Suite::read(Fl_Preferences &prefs) { assert(this); int i; for (i = 0; i < 3; ++i) { @@ -360,7 +360,7 @@ void fld::app::Layout_Suite::read(Fl_Preferences &prefs) { /** Write a presets suite to an .fl project file. */ -void fld::app::Layout_Suite::write(fld::io::Project_Writer *out) { +void Layout_Suite::write(Project_Writer *out) { out->write_string(" suite {\n"); out->write_string(" name "); out->write_word(name_); out->write_string("\n"); int i; @@ -373,7 +373,7 @@ void fld::app::Layout_Suite::write(fld::io::Project_Writer *out) { /** Read a presets suite from an .fl project file. */ -void fld::app::Layout_Suite::read(fld::io::Project_Reader *in) { +void Layout_Suite::read(Project_Reader *in) { const char *key; key = in->read_word(1); if (key && !strcmp(key, "{")) { @@ -401,7 +401,7 @@ void fld::app::Layout_Suite::read(fld::io::Project_Reader *in) { \brief Update the menu_label to show a symbol representing the storage location. Also updates the FLUID user interface. */ -void fld::app::Layout_Suite::update_label() { +void Layout_Suite::update_label() { const char *sym = ""; switch (storage_) { case FLD_TOOL_STORE_INTERNAL: sym = "@fd_beaker "; break; @@ -421,7 +421,7 @@ void fld::app::Layout_Suite::update_label() { \brief Update the Suite name and the Suite menu_label. Also updates the FLUID user interface. */ -void fld::app::Layout_Suite::name(const char *n) { +void Layout_Suite::name(const char *n) { if (name_) ::free(name_); if (n) @@ -434,7 +434,7 @@ void fld::app::Layout_Suite::name(const char *n) { /** Initialize the class for first use. */ -void fld::app::Layout_Suite::init() { +void Layout_Suite::init() { name_ = 0; menu_label = 0; layout[0] = layout[1] = layout[2] = 0; @@ -444,7 +444,7 @@ void fld::app::Layout_Suite::init() { /** Free all allocated resources. */ -fld::app::Layout_Suite::~Layout_Suite() { +Layout_Suite::~Layout_Suite() { if (storage_ == FLD_TOOL_STORE_INTERNAL) return; if (name_) ::free(name_); int i; @@ -453,7 +453,7 @@ fld::app::Layout_Suite::~Layout_Suite() { } } -// ---- fld::app::Layout_List ------------------------------------------------- MARK: - +// ---- Layout_List ------------------------------------------------- MARK: - /** Draw a little FLUID beaker symbol. @@ -596,7 +596,7 @@ void fd_file(Fl_Color c) { /** Instantiate the class that holds a list of all layouts and manages the UI. */ -fld::app::Layout_List::Layout_List() +Layout_List::Layout_List() : main_menu_(main_layout_submenu_), choice_menu_(static_choice_menu), list_(static_suite_list), @@ -615,16 +615,16 @@ fld::app::Layout_List::Layout_List() /** Release allocated resources. */ -fld::app::Layout_List::~Layout_List() { +Layout_List::~Layout_List() { assert(this); if (!list_is_static_) { ::free(main_menu_); ::free(choice_menu_); int i; for (i = 0; i < list_size_; i++) { - fld::app::Layout_Suite &suite = list_[i]; + Layout_Suite &suite = list_[i]; if (suite.storage_ != FLD_TOOL_STORE_INTERNAL) - suite.fld::app::Layout_Suite::~Layout_Suite(); + suite.Layout_Suite::~Layout_Suite(); } ::free(list_); } @@ -633,7 +633,7 @@ fld::app::Layout_List::~Layout_List() { /** Update the Setting dialog and menus to reflect the current Layout selection state. */ -void fld::app::Layout_List::update_dialogs() { +void Layout_List::update_dialogs() { static Fl_Menu_Item *preset_menu = 0; if (!preset_menu) { preset_menu = (Fl_Menu_Item*)Fluid.main_menubar->find_item(select_layout_preset_cb); @@ -657,7 +657,7 @@ void fld::app::Layout_List::update_dialogs() { /** Refresh the label pointers for both pulldown menus. */ -void fld::app::Layout_List::update_menu_labels() { +void Layout_List::update_menu_labels() { int i; for (i =0; i<list_size_; i++) { main_menu_[i].label(list_[i].menu_label); @@ -668,7 +668,7 @@ void fld::app::Layout_List::update_menu_labels() { /** Load all user layouts from the FLUID user preferences. */ -int fld::app::Layout_List::load(const char *filename) { +int Layout_List::load(const char *filename) { remove_all(FLD_TOOL_STORE_FILE); Fl_Preferences prefs(filename, "layout.fluid.fltk.org", 0, Fl_Preferences::C_LOCALE); read(prefs, FLD_TOOL_STORE_FILE); @@ -678,7 +678,7 @@ int fld::app::Layout_List::load(const char *filename) { /** Save all user layouts to the FLUID user preferences. */ -int fld::app::Layout_List::save(const char *filename) { +int Layout_List::save(const char *filename) { assert(this); Fl_Preferences prefs(filename, "layout.fluid.fltk.org", 0, (Fl_Preferences::Root)(Fl_Preferences::C_LOCALE|Fl_Preferences::CLEAR)); prefs.clear(); @@ -689,7 +689,7 @@ int fld::app::Layout_List::save(const char *filename) { /** Write Suite and Layout selection and selected layout data to Preferences database. */ -void fld::app::Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store storage) { +void Layout_List::write(Fl_Preferences &prefs, Tool_Store storage) { Fl_Preferences prefs_list(prefs, "Layouts"); prefs_list.clear(); prefs_list.set("current_suite", list_[current_suite()].name_); @@ -697,7 +697,7 @@ void fld::app::Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store storage int n = 0; int i; for (i = 0; i < list_size_; ++i) { - fld::app::Layout_Suite &suite = list_[i]; + Layout_Suite &suite = list_[i]; if (suite.storage_ == storage) { Fl_Preferences prefs_suite(prefs_list, Fl_Preferences::Name(n++)); suite.write(prefs_suite); @@ -708,7 +708,7 @@ void fld::app::Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store storage /** Read Suite and Layout selection and selected layout data to Preferences database. */ -void fld::app::Layout_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) { +void Layout_List::read(Fl_Preferences &prefs, Tool_Store storage) { Fl_Preferences prefs_list(prefs, "Layouts"); char *cs_ptr = 0; int cp = 0; @@ -737,7 +737,7 @@ void fld::app::Layout_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) /** Write Suite and Layout selection and project layout data to an .fl project file. */ -void fld::app::Layout_List::write(fld::io::Project_Writer *out) { +void Layout_List::write(Project_Writer *out) { // Don't write the Snap field if no custom layout was used int i; if ((current_suite()==0) && (current_preset()==0)) { @@ -751,7 +751,7 @@ void fld::app::Layout_List::write(fld::io::Project_Writer *out) { out->write_string(" current_suite "); out->write_word(list_[current_suite()].name_); out->write_string("\n"); out->write_string(" current_preset %d\n", current_preset()); for (i =0; i<list_size_; i++) { - fld::app::Layout_Suite &suite = list_[i]; + Layout_Suite &suite = list_[i]; if (suite.storage_ == FLD_TOOL_STORE_PROJECT) suite.write(out); } @@ -761,7 +761,7 @@ void fld::app::Layout_List::write(fld::io::Project_Writer *out) { /** Read Suite and Layout selection and project layout data from an .fl project file. */ -void fld::app::Layout_List::read(fld::io::Project_Reader *in) { +void Layout_List::read(Project_Reader *in) { const char *key; key = in->read_word(1); if (key && !strcmp(key, "{")) { @@ -798,7 +798,7 @@ void fld::app::Layout_List::read(fld::io::Project_Reader *in) { Set the current Suite. \param[in] ix index into list of suites */ -void fld::app::Layout_List::current_suite(int ix) { +void Layout_List::current_suite(int ix) { assert(ix >= 0); assert(ix < list_size_); current_suite_ = ix; @@ -810,11 +810,11 @@ void fld::app::Layout_List::current_suite(int ix) { \param[in] arg_name name of the selected suite \return if no name is given or the name is not found, keep the current suite selected */ -void fld::app::Layout_List::current_suite(const char *arg_name) { +void Layout_List::current_suite(const char *arg_name) { if (!arg_name || !arg_name[0]) return; int i; for (i = 0; i < list_size_; ++i) { - fld::app::Layout_Suite &suite = list_[i]; + Layout_Suite &suite = list_[i]; if (suite.name_ && (strcmp(suite.name_, arg_name) == 0)) { current_suite(i); break; @@ -826,7 +826,7 @@ void fld::app::Layout_List::current_suite(const char *arg_name) { Select a Preset within the current Suite. \param[in] ix 0 = application, 1 = dialog, 2 = toolbox */ -void fld::app::Layout_List::current_preset(int ix) { +void Layout_List::current_preset(int ix) { assert(ix >= 0); assert(ix < 3); current_preset_ = ix; @@ -836,7 +836,7 @@ void fld::app::Layout_List::current_preset(int ix) { /** Allocate enough space for n entries in the list. */ -void fld::app::Layout_List::capacity(int n) { +void Layout_List::capacity(int n) { static Fl_Menu_Item *suite_menu = 0; if (!suite_menu) suite_menu = (Fl_Menu_Item*)Fluid.main_menubar->find_item(layout_suite_marker); @@ -844,7 +844,7 @@ void fld::app::Layout_List::capacity(int n) { int old_n = list_size_; int i; - fld::app::Layout_Suite *new_list = (fld::app::Layout_Suite*)::calloc(n, sizeof(fld::app::Layout_Suite)); + Layout_Suite *new_list = (Layout_Suite*)::calloc(n, sizeof(Layout_Suite)); for (i = 0; i < old_n; i++) new_list[i] = list_[i]; if (!list_is_static_) ::free(list_); @@ -872,21 +872,21 @@ void fld::app::Layout_List::capacity(int n) { \brief Clone the currently selected suite and append it to the list. Selects the new layout and updates the UI. */ -int fld::app::Layout_List::add(const char *name) { +int Layout_List::add(const char *name) { if (list_size_ == list_capacity_) { capacity(list_capacity_ * 2); } int n = list_size_; - fld::app::Layout_Suite &old_suite = list_[current_suite_]; - fld::app::Layout_Suite &new_suite = list_[n]; + Layout_Suite &old_suite = list_[current_suite_]; + Layout_Suite &new_suite = list_[n]; new_suite.init(); new_suite.name(name); int i; for (i =0; i<3; ++i) { - new_suite.layout[i] = new fld::app::Layout_Preset; - ::memcpy(new_suite.layout[i], old_suite.layout[i], sizeof(fld::app::Layout_Preset)); + new_suite.layout[i] = new Layout_Preset; + ::memcpy(new_suite.layout[i], old_suite.layout[i], sizeof(Layout_Preset)); } - fld::Tool_Store new_storage = old_suite.storage_; + Tool_Store new_storage = old_suite.storage_; if (new_storage == FLD_TOOL_STORE_INTERNAL) new_storage = FLD_TOOL_STORE_USER; new_suite.storage(new_storage); @@ -903,7 +903,7 @@ int fld::app::Layout_List::add(const char *name) { /** Rename the current Suite. */ -void fld::app::Layout_List::rename(const char *name) { +void Layout_List::rename(const char *name) { int n = current_suite(); list_[n].name(name); main_menu_[n].label(list_[n].menu_label); @@ -914,7 +914,7 @@ void fld::app::Layout_List::rename(const char *name) { Remove the given suite. \param[in] ix index into list of suites */ -void fld::app::Layout_List::remove(int ix) { +void Layout_List::remove(int ix) { int tail = list_size_-ix-1; if (tail) { int i; @@ -932,7 +932,7 @@ void fld::app::Layout_List::remove(int ix) { Remove all Suites that use the given storage attribute. \param[in] storage storage attribute, see FLD_TOOL_STORE_INTERNAL, etc. */ -void fld::app::Layout_List::remove_all(fld::Tool_Store storage) { +void Layout_List::remove_all(Tool_Store storage) { int i; for (i =list_size_-1; i>=0; --i) { if (list_[i].storage_ == storage) @@ -959,19 +959,19 @@ static int nearest(int x, int left, int grid, int right=0x7fff) { return grid_x; } -static bool in_window(fld::app::Snap_Data &d) { +static bool in_window(Snap_Data &d) { return (d.wgt && d.wgt->parent == d.win); } -static bool in_group(fld::app::Snap_Data &d) { +static bool in_group(Snap_Data &d) { return (d.wgt && d.wgt->parent && d.wgt->parent->is_a(FLD_NODE_TYPE_Group) && d.wgt->parent != d.win); } -static bool in_tabs(fld::app::Snap_Data &d) { +static bool in_tabs(Snap_Data &d) { return (d.wgt && d.wgt->parent && d.wgt->parent->is_a(FLD_NODE_TYPE_Tabs)); } -static Fl_Group *parent(fld::app::Snap_Data &d) { +static Fl_Group *parent(Snap_Data &d) { return (d.wgt->o->parent()); } @@ -1002,7 +1002,7 @@ static Fl_Group *parent(fld::app::Snap_Data &d) { \return -1 if this point is closer than any previous check, and this is the new distance to beat. */ -int fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, int x_ref, int x_snap) { +int Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_snap) { int dd = x_ref + d.dx - x_snap; int d2 = abs(dd); if (d2 > d.x_dist) return 1; @@ -1015,9 +1015,9 @@ int fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, int x_ref, int x_sna /** \brief Check if a snap action has reached a preferred y position. - \see fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, int x_ref, int x_snap) + \see Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_snap) */ -int fld::app::Snap_Action::check_y_(fld::app::Snap_Data &d, int y_ref, int y_snap) { +int Snap_Action::check_y_(Snap_Data &d, int y_ref, int y_snap) { int dd = y_ref + d.dy - y_snap; int d2 = abs(dd); if (d2 > d.y_dist) return 1; @@ -1030,9 +1030,9 @@ int fld::app::Snap_Action::check_y_(fld::app::Snap_Data &d, int y_ref, int y_sna /** \brief Check if a snap action has reached a preferred x and y position. - \see fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, int x_ref, int x_snap) + \see Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_snap) */ -void fld::app::Snap_Action::check_x_y_(fld::app::Snap_Data &d, int x_ref, int x_snap, int y_ref, int y_snap) { +void Snap_Action::check_x_y_(Snap_Data &d, int x_ref, int x_snap, int y_ref, int y_snap) { int ddx = x_ref + d.dx - x_snap; int d2x = abs(ddx); int ddy = y_ref + d.dy - y_snap; @@ -1053,7 +1053,7 @@ void fld::app::Snap_Action::check_x_y_(fld::app::Snap_Data &d, int x_ref, int x_ should be drawn. \param[inout] d current event data */ -bool fld::app::Snap_Action::matches(fld::app::Snap_Data &d) { +bool Snap_Action::matches(Snap_Data &d) { switch (type) { case 1: return (d.drag & mask) && (eex == ex) && (d.dx == dx); case 2: return (d.drag & mask) && (eey == ey) && (d.dy == dy); @@ -1066,7 +1066,7 @@ bool fld::app::Snap_Action::matches(fld::app::Snap_Data &d) { \brief Run through all possible snap actions and store the winning coordinates in eex and eey. \param[inout] d current event data */ -void fld::app::Snap_Action::check_all(fld::app::Snap_Data &data) { +void Snap_Action::check_all(Snap_Data &data) { int i; for (i =0; list[i]; i++) { if (list[i]->mask & data.drag) @@ -1083,7 +1083,7 @@ void fld::app::Snap_Action::check_all(fld::app::Snap_Data &data) { coordinate, all of them will be drawn. \param[inout] d current event data */ -void fld::app::Snap_Action::draw_all(fld::app::Snap_Data &data) { +void Snap_Action::draw_all(Snap_Data &data) { int i; for (i =0; list[i]; i++) { if (list[i]->matches(data)) @@ -1092,8 +1092,8 @@ void fld::app::Snap_Action::draw_all(fld::app::Snap_Data &data) { } /** Return a sensible step size for resizing a widget. */ -void fld::app::Snap_Action::get_resize_stepsize(int &x_step, int &y_step) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; +void Snap_Action::get_resize_stepsize(int &x_step, int &y_step) { + Layout_Preset *layout = Fluid.proj.layout; if ((layout->widget_inc_w > 1) && (layout->widget_inc_h > 1)) { x_step = layout->widget_inc_w; y_step = layout->widget_inc_h; @@ -1107,8 +1107,8 @@ void fld::app::Snap_Action::get_resize_stepsize(int &x_step, int &y_step) { } /** Return a sensible step size for moving a widget. */ -void fld::app::Snap_Action::get_move_stepsize(int &x_step, int &y_step) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; +void Snap_Action::get_move_stepsize(int &x_step, int &y_step) { + Layout_Preset *layout = Fluid.proj.layout; if ((layout->group_grid_x > 1) && (layout->group_grid_y > 1)) { x_step = layout->group_grid_x; y_step = layout->group_grid_y; @@ -1122,8 +1122,8 @@ void fld::app::Snap_Action::get_move_stepsize(int &x_step, int &y_step) { } /** Fix the given size to the same or next bigger snap position. */ -void fld::app::Snap_Action::better_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; +void Snap_Action::better_size(int &w, int &h) { + Layout_Preset *layout = Fluid.proj.layout; int x_min = 1, y_min = 1, x_inc = 1, y_inc = 1; get_resize_stepsize(x_inc, y_inc); if (x_inc < 1) x_inc = 1; @@ -1148,7 +1148,7 @@ void fld::app::Snap_Action::better_size(int &w, int &h) { /** Base class for all actions that drag the left side or the entire widget. */ -class Fd_Snap_Left : public fld::app::Snap_Action { +class Fd_Snap_Left : public Snap_Action { public: Fd_Snap_Left() { type = 1; mask = FD_LEFT|FD_DRAG; } }; @@ -1156,7 +1156,7 @@ public: /** Base class for all actions that drag the right side or the entire widget. */ -class Fd_Snap_Right : public fld::app::Snap_Action { +class Fd_Snap_Right : public Snap_Action { public: Fd_Snap_Right() { type = 1; mask = FD_RIGHT|FD_DRAG; } }; @@ -1164,7 +1164,7 @@ public: /** Base class for all actions that drag the top side or the entire widget. */ -class Fd_Snap_Top : public fld::app::Snap_Action { +class Fd_Snap_Top : public Snap_Action { public: Fd_Snap_Top() { type = 2; mask = FD_TOP|FD_DRAG; } }; @@ -1172,7 +1172,7 @@ public: /** Base class for all actions that drag the bottom side or the entire widget. */ -class Fd_Snap_Bottom : public fld::app::Snap_Action { +class Fd_Snap_Bottom : public Snap_Action { public: Fd_Snap_Bottom() { type = 2; mask = FD_BOTTOM|FD_DRAG; } }; @@ -1184,8 +1184,8 @@ public: */ class Fd_Snap_Left_Window_Edge : public Fd_Snap_Left { public: - void check(fld::app::Snap_Data &d) { clr(); check_x_(d, d.bx, 0); } - void draw(fld::app::Snap_Data &d) { draw_left_brace(d.win->o); } + void check(Snap_Data &d) { clr(); check_x_(d, d.bx, 0); } + void draw(Snap_Data &d) { draw_left_brace(d.win->o); } }; Fd_Snap_Left_Window_Edge snap_left_window_edge; @@ -1194,8 +1194,8 @@ Fd_Snap_Left_Window_Edge snap_left_window_edge; */ class Fd_Snap_Right_Window_Edge : public Fd_Snap_Right { public: - void check(fld::app::Snap_Data &d) { clr(); check_x_(d, d.br, d.win->o->w()); } - void draw(fld::app::Snap_Data &d) { draw_right_brace(d.win->o); } + void check(Snap_Data &d) { clr(); check_x_(d, d.br, d.win->o->w()); } + void draw(Snap_Data &d) { draw_right_brace(d.win->o); } }; Fd_Snap_Right_Window_Edge snap_right_window_edge; @@ -1204,8 +1204,8 @@ Fd_Snap_Right_Window_Edge snap_right_window_edge; */ class Fd_Snap_Top_Window_Edge : public Fd_Snap_Top { public: - void check(fld::app::Snap_Data &d) { clr(); check_y_(d, d.by, 0); } - void draw(fld::app::Snap_Data &d) { draw_top_brace(d.win->o); } + void check(Snap_Data &d) { clr(); check_y_(d, d.by, 0); } + void draw(Snap_Data &d) { draw_top_brace(d.win->o); } }; Fd_Snap_Top_Window_Edge snap_top_window_edge; @@ -1214,8 +1214,8 @@ Fd_Snap_Top_Window_Edge snap_top_window_edge; */ class Fd_Snap_Bottom_Window_Edge : public Fd_Snap_Bottom { public: - void check(fld::app::Snap_Data &d) { clr(); check_y_(d, d.bt, d.win->o->h()); } - void draw(fld::app::Snap_Data &d) { draw_bottom_brace(d.win->o); } + void check(Snap_Data &d) { clr(); check_y_(d, d.bt, d.win->o->h()); } + void draw(Snap_Data &d) { draw_bottom_brace(d.win->o); } }; Fd_Snap_Bottom_Window_Edge snap_bottom_window_edge; @@ -1224,11 +1224,11 @@ Fd_Snap_Bottom_Window_Edge snap_bottom_window_edge; */ class Fd_Snap_Left_Window_Margin : public Fd_Snap_Left { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_window(d)) check_x_(d, d.bx, Fluid.proj.layout->left_window_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_h_arrow(d.bx, (d.by+d.bt)/2, 0); } }; @@ -1236,11 +1236,11 @@ Fd_Snap_Left_Window_Margin snap_left_window_margin; class Fd_Snap_Right_Window_Margin : public Fd_Snap_Right { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_window(d)) check_x_(d, d.br, d.win->o->w()-Fluid.proj.layout->right_window_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_h_arrow(d.br, (d.by+d.bt)/2, d.win->o->w()-1); } }; @@ -1248,11 +1248,11 @@ Fd_Snap_Right_Window_Margin snap_right_window_margin; class Fd_Snap_Top_Window_Margin : public Fd_Snap_Top { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_window(d)) check_y_(d, d.by, Fluid.proj.layout->top_window_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_v_arrow((d.bx+d.br)/2, d.by, 0); } }; @@ -1260,11 +1260,11 @@ Fd_Snap_Top_Window_Margin snap_top_window_margin; class Fd_Snap_Bottom_Window_Margin : public Fd_Snap_Bottom { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_window(d)) check_y_(d, d.bt, d.win->o->h()-Fluid.proj.layout->bottom_window_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_v_arrow((d.bx+d.br)/2, d.bt, d.win->o->h()-1); } }; @@ -1277,11 +1277,11 @@ Fd_Snap_Bottom_Window_Margin snap_bottom_window_margin; */ class Fd_Snap_Left_Group_Edge : public Fd_Snap_Left { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_x_(d, d.bx, parent(d)->x()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_left_brace(parent(d)); } }; @@ -1289,11 +1289,11 @@ Fd_Snap_Left_Group_Edge snap_left_group_edge; class Fd_Snap_Right_Group_Edge : public Fd_Snap_Right { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_x_(d, d.br, parent(d)->x() + parent(d)->w()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_right_brace(parent(d)); } }; @@ -1301,11 +1301,11 @@ Fd_Snap_Right_Group_Edge snap_right_group_edge; class Fd_Snap_Top_Group_Edge : public Fd_Snap_Top { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_y_(d, d.by, parent(d)->y()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_top_brace(parent(d)); } }; @@ -1313,11 +1313,11 @@ Fd_Snap_Top_Group_Edge snap_top_group_edge; class Fd_Snap_Bottom_Group_Edge : public Fd_Snap_Bottom { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_y_(d, d.bt, parent(d)->y() + parent(d)->h()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_bottom_brace(parent(d)); } }; @@ -1329,11 +1329,11 @@ Fd_Snap_Bottom_Group_Edge snap_bottom_group_edge; */ class Fd_Snap_Left_Group_Margin : public Fd_Snap_Left { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_x_(d, d.bx, parent(d)->x() + Fluid.proj.layout->left_group_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_left_brace(parent(d)); draw_h_arrow(d.bx, (d.by+d.bt)/2, parent(d)->x()); } @@ -1342,11 +1342,11 @@ Fd_Snap_Left_Group_Margin snap_left_group_margin; class Fd_Snap_Right_Group_Margin : public Fd_Snap_Right { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_x_(d, d.br, parent(d)->x()+parent(d)->w()-Fluid.proj.layout->right_group_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_right_brace(parent(d)); draw_h_arrow(d.br, (d.by+d.bt)/2, parent(d)->x()+parent(d)->w()-1); } @@ -1355,11 +1355,11 @@ Fd_Snap_Right_Group_Margin snap_right_group_margin; class Fd_Snap_Top_Group_Margin : public Fd_Snap_Top { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d) && !in_tabs(d)) check_y_(d, d.by, parent(d)->y()+Fluid.proj.layout->top_group_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_top_brace(parent(d)); draw_v_arrow((d.bx+d.br)/2, d.by, parent(d)->y()); } @@ -1368,11 +1368,11 @@ Fd_Snap_Top_Group_Margin snap_top_group_margin; class Fd_Snap_Bottom_Group_Margin : public Fd_Snap_Bottom { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d) && !in_tabs(d)) check_y_(d, d.bt, parent(d)->y()+parent(d)->h()-Fluid.proj.layout->bottom_group_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_bottom_brace(parent(d)); draw_v_arrow((d.bx+d.br)/2, d.bt, parent(d)->y()+parent(d)->h()-1); } @@ -1386,7 +1386,7 @@ Fd_Snap_Bottom_Group_Margin snap_bottom_group_margin; */ class Fd_Snap_Top_Tabs_Margin : public Fd_Snap_Top_Group_Margin { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_tabs(d)) check_y_(d, d.by, parent(d)->y()+Fluid.proj.layout->top_tabs_margin); } @@ -1395,7 +1395,7 @@ Fd_Snap_Top_Tabs_Margin snap_top_tabs_margin; class Fd_Snap_Bottom_Tabs_Margin : public Fd_Snap_Bottom_Group_Margin { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_tabs(d)) check_y_(d, d.bt, parent(d)->y()+parent(d)->h()-Fluid.proj.layout->bottom_tabs_margin); } @@ -1407,12 +1407,12 @@ Fd_Snap_Bottom_Tabs_Margin snap_bottom_tabs_margin; /** Base class for grid based snapping. */ -class Fd_Snap_Grid : public fld::app::Snap_Action { +class Fd_Snap_Grid : public Snap_Action { protected: int nearest_x, nearest_y; public: Fd_Snap_Grid() { type = 3; mask = FD_LEFT|FD_TOP|FD_DRAG; } - void check_grid(fld::app::Snap_Data &d, int left, int grid_x, int right, int top, int grid_y, int bottom) { + void check_grid(Snap_Data &d, int left, int grid_x, int right, int top, int grid_y, int bottom) { if ((grid_x <= 1) || (grid_y <= 1)) return; int suggested_x = d.bx + d.dx; nearest_x = nearest(suggested_x, left, grid_x, right); @@ -1425,7 +1425,7 @@ public: else check_x_y_(d, d.bx, nearest_x, d.by, nearest_y); } - bool matches(fld::app::Snap_Data &d) { + bool matches(Snap_Data &d) { if (d.drag == FD_LEFT) return (eex == ex); if (d.drag == FD_TOP) return (eey == ey) && (d.dx == dx); return (d.drag & mask) && (eex == ex) && (d.dx == dx) && (eey == ey) && (d.dy == dy); @@ -1437,14 +1437,14 @@ public: */ class Fd_Snap_Window_Grid : public Fd_Snap_Grid { public: - void check(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void check(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; clr(); if (in_window(d)) check_grid(d, layout->left_window_margin, layout->window_grid_x, d.win->o->w()-layout->right_window_margin, layout->top_window_margin, layout->window_grid_y, d.win->o->h()-layout->bottom_window_margin); } - void draw(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void draw(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; draw_grid(nearest_x, nearest_y, layout->window_grid_x, layout->window_grid_y); } }; @@ -1455,17 +1455,17 @@ Fd_Snap_Window_Grid snap_window_grid; */ class Fd_Snap_Group_Grid : public Fd_Snap_Grid { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { if (in_group(d)) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; clr(); Fl_Widget *g = parent(d); check_grid(d, g->x()+layout->left_group_margin, layout->group_grid_x, g->x()+g->w()-layout->right_group_margin, g->y()+layout->top_group_margin, layout->group_grid_y, g->y()+g->h()-layout->bottom_group_margin); } } - void draw(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void draw(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; draw_grid(nearest_x, nearest_y, layout->group_grid_x, layout->group_grid_y); } }; @@ -1476,13 +1476,13 @@ Fd_Snap_Group_Grid snap_group_grid; /** Base class the check distance to other widgets in the same group. */ -class Fd_Snap_Sibling : public fld::app::Snap_Action { +class Fd_Snap_Sibling : public Snap_Action { protected: Fl_Widget *best_match; public: Fd_Snap_Sibling() : best_match(0) { } - virtual int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) = 0; - void check(fld::app::Snap_Data &d) { + virtual int sibling_check(Snap_Data &d, Fl_Widget *s) = 0; + void check(Snap_Data &d) { clr(); best_match = 0; if (!d.wgt) return; @@ -1517,10 +1517,10 @@ public: class Fd_Snap_Siblings_Left_Same : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Left_Same() { type = 1; mask = FD_LEFT|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return check_x_(d, d.bx, s->x()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_left_brace(best_match); } }; @@ -1532,11 +1532,11 @@ Fd_Snap_Siblings_Left_Same snap_siblings_left_same; class Fd_Snap_Siblings_Left : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Left() { type = 1; mask = FD_LEFT|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return MIN(check_x_(d, d.bx, s->x()+s->w()), check_x_(d, d.bx, s->x()+s->w()+Fluid.proj.layout->widget_gap_x) ); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_right_brace(best_match); } }; @@ -1545,10 +1545,10 @@ Fd_Snap_Siblings_Left snap_siblings_left; class Fd_Snap_Siblings_Right_Same : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Right_Same() { type = 1; mask = FD_RIGHT|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return check_x_(d, d.br, s->x()+s->w()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_right_brace(best_match); } }; @@ -1557,11 +1557,11 @@ Fd_Snap_Siblings_Right_Same snap_siblings_right_same; class Fd_Snap_Siblings_Right : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Right() { type = 1; mask = FD_RIGHT|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return MIN(check_x_(d, d.br, s->x()), check_x_(d, d.br, s->x()-Fluid.proj.layout->widget_gap_x)); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_left_brace(best_match); } }; @@ -1570,10 +1570,10 @@ Fd_Snap_Siblings_Right snap_siblings_right; class Fd_Snap_Siblings_Top_Same : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Top_Same() { type = 2; mask = FD_TOP|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return check_y_(d, d.by, s->y()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_top_brace(best_match); } }; @@ -1582,11 +1582,11 @@ Fd_Snap_Siblings_Top_Same snap_siblings_top_same; class Fd_Snap_Siblings_Top : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Top() { type = 2; mask = FD_TOP|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return MIN(check_y_(d, d.by, s->y()+s->h()), check_y_(d, d.by, s->y()+s->h()+Fluid.proj.layout->widget_gap_y)); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_bottom_brace(best_match); } }; @@ -1595,10 +1595,10 @@ Fd_Snap_Siblings_Top snap_siblings_top; class Fd_Snap_Siblings_Bottom_Same : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Bottom_Same() { type = 2; mask = FD_BOTTOM|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return check_y_(d, d.bt, s->y()+s->h()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_bottom_brace(best_match); } }; @@ -1607,11 +1607,11 @@ Fd_Snap_Siblings_Bottom_Same snap_siblings_bottom_same; class Fd_Snap_Siblings_Bottom : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Bottom() { type = 2; mask = FD_BOTTOM|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return MIN(check_y_(d, d.bt, s->y()), check_y_(d, d.bt, s->y()-Fluid.proj.layout->widget_gap_y)); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_top_brace(best_match); } }; @@ -1623,11 +1623,11 @@ Fd_Snap_Siblings_Bottom snap_siblings_bottom; /** Snap horizontal resizing to min_w or min_w and a multiple of inc_w. */ -class Fd_Snap_Widget_Ideal_Width : public fld::app::Snap_Action { +class Fd_Snap_Widget_Ideal_Width : public Snap_Action { public: Fd_Snap_Widget_Ideal_Width() { type = 1; mask = FD_LEFT|FD_RIGHT; } - void check(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void check(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; clr(); if (!d.wgt) return; int iw = 15, ih = 15; @@ -1644,17 +1644,17 @@ public: check_x_(d, d.bx, d.br-iw); } } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_width(d.bx, d.bt+7, d.br, 0); } }; Fd_Snap_Widget_Ideal_Width snap_widget_ideal_width; -class Fd_Snap_Widget_Ideal_Height : public fld::app::Snap_Action { +class Fd_Snap_Widget_Ideal_Height : public Snap_Action { public: Fd_Snap_Widget_Ideal_Height() { type = 2; mask = FD_TOP|FD_BOTTOM; } - void check(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void check(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; clr(); if (!d.wgt) return; int iw, ih; @@ -1671,7 +1671,7 @@ public: check_y_(d, d.by, d.bt-ih); } } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_height(d.br+7, d.by, d.bt, 0); } }; @@ -1686,7 +1686,7 @@ Fd_Snap_Widget_Ideal_Height snap_widget_ideal_height; action in the list wins. All snap actions with the same distance and same winning coordinates are drawn in the overlay plane. */ -fld::app::Snap_Action *fld::app::Snap_Action::list[] = { +Snap_Action *Snap_Action::list[] = { &snap_left_window_edge, &snap_right_window_edge, &snap_top_window_edge, diff --git a/fluid/app/Snap_Action.h b/fluid/app/Snap_Action.h index 7c1e3fabc..f48b1490a 100644 --- a/fluid/app/Snap_Action.h +++ b/fluid/app/Snap_Action.h @@ -26,15 +26,8 @@ class Fl_Preferences; extern Fl_Menu_Item main_layout_submenu_[]; -namespace fld { -namespace io { -class Project_Reader; // fld::io:: -class Project_Writer; // fld::io:: -} // namespace io -} // namespace fld - -namespace fld { -namespace app { +class Project_Reader; +class Project_Writer; /** \brief Collection of layout settings. @@ -77,8 +70,8 @@ public: void write(Fl_Preferences &prefs); void read(Fl_Preferences &prefs); - void write(fld::io::Project_Writer*); - void read(fld::io::Project_Reader*); + void write(Project_Writer*); + void read(Project_Reader*); int textsize_not_null(); }; @@ -98,13 +91,13 @@ public: char *name_; ///< name of the suite char *menu_label; ///< label text used in pulldown menu Layout_Preset *layout[3]; ///< presets for application, dialog, and toolbox windows - fld::Tool_Store storage_; ///< storage location (see FLD_TOOL_STORE_INTERNAL, etc.) + Tool_Store storage_; ///< storage location (see FLD_TOOL_STORE_INTERNAL, etc.) void write(Fl_Preferences &prefs); void read(Fl_Preferences &prefs); - void write(fld::io::Project_Writer*); - void read(fld::io::Project_Reader*); + void write(Project_Writer*); + void read(Project_Reader*); void update_label(); - void storage(fld::Tool_Store s) { storage_ = s; update_label(); } + void storage(Tool_Store s) { storage_ = s; update_label(); } void name(const char *n); void init(); ~Layout_Suite(); @@ -147,13 +140,13 @@ public: int load(const char *filename); int save(const char *filename); - void write(Fl_Preferences &prefs, fld::Tool_Store storage); - void read(Fl_Preferences &prefs, fld::Tool_Store storage); - void write(fld::io::Project_Writer*); - void read(fld::io::Project_Reader*); + void write(Fl_Preferences &prefs, Tool_Store storage); + void read(Fl_Preferences &prefs, Tool_Store storage); + void write(Project_Writer*); + void read(Project_Reader*); int add(Layout_Suite*); void remove(int index); - void remove_all(fld::Tool_Store storage); + void remove_all(Tool_Store storage); Layout_Preset *at(int); int size(); }; @@ -198,8 +191,6 @@ public: static void better_size(int &w, int &h); }; -} // namespace app -} // namespace fld #endif // _FLUID_FD_SNAP_ACTION_H diff --git a/fluid/app/args.cxx b/fluid/app/args.cxx index 70faebafc..ef7652060 100644 --- a/fluid/app/args.cxx +++ b/fluid/app/args.cxx @@ -26,7 +26,7 @@ #include "../src/flstring.h" -fld::app::Args::Args() +Args::Args() : update_file(0), compile_file(0), compile_strings(0), @@ -46,7 +46,7 @@ fld::app::Args::Args() \return 0 if the args were handled successfully, -1 if there was an error and the usage message was shown. */ -int fld::app::Args::load(int argc, char **argv) { +int Args::load(int argc, char **argv) { int i = 1; Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW if ( (Fl::args(argc, argv, i, arg_cb) == 0) // unsupported argument found @@ -79,7 +79,7 @@ int fld::app::Args::load(int argc, char **argv) { } -int fld::app::Args::arg_cb(int argc, char** argv, int& i) { +int Args::arg_cb(int argc, char** argv, int& i) { return Fluid.args.arg(argc, argv, i); } @@ -91,7 +91,7 @@ int fld::app::Args::arg_cb(int argc, char** argv, int& i) { \param[inout] i current argument index \return number of arguments used; if 0, the argument is not supported */ -int fld::app::Args::arg(int argc, char** argv, int& i) { +int Args::arg(int argc, char** argv, int& i) { if (argv[i][0] != '-') return 0; if (argv[i][1] == 'd' && !argv[i][2]) { diff --git a/fluid/app/args.h b/fluid/app/args.h index 1165c4f58..601cc91c9 100644 --- a/fluid/app/args.h +++ b/fluid/app/args.h @@ -19,9 +19,6 @@ #include <FL/filename.H> -namespace fld { -namespace app { - class Args { // Callback. static int arg_cb(int argc, char** argv, int& i); @@ -48,7 +45,4 @@ public: int load(int argc, char **argv); }; -} // namespace app -} // namespace fld - #endif // FLUID_APP_ARGS_H diff --git a/fluid/app/history.cxx b/fluid/app/history.cxx index 91b2f0b99..3b252598d 100644 --- a/fluid/app/history.cxx +++ b/fluid/app/history.cxx @@ -22,7 +22,7 @@ #include "../src/flstring.h" -fld::app::History::History() { +History::History() { int i, j; for (i = 0; i < 10; i++) { for (j = 0; j < FL_PATH_MAX; j++) { @@ -40,7 +40,7 @@ fld::app::History::History() { It also computes and stores the relative filepaths for display in the main menu. */ -void fld::app::History::load() { +void History::load() { int i; int max_files; @@ -71,7 +71,7 @@ void fld::app::History::load() { \param[in] project_file path and filename of .fl project file, will be converted into an absolute file path based on the current working directory. */ -void fld::app::History::update(const char *project_file) { +void History::update(const char *project_file) { int i; int max_files; diff --git a/fluid/app/history.h b/fluid/app/history.h index 99200757a..92e494226 100644 --- a/fluid/app/history.h +++ b/fluid/app/history.h @@ -19,9 +19,6 @@ #include <FL/filename.H> -namespace fld { -namespace app { - class History { public: /// Stores the absolute filename of the last 10 project files, saved in app preferences. @@ -36,7 +33,4 @@ public: void update(const char *project_file); }; -} // namespace app -} // namespace fld - #endif // FLUID_APP_HISTORY_H diff --git a/fluid/app/shell_command.cxx b/fluid/app/shell_command.cxx index 0a9a04121..fc5d0ffe9 100644 --- a/fluid/app/shell_command.cxx +++ b/fluid/app/shell_command.cxx @@ -441,7 +441,7 @@ Fd_Shell_Command::Fd_Shell_Command(const char *in_name) Fd_Shell_Command::Fd_Shell_Command(const char *in_name, const char *in_label, Fl_Shortcut in_shortcut, - fld::Tool_Store in_storage, + Tool_Store in_storage, int in_condition, const char *in_condition_data, const char *in_command, @@ -561,7 +561,7 @@ void Fd_Shell_Command::read(Fl_Preferences &prefs) { prefs.get("shortcut", tmp, 0); shortcut = (Fl_Shortcut)tmp; prefs.get("storage", tmp, -1); - if (tmp != -1) storage = (fld::Tool_Store)tmp; + if (tmp != -1) storage = (Tool_Store)tmp; prefs.get("condition", condition, ALWAYS); prefs.get("condition_data", str_ptr, ""); @@ -586,7 +586,7 @@ void Fd_Shell_Command::write(Fl_Preferences &prefs, int save_location) { if (flags != 0) prefs.set("flags", flags); } -void Fd_Shell_Command::read(class fld::io::Project_Reader *in) { +void Fd_Shell_Command::read(class Project_Reader *in) { const char *c = in->read_word(1); if (strcmp(c, "{")!=0) return; // expecting start of group storage = FLD_TOOL_STORE_PROJECT; @@ -612,7 +612,7 @@ void Fd_Shell_Command::read(class fld::io::Project_Reader *in) { } } -void Fd_Shell_Command::write(class fld::io::Project_Writer *out) { +void Fd_Shell_Command::write(class Project_Writer *out) { out->write_string("\n command {"); out->write_string("\n name "); out->write_word(name ? name : ""); out->write_string("\n label "); out->write_word(label ? label : ""); @@ -676,7 +676,7 @@ void Fd_Shell_Command_List::clear() { /** remove all shell commands of the given storage location from the list. */ -void Fd_Shell_Command_List::clear(fld::Tool_Store storage) { +void Fd_Shell_Command_List::clear(Tool_Store storage) { int i; for (i=list_size-1; i>=0; i--) { if (list[i]->storage == storage) { @@ -688,7 +688,7 @@ void Fd_Shell_Command_List::clear(fld::Tool_Store storage) { /** Read shell configuration from a preferences group. */ -void Fd_Shell_Command_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) { +void Fd_Shell_Command_List::read(Fl_Preferences &prefs, Tool_Store storage) { int i, n; // import the old shell commands from previous user settings if (&Fluid.preferences == &prefs) { @@ -729,7 +729,7 @@ void Fd_Shell_Command_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) /** Write shell configuration to a preferences group. */ -void Fd_Shell_Command_List::write(Fl_Preferences &prefs, fld::Tool_Store storage) { +void Fd_Shell_Command_List::write(Fl_Preferences &prefs, Tool_Store storage) { int i, index; Fl_Preferences shell_commands(prefs, "shell_commands"); shell_commands.delete_all_groups(); @@ -745,7 +745,7 @@ void Fd_Shell_Command_List::write(Fl_Preferences &prefs, fld::Tool_Store storage /** Read shell configuration from a project file. */ -void Fd_Shell_Command_List::read(fld::io::Project_Reader *in) { +void Fd_Shell_Command_List::read(Project_Reader *in) { const char *c = in->read_word(1); if (strcmp(c, "{")!=0) return; // expecting start of group clear(FLD_TOOL_STORE_PROJECT); @@ -765,7 +765,7 @@ void Fd_Shell_Command_List::read(fld::io::Project_Reader *in) { /** Write shell configuration to a project file. */ -void Fd_Shell_Command_List::write(fld::io::Project_Writer *out) { +void Fd_Shell_Command_List::write(Project_Writer *out) { int i, n_in_project_file = 0; for (i=0; i<list_size; i++) { if (list[i]->storage == FLD_TOOL_STORE_PROJECT) diff --git a/fluid/app/shell_command.h b/fluid/app/shell_command.h index 716a87349..234477151 100644 --- a/fluid/app/shell_command.h +++ b/fluid/app/shell_command.h @@ -34,15 +34,9 @@ # include <unistd.h> #endif -namespace fld { -namespace io { - class Project_Reader; class Project_Writer; -} // namespace io -} // namespace fld - struct Fl_Menu_Item; class Fl_Widget; class Fl_Preferences; @@ -93,7 +87,7 @@ public: char *name; char *label; Fl_Shortcut shortcut; - fld::Tool_Store storage; + Tool_Store storage; int condition; char *condition_data; char *command; @@ -106,7 +100,7 @@ public: Fd_Shell_Command(const char *in_name, const char *in_label, Fl_Shortcut in_shortcut, - fld::Tool_Store in_storage, + Tool_Store in_storage, int in_condition, const char *in_condition_data, const char *in_command, @@ -121,8 +115,8 @@ public: void run(); void read(Fl_Preferences &prefs); void write(Fl_Preferences &prefs, int save_location); - void read(class fld::io::Project_Reader*); - void write(class fld::io::Project_Writer*); + void read(class Project_Reader*); + void write(class Project_Writer*); void update_shell_menu(); int is_active(); }; @@ -142,11 +136,11 @@ public: void insert(int index, Fd_Shell_Command *cmd); void remove(int index); void clear(); - void clear(fld::Tool_Store store); - void read(Fl_Preferences &prefs, fld::Tool_Store storage); - void write(Fl_Preferences &prefs, fld::Tool_Store storage); - void read(class fld::io::Project_Reader*); - void write(class fld::io::Project_Writer*); + void clear(Tool_Store store); + void read(Fl_Preferences &prefs, Tool_Store storage); + void write(Fl_Preferences &prefs, Tool_Store storage); + void read(class Project_Reader*); + void write(class Project_Writer*); void rebuild_shell_menu(); void update_settings_dialog(); diff --git a/fluid/app/templates.cxx b/fluid/app/templates.cxx index 9b2253001..96534ae01 100644 --- a/fluid/app/templates.cxx +++ b/fluid/app/templates.cxx @@ -32,7 +32,7 @@ Save a design template. \todo We should document the concept of templates. */ -void fld::app::save_template() { +void save_template() { // Setup the template panel... if (!template_panel) make_template_panel(); @@ -93,7 +93,7 @@ void fld::app::save_template() { "Replace", 0, c) == 0) return; } - if (!fld::io::write_file(Fluid.proj, filename)) { + if (!write_file(Fluid.proj, filename)) { fl_alert("Error writing %s: %s", filename, strerror(errno)); return; } diff --git a/fluid/app/templates.h b/fluid/app/templates.h index cedec9f76..2f4d972d0 100644 --- a/fluid/app/templates.h +++ b/fluid/app/templates.h @@ -17,13 +17,7 @@ #ifndef FLUID_APP_TEMPLATES_H #define FLUID_APP_TEMPLATES_H -namespace fld { -namespace app { - void save_template(); -} // namespace app -} // namespace fld - #endif // FLUID_APP_TEMPLATES_H diff --git a/fluid/fld_tool_store.h b/fluid/fld_tool_store.h index cfe325def..3f16ba68e 100644 --- a/fluid/fld_tool_store.h +++ b/fluid/fld_tool_store.h @@ -10,16 +10,12 @@ #ifndef FLUID_FLD_TOOL_STORE_H #define FLUID_FLD_TOOL_STORE_H -namespace fld { - /** Indicate the storage location for tools like layout suites and shell macros. \see class Fd_Shell_Command, class Layout_Suite */ typedef int Tool_Store; -} // namespace fld - enum { FLD_TOOL_STORE_INTERNAL = 0, ///< stored inside FLUID app FLD_TOOL_STORE_USER, ///< suite is stored in the user wide FLUID settings diff --git a/fluid/io/Code_Writer.cxx b/fluid/io/Code_Writer.cxx index ffa63514a..f81da6ca7 100644 --- a/fluid/io/Code_Writer.cxx +++ b/fluid/io/Code_Writer.cxx @@ -141,7 +141,7 @@ int is_id(char c) { \param[in] label else if label is set, it is appended, skipping non-keyword characters \return buffer to a unique identifier, managed by Code_Writer, so caller must NOT free() it */ -const char* fld::io::Code_Writer::unique_id(void* o, const char* type, const char* name, const char* label) { +const char* Code_Writer::unique_id(void* o, const char* type, const char* name, const char* label) { char buffer[128]; char* q = buffer; char* q_end = q + 128 - 8 - 1; // room for hex number and NUL @@ -186,7 +186,7 @@ const char* fld::io::Code_Writer::unique_id(void* o, const char* type, const cha \param[in] set generate this indent depth \return pointer to a static string */ -const char *fld::io::Code_Writer::indent(int set) { +const char *Code_Writer::indent(int set) { static const char* spaces = " "; int i = set * 2; if (i>64) i = 64; @@ -198,7 +198,7 @@ const char *fld::io::Code_Writer::indent(int set) { Return a C string that indents code to the current source file depth. \return pointer to a static string */ -const char *fld::io::Code_Writer::indent() { +const char *Code_Writer::indent() { return indent(indentation); } @@ -208,7 +208,7 @@ const char *fld::io::Code_Writer::indent() { change the `indentation` variable; offset can be negative \return pointer to a static string */ -const char *fld::io::Code_Writer::indent_plus(int offset) { +const char *Code_Writer::indent_plus(int offset) { return indent(indentation+offset); } @@ -219,7 +219,7 @@ const char *fld::io::Code_Writer::indent_plus(int offset) { \param[in] format printf-style formatting text, followed by a vararg list \return 1 if the text was written to the file, 0 if it was previously written. */ -int fld::io::Code_Writer::write_h_once(const char *format, ...) { +int Code_Writer::write_h_once(const char *format, ...) { va_list args; char buf[1024]; va_start(args, format); @@ -239,7 +239,7 @@ int fld::io::Code_Writer::write_h_once(const char *format, ...) { \param[in] format printf-style formatting text, followed by a vararg list \return 1 if the text was written to the file, 0 if it was previously written. */ -int fld::io::Code_Writer::write_c_once(const char *format, ...) { +int Code_Writer::write_c_once(const char *format, ...) { va_list args; char buf[1024]; va_start(args, format); @@ -264,7 +264,7 @@ int fld::io::Code_Writer::write_c_once(const char *format, ...) { \param[in] pp ay pointer \return true if found in the tree, false if added to the tree */ -bool fld::io::Code_Writer::c_contains(void *pp) { +bool Code_Writer::c_contains(void *pp) { if (ptr_in_code.contains(pp)) { return true; } @@ -289,7 +289,7 @@ bool fld::io::Code_Writer::c_contains(void *pp) { \see f.write_cstring(const char*) */ -void fld::io::Code_Writer::write_cstring(const char *s, int length) { +void Code_Writer::write_cstring(const char *s, int length) { const char *next_line = "\"\n\""; if (varused_test) { varused = 1; @@ -370,7 +370,7 @@ void fld::io::Code_Writer::write_cstring(const char *s, int length) { \param[in] s write this string \see f.write_cstring(const char*, int) */ -void fld::io::Code_Writer::write_cstring(const char *s) { +void Code_Writer::write_cstring(const char *s) { write_cstring(s, (int)strlen(s)); } @@ -382,7 +382,7 @@ void fld::io::Code_Writer::write_cstring(const char *s) { \param[in] s a block of binary data, interpreted as unsigned bytes \param[in] length size of the block in bytes */ -void fld::io::Code_Writer::write_cdata(const char *s, int length) { +void Code_Writer::write_cdata(const char *s, int length) { if (varused_test) { varused = 1; return; @@ -420,7 +420,7 @@ void fld::io::Code_Writer::write_cdata(const char *s, int length) { \param[in] format printf-style formatting text \param[in] args list of arguments */ -void fld::io::Code_Writer::vwrite_c(const char* format, va_list args) { +void Code_Writer::vwrite_c(const char* format, va_list args) { if (varused_test) { varused = 1; return; @@ -432,7 +432,7 @@ void fld::io::Code_Writer::vwrite_c(const char* format, va_list args) { Print a formatted line to the source file. \param[in] format printf-style formatting text, followed by a vararg list */ -void fld::io::Code_Writer::write_c(const char* format,...) { +void Code_Writer::write_c(const char* format,...) { va_list args; va_start(args, format); vwrite_c(format, args); @@ -447,7 +447,7 @@ void fld::io::Code_Writer::write_c(const char* format,...) { \param[in] c line of code \param[in] com optional commentary */ -void fld::io::Code_Writer::write_cc(const char *indent, int n, const char *c, const char *com) { +void Code_Writer::write_cc(const char *indent, int n, const char *c, const char *com) { write_c("%s%.*s", indent, n, c); char cc = c[n-1]; if (cc!='}' && cc!=';') @@ -461,7 +461,7 @@ void fld::io::Code_Writer::write_cc(const char *indent, int n, const char *c, co Print a formatted line to the header file. \param[in] format printf-style formatting text, followed by a vararg list */ -void fld::io::Code_Writer::write_h(const char* format,...) { +void Code_Writer::write_h(const char* format,...) { if (varused_test) return; va_list args; va_start(args, format); @@ -477,7 +477,7 @@ void fld::io::Code_Writer::write_h(const char* format,...) { \param[in] c line of code \param[in] com optional commentary */ -void fld::io::Code_Writer::write_hc(const char *indent, int n, const char* c, const char *com) { +void Code_Writer::write_hc(const char *indent, int n, const char* c, const char *com) { write_h("%s%.*s", indent, n, c); char cc = c[n-1]; if (cc!='}' && cc!=';') @@ -494,7 +494,7 @@ void fld::io::Code_Writer::write_hc(const char *indent, int n, const char* c, co \param[in] inTrailWith append this character if the last line did not end with a newline, usually 0 or newline. */ -void fld::io::Code_Writer::write_c_indented(const char *textlines, int inIndent, char inTrailWith) { +void Code_Writer::write_c_indented(const char *textlines, int inIndent, char inTrailWith) { if (textlines) { indentation += inIndent; for (;;) { @@ -567,7 +567,7 @@ bool is_comment_before_class_member(Node *q) { \param[in] p write this type and all its children \return pointer to the next sibling */ -Node* fld::io::Code_Writer::write_static(Node* p) { +Node* Code_Writer::write_static(Node* p) { if (write_codeview) p->header_static_start = (int)ftell(header_file); if (write_codeview) p->code_static_start = (int)ftell(code_file); p->write_static(*this); @@ -589,7 +589,7 @@ Node* fld::io::Code_Writer::write_static(Node* p) { \param[in] p write this node and all its children \return pointer to the next sibling */ -Node* fld::io::Code_Writer::write_code(Node* p) { +Node* Code_Writer::write_code(Node* p) { // write all code that comes before the children code // (but don't write the last comment until the very end) if (!(p==Fluid.proj.tree.last && p->is_a(FLD_NODE_TYPE_Comment))) { @@ -658,7 +658,7 @@ Node* fld::io::Code_Writer::write_code(Node* p) { \param[in] t filename of the header file \return 0 if the operation failed, 1 if it was successful */ -int fld::io::Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { +int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { write_codeview = to_codeview; unique_id_list.clear(); indentation = 0; @@ -873,7 +873,7 @@ int fld::io::Code_Writer::write_code(const char *s, const char *t, bool to_codev This avoids repeating these words if the mode is already set. \param[in] state 0 for private, 1 for public, 2 for protected */ -void fld::io::Code_Writer::write_public(int state) { +void Code_Writer::write_public(int state) { if (!current_class && !current_widget_class) return; if (current_class && current_class->write_public_state == state) return; if (current_widget_class && current_widget_class->write_public_state == state) return; @@ -889,7 +889,7 @@ void fld::io::Code_Writer::write_public(int state) { /** Create and initialize a new C++ source code writer. */ -fld::io::Code_Writer::Code_Writer(Project &proj) +Code_Writer::Code_Writer(Project &proj) : proj_ { proj } { block_crc_ = crc32(0, 0, 0); @@ -898,7 +898,7 @@ fld::io::Code_Writer::Code_Writer(Project &proj) /** Release all resources. */ -fld::io::Code_Writer::~Code_Writer() +Code_Writer::~Code_Writer() { if (block_buffer_) ::free(block_buffer_); } @@ -911,7 +911,7 @@ fld::io::Code_Writer::~Code_Writer() \param[in] type FD_TAG_GENERIC, FD_TAG_CODE, FD_TAG_MENU_CALLBACK, or FD_TAG_WIDGET_CALLBACK \param[in] uid the unique id of the current type */ -void fld::io::Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_type, unsigned short uid) { +void Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_type, unsigned short uid) { if (proj_.write_mergeback_data) { ::Mergeback::print_tag(code_file, prev_type, next_type, uid, (uint32_t)block_crc_); } @@ -929,7 +929,7 @@ void fld::io::Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_typ if we are the start of a line, used to find leading whitespace \return the new CRC */ -unsigned long fld::io::Code_Writer::block_crc(const void *data, int n, unsigned long in_crc, bool *inout_line_start) { +unsigned long Code_Writer::block_crc(const void *data, int n, unsigned long in_crc, bool *inout_line_start) { if (!data) return 0; if (n==-1) n = (int)strlen((const char*)data); bool line_start = true; @@ -956,7 +956,7 @@ unsigned long fld::io::Code_Writer::block_crc(const void *data, int n, unsigned \param[in] data a pointer to the data block \param[in] n the size of the data in bytes, or -1 to use strlen() */ -void fld::io::Code_Writer::crc_add(const void *data, int n) { +void Code_Writer::crc_add(const void *data, int n) { block_crc_ = block_crc(data, n, block_crc_, &block_line_start_); } @@ -965,7 +965,7 @@ void fld::io::Code_Writer::crc_add(const void *data, int n) { \param[in] format printf style formatting string \return see fprintf(FILE *, *const char*, ...) */ -int fld::io::Code_Writer::crc_printf(const char *format, ...) { +int Code_Writer::crc_printf(const char *format, ...) { va_list args; va_start(args, format); int ret = crc_vprintf(format, args); @@ -979,7 +979,7 @@ int fld::io::Code_Writer::crc_printf(const char *format, ...) { \param[in] args list of arguments \return see fprintf(FILE *, *const char*, ...) */ -int fld::io::Code_Writer::crc_vprintf(const char *format, va_list args) { +int Code_Writer::crc_vprintf(const char *format, va_list args) { if (proj_.write_mergeback_data) { int n = vsnprintf(block_buffer_, block_buffer_size_, format, args); if (n > block_buffer_size_) { @@ -1000,7 +1000,7 @@ int fld::io::Code_Writer::crc_vprintf(const char *format, va_list args) { \param[in] text any text, no requirements to end in a newline or such \return see fputs(const char*, FILE*) */ -int fld::io::Code_Writer::crc_puts(const char *text) { +int Code_Writer::crc_puts(const char *text) { if (proj_.write_mergeback_data) { crc_add(text); } @@ -1009,11 +1009,11 @@ int fld::io::Code_Writer::crc_puts(const char *text) { /** Write a single ASCII character to the code file. If MergeBack is enabled, the CRC calculation is continued. - \note to write UTF-8 characters, use fld::io::Code_Writer::crc_puts(const char *text) + \note to write UTF-8 characters, use Code_Writer::crc_puts(const char *text) \param[in] c any character between 0 and 127 inclusive \return see fputc(int, FILE*) */ -int fld::io::Code_Writer::crc_putc(int c) { +int Code_Writer::crc_putc(int c) { if (proj_.write_mergeback_data) { uchar uc = (uchar)c; crc_add(&uc, 1); diff --git a/fluid/io/Code_Writer.h b/fluid/io/Code_Writer.h index bd99395e5..4b0ed6794 100644 --- a/fluid/io/Code_Writer.h +++ b/fluid/io/Code_Writer.h @@ -74,12 +74,8 @@ struct Fd_Pointer_Set { int is_id(char c); -namespace fld { - class Project; -namespace io { - class Code_Writer { private: @@ -161,7 +157,4 @@ public: static unsigned long block_crc(const void *data, int n=-1, unsigned long in_crc=0, bool *inout_line_start=0); }; -} // namespace io -} // namespace fld - #endif // FLUID_IO_CODE_WRITER_H diff --git a/fluid/io/Project_Reader.cxx b/fluid/io/Project_Reader.cxx index 54baa9a85..043aebcfa 100644 --- a/fluid/io/Project_Reader.cxx +++ b/fluid/io/Project_Reader.cxx @@ -44,7 +44,7 @@ // This file contains code to read and write .fl files. /// If set, we read an old fdesign file and widget y coordinates need to be flipped. -int fld::io::fdesign_flip = 0; +int fdesign_flip = 0; /** \brief Read a .fl project file. @@ -56,7 +56,7 @@ int fld::io::fdesign_flip = 0; \param[in] strategy add new nodes after current or as last child \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::read_file(Project &proj, const char *filename, int merge, Strategy strategy) { +int read_file(Project &proj, const char *filename, int merge, Strategy strategy) { Project_Reader f(proj); strategy.source(Strategy::FROM_FILE); return f.read_project(filename, merge, strategy); @@ -82,7 +82,7 @@ static int hexdigit(int x) { Oh how I wish sometimes we would upgrade to modern C++. \param[in] length minimum length in bytes */ -void fld::io::Project_Reader::expand_buffer(int length) { +void Project_Reader::expand_buffer(int length) { if (length >= buflen) { if (!buflen) { buflen = length+1; @@ -96,13 +96,13 @@ void fld::io::Project_Reader::expand_buffer(int length) { } /** \brief Construct local project reader. */ -fld::io::Project_Reader::Project_Reader(Project &proj) +Project_Reader::Project_Reader(Project &proj) : proj_(proj) { } /** \brief Release project reader resources. */ -fld::io::Project_Reader::~Project_Reader() +Project_Reader::~Project_Reader() { // fname is not copied, so do not free it if (buffer) @@ -114,7 +114,7 @@ fld::io::Project_Reader::~Project_Reader() \param[in] s filename, if 0, read from stdin instead \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::Project_Reader::open_read(const char *s) { +int Project_Reader::open_read(const char *s) { lineno = 1; if (!s) { fin = stdin; @@ -133,7 +133,7 @@ int fld::io::Project_Reader::open_read(const char *s) { Close the .fl file. \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::Project_Reader::close_read() { +int Project_Reader::close_read() { if (fin != stdin) { int x = fclose(fin); fin = 0; @@ -146,7 +146,7 @@ int fld::io::Project_Reader::close_read() { Return the name part of the current filename and path. \return a pointer into a string that is not owned by this class */ -const char *fld::io::Project_Reader::filename_name() { +const char *Project_Reader::filename_name() { return fl_filename_name(fname); } @@ -156,7 +156,7 @@ const char *fld::io::Project_Reader::filename_name() { values, and \\o### octal values. \return a character in the ASCII range */ -int fld::io::Project_Reader::read_quoted() { // read whatever character is after a \ . +int Project_Reader::read_quoted() { // read whatever character is after a \ . int c,d,x; switch(c = nextchar()) { case '\n': lineno++; return -1; @@ -201,7 +201,7 @@ int fld::io::Project_Reader::read_quoted() { // read whatever character is a previous call, and there is no need to waste time searching for them. \return the last node that was created */ -Node *fld::io::Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options) { +Node *Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options) { Fluid.proj.tree.current = p; Node *last_child_read = 0; Node *t = 0; @@ -385,7 +385,7 @@ Node *fld::io::Project_Reader::read_children(Node *p, int merge, Strategy strate \param[in] strategy add new nodes after current or as last child \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::Project_Reader::read_project(const char *filename, int merge, Strategy strategy) { +int Project_Reader::read_project(const char *filename, int merge, Strategy strategy) { Node *o; proj_.undo.suspend(); read_version = 0.0; @@ -435,7 +435,7 @@ int fld::io::Project_Reader::read_project(const char *filename, int merge, Strat operations. \param[in] format printf style format string, followed by an argument list */ -void fld::io::Project_Reader::read_error(const char *format, ...) { +void Project_Reader::read_error(const char *format, ...) { va_list args; va_start(args, format); if (!fin) { // FIXME: this line suppresses any error messages in interactive mode @@ -468,7 +468,7 @@ void fld::io::Project_Reader::read_error(const char *format, ...) { overwrite this buffer. If wantbrace is not set, but we read a leading '{', the returned string will be stripped of its leading and trailing braces. */ -const char *fld::io::Project_Reader::read_word(int wantbrace) { +const char *Project_Reader::read_word(int wantbrace) { int x; // skip all the whitespace before it: @@ -538,7 +538,7 @@ const char *fld::io::Project_Reader::read_word(int wantbrace) { /** Read a word and interpret it as an integer value. \return integer value, or 0 if the word is not an integer */ -int fld::io::Project_Reader::read_int() { +int Project_Reader::read_int() { const char *word = read_word(); if (word) { return atoi(word); @@ -554,7 +554,7 @@ int fld::io::Project_Reader::read_int() { \param[out] value string \return 0 if end of file, else 1 */ -int fld::io::Project_Reader::read_fdesign_line(const char*& name, const char*& value) { +int Project_Reader::read_fdesign_line(const char*& name, const char*& value) { int length = 0; int x; // find a colon: @@ -681,7 +681,7 @@ static void forms_end(Fl_Group *g, int flip) { FLTK widgets. \see http://xforms-toolkit.org */ -void fld::io::Project_Reader::read_fdesign() { +void Project_Reader::read_fdesign() { int fdesign_magic = atoi(read_word()); fdesign_flip = (fdesign_magic < 13000); Widget_Node *window = 0; diff --git a/fluid/io/Project_Reader.h b/fluid/io/Project_Reader.h index fe66be689..a68b7a237 100644 --- a/fluid/io/Project_Reader.h +++ b/fluid/io/Project_Reader.h @@ -26,12 +26,8 @@ class Node; -namespace fld { - class Project; -namespace io { - extern int fdesign_flip; int read_file(Project &proj, const char *, int merge, Strategy strategy=Strategy::FROM_FILE_AS_LAST_CHILD); @@ -77,7 +73,4 @@ public: void read_fdesign(); }; -} // namespace io -} // namespace fld - #endif // FLUID_IO_PROJECT_READER_H diff --git a/fluid/io/Project_Writer.cxx b/fluid/io/Project_Writer.cxx index e2f670f8f..f67a877cb 100644 --- a/fluid/io/Project_Writer.cxx +++ b/fluid/io/Project_Writer.cxx @@ -41,7 +41,7 @@ is used to implement copy and paste. \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::write_file(Project &proj, const char *filename, int selected_only, bool to_codeview) { +int write_file(Project &proj, const char *filename, int selected_only, bool to_codeview) { Project_Writer out(proj); return out.write_project(filename, selected_only, to_codeview); } @@ -49,13 +49,13 @@ int fld::io::write_file(Project &proj, const char *filename, int selected_only, // ---- Project_Writer ---------------------------------------------- MARK: - /** \brief Construct local project writer. */ -fld::io::Project_Writer::Project_Writer(Project &proj) +Project_Writer::Project_Writer(Project &proj) : proj_(proj) { } /** \brief Release project writer resources. */ -fld::io::Project_Writer::~Project_Writer() +Project_Writer::~Project_Writer() { } @@ -65,7 +65,7 @@ fld::io::Project_Writer::~Project_Writer() \param[in] s the filename or 0 for stdout \return 1 if successful. 0 if the operation failed */ -int fld::io::Project_Writer::open_write(const char *s) { +int Project_Writer::open_write(const char *s) { if (!s) { fout = stdout; } else { @@ -81,7 +81,7 @@ int fld::io::Project_Writer::open_write(const char *s) { Don't close, if data was sent to stdout. \return 1 if succeeded, 0 if fclose failed */ -int fld::io::Project_Writer::close_write() { +int Project_Writer::close_write() { if (fout != stdout) { int x = fclose(fout); fout = stdout; @@ -97,7 +97,7 @@ int fld::io::Project_Writer::close_write() { \param[in] sv if set, this file will be used by codeview \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::Project_Writer::write_project(const char *filename, int selected_only, bool sv) { +int Project_Writer::write_project(const char *filename, int selected_only, bool sv) { write_codeview_ = sv; proj_.undo.suspend(); if (!open_write(filename)) { @@ -148,7 +148,7 @@ int fld::io::Project_Writer::write_project(const char *filename, int selected_on Write a string to the .fl file, quoting characters if necessary. \param[in] w NUL terminated text */ -void fld::io::Project_Writer::write_word(const char *w) { +void Project_Writer::write_word(const char *w) { if (needspace) putc(' ', fout); needspace = 1; if (!w || !*w) {fprintf(fout,"{}"); return;} @@ -186,7 +186,7 @@ void fld::io::Project_Writer::write_word(const char *w) { unless the format starts with a newline character \\n. \param[in] format printf style formatting string followed by a list of arguments */ -void fld::io::Project_Writer::write_string(const char *format, ...) { +void Project_Writer::write_string(const char *format, ...) { va_list args; va_start(args, format); if (needspace && *format != '\n') fputc(' ',fout); @@ -199,7 +199,7 @@ void fld::io::Project_Writer::write_string(const char *format, ...) { Start a new line in the .fl file and indent it for a given nesting level. \param[in] n indent level */ -void fld::io::Project_Writer::write_indent(int n) { +void Project_Writer::write_indent(int n) { fputc('\n',fout); while (n--) {fputc(' ',fout); fputc(' ',fout);} needspace = 0; @@ -208,7 +208,7 @@ void fld::io::Project_Writer::write_indent(int n) { /** Write a '{' to the .fl file at the given indenting level. */ -void fld::io::Project_Writer::write_open() { +void Project_Writer::write_open() { if (needspace) fputc(' ',fout); fputc('{',fout); needspace = 0; @@ -218,7 +218,7 @@ void fld::io::Project_Writer::write_open() { Write a '}' to the .fl file at the given indenting level. \param[in] n indent level */ -void fld::io::Project_Writer::write_close(int n) { +void Project_Writer::write_close(int n) { if (needspace) write_indent(n); fputc('}',fout); needspace = 1; diff --git a/fluid/io/Project_Writer.h b/fluid/io/Project_Writer.h index 845f77f1e..cfb3b31c8 100644 --- a/fluid/io/Project_Writer.h +++ b/fluid/io/Project_Writer.h @@ -23,12 +23,8 @@ class Node; -namespace fld { - class Project; -namespace io { - int write_file(Project &proj, const char *, int selected_only = 0, bool to_codeview = false); class Project_Writer @@ -60,7 +56,4 @@ public: bool write_codeview() const { return write_codeview_; } }; -} // namespace io -} // namespace fld - #endif // FLUID_IO_PROJECT_WRITER_H diff --git a/fluid/io/String_Writer.cxx b/fluid/io/String_Writer.cxx index 891fc5a25..dc7424c3d 100644 --- a/fluid/io/String_Writer.cxx +++ b/fluid/io/String_Writer.cxx @@ -58,7 +58,7 @@ static int write_escaped_strings(FILE *out, const char *text) { \param[in] filename file path and name to a file that will hold the strings \return 1 if the file could not be opened for writing, or the result of `fclose`. */ -int fld::io::write_strings(Project &proj, const char *filename) { +int write_strings(Project &proj, const char *filename) { Node *p; Widget_Node *w; int i; diff --git a/fluid/io/String_Writer.h b/fluid/io/String_Writer.h index 8402836c1..428cde33f 100644 --- a/fluid/io/String_Writer.h +++ b/fluid/io/String_Writer.h @@ -17,15 +17,8 @@ #ifndef FLUID_IO_STRING_WRITER_H #define FLUID_IO_STRING_WRITER_H -namespace fld { - class Project; -namespace io { - int write_strings(Project &proj, const char *filename); -} // namespace io -} // namespace fld - #endif // FLUID_IO_STRING_WRITER_H 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; diff --git a/fluid/panels/codeview_panel.cxx b/fluid/panels/codeview_panel.cxx index 728ee986c..37e8b873f 100644 --- a/fluid/panels/codeview_panel.cxx +++ b/fluid/panels/codeview_panel.cxx @@ -171,7 +171,7 @@ void update_codeview_cb(class Fl_Button*, void*) { } if (cv_project->visible_r()) { - fld::io::write_file(Fluid.proj, cv_design_filename, false, true); + write_file(Fluid.proj, cv_design_filename, false, true); int top = cv_project->top_line(); cv_project->buffer()->loadfile(cv_design_filename); cv_project->scroll(top, 0); @@ -181,7 +181,7 @@ void update_codeview_cb(class Fl_Button*, void*) { fl_strlcpy(fn, Fluid.get_tmpdir(), FL_PATH_MAX); fl_strlcat(fn, "strings", FL_PATH_MAX); fl_filename_setext(fn, FL_PATH_MAX, exts[(int)(Fluid.proj.i18n.type)]); - fld::io::write_strings(Fluid.proj, fn); + write_strings(Fluid.proj, fn); int top = cv_strings->top_line(); cv_strings->buffer()->loadfile(fn); cv_strings->scroll(top, 0); @@ -194,7 +194,7 @@ void update_codeview_cb(class Fl_Button*, void*) { Fluid.proj.set_header_file_name(cv_header_filename); // generate the code and load the files - fld::io::Code_Writer f(Fluid.proj); + Code_Writer f(Fluid.proj); // generate files if (f.write_code(cv_source_filename, cv_header_filename, true)) { @@ -271,13 +271,13 @@ Fl_Tabs *cv_tab=(Fl_Tabs *)0; Fl_Group *cv_source_tab=(Fl_Group *)0; -fld::widget::Code_Viewer *cv_source=(fld::widget::Code_Viewer *)0; +Code_Viewer *cv_source=(Code_Viewer *)0; -fld::widget::Code_Viewer *cv_header=(fld::widget::Code_Viewer *)0; +Code_Viewer *cv_header=(Code_Viewer *)0; -fld::widget::Text_Viewer *cv_strings=(fld::widget::Text_Viewer *)0; +Text_Viewer *cv_strings=(Text_Viewer *)0; -fld::widget::Text_Viewer *cv_project=(fld::widget::Text_Viewer *)0; +Text_Viewer *cv_project=(Text_Viewer *)0; Fl_Group *cv_find_row=(Fl_Group *)0; @@ -406,7 +406,7 @@ Fl_Double_Window* make_codeview() { cv_tab->callback((Fl_Callback*)update_codeview_position_cb); { cv_source_tab = new Fl_Group(10, 35, 500, 415, "Source"); cv_source_tab->labelsize(13); - { fld::widget::Code_Viewer* o = cv_source = new fld::widget::Code_Viewer(10, 40, 500, 410); + { Code_Viewer* o = cv_source = new Code_Viewer(10, 40, 500, 410); cv_source->box(FL_DOWN_FRAME); cv_source->color(FL_BACKGROUND2_COLOR); cv_source->selection_color(FL_SELECTION_COLOR); @@ -421,14 +421,14 @@ Fl_Double_Window* make_codeview() { Fl_Group::current()->resizable(cv_source); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Code_Viewer* cv_source + } // Code_Viewer* cv_source cv_source_tab->end(); Fl_Group::current()->resizable(cv_source_tab); } // Fl_Group* cv_source_tab { Fl_Group* o = new Fl_Group(10, 35, 500, 415, "Header"); o->labelsize(13); o->hide(); - { fld::widget::Code_Viewer* o = cv_header = new fld::widget::Code_Viewer(10, 40, 500, 410); + { Code_Viewer* o = cv_header = new Code_Viewer(10, 40, 500, 410); cv_header->box(FL_DOWN_FRAME); cv_header->color(FL_BACKGROUND2_COLOR); cv_header->selection_color(FL_SELECTION_COLOR); @@ -443,13 +443,13 @@ Fl_Double_Window* make_codeview() { Fl_Group::current()->resizable(cv_header); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Code_Viewer* cv_header + } // Code_Viewer* cv_header o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(10, 35, 500, 415, "Strings"); o->labelsize(13); o->hide(); - { fld::widget::Text_Viewer* o = cv_strings = new fld::widget::Text_Viewer(10, 40, 500, 410); + { Text_Viewer* o = cv_strings = new Text_Viewer(10, 40, 500, 410); cv_strings->box(FL_DOWN_FRAME); cv_strings->color(FL_BACKGROUND2_COLOR); cv_strings->selection_color(FL_SELECTION_COLOR); @@ -464,13 +464,13 @@ Fl_Double_Window* make_codeview() { Fl_Group::current()->resizable(cv_strings); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Text_Viewer* cv_strings + } // Text_Viewer* cv_strings o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(10, 35, 500, 415, "Project"); o->labelsize(13); o->hide(); - { fld::widget::Text_Viewer* o = cv_project = new fld::widget::Text_Viewer(10, 40, 500, 410); + { Text_Viewer* o = cv_project = new Text_Viewer(10, 40, 500, 410); cv_project->box(FL_DOWN_FRAME); cv_project->color(FL_BACKGROUND2_COLOR); cv_project->selection_color(FL_SELECTION_COLOR); @@ -485,7 +485,7 @@ Fl_Double_Window* make_codeview() { Fl_Group::current()->resizable(cv_project); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Text_Viewer* cv_project + } // Text_Viewer* cv_project o->end(); } // Fl_Group* o cv_tab->end(); diff --git a/fluid/panels/codeview_panel.fl b/fluid/panels/codeview_panel.fl index 1d5a0cad6..90128afd9 100644 --- a/fluid/panels/codeview_panel.fl +++ b/fluid/panels/codeview_panel.fl @@ -48,13 +48,13 @@ decl {\#include <FL/Fl_Button.H>} {private local decl {\#include "../src/flstring.h"} {private local } -decl {char *cv_source_filename = nullptr;} {private local +decl {char *cv_source_filename = 0;} {private local } -decl {char *cv_header_filename = nullptr;} {private local +decl {char *cv_header_filename = 0;} {private local } -decl {char *cv_design_filename = nullptr;} {private local +decl {char *cv_design_filename = 0;} {private local } decl {int cv_code_choice;} {public local @@ -201,7 +201,7 @@ and load those into the Code Viewer widgets.} open return_type void } if (cv_project->visible_r()) { - fld::io::write_file(Fluid.proj, cv_design_filename, false, true); + write_file(Fluid.proj, cv_design_filename, false, true); int top = cv_project->top_line(); cv_project->buffer()->loadfile(cv_design_filename); cv_project->scroll(top, 0); @@ -211,18 +211,20 @@ and load those into the Code Viewer widgets.} open return_type void fl_strlcpy(fn, Fluid.get_tmpdir().c_str(), 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)]); - fld::io::write_strings(Fluid.proj, fn); + 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); + Code_Writer f(Fluid.proj); // generate files if (f.write_code(cv_source_filename, cv_header_filename, true)) { @@ -238,8 +240,8 @@ and load those into the Code Viewer widgets.} open return_type 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); }} {selected } } @@ -313,7 +315,7 @@ Function {make_codeview()} {open code0 {\#include "widgets/Code_Viewer.h"} code1 {o->linenumber_width(60);} code2 {o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Code_Viewer} + class {Code_Viewer} } } Fl_Group {} { @@ -325,7 +327,7 @@ Function {make_codeview()} {open code0 {\#include "widgets/Code_Viewer.h"} code1 {o->linenumber_width(60);} code2 {o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Code_Viewer} + class {Code_Viewer} } } Fl_Group {} { @@ -337,7 +339,7 @@ Function {make_codeview()} {open code0 {\#include "widgets/Text_Viewer.h"} code1 {o->linenumber_width(60);} code2 {o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Text_Viewer} + class {Text_Viewer} } } Fl_Group {} { @@ -349,7 +351,7 @@ Function {make_codeview()} {open code0 {\#include "widgets/Text_Viewer.h"} code1 {o->linenumber_width(60);} code2 {o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Text_Viewer} + class {Text_Viewer} } } } @@ -362,7 +364,7 @@ Function {make_codeview()} {open } Fl_Input cv_find_text { label {Find:} - callback {Fl_Text_Display *e = nullptr; + callback {Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -384,7 +386,7 @@ if (e) { } Fl_Button {} { label {<<} - callback {Fl_Text_Display *e = nullptr; + callback {Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -410,7 +412,7 @@ if (e) { } Fl_Button {} { label {>>} - callback {Fl_Text_Display *e = nullptr; + callback {Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -437,7 +439,7 @@ if (e) { Fl_Button {} { label Reveal callback {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/codeview_panel.h b/fluid/panels/codeview_panel.h index ba30336df..5c482a54a 100644 --- a/fluid/panels/codeview_panel.h +++ b/fluid/panels/codeview_panel.h @@ -34,11 +34,11 @@ extern Fl_Tabs *cv_tab; #include <FL/Fl_Group.H> extern Fl_Group *cv_source_tab; #include "widgets/Code_Viewer.h" -extern fld::widget::Code_Viewer *cv_source; -extern fld::widget::Code_Viewer *cv_header; +extern Code_Viewer *cv_source; +extern Code_Viewer *cv_header; #include "widgets/Text_Viewer.h" -extern fld::widget::Text_Viewer *cv_strings; -extern fld::widget::Text_Viewer *cv_project; +extern Text_Viewer *cv_strings; +extern Text_Viewer *cv_project; extern Fl_Group *cv_find_row; #include <FL/Fl_Button.H> extern Fl_Button *cv_find_text_case; diff --git a/fluid/panels/function_panel.cxx b/fluid/panels/function_panel.cxx index a5aa35f12..3acebb603 100644 --- a/fluid/panels/function_panel.cxx +++ b/fluid/panels/function_panel.cxx @@ -78,7 +78,7 @@ Fl_Window* make_widgetbin() { o->callback((Fl_Callback*)type_make_cb, (void*)("CodeBlock")); o->image(pixmap[(int)FLD_NODE_TYPE_CodeBlock]); } // Fl_Button* o - { fld::widget::Bin_Window_Button* o = new fld::widget::Bin_Window_Button(55, 46, 24, 24); + { Bin_Window_Button* o = new Bin_Window_Button(55, 46, 24, 24); o->tooltip("Widget Class"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -91,7 +91,7 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Widget_Class]); - } // fld::widget::Bin_Window_Button* o + } // Bin_Window_Button* o { Fl_Button* o = new Fl_Button(5, 71, 24, 24); o->tooltip("Declaration"); o->box(FL_THIN_UP_BOX); @@ -114,7 +114,7 @@ Fl_Window* make_widgetbin() { } // Fl_Group* o { Fl_Group* o = new Fl_Group(87, 19, 79, 79, "Groups"); o->labelsize(12); - { fld::widget::Bin_Window_Button* o = new fld::widget::Bin_Window_Button(89, 21, 24, 24); + { Bin_Window_Button* o = new Bin_Window_Button(89, 21, 24, 24); o->tooltip("Window"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -127,8 +127,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Window]); - } // fld::widget::Bin_Window_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(114, 21, 24, 24); + } // Bin_Window_Button* o + { Bin_Button* o = new Bin_Button(114, 21, 24, 24); o->tooltip("Group"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -141,8 +141,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Group]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(139, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(139, 21, 24, 24); o->tooltip("Pack"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -155,8 +155,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Pack]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(89, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(89, 46, 24, 24); o->tooltip("Tabs"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -169,8 +169,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Tabs]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(114, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(114, 46, 24, 24); o->tooltip("Scroll"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -183,8 +183,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Scroll]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(139, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(139, 46, 24, 24); o->tooltip("Flex"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -197,8 +197,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Flex]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(89, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(89, 71, 24, 24); o->tooltip("Tile"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -211,8 +211,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Tile]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(114, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(114, 71, 24, 24); o->tooltip("Wizard"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -225,8 +225,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Wizard]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(139, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(139, 71, 24, 24); o->tooltip("Grid"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -239,12 +239,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Grid]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(171, 19, 54, 79, "Buttons"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(173, 21, 24, 24); + { Bin_Button* o = new Bin_Button(173, 21, 24, 24); o->tooltip("Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -257,8 +257,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(198, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(198, 21, 24, 24); o->tooltip("Return Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -271,8 +271,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Return_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(173, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(173, 46, 24, 24); o->tooltip("Light Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -285,8 +285,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Light_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(198, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(198, 46, 24, 24); o->tooltip("Repeat Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -299,8 +299,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Repeat_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(173, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(173, 71, 24, 24); o->tooltip("Check Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -313,8 +313,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Check_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(198, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(198, 71, 24, 24); o->tooltip("Round Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -327,12 +327,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Round_Button]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(230, 19, 104, 79, "Valuators"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(232, 21, 24, 24); + { Bin_Button* o = new Bin_Button(232, 21, 24, 24); o->tooltip("Slider"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -345,8 +345,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Slider]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(257, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(257, 21, 24, 24); o->tooltip("Scroll Bar"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -359,8 +359,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Scrollbar]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(282, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(282, 21, 24, 24); o->tooltip("Value Slider"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -373,8 +373,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Value_Slider]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(307, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(307, 21, 24, 24); o->tooltip("Value Output"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -387,8 +387,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Value_Output]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(232, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(232, 46, 24, 24); o->tooltip("Adjuster"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -401,8 +401,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Adjuster]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(257, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(257, 46, 24, 24); o->tooltip("Counter"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -415,8 +415,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Counter]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(282, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(282, 46, 24, 24); o->tooltip("Dial"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -429,8 +429,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Dial]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(232, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(232, 71, 24, 24); o->tooltip("Roller"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -443,8 +443,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Roller]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(257, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(257, 71, 24, 24); o->tooltip("Spinner"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -457,8 +457,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Spinner]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(282, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(282, 71, 24, 24); o->tooltip("Value Input"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -471,12 +471,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Value_Input]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(339, 19, 54, 79, "Text"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(341, 21, 24, 24); + { Bin_Button* o = new Bin_Button(341, 21, 24, 24); o->tooltip("Input"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -489,8 +489,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Input]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(366, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(366, 21, 24, 24); o->tooltip("Output"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -503,8 +503,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Output]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(341, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(341, 46, 24, 24); o->tooltip("Text Edit"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -517,8 +517,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Text_Editor]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(366, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(366, 46, 24, 24); o->tooltip("Text Display"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -531,8 +531,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Text_Display]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(341, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(341, 71, 24, 24); o->tooltip("File Input"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -545,8 +545,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_File_Input]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(366, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(366, 71, 24, 24); o->tooltip("Terminal"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -559,12 +559,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Terminal]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(398, 19, 79, 79, "Menus"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(400, 22, 24, 24); + { Bin_Button* o = new Bin_Button(400, 22, 24, 24); o->tooltip("Input Choice"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -577,8 +577,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Input_Choice]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(425, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(425, 21, 24, 24); o->tooltip("Menu Item"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -591,8 +591,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Item]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(450, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(450, 21, 24, 24); o->tooltip("Menu Bar"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -605,8 +605,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Bar]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(400, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(400, 46, 24, 24); o->tooltip("Menu Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -619,8 +619,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(425, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(425, 46, 24, 24); o->tooltip("Checkbox Menu Item"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -633,8 +633,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Checkbox_Menu_Item]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(450, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(450, 46, 24, 24); o->tooltip("Sub Menu"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -647,8 +647,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Submenu]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(400, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(400, 71, 24, 24); o->tooltip("Choice"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -661,8 +661,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Choice]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(425, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(425, 71, 24, 24); o->tooltip("Radio Menu Item"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -675,12 +675,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Radio_Menu_Item]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(482, 19, 54, 79, "Browsers"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(484, 21, 24, 24); + { Bin_Button* o = new Bin_Button(484, 21, 24, 24); o->tooltip("Browser"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -693,8 +693,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Browser]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(509, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(509, 21, 24, 24); o->tooltip("Tree"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -707,8 +707,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Tree]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(484, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(484, 46, 24, 24); o->tooltip("Check Browser"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -721,8 +721,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Check_Browser]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(509, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(509, 46, 24, 24); o->tooltip("Help Browser"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -735,8 +735,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Help_View]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(484, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(484, 71, 24, 24); o->tooltip("File Browser"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -749,8 +749,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_File_Browser]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(509, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(509, 71, 24, 24); o->tooltip("Table"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -763,12 +763,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Table]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(540, 19, 55, 79, "Misc"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(542, 21, 24, 24); + { Bin_Button* o = new Bin_Button(542, 21, 24, 24); o->tooltip("Box"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -781,8 +781,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Box]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(567, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(567, 21, 24, 24); o->tooltip("Clock"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -795,8 +795,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Clock]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(542, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(542, 46, 24, 24); o->tooltip("Progress"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -809,7 +809,7 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Progress]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o widgetbin_panel->set_non_modal(); diff --git a/fluid/panels/function_panel.fl b/fluid/panels/function_panel.fl index 6bb28907e..4e1010c77 100644 --- a/fluid/panels/function_panel.fl +++ b/fluid/panels/function_panel.fl @@ -105,7 +105,7 @@ else callback type_make_cb tooltip {Widget Class} xywh {55 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Widget_Class]);} - class {fld::widget::Bin_Window_Button} + class {Bin_Window_Button} } Fl_Button {} { user_data {"decl"} @@ -135,63 +135,63 @@ else callback type_make_cb tooltip Window xywh {89 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Window]);} - class {fld::widget::Bin_Window_Button} + class {Bin_Window_Button} } Fl_Button {} { user_data {"Fl_Group"} callback type_make_cb tooltip Group xywh {114 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Group]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Pack"} callback type_make_cb tooltip Pack xywh {139 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Pack]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Tabs"} callback type_make_cb tooltip Tabs xywh {89 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Tabs]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Scroll"} callback type_make_cb tooltip Scroll xywh {114 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Scroll]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Flex"} callback type_make_cb tooltip Flex xywh {139 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Flex]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Tile"} callback type_make_cb tooltip Tile xywh {89 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Tile]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Wizard"} callback type_make_cb tooltip Wizard xywh {114 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Wizard]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Grid"} callback type_make_cb tooltip Grid xywh {139 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Grid]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -203,42 +203,42 @@ else callback type_make_cb tooltip Button xywh {173 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Return_Button"} callback type_make_cb tooltip {Return Button} xywh {198 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Return_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Light_Button"} callback type_make_cb tooltip {Light Button} xywh {173 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Light_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Repeat_Button"} callback type_make_cb tooltip {Repeat Button} xywh {198 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Repeat_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Check_Button"} callback type_make_cb tooltip {Check Button} xywh {173 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Check_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Round_Button"} callback type_make_cb tooltip {Round Button} xywh {198 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Round_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -250,70 +250,70 @@ else callback type_make_cb tooltip Slider xywh {232 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Slider]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Scrollbar"} callback type_make_cb tooltip {Scroll Bar} xywh {257 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Scrollbar]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Value_Slider"} callback type_make_cb tooltip {Value Slider} xywh {282 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Value_Slider]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Value_Output"} callback type_make_cb tooltip {Value Output} xywh {307 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Value_Output]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Adjuster"} callback type_make_cb tooltip Adjuster xywh {232 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Adjuster]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Counter"} callback type_make_cb tooltip Counter xywh {257 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Counter]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Dial"} callback type_make_cb tooltip Dial xywh {282 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Dial]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Roller"} callback type_make_cb tooltip Roller xywh {232 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Roller]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Spinner"} callback type_make_cb tooltip Spinner xywh {257 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Spinner]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Value_Input"} callback type_make_cb tooltip {Value Input} xywh {282 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Value_Input]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -325,42 +325,42 @@ else callback type_make_cb tooltip Input xywh {341 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Input]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Output"} callback type_make_cb tooltip Output xywh {366 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Output]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Text_Editor"} callback type_make_cb tooltip {Text Edit} xywh {341 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Text_Editor]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Text_Display"} callback type_make_cb tooltip {Text Display} xywh {366 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Text_Display]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_File_Input"} callback type_make_cb tooltip {File Input} xywh {341 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_File_Input]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Terminal"} callback type_make_cb tooltip Terminal xywh {366 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Terminal]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -372,56 +372,56 @@ else callback type_make_cb tooltip {Input Choice} xywh {400 22 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Input_Choice]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"menuitem"} callback type_make_cb tooltip {Menu Item} xywh {425 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Item]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Menu_Bar"} callback type_make_cb tooltip {Menu Bar} xywh {450 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Bar]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Menu_Button"} callback type_make_cb tooltip {Menu Button} xywh {400 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"checkmenuitem"} callback type_make_cb tooltip {Checkbox Menu Item} xywh {425 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Checkbox_Menu_Item]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"submenu"} callback type_make_cb tooltip {Sub Menu} xywh {450 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Submenu]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Choice"} callback type_make_cb tooltip Choice xywh {400 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Choice]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"radiomenuitem"} callback type_make_cb tooltip {Radio Menu Item} xywh {425 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Radio_Menu_Item]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -433,42 +433,42 @@ else callback type_make_cb tooltip Browser xywh {484 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Browser]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Tree"} callback type_make_cb tooltip Tree xywh {509 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Tree]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Check_Browser"} callback type_make_cb tooltip {Check Browser} xywh {484 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Check_Browser]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Help_View"} callback type_make_cb tooltip {Help Browser} xywh {509 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Help_View]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_File_Browser"} callback type_make_cb tooltip {File Browser} xywh {484 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_File_Browser]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Table"} callback type_make_cb tooltip Table xywh {509 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Table]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -480,21 +480,21 @@ else callback type_make_cb tooltip Box xywh {542 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Box]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Clock"} callback type_make_cb tooltip Clock xywh {567 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Clock]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Progress"} callback type_make_cb tooltip Progress xywh {542 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Progress]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } } diff --git a/fluid/panels/settings_panel.cxx b/fluid/panels/settings_panel.cxx index 66df11816..1494bd357 100644 --- a/fluid/panels/settings_panel.cxx +++ b/fluid/panels/settings_panel.cxx @@ -544,7 +544,7 @@ 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()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; int i; if (suite.storage_ == FLD_TOOL_STORE_INTERNAL) { w_layout_menu_rename->deactivate(); @@ -572,25 +572,25 @@ static void cb_w_layout_menu_rename(Fl_Menu_*, void*) { } static void cb_w_layout_menu_storage(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_INTERNAL); 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()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_USER); 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()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_PROJECT); 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()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_FILE); Fluid.layout_list->update_dialogs(); } @@ -1122,7 +1122,7 @@ static void cb_Store(Fl_Choice* o, void* v) { int selected = w_settings_shell_list_selected; if (v == LOAD) { if (selected) { - fld::Tool_Store ts = g_shell_config->list[selected-1]->storage; + Tool_Store ts = g_shell_config->list[selected-1]->storage; o->value(o->find_item_with_argument((long)ts)); } else { o->value(o->find_item_with_argument((long)FLD_TOOL_STORE_USER)); @@ -1130,7 +1130,7 @@ static void cb_Store(Fl_Choice* o, void* v) { } else { if (selected) { Fd_Shell_Command *cmd = g_shell_config->list[selected-1]; - fld::Tool_Store ts = (fld::Tool_Store)(o->mvalue()->argument()); + Tool_Store ts = (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); @@ -2447,18 +2447,18 @@ Fl_Choice *w_settings_user_commenttext=(Fl_Choice *)0; static void cb_Reset(Fl_Button* o, void* v) { if (v == LOAD) return; - 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; + 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; o->parent()->do_callback(o->parent(), LOAD); widget_browser->redraw(); widget_browser->save_prefs(); @@ -3423,17 +3423,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_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(271, 112, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_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(322, 112, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::label_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::label_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3449,17 +3449,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_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(271, 137, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_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(322, 137, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::class_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::class_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3475,17 +3475,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_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(271, 162, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_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(322, 162, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::func_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::func_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3501,17 +3501,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_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(271, 187, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_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(322, 187, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::name_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::name_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3527,17 +3527,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_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(271, 212, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_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(322, 212, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::code_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::code_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3553,17 +3553,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*)(&fld::widget::Node_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(271, 237, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_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(322, 237, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_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 86513bafd..00d28e7fd 100644 --- a/fluid/panels/settings_panel.fl +++ b/fluid/panels/settings_panel.fl @@ -98,8 +98,6 @@ decl {\#include "../src/flstring.h"} {private global decl {\#include <string.h>} {private global } -decl {using namespace fld::widget;} {private global -} decl {extern struct Fl_Menu_Item *dbmanager_item;} {public local } @@ -500,10 +498,11 @@ an include guard in header file: 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) +char old_name[256]; +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); @@ -512,7 +511,7 @@ Fluid.layout_list.update_dialogs();} } Fl_Menu_Button w_layout_menu { callback {if (v == LOAD) { - fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + 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(); @@ -530,9 +529,9 @@ Fluid.layout_list.update_dialogs();} label {Rename...} callback {// 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); @@ -541,28 +540,28 @@ Fluid.layout_list.update_dialogs();} } MenuItem {w_layout_menu_storage[0]} { label {@fd_beaker FLUID Built-In} - callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; suite.storage(FLD_TOOL_STORE_INTERNAL); Fluid.layout_list.update_dialogs();} xywh {0 0 31 20} type Radio deactivate } MenuItem {w_layout_menu_storage[1]} { label {@fd_user User Preference} - callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; suite.storage(FLD_TOOL_STORE_USER); Fluid.layout_list.update_dialogs();} xywh {0 0 31 20} type Radio } MenuItem {w_layout_menu_storage[2]} { label {@fd_project Store in .fl Project File} - callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; suite.storage(FLD_TOOL_STORE_PROJECT); Fluid.layout_list.update_dialogs();} xywh {0 0 31 20} type Radio } MenuItem {w_layout_menu_storage[3]} { label {@fd_file Store in External File} - callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; suite.storage(FLD_TOOL_STORE_FILE); Fluid.layout_list.update_dialogs();} xywh {0 0 31 20} type Radio divider @@ -591,13 +590,9 @@ Fluid.layout_list.update_dialogs();} 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()); 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);} xywh {0 0 31 20} divider code0 {\#include <FL/Fl_Native_File_Chooser.H>} @@ -1020,7 +1015,7 @@ if (v==LOAD) { } 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.c_str()); 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); @@ -1179,7 +1174,7 @@ if (v == LOAD) { callback {int selected = w_settings_shell_list_selected; if (v == LOAD) { if (selected) { - fld::Tool_Store ts = g_shell_config->list[selected-1]->storage; + Tool_Store ts = g_shell_config->list[selected-1]->storage; o->value(o->find_item_with_argument((long)ts)); } else { o->value(o->find_item_with_argument((long)FLD_TOOL_STORE_USER)); @@ -1187,7 +1182,7 @@ if (v == LOAD) { } else { if (selected) { Fd_Shell_Command *cmd = g_shell_config->list[selected-1]; - fld::Tool_Store ts = (fld::Tool_Store)(o->mvalue()->argument()); + Tool_Store ts = (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()); @@ -1319,7 +1314,7 @@ if (mi) { 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); }} open tooltip {a list of text replacements available for the shell script} xywh {318 373 22 22} labelsize 12 textsize 12 } { diff --git a/fluid/panels/widget_panel.cxx b/fluid/panels/widget_panel.cxx index 33720b5ac..d7e4ced55 100644 --- a/fluid/panels/widget_panel.cxx +++ b/fluid/panels/widget_panel.cxx @@ -43,7 +43,7 @@ extern void color_common(Fl_Color c); extern void color2_common(Fl_Color c); extern void textcolor_common(Fl_Color c); extern int widget_i; -extern fld::widget::Formula_Input_Vars widget_vars[]; +extern Formula_Input_Vars widget_vars[]; extern int numselected; extern Fl_Menu_Item boxmenu[]; extern int haderror; @@ -91,9 +91,9 @@ static void cb_image_panel_data(Fl_Box* o, void* v) { //fl ▲ ----------=~-=-~-~---~-----------~=--~~~-~~=--~-=--=-= ▲ fl// } -fld::widget::Formula_Input *image_panel_imagew=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_imagew=(Formula_Input *)0; -static void cb_image_panel_imagew(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_imagew(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--~=---~-~=-=~~~-~~- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -124,9 +124,9 @@ static void cb_image_panel_imagew(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~==~=~-~~=~~----------~-~-=-=~~-~=~~-~=~~-~- ▲ fl// } -fld::widget::Formula_Input *image_panel_imageh=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_imageh=(Formula_Input *)0; -static void cb_image_panel_imageh(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_imageh(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~-~=-~~-=-=~~~--~----= ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -233,9 +233,9 @@ static void cb_image_panel_dedata(Fl_Box* o, void* v) { //fl ▲ ----------~=~=-~~---=~------------~~=-~~=-=-=~=~--=--~ ▲ fl// } -fld::widget::Formula_Input *image_panel_deimagew=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_deimagew=(Formula_Input *)0; -static void cb_image_panel_deimagew(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_deimagew(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--=~=~=~=~-=~--=~~=- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -266,9 +266,9 @@ static void cb_image_panel_deimagew(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~=-~--=-=~=~----------~-~-~~--~~-=-==~~==-~= ▲ fl// } -fld::widget::Formula_Input *image_panel_deimageh=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_deimageh=(Formula_Input *)0; -static void cb_image_panel_deimageh(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_deimageh(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~=-=---~-~~-=-=~-~--- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -379,7 +379,7 @@ Fl_Double_Window* make_image_panel() { } // Fl_Box* image_panel_data { Fl_Group* o = new Fl_Group(75, 75, 170, 20); o->callback((Fl_Callback*)propagate_load); - { image_panel_imagew = new fld::widget::Formula_Input(75, 75, 55, 20, "Width:"); + { image_panel_imagew = new Formula_Input(75, 75, 55, 20, "Width:"); image_panel_imagew->tooltip("Scale image to this width in pixel units"); image_panel_imagew->box(FL_DOWN_BOX); image_panel_imagew->color(FL_BACKGROUND2_COLOR); @@ -392,8 +392,8 @@ Fl_Double_Window* make_image_panel() { image_panel_imagew->callback((Fl_Callback*)cb_image_panel_imagew); image_panel_imagew->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_imagew->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_imagew - { image_panel_imageh = new fld::widget::Formula_Input(135, 75, 55, 20, "Height:"); + } // Formula_Input* image_panel_imagew + { image_panel_imageh = new Formula_Input(135, 75, 55, 20, "Height:"); image_panel_imageh->tooltip("Scale image to this height in pixel units"); image_panel_imageh->box(FL_DOWN_BOX); image_panel_imageh->color(FL_BACKGROUND2_COLOR); @@ -406,7 +406,7 @@ Fl_Double_Window* make_image_panel() { image_panel_imageh->callback((Fl_Callback*)cb_image_panel_imageh); image_panel_imageh->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_imageh->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_imageh + } // Formula_Input* image_panel_imageh { Fl_Button* o = new Fl_Button(195, 75, 50, 20, "Reset"); o->tooltip("Reset scale to original size"); o->labelsize(11); @@ -455,7 +455,7 @@ Fl_Double_Window* make_image_panel() { } // Fl_Box* image_panel_dedata { Fl_Group* o = new Fl_Group(75, 215, 170, 20); o->callback((Fl_Callback*)propagate_load); - { image_panel_deimagew = new fld::widget::Formula_Input(75, 215, 55, 20, "Width:"); + { image_panel_deimagew = new Formula_Input(75, 215, 55, 20, "Width:"); image_panel_deimagew->tooltip("Scale image to this width in pixel units"); image_panel_deimagew->box(FL_DOWN_BOX); image_panel_deimagew->color(FL_BACKGROUND2_COLOR); @@ -468,8 +468,8 @@ Fl_Double_Window* make_image_panel() { image_panel_deimagew->callback((Fl_Callback*)cb_image_panel_deimagew); image_panel_deimagew->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_deimagew->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_deimagew - { image_panel_deimageh = new fld::widget::Formula_Input(135, 215, 55, 20, "Height:"); + } // Formula_Input* image_panel_deimagew + { image_panel_deimageh = new Formula_Input(135, 215, 55, 20, "Height:"); image_panel_deimageh->tooltip("Scale image to this height in pixel units"); image_panel_deimageh->box(FL_DOWN_BOX); image_panel_deimageh->color(FL_BACKGROUND2_COLOR); @@ -482,7 +482,7 @@ Fl_Double_Window* make_image_panel() { image_panel_deimageh->callback((Fl_Callback*)cb_image_panel_deimageh); image_panel_deimageh->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_deimageh->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_deimageh + } // Formula_Input* image_panel_deimageh { Fl_Button* o = new Fl_Button(195, 215, 50, 20, "Reset"); o->tooltip("Reset scale to original size"); o->labelsize(11); @@ -719,9 +719,9 @@ Fl_Menu_Item menu_1[] = { {0,0,0,0,0,0,0,0,0} }; -fld::widget::Formula_Input *widget_x_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_x_input=(Formula_Input *)0; -static void cb_widget_x_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_x_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~=-~~~~~~=-~-~~----~- ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -753,9 +753,9 @@ static void cb_widget_x_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------=~=~--~~-=-~----------~~=~=--~~~-=~=~-=~~==- ▲ fl// } -fld::widget::Formula_Input *widget_y_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_y_input=(Formula_Input *)0; -static void cb_widget_y_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_y_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--~=--~-~=-~=~~~=~~= ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -786,9 +786,9 @@ static void cb_widget_y_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~==--=~=--=-----------~~=~--~~=~-~---=~-=-~= ▲ fl// } -fld::widget::Formula_Input *widget_w_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_w_input=(Formula_Input *)0; -static void cb_widget_w_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_w_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ---=~~--~==-=-~-=-~-=~ ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -819,9 +819,9 @@ static void cb_widget_w_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~=~-=~~--~------------~--~-==-~~~~~==-=--=-= ▲ fl// } -fld::widget::Formula_Input *widget_h_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_h_input=(Formula_Input *)0; -static void cb_widget_h_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_h_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback -~-=-==~--~=-~--=----- ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -2342,9 +2342,9 @@ static void cb_wComment(Fl_Text_Editor* o, void* v) { //fl ▲ ----------=~---~~-=--~----------~~-~--=~~~-~~==~~=~~~- ▲ fl// } -fld::widget::Code_Editor *wCallback=(fld::widget::Code_Editor *)0; +Code_Editor *wCallback=(Code_Editor *)0; -static void cb_wCallback(fld::widget::Code_Editor* o, void* v) { +static void cb_wCallback(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ~--~-~-~~-=~~-~=~=-~~= ▼ fl// if (v == LOAD) { const char *cbtext = current_widget->callback(); @@ -2563,9 +2563,6 @@ Fl_Menu_Item menu_7[] = { {"binary: unsigned char[]", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {"text: const char*", 0, 0, (void*)(1), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {"compressed: unsigned char[]", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"binary: std::vector<uint8_t>", 0, 0, (void*)(3), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"text: std::string", 0, 0, (void*)(4), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"compressed: std::vector<uint8_t>", 0, 0, (void*)(5), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {0,0,0,0,0,0,0,0,0} }; @@ -3202,7 +3199,7 @@ static void cb_1b(Fl_Tile* o, void* v) { //fl ▲ ----------=~-=~--~~=~=-----------~~----=--~=~~-~-----= ▲ fl// } -static void cb_Declaration(fld::widget::Code_Editor* o, void* v) { +static void cb_Declaration(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ---==--~~-=-=-~=----=- ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Decl)) return; Decl_Node* nd = (Decl_Node*)current_node; @@ -3331,7 +3328,7 @@ static void cb_code_tabs(Fl_Tabs* o, void* v) { Fl_Group *code_tabs_main=(Fl_Group *)0; -static void cb_1c(fld::widget::Code_Editor* o, void* v) { +static void cb_1c(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ~-=--~=~~==~=~=~-~--=~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Code)) return; Code_Node* nd = (Code_Node*)current_node; @@ -3454,7 +3451,7 @@ static void cb_1f(Fl_Tile* o, void* v) { //fl ▲ ----------=~~=~~-~---~-----------~~----=--~=~~-~-----= ▲ fl// } -static void cb_Function(fld::widget::Code_Editor* o, void* v) { +static void cb_Function(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback --=~=----~=~~-=~-==--~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Function)) return; Function_Node* nd = (Function_Node*)current_node; @@ -3478,7 +3475,7 @@ static void cb_Function(fld::widget::Code_Editor* o, void* v) { //fl ▲ ----------=~=~=-=--~=~-----------~=-=~~~~~-=~~~=-=-~-- ▲ fl// } -static void cb_Return(fld::widget::Code_Editor* o, void* v) { +static void cb_Return(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback -~=--~-~=~=~~~---=~~=~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Function)) return; Function_Node* nd = (Function_Node*)current_node; @@ -3708,7 +3705,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->callback((Fl_Callback*)position_group_cb); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_x_input = new fld::widget::Formula_Input(95, 150, 55, 20, "X:"); + { widget_x_input = new Formula_Input(95, 150, 55, 20, "X:"); widget_x_input->tooltip("The X position of the widget as a number or formula.\nFormulas can be simple " "math, including the variables\nx, px, sx, cx, and i"); widget_x_input->box(FL_DOWN_BOX); @@ -3722,8 +3719,8 @@ Fl_Double_Window* make_widget_panel() { widget_x_input->callback((Fl_Callback*)cb_widget_x_input); widget_x_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_x_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_x_input - { widget_y_input = new fld::widget::Formula_Input(155, 150, 55, 20, "Y:"); + } // Formula_Input* widget_x_input + { widget_y_input = new Formula_Input(155, 150, 55, 20, "Y:"); widget_y_input->tooltip("The Y position of the widget as a number or formula.\nFormulas can be simple " "math, including the variables\ny, py, sy, cy, and i"); widget_y_input->box(FL_DOWN_BOX); @@ -3737,8 +3734,8 @@ Fl_Double_Window* make_widget_panel() { widget_y_input->callback((Fl_Callback*)cb_widget_y_input); widget_y_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_y_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_y_input - { widget_w_input = new fld::widget::Formula_Input(215, 150, 55, 20, "Width:"); + } // Formula_Input* widget_y_input + { widget_w_input = new Formula_Input(215, 150, 55, 20, "Width:"); widget_w_input->tooltip("The width of the widget as a number or formula.\nFormulas can be simple math," " including the variables\nw, pw, sw, cw, and i"); widget_w_input->box(FL_DOWN_BOX); @@ -3752,8 +3749,8 @@ Fl_Double_Window* make_widget_panel() { widget_w_input->callback((Fl_Callback*)cb_widget_w_input); widget_w_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_w_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_w_input - { widget_h_input = new fld::widget::Formula_Input(275, 150, 55, 20, "Height:"); + } // Formula_Input* widget_w_input + { widget_h_input = new Formula_Input(275, 150, 55, 20, "Height:"); widget_h_input->tooltip("The height of the widget as a number or formula.\nFormulas can be simple math" ", including the variables\nh, ph, sh, ch, and i"); widget_h_input->box(FL_DOWN_BOX); @@ -3767,7 +3764,7 @@ Fl_Double_Window* make_widget_panel() { widget_h_input->callback((Fl_Callback*)cb_widget_h_input); widget_h_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_h_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_h_input + } // Formula_Input* widget_h_input { Fl_Choice* o = new Fl_Choice(335, 150, 64, 20, "Children:"); o->tooltip("When instantiating a widget class, the children can either be fixed in their " "original position, automatically be repositioned, or both repsositioned and re" @@ -4371,7 +4368,7 @@ Fl_Double_Window* make_widget_panel() { } // Fl_Group* o { Fl_Group* o = new Fl_Group(95, 223, 310, 82); o->box(FL_FLAT_BOX); - { wCallback = new fld::widget::Code_Editor(95, 225, 310, 80, "Callback:"); + { wCallback = new Code_Editor(95, 225, 310, 80, "Callback:"); wCallback->tooltip("The callback function or code for the widget. Use the variable name \'o\' to " "access the Widget pointer and \'v\' to access the user value."); wCallback->box(FL_DOWN_BOX); @@ -4387,7 +4384,7 @@ Fl_Double_Window* make_widget_panel() { wCallback->align(Fl_Align(FL_ALIGN_LEFT)); wCallback->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(wCallback); - } // fld::widget::Code_Editor* wCallback + } // Code_Editor* wCallback o->end(); } // Fl_Group* o o->end(); @@ -4825,7 +4822,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 75, 310, 100, "Declaration:"); + { Code_Editor* o = new Code_Editor(95, 75, 310, 100, "Declaration:"); o->tooltip("a declaration: `int x;`, an external symbol: `extern int foo();`,\na `#` dire" "ctive: `#include <foo.h>`, a typedef `typedef char byte;`,\n or a `using` stat" "ement, etc."); @@ -4842,7 +4839,7 @@ Fl_Double_Window* make_widget_panel() { o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 180, 390, 105); @@ -4924,7 +4921,7 @@ Fl_Double_Window* make_widget_panel() { { code_tabs_main = new Fl_Group(10, 30, 400, 330, "Code"); code_tabs_main->labelsize(11); code_tabs_main->callback((Fl_Callback*)propagate_load); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(15, 40, 390, 315); + { Code_Editor* o = new Code_Editor(15, 40, 390, 315); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -4940,7 +4937,7 @@ Fl_Double_Window* make_widget_panel() { Fl_Group::current()->resizable(o); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Code_Editor* o + } // Code_Editor* o code_tabs_main->end(); Fl_Group::current()->resizable(code_tabs_main); } // Fl_Group* code_tabs_main @@ -4998,7 +4995,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 100, 310, 50, "Function\nName and\nArgs:"); + { Code_Editor* o = new Code_Editor(95, 100, 310, 50, "Function\nName and\nArgs:"); o->tooltip("function name and args, or blank for `main(..)`"); o->box(FL_DOWN_FRAME); o->color(FL_BACKGROUND2_COLOR); @@ -5013,7 +5010,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 155, 390, 60); @@ -5022,7 +5019,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 160, 310, 50, "Return Type:"); + { Code_Editor* o = new Code_Editor(95, 160, 310, 50, "Return Type:"); o->tooltip("return type, or blank to return outermost widget"); o->box(FL_DOWN_FRAME); o->color(FL_BACKGROUND2_COLOR); @@ -5037,7 +5034,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 215, 390, 105); diff --git a/fluid/panels/widget_panel.fl b/fluid/panels/widget_panel.fl index 0fb788ff2..a98916654 100644 --- a/fluid/panels/widget_panel.fl +++ b/fluid/panels/widget_panel.fl @@ -84,7 +84,7 @@ decl {\#include <ctype.h>} {uid 43de private global decl {\#include <stdlib.h> // free()} {uid 053c private global } -decl {\#include <functional> // std::function} {uid 29a1 private global +decl {\#include <string.h>} {uid 29a1 private global } decl {\#define ZERO_ENTRY 1000} {uid e18b private global @@ -99,7 +99,7 @@ extern void color_common(Fl_Color c); extern void color2_common(Fl_Color c); extern void textcolor_common(Fl_Color c); extern int widget_i; -extern fld::widget::Formula_Input_Vars widget_vars[];} {uid 81c9 private global +extern Formula_Input_Vars widget_vars[];} {uid 81c9 private global } decl {extern int numselected; @@ -116,32 +116,34 @@ Function {use_tab_navigation(int, Fl_Text_Editor*)} {uid 42b9 } } -Function {update_current(Fl_Input* o, void *v, - std::function<std::string()> getter, - std::function<void(std::string)> setter)} {uid a6e0 open private return_type void +Function {update_current_input(Fl_Input* o, void *v, + const char *cur_val, void (*setter_fn)(void*, const char*), void *nd)} {uid a6e0 open private return_type void } { code {if (v == LOAD) { - o->value( getter().c_str() ); + o->value(cur_val ? cur_val : ""); } else { - std::string v = o->value(); - if (v != getter()) { - setter(v); + const char *nv = o->value(); + if (!cur_val) cur_val = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur_val) != 0) { + setter_fn(nd, nv); Fluid.proj.set_modflag(1); } }} {uid e438 } } -Function {update_current(Fl_Text_Editor* o, void *v, - std::function<std::string()> getter, - std::function<void(std::string)> setter)} {uid 7c05 open private return_type void +Function {update_current_editor(Fl_Text_Editor* o, void *v, + const char *cur_val, void (*setter_fn)(void*, const char*), void *nd)} {uid 7c05 open private return_type void } { code {if (v == LOAD) { - o->buffer()->text( getter().c_str() ); + o->buffer()->text(cur_val ? cur_val : ""); } else { - std::string v = o->buffer()->text(); - if (v != getter()) { - setter(v); + const char *nv = o->buffer()->text(); + if (!cur_val) cur_val = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur_val) != 0) { + setter_fn(nd, nv); Fluid.proj.set_modflag(1); } }} {uid c364 @@ -217,7 +219,7 @@ Function {make_image_panel()} {uid b832 if (mod) Fluid.proj.set_modflag(1); }} tooltip {Scale image to this width in pixel units} xywh {75 75 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input image_panel_imageh {uid e676 label {Height:} @@ -247,7 +249,7 @@ Function {make_image_panel()} {uid b832 if (mod) Fluid.proj.set_modflag(1); }} tooltip {Scale image to this height in pixel units} xywh {135 75 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Button {} {uid 4df5 label Reset @@ -367,7 +369,7 @@ Function {make_image_panel()} {uid b832 if (mod) Fluid.proj.set_modflag(1); }} tooltip {Scale image to this width in pixel units} xywh {75 215 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input image_panel_deimageh {uid c6c4 label {Height:} @@ -397,7 +399,7 @@ Function {make_image_panel()} {uid b832 if (mod) Fluid.proj.set_modflag(1); }} tooltip {Scale image to this height in pixel units} xywh {135 215 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Button {} {uid a381 label Reset @@ -850,7 +852,7 @@ Use Ctrl-J for newlines.} xywh {95 40 190 20} labelfont 1 labelsize 11 when 15 t tooltip {The X position of the widget as a number or formula. Formulas can be simple math, including the variables x, px, sx, cx, and i} xywh {95 150 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input widget_y_input {uid 5985 label {Y:} @@ -883,7 +885,7 @@ x, px, sx, cx, and i} xywh {95 150 55 20} labelsize 11 align 5 textsize 11 tooltip {The Y position of the widget as a number or formula. Formulas can be simple math, including the variables y, py, sy, cy, and i} xywh {155 150 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input widget_w_input {uid 2e88 label {Width:} @@ -916,7 +918,7 @@ y, py, sy, cy, and i} xywh {155 150 55 20} labelsize 11 align 5 textsize 11 tooltip {The width of the widget as a number or formula. Formulas can be simple math, including the variables w, pw, sw, cw, and i} xywh {215 150 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input widget_h_input {uid 2382 label {Height:} @@ -949,7 +951,7 @@ w, pw, sw, cw, and i} xywh {215 150 55 20} labelsize 11 align 5 textsize 11 tooltip {The height of the widget as a number or formula. Formulas can be simple math, including the variables h, ph, sh, ch, and i} xywh {275 150 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Choice {} {uid 4f6a label {Children:} @@ -2495,7 +2497,7 @@ wCallback->do_callback(wCallback, v);} open }} tooltip {The callback function or code for the widget. Use the variable name 'o' to access the Widget pointer and 'v' to access the user value.} xywh {95 225 310 80} box DOWN_BOX labelfont 1 labelsize 11 align 4 textfont 4 textsize 11 resizable code0 {\#include "widgets/Code_Editor.h"} - class {fld::widget::Code_Editor} + class {Code_Editor} } } } @@ -2737,21 +2739,6 @@ if (v == LOAD) { user_data 2 user_data_type long xywh {10 10 100 20} labelsize 11 } - MenuItem {} {uid a638 - label {binary: std::vector<uint8_t>} - user_data 3 user_data_type long - xywh {10 10 100 20} labelsize 11 - } - MenuItem {} {uid c0e7 - label {text: std::string} - user_data 4 user_data_type long - xywh {10 10 100 20} labelsize 11 - } - MenuItem {} {uid 8d7a - label {compressed: std::vector<uint8_t>} - user_data 5 user_data_type long - xywh {10 10 100 20} labelsize 11 - } } Fl_Box {} {uid 4a0a xywh {363 75 42 20} resizable @@ -2781,10 +2768,18 @@ if (v == LOAD) { label {Filename:} callback {if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Data)) return; Data_Node* nd = (Data_Node*)current_node; -update_current(o, v, - [nd](){return nd->filename();}, - [nd](std::string s){nd->filename(s);} -);} +if (v == LOAD) { + o->value(nd->filename() ? nd->filename() : ""); +} else { + const char *nv = o->value(); + const char *cur = nd->filename(); + if (!cur) cur = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur) != 0) { + nd->filename(nv); + Fluid.proj.set_modflag(1); + } +}} tooltip {name and path of file that will be inlined} xywh {95 125 270 20} labelfont 1 labelsize 11 align 132 textfont 4 textsize 11 resizable } Fl_Button {} {uid a0fe @@ -3196,10 +3191,18 @@ if (v == LOAD) { label {End Code:} callback {if (!current_node || !current_node->is_a(FLD_NODE_TYPE_DeclBlock)) return; DeclBlock_Node* nd = (DeclBlock_Node*)current_node; -update_current(o, v, - [nd](){return nd->end_code();}, - [nd](std::string s){nd->end_code(s);} -);} +if (v == LOAD) { + o->value(nd->end_code() ? nd->end_code() : ""); +} else { + const char *nv = o->value(); + const char *cur = nd->end_code(); + if (!cur) cur = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur) != 0) { + nd->end_code(nv); + Fluid.proj.set_modflag(1); + } +}} tooltip {`\#endif` or similar declaration code block} xywh {95 75 305 20} labelfont 1 labelsize 11 textfont 4 textsize 11 } Fl_Group {} {uid 9b63 @@ -3456,7 +3459,7 @@ a `\#` directive: `\#include <foo.h>`, a typedef `typedef char byte;`, or a `using` statement, etc.} xywh {95 75 310 100} labelfont 1 labelsize 11 align 132 textsize 11 resizable code0 {\#include "widgets/Code_Editor.h"} code1 {o->add_key_binding(FL_Tab, 0, use_tab_navigation);} - class {fld::widget::Code_Editor} + class {Code_Editor} } } Fl_Group {} {uid 160e @@ -3525,10 +3528,18 @@ if (v == LOAD) { label {End Code:} callback {if (!current_node || !current_node->is_a(FLD_NODE_TYPE_CodeBlock)) return; CodeBlock_Node* nd = (CodeBlock_Node*)current_node; -update_current(o, v, - [nd](){return nd->end_code();}, - [nd](std::string s){nd->end_code(s);} -);} +if (v == LOAD) { + o->value(nd->end_code() ? nd->end_code() : ""); +} else { + const char *nv = o->value(); + const char *cur = nd->end_code(); + if (!cur) cur = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur) != 0) { + nd->end_code(nv); + Fluid.proj.set_modflag(1); + } +}} tooltip {condition end: `while (x==1);`, or empty} xywh {95 75 305 20} labelfont 1 labelsize 11 textfont 4 textsize 11 } Fl_Text_Editor {} {uid 13f0 @@ -3595,7 +3606,7 @@ Code_Node* nd = (Code_Node*)current_node; code1 {\#include "widgets/Code_Editor.h"} code2 {o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Code_Editor} + class {Code_Editor} } } } @@ -3743,7 +3754,7 @@ if (v == LOAD) { tooltip {function name and args, or blank for `main(..)`} xywh {95 100 310 50} labelfont 1 labelsize 11 align 132 textsize 11 resizable code0 {\#include "widgets/Code_Editor.h"} code1 {o->add_key_binding(FL_Tab, 0, use_tab_navigation);} - class {fld::widget::Code_Editor} + class {Code_Editor} } } Fl_Group {} {uid 3cb7 @@ -3754,14 +3765,22 @@ if (v == LOAD) { label {Return Type:} callback {if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Function)) return; Function_Node* nd = (Function_Node*)current_node; -update_current(o, v, - [nd](){return nd->return_type();}, - [nd](std::string s){nd->return_type(s);} -);} +if (v == LOAD) { + o->buffer()->text(nd->return_type() ? nd->return_type() : ""); +} else { + const char *nv = o->buffer()->text(); + const char *cur = nd->return_type(); + if (!cur) cur = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur) != 0) { + nd->return_type(nv); + Fluid.proj.set_modflag(1); + } +}} tooltip {return type, or blank to return outermost widget} xywh {95 160 310 50} labelfont 1 labelsize 11 align 132 textsize 11 resizable code0 {\#include "widgets/Code_Editor.h"} code1 {o->add_key_binding(FL_Tab, 0, use_tab_navigation);} - class {fld::widget::Code_Editor} + class {Code_Editor} } } Fl_Group {} {uid 01de diff --git a/fluid/panels/widget_panel.h b/fluid/panels/widget_panel.h index 98d1066b7..48462350d 100644 --- a/fluid/panels/widget_panel.h +++ b/fluid/panels/widget_panel.h @@ -31,14 +31,14 @@ extern Fl_Group *image_panel_imagegroup; #include <FL/Fl_Box.H> #include <FL/Fl_Shared_Image.H> extern Fl_Box *image_panel_data; -extern fld::widget::Formula_Input *image_panel_imagew; -extern fld::widget::Formula_Input *image_panel_imageh; +extern Formula_Input *image_panel_imagew; +extern Formula_Input *image_panel_imageh; #include <FL/Fl_Button.H> #include <FL/Fl_Check_Button.H> extern Fl_Group *image_panel_deimagegroup; extern Fl_Box *image_panel_dedata; -extern fld::widget::Formula_Input *image_panel_deimagew; -extern fld::widget::Formula_Input *image_panel_deimageh; +extern Formula_Input *image_panel_deimagew; +extern Formula_Input *image_panel_deimageh; extern Fl_Button *image_panel_close; Fl_Double_Window* make_image_panel(); void run_image_panel(); @@ -61,10 +61,10 @@ extern void align_cb(Fl_Button*, void*); extern void align_text_image_cb(Fl_Choice*, void*); extern void align_position_cb(Fl_Choice*, void*); extern void position_group_cb(Fl_Group*, void*); -extern fld::widget::Formula_Input *widget_x_input; -extern fld::widget::Formula_Input *widget_y_input; -extern fld::widget::Formula_Input *widget_w_input; -extern fld::widget::Formula_Input *widget_h_input; +extern Formula_Input *widget_x_input; +extern Formula_Input *widget_y_input; +extern Formula_Input *widget_w_input; +extern Formula_Input *widget_h_input; extern Fl_Group *wp_gui_flexp; #include <FL/Fl_Value_Input.H> extern Fl_Value_Input *widget_flex_size; @@ -100,7 +100,7 @@ extern Fl_Input *v_input[4]; #include <FL/Fl_Text_Editor.H> extern Fl_Text_Editor *wComment; #include "widgets/Code_Editor.h" -extern fld::widget::Code_Editor *wCallback; +extern Code_Editor *wCallback; extern Fl_Group *wp_cpp_callback; extern Fl_Menu_Item whenmenu[]; #include <FL/Fl_Input_Choice.H> diff --git a/fluid/panels/widget_panel/Grid_Child_Tab.cxx b/fluid/panels/widget_panel/Grid_Child_Tab.cxx index 674b17bd7..a1d72b9f6 100644 --- a/fluid/panels/widget_panel/Grid_Child_Tab.cxx +++ b/fluid/panels/widget_panel/Grid_Child_Tab.cxx @@ -6,11 +6,11 @@ #include "nodes/Grid_Node.h" extern Grid_Child_Tab *widget_tab_grid_child; -void Grid_Child_Tab::cb_widget_grid_row_input_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_row_input_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 8); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD); } -void Grid_Child_Tab::cb_widget_grid_row_input(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_row_input(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_widget_grid_row_input_i(o,v); } @@ -34,11 +34,11 @@ void Grid_Child_Tab::cb_1(Fl_Button* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()->parent()))->cb_1_i(o,v); } -void Grid_Child_Tab::cb_widget_grid_col_input_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_col_input_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 9); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD); } -void Grid_Child_Tab::cb_widget_grid_col_input(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_col_input(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_widget_grid_col_input_i(o,v); } @@ -174,25 +174,25 @@ Fl_Menu_Item Grid_Child_Tab::menu_Vertical[] = { {0,0,0,0,0,0,0,0,0} }; -void Grid_Child_Tab::cb_Width_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_Width_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 12); } -void Grid_Child_Tab::cb_Width(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_Width(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_Width_i(o,v); } -void Grid_Child_Tab::cb_Height_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_Height_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 13); } -void Grid_Child_Tab::cb_Height(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_Height(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_Height_i(o,v); } -void Grid_Child_Tab::cb_widget_grid_rowspan_input_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_rowspan_input_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 10); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD); } -void Grid_Child_Tab::cb_widget_grid_rowspan_input(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_rowspan_input(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_widget_grid_rowspan_input_i(o,v); } @@ -216,11 +216,11 @@ void Grid_Child_Tab::cb_5(Fl_Button* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()->parent()))->cb_5_i(o,v); } -void Grid_Child_Tab::cb_widget_grid_colspan_input_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_colspan_input_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 11); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD); } -void Grid_Child_Tab::cb_widget_grid_colspan_input(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_colspan_input(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_widget_grid_colspan_input_i(o,v); } @@ -255,7 +255,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_row_input = new fld::widget::Formula_Input(85, 30, 40, 20, "Row:"); + { widget_grid_row_input = new Formula_Input(85, 30, 40, 20, "Row:"); widget_grid_row_input->box(FL_DOWN_BOX); widget_grid_row_input->color(FL_BACKGROUND2_COLOR); widget_grid_row_input->selection_color(FL_SELECTION_COLOR); @@ -267,7 +267,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_row_input->callback((Fl_Callback*)cb_widget_grid_row_input); widget_grid_row_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_row_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_row_input + } // Formula_Input* widget_grid_row_input { Fl_Group* o = new Fl_Group(125, 30, 30, 20); { Fl_Button* o = new Fl_Button(125, 30, 15, 20, "-"); o->compact(1); @@ -283,7 +283,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Button* o o->end(); } // Fl_Group* o - { widget_grid_col_input = new fld::widget::Formula_Input(165, 30, 40, 20, "Column:"); + { widget_grid_col_input = new Formula_Input(165, 30, 40, 20, "Column:"); widget_grid_col_input->box(FL_DOWN_BOX); widget_grid_col_input->color(FL_BACKGROUND2_COLOR); widget_grid_col_input->selection_color(FL_SELECTION_COLOR); @@ -295,7 +295,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_col_input->callback((Fl_Callback*)cb_widget_grid_col_input); widget_grid_col_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_col_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_col_input + } // Formula_Input* widget_grid_col_input { Fl_Group* o = new Fl_Group(205, 30, 30, 20); { Fl_Button* o = new Fl_Button(205, 30, 15, 20, "-"); o->compact(1); @@ -359,7 +359,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : wp_gridc_size->labelsize(11); wp_gridc_size->callback((Fl_Callback*)propagate_load); wp_gridc_size->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(85, 105, 55, 20, "Width:"); + { Formula_Input* o = new Formula_Input(85, 105, 55, 20, "Width:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -371,8 +371,8 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Width); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(145, 105, 55, 20, "Height:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(145, 105, 55, 20, "Height:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -384,7 +384,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Height); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o + } // Formula_Input* o { Fl_Box* o = new Fl_Box(385, 105, 1, 20); o->hide(); Fl_Group::current()->resizable(o); @@ -396,7 +396,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_rowspan_input = new fld::widget::Formula_Input(85, 140, 40, 20, "Row Span:"); + { widget_grid_rowspan_input = new Formula_Input(85, 140, 40, 20, "Row Span:"); widget_grid_rowspan_input->box(FL_DOWN_BOX); widget_grid_rowspan_input->color(FL_BACKGROUND2_COLOR); widget_grid_rowspan_input->selection_color(FL_SELECTION_COLOR); @@ -408,7 +408,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_rowspan_input->callback((Fl_Callback*)cb_widget_grid_rowspan_input); widget_grid_rowspan_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_rowspan_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_rowspan_input + } // Formula_Input* widget_grid_rowspan_input { Fl_Group* o = new Fl_Group(125, 140, 30, 20); { Fl_Button* o = new Fl_Button(125, 140, 15, 20, "-"); o->compact(1); @@ -424,7 +424,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Button* o o->end(); } // Fl_Group* o - { widget_grid_colspan_input = new fld::widget::Formula_Input(165, 140, 40, 20, "Col. Span:"); + { widget_grid_colspan_input = new Formula_Input(165, 140, 40, 20, "Col. Span:"); widget_grid_colspan_input->box(FL_DOWN_BOX); widget_grid_colspan_input->color(FL_BACKGROUND2_COLOR); widget_grid_colspan_input->selection_color(FL_SELECTION_COLOR); @@ -436,7 +436,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_colspan_input->callback((Fl_Callback*)cb_widget_grid_colspan_input); widget_grid_colspan_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_colspan_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_colspan_input + } // Formula_Input* widget_grid_colspan_input { Fl_Group* o = new Fl_Group(205, 140, 30, 20); { Fl_Button* o = new Fl_Button(205, 140, 15, 20, "-"); o->compact(1); @@ -467,7 +467,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : resize(X, Y, W, H); } -void Grid_Child_Tab::grid_child_cb(fld::widget::Formula_Input* i, void* v, int what) { +void Grid_Child_Tab::grid_child_cb(Formula_Input* i, void* v, int what) { if ( !current_widget || !current_widget->parent || !current_widget->parent->is_a(FLD_NODE_TYPE_Grid)) diff --git a/fluid/panels/widget_panel/Grid_Child_Tab.fl b/fluid/panels/widget_panel/Grid_Child_Tab.fl index 4bd3744d6..dc6b0a5e7 100644 --- a/fluid/panels/widget_panel/Grid_Child_Tab.fl +++ b/fluid/panels/widget_panel/Grid_Child_Tab.fl @@ -33,7 +33,7 @@ widget_class Grid_Child_Tab { callback {grid_child_cb(o, v, 8); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD);} xywh {85 30 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {125 30 30 20} @@ -62,7 +62,7 @@ widget_class Grid_Child_Tab { callback {grid_child_cb(o, v, 9); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD);} xywh {165 30 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {205 30 30 20} @@ -243,13 +243,13 @@ widget_class Grid_Child_Tab { label {Width:} callback {grid_child_cb(o, v, 12);} xywh {85 105 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Height:} callback {grid_child_cb(o, v, 13);} xywh {145 105 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Box {} { xywh {385 105 1 20} hide resizable @@ -265,7 +265,7 @@ widget_class Grid_Child_Tab { callback {grid_child_cb(o, v, 10); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD);} xywh {85 140 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {125 140 30 20} @@ -294,7 +294,7 @@ widget_class Grid_Child_Tab { callback {grid_child_cb(o, v, 11); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD);} xywh {165 140 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {205 140 30 20} @@ -325,7 +325,7 @@ widget_class Grid_Child_Tab { Fl_Box {} { xywh {85 320 300 5} labelsize 11 hide resizable } - Function {grid_child_cb(fld::widget::Formula_Input* i, void* v, int what)} {open return_type void + Function {grid_child_cb(Formula_Input* i, void* v, int what)} {open return_type void } { code {if ( !current_widget || !current_widget->parent diff --git a/fluid/panels/widget_panel/Grid_Child_Tab.h b/fluid/panels/widget_panel/Grid_Child_Tab.h index 93cfda78b..6970c69bd 100644 --- a/fluid/panels/widget_panel/Grid_Child_Tab.h +++ b/fluid/panels/widget_panel/Grid_Child_Tab.h @@ -13,19 +13,19 @@ extern void propagate_load(Fl_Group*, void*); class Grid_Child_Tab : public Fl_Group { public: Grid_Child_Tab(int X, int Y, int W, int H, const char *L = 0); - fld::widget::Formula_Input *widget_grid_row_input; + Formula_Input *widget_grid_row_input; private: - inline void cb_widget_grid_row_input_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_row_input(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_row_input_i(Formula_Input*, void*); + static void cb_widget_grid_row_input(Formula_Input*, void*); inline void cb__i(Fl_Button*, void*); static void cb_(Fl_Button*, void*); inline void cb_1_i(Fl_Button*, void*); static void cb_1(Fl_Button*, void*); public: - fld::widget::Formula_Input *widget_grid_col_input; + Formula_Input *widget_grid_col_input; private: - inline void cb_widget_grid_col_input_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_col_input(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_col_input_i(Formula_Input*, void*); + static void cb_widget_grid_col_input(Formula_Input*, void*); inline void cb_2_i(Fl_Button*, void*); static void cb_2(Fl_Button*, void*); inline void cb_3_i(Fl_Button*, void*); @@ -51,29 +51,29 @@ private: public: Fl_Group *wp_gridc_size; private: - inline void cb_Width_i(fld::widget::Formula_Input*, void*); - static void cb_Width(fld::widget::Formula_Input*, void*); - inline void cb_Height_i(fld::widget::Formula_Input*, void*); - static void cb_Height(fld::widget::Formula_Input*, void*); + inline void cb_Width_i(Formula_Input*, void*); + static void cb_Width(Formula_Input*, void*); + inline void cb_Height_i(Formula_Input*, void*); + static void cb_Height(Formula_Input*, void*); public: - fld::widget::Formula_Input *widget_grid_rowspan_input; + Formula_Input *widget_grid_rowspan_input; private: - inline void cb_widget_grid_rowspan_input_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_rowspan_input(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_rowspan_input_i(Formula_Input*, void*); + static void cb_widget_grid_rowspan_input(Formula_Input*, void*); inline void cb_4_i(Fl_Button*, void*); static void cb_4(Fl_Button*, void*); inline void cb_5_i(Fl_Button*, void*); static void cb_5(Fl_Button*, void*); public: - fld::widget::Formula_Input *widget_grid_colspan_input; + Formula_Input *widget_grid_colspan_input; private: - inline void cb_widget_grid_colspan_input_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_colspan_input(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_colspan_input_i(Formula_Input*, void*); + static void cb_widget_grid_colspan_input(Formula_Input*, void*); inline void cb_6_i(Fl_Button*, void*); static void cb_6(Fl_Button*, void*); inline void cb_7_i(Fl_Button*, void*); static void cb_7(Fl_Button*, void*); public: - void grid_child_cb(fld::widget::Formula_Input* i, void* v, int what); + void grid_child_cb(Formula_Input* i, void* v, int what); }; #endif diff --git a/fluid/panels/widget_panel/Grid_Tab.cxx b/fluid/panels/widget_panel/Grid_Tab.cxx index 4730f0789..2540d95a5 100644 --- a/fluid/panels/widget_panel/Grid_Tab.cxx +++ b/fluid/panels/widget_panel/Grid_Tab.cxx @@ -6,7 +6,7 @@ #include "nodes/Grid_Node.h" extern Grid_Tab *widget_tab_grid; -void Grid_Tab::cb_widget_grid_rows_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_rows_i(Formula_Input* o, void* v) { // grid_rows_cb Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; @@ -31,7 +31,7 @@ void Grid_Tab::cb_widget_grid_rows_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_widget_grid_rows(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_rows(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_rows_i(o,v); } @@ -55,7 +55,7 @@ void Grid_Tab::cb_1(Fl_Button* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_1_i(o,v); } -void Grid_Tab::cb_widget_grid_cols_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_cols_i(Formula_Input* o, void* v) { // grid_rows_cb Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; @@ -80,7 +80,7 @@ void Grid_Tab::cb_widget_grid_cols_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_widget_grid_cols(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_cols(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_cols_i(o,v); } @@ -250,7 +250,7 @@ void Grid_Tab::cb_Row1(Fl_Group* o, void* v) { ((Grid_Tab*)(o->parent()))->cb_Row1_i(o,v); } -void Grid_Tab::cb_widget_grid_curr_row_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_curr_row_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int r = o->value(), old_r = r; @@ -263,7 +263,7 @@ void Grid_Tab::cb_widget_grid_curr_row_i(fld::widget::Formula_Input* o, void* v) widget_grid_curr_row_attributes->do_callback(widget_grid_curr_row_attributes, LOAD); } } -void Grid_Tab::cb_widget_grid_curr_row(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_curr_row(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_curr_row_i(o,v); } @@ -287,7 +287,7 @@ void Grid_Tab::cb_5(Fl_Button* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_5_i(o,v); } -void Grid_Tab::cb_Height_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Height_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int r = widget_grid_curr_row->value(); @@ -304,11 +304,11 @@ void Grid_Tab::cb_Height_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Height(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Height(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Height_i(o,v); } -void Grid_Tab::cb_Weight_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Weight_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int r = widget_grid_curr_row->value(); @@ -325,11 +325,11 @@ void Grid_Tab::cb_Weight_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Weight(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Weight(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Weight_i(o,v); } -void Grid_Tab::cb_Gap_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Gap_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int r = widget_grid_curr_row->value(); @@ -346,11 +346,11 @@ void Grid_Tab::cb_Gap_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Gap(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Gap(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Gap_i(o,v); } -void Grid_Tab::cb_widget_grid_curr_col_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_curr_col_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int c = o->value(), old_c = c; @@ -363,7 +363,7 @@ void Grid_Tab::cb_widget_grid_curr_col_i(fld::widget::Formula_Input* o, void* v) widget_grid_curr_col_attributes->do_callback(widget_grid_curr_col_attributes, LOAD); } } -void Grid_Tab::cb_widget_grid_curr_col(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_curr_col(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_curr_col_i(o,v); } @@ -387,7 +387,7 @@ void Grid_Tab::cb_7(Fl_Button* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_7_i(o,v); } -void Grid_Tab::cb_Width_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Width_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int c = widget_grid_curr_col->value(); @@ -404,11 +404,11 @@ void Grid_Tab::cb_Width_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Width(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Width(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Width_i(o,v); } -void Grid_Tab::cb_Weight1_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Weight1_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int c = widget_grid_curr_col->value(); @@ -425,11 +425,11 @@ void Grid_Tab::cb_Weight1_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Weight1(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Weight1(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Weight1_i(o,v); } -void Grid_Tab::cb_Gap1_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Gap1_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int c = widget_grid_curr_col->value(); @@ -446,7 +446,7 @@ void Grid_Tab::cb_Gap1_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Gap1(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Gap1(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Gap1_i(o,v); } @@ -460,7 +460,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_rows = new fld::widget::Formula_Input(85, 30, 40, 20, "Rows:"); + { widget_grid_rows = new Formula_Input(85, 30, 40, 20, "Rows:"); widget_grid_rows->tooltip("Number of horizontal rows in the Grid group"); widget_grid_rows->box(FL_DOWN_BOX); widget_grid_rows->color(FL_BACKGROUND2_COLOR); @@ -473,7 +473,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_rows->callback((Fl_Callback*)cb_widget_grid_rows); widget_grid_rows->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_rows->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_rows + } // Formula_Input* widget_grid_rows { Fl_Group* o = new Fl_Group(125, 30, 30, 20); { Fl_Button* o = new Fl_Button(125, 30, 15, 20, "-"); o->compact(1); @@ -489,7 +489,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Button* o o->end(); } // Fl_Group* o - { widget_grid_cols = new fld::widget::Formula_Input(165, 30, 40, 20, "Columns:"); + { widget_grid_cols = new Formula_Input(165, 30, 40, 20, "Columns:"); widget_grid_cols->tooltip("Number of vertical columns in the Grid group"); widget_grid_cols->box(FL_DOWN_BOX); widget_grid_cols->color(FL_BACKGROUND2_COLOR); @@ -502,7 +502,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_cols->callback((Fl_Callback*)cb_widget_grid_cols); widget_grid_cols->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_cols->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_cols + } // Formula_Input* widget_grid_cols { Fl_Group* o = new Fl_Group(205, 30, 30, 20); { Fl_Button* o = new Fl_Button(205, 30, 15, 20, "-"); o->compact(1); @@ -602,7 +602,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)cb_Row1); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_curr_row = new fld::widget::Formula_Input(85, 145, 40, 20, "Index"); + { widget_grid_curr_row = new Formula_Input(85, 145, 40, 20, "Index"); widget_grid_curr_row->box(FL_DOWN_BOX); widget_grid_curr_row->color(FL_BACKGROUND2_COLOR); widget_grid_curr_row->selection_color(FL_SELECTION_COLOR); @@ -614,7 +614,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_curr_row->callback((Fl_Callback*)cb_widget_grid_curr_row); widget_grid_curr_row->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_curr_row->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_curr_row + } // Formula_Input* widget_grid_curr_row { Fl_Group* o = new Fl_Group(125, 145, 30, 20); o->callback((Fl_Callback*)propagate_load); { Fl_Button* o = new Fl_Button(125, 145, 15, 20, "-"); @@ -636,7 +636,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Box* o { widget_grid_curr_row_attributes = new Fl_Group(170, 145, 175, 20); widget_grid_curr_row_attributes->callback((Fl_Callback*)propagate_load); - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(170, 145, 55, 20, "Height:"); + { Formula_Input* o = new Formula_Input(170, 145, 55, 20, "Height:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -648,8 +648,8 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Height); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(230, 145, 55, 20, "Weight:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(230, 145, 55, 20, "Weight:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -661,8 +661,8 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Weight); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(290, 145, 55, 20, "Gap:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(290, 145, 55, 20, "Gap:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -674,7 +674,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Gap); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o + } // Formula_Input* o widget_grid_curr_row_attributes->end(); } // Fl_Group* widget_grid_curr_row_attributes { Fl_Box* o = new Fl_Box(390, 145, 1, 20); @@ -688,7 +688,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_curr_col = new fld::widget::Formula_Input(85, 180, 40, 20, "Index"); + { widget_grid_curr_col = new Formula_Input(85, 180, 40, 20, "Index"); widget_grid_curr_col->box(FL_DOWN_BOX); widget_grid_curr_col->color(FL_BACKGROUND2_COLOR); widget_grid_curr_col->selection_color(FL_SELECTION_COLOR); @@ -700,7 +700,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_curr_col->callback((Fl_Callback*)cb_widget_grid_curr_col); widget_grid_curr_col->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_curr_col->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_curr_col + } // Formula_Input* widget_grid_curr_col { Fl_Group* o = new Fl_Group(125, 180, 30, 20); { Fl_Button* o = new Fl_Button(125, 180, 15, 20, "-"); o->compact(1); @@ -721,7 +721,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Box* o { widget_grid_curr_col_attributes = new Fl_Group(170, 180, 175, 20); widget_grid_curr_col_attributes->callback((Fl_Callback*)propagate_load); - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(170, 180, 55, 20, "Width:"); + { Formula_Input* o = new Formula_Input(170, 180, 55, 20, "Width:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -733,8 +733,8 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Width); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(230, 180, 55, 20, "Weight:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(230, 180, 55, 20, "Weight:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -746,8 +746,8 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Weight1); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(290, 180, 55, 20, "Gap:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(290, 180, 55, 20, "Gap:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -759,7 +759,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Gap1); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o + } // Formula_Input* o widget_grid_curr_col_attributes->end(); } // Fl_Group* widget_grid_curr_col_attributes { Fl_Box* o = new Fl_Box(390, 180, 1, 20); diff --git a/fluid/panels/widget_panel/Grid_Tab.fl b/fluid/panels/widget_panel/Grid_Tab.fl index 422ddf789..231d67361 100644 --- a/fluid/panels/widget_panel/Grid_Tab.fl +++ b/fluid/panels/widget_panel/Grid_Tab.fl @@ -54,7 +54,7 @@ if (v == LOAD) { } }} tooltip {Number of horizontal rows in the Grid group} xywh {85 30 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {125 30 30 20} @@ -104,7 +104,7 @@ if (v == LOAD) { } }} tooltip {Number of vertical columns in the Grid group} xywh {165 30 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {205 30 30 20} @@ -296,7 +296,7 @@ if (v == LOAD) { widget_grid_curr_row_attributes->do_callback(widget_grid_curr_row_attributes, LOAD); }} xywh {85 145 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} { callback propagate_load open @@ -347,7 +347,7 @@ if (v == LOAD) { } }} xywh {170 145 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Weight:} @@ -367,7 +367,7 @@ if (v == LOAD) { } }} xywh {230 145 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Gap:} @@ -387,7 +387,7 @@ if (v == LOAD) { } }} xywh {290 145 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } } Fl_Box {} { @@ -413,7 +413,7 @@ if (v == LOAD) { widget_grid_curr_col_attributes->do_callback(widget_grid_curr_col_attributes, LOAD); }} xywh {85 180 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {125 180 30 20} @@ -463,7 +463,7 @@ if (v == LOAD) { } }} xywh {170 180 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Weight:} @@ -483,7 +483,7 @@ if (v == LOAD) { } }} xywh {230 180 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Gap:} @@ -503,7 +503,7 @@ if (v == LOAD) { } }} xywh {290 180 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } } Fl_Box {} { diff --git a/fluid/panels/widget_panel/Grid_Tab.h b/fluid/panels/widget_panel/Grid_Tab.h index 4b06a9e43..c562f345a 100644 --- a/fluid/panels/widget_panel/Grid_Tab.h +++ b/fluid/panels/widget_panel/Grid_Tab.h @@ -13,19 +13,19 @@ extern void propagate_load(Fl_Group*, void*); class Grid_Tab : public Fl_Group { public: Grid_Tab(int X, int Y, int W, int H, const char *L = 0); - fld::widget::Formula_Input *widget_grid_rows; + Formula_Input *widget_grid_rows; private: - inline void cb_widget_grid_rows_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_rows(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_rows_i(Formula_Input*, void*); + static void cb_widget_grid_rows(Formula_Input*, void*); inline void cb__i(Fl_Button*, void*); static void cb_(Fl_Button*, void*); inline void cb_1_i(Fl_Button*, void*); static void cb_1(Fl_Button*, void*); public: - fld::widget::Formula_Input *widget_grid_cols; + Formula_Input *widget_grid_cols; private: - inline void cb_widget_grid_cols_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_cols(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_cols_i(Formula_Input*, void*); + static void cb_widget_grid_cols(Formula_Input*, void*); inline void cb_2_i(Fl_Button*, void*); static void cb_2(Fl_Button*, void*); inline void cb_3_i(Fl_Button*, void*); @@ -51,10 +51,10 @@ private: inline void cb_Row1_i(Fl_Group*, void*); static void cb_Row1(Fl_Group*, void*); public: - fld::widget::Formula_Input *widget_grid_curr_row; + Formula_Input *widget_grid_curr_row; private: - inline void cb_widget_grid_curr_row_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_curr_row(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_curr_row_i(Formula_Input*, void*); + static void cb_widget_grid_curr_row(Formula_Input*, void*); inline void cb_4_i(Fl_Button*, void*); static void cb_4(Fl_Button*, void*); inline void cb_5_i(Fl_Button*, void*); @@ -62,17 +62,17 @@ private: public: Fl_Group *widget_grid_curr_row_attributes; private: - inline void cb_Height_i(fld::widget::Formula_Input*, void*); - static void cb_Height(fld::widget::Formula_Input*, void*); - inline void cb_Weight_i(fld::widget::Formula_Input*, void*); - static void cb_Weight(fld::widget::Formula_Input*, void*); - inline void cb_Gap_i(fld::widget::Formula_Input*, void*); - static void cb_Gap(fld::widget::Formula_Input*, void*); + inline void cb_Height_i(Formula_Input*, void*); + static void cb_Height(Formula_Input*, void*); + inline void cb_Weight_i(Formula_Input*, void*); + static void cb_Weight(Formula_Input*, void*); + inline void cb_Gap_i(Formula_Input*, void*); + static void cb_Gap(Formula_Input*, void*); public: - fld::widget::Formula_Input *widget_grid_curr_col; + Formula_Input *widget_grid_curr_col; private: - inline void cb_widget_grid_curr_col_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_curr_col(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_curr_col_i(Formula_Input*, void*); + static void cb_widget_grid_curr_col(Formula_Input*, void*); inline void cb_6_i(Fl_Button*, void*); static void cb_6(Fl_Button*, void*); inline void cb_7_i(Fl_Button*, void*); @@ -80,11 +80,11 @@ private: public: Fl_Group *widget_grid_curr_col_attributes; private: - inline void cb_Width_i(fld::widget::Formula_Input*, void*); - static void cb_Width(fld::widget::Formula_Input*, void*); - inline void cb_Weight1_i(fld::widget::Formula_Input*, void*); - static void cb_Weight1(fld::widget::Formula_Input*, void*); - inline void cb_Gap1_i(fld::widget::Formula_Input*, void*); - static void cb_Gap1(fld::widget::Formula_Input*, void*); + inline void cb_Width_i(Formula_Input*, void*); + static void cb_Width(Formula_Input*, void*); + inline void cb_Weight1_i(Formula_Input*, void*); + static void cb_Weight1(Formula_Input*, void*); + inline void cb_Gap1_i(Formula_Input*, void*); + static void cb_Gap1(Formula_Input*, void*); }; #endif diff --git a/fluid/proj/i18n.cxx b/fluid/proj/i18n.cxx index 71ba892a1..c726a56d0 100644 --- a/fluid/proj/i18n.cxx +++ b/fluid/proj/i18n.cxx @@ -23,7 +23,7 @@ static char *dup_str(const char *s) { return s ? fl_strdup(s) : 0; } -fld::proj::I18n::I18n(Project &p) : project_(p) { +I18n::I18n(Project &p) : project_(p) { type = FLD_I18N_TYPE_NONE; gnu_include = fl_strdup("<libintl.h>"); gnu_conditional = 0; @@ -35,7 +35,7 @@ fld::proj::I18n::I18n(Project &p) : project_(p) { posix_set = fl_strdup("1"); } -fld::proj::I18n::~I18n() { +I18n::~I18n() { if (gnu_include) free(gnu_include); if (gnu_conditional) free(gnu_conditional); if (gnu_function) free(gnu_function); @@ -46,42 +46,42 @@ fld::proj::I18n::~I18n() { if (posix_set) free(posix_set); } -void fld::proj::I18n::set_gnu_include(const char *s) { +void I18n::set_gnu_include(const char *s) { if (gnu_include) free(gnu_include); gnu_include = dup_str(s); } -void fld::proj::I18n::set_gnu_conditional(const char *s) { +void I18n::set_gnu_conditional(const char *s) { if (gnu_conditional) free(gnu_conditional); gnu_conditional = dup_str(s); } -void fld::proj::I18n::set_gnu_function(const char *s) { +void I18n::set_gnu_function(const char *s) { if (gnu_function) free(gnu_function); gnu_function = dup_str(s); } -void fld::proj::I18n::set_gnu_static_function(const char *s) { +void I18n::set_gnu_static_function(const char *s) { if (gnu_static_function) free(gnu_static_function); gnu_static_function = dup_str(s); } -void fld::proj::I18n::set_posix_include(const char *s) { +void I18n::set_posix_include(const char *s) { if (posix_include) free(posix_include); posix_include = dup_str(s); } -void fld::proj::I18n::set_posix_conditional(const char *s) { +void I18n::set_posix_conditional(const char *s) { if (posix_conditional) free(posix_conditional); posix_conditional = dup_str(s); } -void fld::proj::I18n::set_posix_file(const char *s) { +void I18n::set_posix_file(const char *s) { if (posix_file) free(posix_file); posix_file = dup_str(s); } -void fld::proj::I18n::set_posix_set(const char *s) { +void I18n::set_posix_set(const char *s) { if (posix_set) free(posix_set); posix_set = dup_str(s); } @@ -89,7 +89,7 @@ void fld::proj::I18n::set_posix_set(const char *s) { /** Reset all project setting to create a new empty project. */ -void fld::proj::I18n::reset() { +void I18n::reset() { type = FLD_I18N_TYPE_NONE; set_gnu_include("<libintl.h>"); @@ -103,9 +103,9 @@ void fld::proj::I18n::reset() { set_posix_set("1"); } -void fld::proj::I18n::read(io::Project_Reader &f, const char *key) { +void I18n::read(Project_Reader &f, const char *key) { if (!strcmp(key, "i18n_type")) { - type = (fld::I18n_Type)(atoi(f.read_word())); + type = (I18n_Type)(atoi(f.read_word())); } else if (!strcmp(key, "i18n_gnu_function")) { set_gnu_function(f.read_word()); } else if (!strcmp(key, "i18n_gnu_static_function")) { @@ -129,7 +129,7 @@ void fld::proj::I18n::read(io::Project_Reader &f, const char *key) { } } -void fld::proj::I18n::write(io::Project_Writer &f) const { +void I18n::write(Project_Writer &f) const { if ((type != FLD_I18N_TYPE_NONE)) { f.write_string("\ni18n_type %d", (int)(type)); switch (type) { diff --git a/fluid/proj/i18n.h b/fluid/proj/i18n.h index 65ef72bf6..262a6347c 100644 --- a/fluid/proj/i18n.h +++ b/fluid/proj/i18n.h @@ -21,8 +21,6 @@ #include <stdlib.h> #include <string.h> -namespace fld { - class Project; /** @@ -30,22 +28,14 @@ class Project; */ typedef int I18n_Type; -} // namespace fld - enum { FLD_I18N_TYPE_NONE = 0, ///< No i18n, all strings are litearals FLD_I18N_TYPE_GNU, ///< GNU gettext internationalization FLD_I18N_TYPE_POSIX ///< Posix catgets internationalization }; -namespace fld { - -namespace io { class Project_Reader; class Project_Writer; -} - -namespace proj { /** Data and settings for a FLUID project file. @@ -56,7 +46,7 @@ public: Project &project_; /// One of the available internationalization types. - fld::I18n_Type type; + I18n_Type type; /// Include file for GNU i18n, writes an #include statement into the source /// file. This is usually `<libintl.h>` or `"gettext.h"` for GNU gettext. char *gnu_include; @@ -83,8 +73,8 @@ public: // Methods I18n(Project &p); ~I18n(); void reset(); - void read(io::Project_Reader &f, const char *key); - void write(io::Project_Writer &f) const; + void read(Project_Reader &f, const char *key); + void write(Project_Writer &f) const; void set_gnu_include(const char *s); void set_gnu_conditional(const char *s); @@ -96,9 +86,6 @@ public: // Methods void set_posix_set(const char *s); }; -} // namespace proj - -} // namespace fld #endif // FLUID_PROJ_I18N_H diff --git a/fluid/proj/mergeback.cxx b/fluid/proj/mergeback.cxx index 2d553aedb..827a9505b 100644 --- a/fluid/proj/mergeback.cxx +++ b/fluid/proj/mergeback.cxx @@ -91,7 +91,7 @@ extern void redraw_browser(); Returns 0 if nothing changed, and 1 if it merged any changes back, and -1 if there were conflicts. - \note this function is currently part of fld::io::Code_Writer to get easy access + \note this function is currently part of Code_Writer to get easy access to our crc32 code that also wrote the code file originally. \param[in] s path and filename of the source code file @@ -100,7 +100,7 @@ extern void redraw_browser(); \return -2 if no code file was found \return see above */ -static int merge_back(fld::Project &proj, const char *s, const char *p, Mergeback::Task task) { +static int merge_back(Project &proj, const char *s, const char *p, Mergeback::Task task) { if (proj.write_mergeback_data) { Mergeback mergeback(proj); return mergeback.merge_back(s, p, task); @@ -111,7 +111,7 @@ static int merge_back(fld::Project &proj, const char *s, const char *p, Mergebac } /** Allocate and initialize MergeBack class. */ -Mergeback::Mergeback(fld::Project &proj) +Mergeback::Mergeback(Project &proj) : proj_(proj), code(0), line_no(0), @@ -253,7 +253,7 @@ void Mergeback::analyse_callback(unsigned long code_crc, unsigned long tag_crc, if (cb && len) memcpy(cb_nl, cb, len); cb_nl[len] = '\n'; cb_nl[len + 1] = '\0'; - unsigned long project_crc = fld::io::Code_Writer::block_crc(cb_nl); + unsigned long project_crc = Code_Writer::block_crc(cb_nl); free(cb_nl); // check if the code and project crc are the same, so this modification was already applied if (project_crc!=code_crc) { @@ -281,7 +281,7 @@ void Mergeback::analyse_code(unsigned long code_crc, unsigned long tag_crc, int if (code && len) memcpy(code_nl, code, len); code_nl[len] = '\n'; code_nl[len + 1] = '\0'; - unsigned long project_crc = fld::io::Code_Writer::block_crc(code_nl); + unsigned long project_crc = Code_Writer::block_crc(code_nl); free(code_nl); // check if the code and project crc are the same, so this modification was already applied if (project_crc!=code_crc) { @@ -448,7 +448,7 @@ int Mergeback::analyse() { const char *tag = find_mergeback_tag(line); if (!tag) { // if this line has no tag, add the contents to the CRC and continue - code_crc = fld::io::Code_Writer::block_crc(line, -1, code_crc, &line_start); + code_crc = Code_Writer::block_crc(line, -1, code_crc, &line_start); } else { // if this line has a tag, read all tag data Tag tag_type = FLD_MERGEBACK_TAG_UNUSED_; @@ -494,7 +494,7 @@ int Mergeback::apply_callback(long block_end, long block_start, unsigned long co if (cb && len) memcpy(cb_nl, cb, len); cb_nl[len] = '\n'; cb_nl[len + 1] = '\0'; - unsigned long project_crc = fld::io::Code_Writer::block_crc(cb_nl); + unsigned long project_crc = Code_Writer::block_crc(cb_nl); free(cb_nl); if (project_crc!=code_crc) { char *block = read_and_unindent_block(block_start, block_end); @@ -518,7 +518,7 @@ int Mergeback::apply_code(long block_end, long block_start, unsigned long code_c if (code && len) memcpy(code_nl, code, len); code_nl[len] = '\n'; code_nl[len + 1] = '\0'; - unsigned long project_crc = fld::io::Code_Writer::block_crc(code_nl); + unsigned long project_crc = Code_Writer::block_crc(code_nl); free(code_nl); if (project_crc!=code_crc) { char *block = read_and_unindent_block(block_start, block_end); @@ -557,7 +557,7 @@ int Mergeback::apply() { const char *tag = find_mergeback_tag(line); if (!tag) { // if this line has no tag, add the contents to the CRC and continue - code_crc = fld::io::Code_Writer::block_crc(line, -1, code_crc, &line_start); + code_crc = Code_Writer::block_crc(line, -1, code_crc, &line_start); block_end = ::ftell(code); } else { // if this line has a tag, read all tag data @@ -654,7 +654,7 @@ int Mergeback::merge_back(const char *s, const char *p, Task task) { \return 0 if MergeBack is not enabled, or the result of the merge_back function. \see Mergeback::merge_back(const char *s, const char *p, Task task) */ -int mergeback_code_files(fld::Project &proj, Mergeback::Feedback feedback) +int mergeback_code_files(Project &proj, Mergeback::Feedback feedback) { static bool recursion_lock = false; if (recursion_lock) return 2; diff --git a/fluid/proj/mergeback.h b/fluid/proj/mergeback.h index 04a9dc902..c1e877d60 100644 --- a/fluid/proj/mergeback.h +++ b/fluid/proj/mergeback.h @@ -22,7 +22,7 @@ #include <stdint.h> #include <stdio.h> -namespace fld { class Project; } +class Project; /** Class that implements the MergeBack functionality. \see merge_back(const char *s, int task) @@ -50,7 +50,7 @@ public: enum Feedback { QUIET = 0, CHATTY = 1 }; protected: /// Apply mergeback for this project. - fld::Project &proj_; + Project &proj_; /// Pointer to the C++ code file. FILE *code; /// Current line number in the C++ code file. @@ -80,7 +80,7 @@ protected: static bool read_tag(const char *tag, Tag *prev_type, uint16_t *uid, uint32_t *crc); public: - Mergeback(fld::Project &proj); + Mergeback(Project &proj); ~Mergeback(); int merge_back(const char *s, const char *p, Task task); int ask_user_to_merge(const char *s, const char *p); diff --git a/fluid/proj/undo.cxx b/fluid/proj/undo.cxx index d3444c91a..829b2d4d4 100644 --- a/fluid/proj/undo.cxx +++ b/fluid/proj/undo.cxx @@ -47,11 +47,11 @@ extern Fl_Window* the_panel; -fld::proj::Undo::Undo(fld::Project &p) +Undo::Undo(Project &p) : proj_( p ) { } -fld::proj::Undo::~Undo() { +Undo::~Undo() { // TODO: delete old undo files when calling the destructor. } @@ -60,7 +60,7 @@ fld::proj::Undo::~Undo() { // The filename is constructed in a static internal buffer and // this buffer is overwritten by every call of this function. // The return value is a pointer to this internal string. -char *fld::proj::Undo::filename(int level) { +char *Undo::filename(int level) { if (!path_len_) { Fluid.preferences.getUserdataPath(path_, sizeof(path_)); path_len_ = (unsigned int)strlen(path_); @@ -75,7 +75,7 @@ char *fld::proj::Undo::filename(int level) { // Redo menu callback -void fld::proj::Undo::redo() { +void Undo::redo() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; @@ -91,7 +91,7 @@ void fld::proj::Undo::redo() { widget_browser->new_list(); } int reload_panel = (the_panel && the_panel->visible()); - if (!fld::io::read_file(proj_, filename(current_ + 1), 0)) { + if (!read_file(proj_, filename(current_ + 1), 0)) { // Unable to read checkpoint file, don't redo... widget_browser->rebuild(); proj_.update_settings_dialog(); @@ -119,7 +119,7 @@ void fld::proj::Undo::redo() { } // Undo menu callback -void fld::proj::Undo::undo() { +void Undo::undo() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; @@ -130,7 +130,7 @@ void fld::proj::Undo::undo() { } if (current_ == last_) { - fld::io::write_file(proj_, filename(current_)); + write_file(proj_, filename(current_)); } suspend(); @@ -142,7 +142,7 @@ void fld::proj::Undo::undo() { widget_browser->new_list(); } int reload_panel = (the_panel && the_panel->visible()); - if (!fld::io::read_file(proj_, filename(current_ - 1), 0)) { + if (!read_file(proj_, filename(current_ - 1), 0)) { // Unable to read checkpoint file, don't undo... widget_browser->rebuild(); proj_.update_settings_dialog(); @@ -180,7 +180,7 @@ void fld::proj::Undo::undo() { \param[in] type set a new type, or set to 0 to clear the once_type without setting a checkpoint \return 1 if the checkpoint was set, 0 if this is a repeating event */ -int fld::proj::Undo::checkpoint(OnceType type) { +int Undo::checkpoint(OnceType type) { if (type == FLD_UNDO_ONCETYPE_ALWAYS) { once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; return 0; @@ -197,7 +197,7 @@ int fld::proj::Undo::checkpoint(OnceType type) { } // Save current file to undo buffer -void fld::proj::Undo::checkpoint() { +void Undo::checkpoint() { // printf("checkpoint(): current_=%d, paused_=%d, modflag=%d\n", // current_, paused_, modflag); @@ -210,7 +210,7 @@ void fld::proj::Undo::checkpoint() { // Save the current UI to a checkpoint file... const char *file = filename(current_); - if (!fld::io::write_file(proj_, file)) { + if (!write_file(proj_, file)) { // Don't attempt to do undo stuff if we can't write a checkpoint file... perror(file); return; @@ -231,7 +231,7 @@ void fld::proj::Undo::checkpoint() { } // Clear undo buffer -void fld::proj::Undo::clear() { +void Undo::clear() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); // Remove old checkpoint files... @@ -251,19 +251,19 @@ void fld::proj::Undo::clear() { } // Resume undo checkpoints -void fld::proj::Undo::resume() { +void Undo::resume() { paused_--; } // Suspend undo checkpoints -void fld::proj::Undo::suspend() { +void Undo::suspend() { paused_++; } -void fld::proj::Undo::undo_cb(Fl_Widget *, void *) { +void Undo::undo_cb(Fl_Widget *, void *) { Fluid.proj.undo.undo(); } -void fld::proj::Undo::redo_cb(Fl_Widget *, void *) { +void Undo::redo_cb(Fl_Widget *, void *) { Fluid.proj.undo.redo(); } diff --git a/fluid/proj/undo.h b/fluid/proj/undo.h index de038908a..a50346faf 100644 --- a/fluid/proj/undo.h +++ b/fluid/proj/undo.h @@ -21,12 +21,8 @@ class Fl_Widget; -namespace fld { - class Project; -namespace proj { - enum { FLD_UNDO_ONCETYPE_ALWAYS = 0, FLD_UNDO_ONCETYPE_WINDOW_RESIZE @@ -88,8 +84,6 @@ public: static void undo_cb(Fl_Widget *, void *); }; -} // namespace fld -} // namespace proj #endif // !undo_h diff --git a/fluid/tools/ExternalCodeEditor_WIN32.cxx b/fluid/tools/ExternalCodeEditor_WIN32.cxx index ea9178c63..8c09ca614 100644 --- a/fluid/tools/ExternalCodeEditor_WIN32.cxx +++ b/fluid/tools/ExternalCodeEditor_WIN32.cxx @@ -28,8 +28,6 @@ #include <stdio.h> // snprintf() #include <stdlib.h> -using namespace fld; - // Static local data static int L_editors_open = 0; // keep track of #editors open static Fl_Timeout_Handler L_update_timer_cb = 0; // app's update timer callback diff --git a/fluid/widgets/App_Menu_Bar.cxx b/fluid/widgets/App_Menu_Bar.cxx index cb0dae33f..30377eb68 100644 --- a/fluid/widgets/App_Menu_Bar.cxx +++ b/fluid/widgets/App_Menu_Bar.cxx @@ -29,11 +29,11 @@ extern void mergeback_cb(Fl_Widget *, void *); /** - Create a fld::widget::App_Menu_Bar widget. + Create a App_Menu_Bar widget. \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -fld::widget::App_Menu_Bar::App_Menu_Bar(int X, int Y, int W, int H, const char *L) +App_Menu_Bar::App_Menu_Bar(int X, int Y, int W, int H, const char *L) : Fl_Menu_Bar(X, Y, W, H, L) { } @@ -41,7 +41,7 @@ fld::widget::App_Menu_Bar::App_Menu_Bar(int X, int Y, int W, int H, const char * /** Set menu item visibility and active state before menu pops up. */ -int fld::widget::App_Menu_Bar::handle(int event) +int App_Menu_Bar::handle(int event) { Fl_Menu_Item *mi = 0; if (event == FL_BEFORE_MENU) { diff --git a/fluid/widgets/App_Menu_Bar.h b/fluid/widgets/App_Menu_Bar.h index d9547c38f..f5792dd3f 100644 --- a/fluid/widgets/App_Menu_Bar.h +++ b/fluid/widgets/App_Menu_Bar.h @@ -23,9 +23,6 @@ #include <FL/Fl_Menu_Bar.H> -namespace fld { -namespace widget { - /** A text viewer with an additional highlighting color scheme. */ @@ -35,7 +32,4 @@ public: int handle(int event); }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_APP_MENU_BAR_H diff --git a/fluid/widgets/Bin_Button.cxx b/fluid/widgets/Bin_Button.cxx index 1a14433e2..325313f1c 100644 --- a/fluid/widgets/Bin_Button.cxx +++ b/fluid/widgets/Bin_Button.cxx @@ -28,7 +28,7 @@ -/** \class fld::widget::Bin_Button +/** \class Bin_Button The Bin_Button button is a button that can be used in the widget bin to allow the user to drag and drop widgets into a window or group. This feature makes it easy for the user to position a widget at a specific location within @@ -38,7 +38,7 @@ /** Convert mouse dragging into a drag and drop event. */ -int fld::widget::Bin_Button::handle(int inEvent) +int Bin_Button::handle(int inEvent) { int ret = 0; switch (inEvent) { @@ -67,7 +67,7 @@ int fld::widget::Bin_Button::handle(int inEvent) return Fl_Button::handle(inEvent); } -/** \class fld::widget::Bin_Window_Button +/** \class Bin_Window_Button The Bin_Window_Button button is used in the widget bin to create new windows by dragging and dropping. When the button is dragged and dropped onto the desktop, a new window will be created at the drop location. @@ -79,7 +79,7 @@ int fld::widget::Bin_Button::handle(int inEvent) /** Convert mouse dragging into a drag and drop event. */ -int fld::widget::Bin_Window_Button::handle(int inEvent) +int Bin_Window_Button::handle(int inEvent) { static Fl_Window *drag_win = 0; int ret = 0; diff --git a/fluid/widgets/Bin_Button.h b/fluid/widgets/Bin_Button.h index aac415ff8..9d3c468d2 100644 --- a/fluid/widgets/Bin_Button.h +++ b/fluid/widgets/Bin_Button.h @@ -19,9 +19,6 @@ #include <FL/Fl_Button.H> -namespace fld { -namespace widget { - // Adding drag and drop for dragging widgets into windows. class Bin_Button : public Fl_Button { public: @@ -38,7 +35,4 @@ public: Fl_Button(X,Y,W,H,l) { } }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_BIN_BUTTON_H diff --git a/fluid/widgets/Code_Editor.cxx b/fluid/widgets/Code_Editor.cxx index 1551ed3e2..b30b08db1 100644 --- a/fluid/widgets/Code_Editor.cxx +++ b/fluid/widgets/Code_Editor.cxx @@ -33,7 +33,7 @@ Lookup table for all supported styles. Every table entry describes a rendering style for the corresponding text. */ -Fl_Text_Display::Style_Table_Entry fld::widget::Code_Editor::styletable[] = { // Style table +Fl_Text_Display::Style_Table_Entry Code_Editor::styletable[] = { // Style table { FL_FOREGROUND_COLOR, FL_COURIER, 11 }, // A - Plain { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments @@ -51,7 +51,7 @@ Fl_Text_Display::Style_Table_Entry fld::widget::Code_Editor::styletable[] = { \param[in] in_len byte length to parse \param[in] in_style starting style letter */ -void fld::widget::Code_Editor::style_parse(const char *in_tbuff, // text buffer to parse +void Code_Editor::style_parse(const char *in_tbuff, // text buffer to parse char *in_sbuff, // style buffer we modify int in_len, // byte length to parse char in_style) { // starting style letter @@ -104,7 +104,7 @@ void fld::widget::Code_Editor::style_parse(const char *in_tbuff, // text /** Update unfinished styles. */ -void fld::widget::Code_Editor::style_unfinished_cb(int, void*) { +void Code_Editor::style_unfinished_cb(int, void*) { } /** @@ -114,7 +114,7 @@ void fld::widget::Code_Editor::style_unfinished_cb(int, void*) { \param[in] nDeleted number of bytes deleted \param[in] cbArg pointer back to the code editor */ -void fld::widget::Code_Editor::style_update(int pos, int nInserted, int nDeleted, +void Code_Editor::style_update(int pos, int nInserted, int nDeleted, int /*nRestyled*/, const char * /*deletedText*/, void *cbArg) { Code_Editor *editor = (Code_Editor*)cbArg; @@ -165,7 +165,7 @@ void fld::widget::Code_Editor::style_update(int pos, int nInserted, int nDeleted Find the right indentation depth after pressing the Enter key. \param[in] e pointer back to the code editor */ -int fld::widget::Code_Editor::auto_indent(int, Code_Editor* e) { +int Code_Editor::auto_indent(int, Code_Editor* e) { if (e->buffer()->selected()) { e->insert_position(e->buffer()->primary_selection()->start()); e->buffer()->remove_selection(); @@ -203,7 +203,7 @@ int fld::widget::Code_Editor::auto_indent(int, Code_Editor* e) { \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -fld::widget::Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) : +Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) : Fl_Text_Editor(X, Y, W, H, L) { buffer(new Fl_Text_Buffer); @@ -231,7 +231,7 @@ fld::widget::Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) /** Destroy a Code_Editor widget. */ -fld::widget::Code_Editor::~Code_Editor() { +Code_Editor::~Code_Editor() { Fl_Text_Buffer *buf = mStyleBuffer; mStyleBuffer = 0; delete buf; @@ -246,7 +246,7 @@ fld::widget::Code_Editor::~Code_Editor() { This works by updating the fontsizes in the style table. \param[in] s the new general height of the text font */ -void fld::widget::Code_Editor::textsize(Fl_Fontsize s) { +void Code_Editor::textsize(Fl_Fontsize s) { Fl_Text_Editor::textsize(s); // call base class method // now attempt to update our styletable to honor the new size... int entries = sizeof(styletable) / sizeof(styletable[0]); diff --git a/fluid/widgets/Code_Editor.h b/fluid/widgets/Code_Editor.h index 3ee654da1..db90c32f9 100644 --- a/fluid/widgets/Code_Editor.h +++ b/fluid/widgets/Code_Editor.h @@ -27,9 +27,6 @@ #include <FL/Fl_Text_Editor.H> -namespace fld { -namespace widget { - // ---- Code_Editor declaration /** @@ -65,8 +62,6 @@ public: int scroll_col() { return mHorizOffset; } }; -} // namespace widget -} // namespace fld #endif // FLUID_WIDGETS_CODE_EDITOR_H diff --git a/fluid/widgets/Code_Viewer.cxx b/fluid/widgets/Code_Viewer.cxx index 978ed178e..fc456ea74 100644 --- a/fluid/widgets/Code_Viewer.cxx +++ b/fluid/widgets/Code_Viewer.cxx @@ -26,11 +26,11 @@ /** - Create a fld::widget::Code_Viewer widget. + Create a Code_Viewer widget. \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -fld::widget::Code_Viewer::Code_Viewer(int X, int Y, int W, int H, const char *L) +Code_Viewer::Code_Viewer(int X, int Y, int W, int H, const char *L) : Code_Editor(X, Y, W, H, L) { default_key_function(kf_ignore); @@ -41,7 +41,7 @@ fld::widget::Code_Viewer::Code_Viewer(int X, int Y, int W, int H, const char *L) /** Tricking Fl_Text_Display into using bearable colors for this specific task. */ -void fld::widget::Code_Viewer::draw() +void Code_Viewer::draw() { Fl_Color c = Fl::get_color(FL_SELECTION_COLOR); Fl::set_color(FL_SELECTION_COLOR, fl_color_average(FL_BACKGROUND_COLOR, FL_FOREGROUND_COLOR, 0.9f)); diff --git a/fluid/widgets/Code_Viewer.h b/fluid/widgets/Code_Viewer.h index a65a66f58..7c183f1d2 100644 --- a/fluid/widgets/Code_Viewer.h +++ b/fluid/widgets/Code_Viewer.h @@ -25,9 +25,6 @@ #include "widgets/Code_Editor.h" -namespace fld { -namespace widget { - /** A widget derived from Code_Editor with highlighting for code blocks. @@ -46,7 +43,4 @@ protected: int handle(int ev) { return Fl_Text_Display::handle(ev); } }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_CODE_VIEWER_H diff --git a/fluid/widgets/Formula_Input.cxx b/fluid/widgets/Formula_Input.cxx index 06f5e3672..c7daefc5e 100644 --- a/fluid/widgets/Formula_Input.cxx +++ b/fluid/widgets/Formula_Input.cxx @@ -26,7 +26,7 @@ -/** \class fld::widget::Formula_Input +/** \class Formula_Input The Formula_Input widget is an input field for entering widget coordinates and sizes. It includes basic math capabilities and allows the use of variables in formulas. This widget is useful for specifying precise positions and @@ -36,18 +36,18 @@ /** Create an input field. */ -fld::widget::Formula_Input::Formula_Input(int x, int y, int w, int h, const char *l) +Formula_Input::Formula_Input(int x, int y, int w, int h, const char *l) : Fl_Input(x, y, w, h, l) { Fl_Input::callback((Fl_Callback*)callback_handler_cb); text("0"); } -void fld::widget::Formula_Input::callback_handler_cb(Formula_Input *This, void *v) { +void Formula_Input::callback_handler_cb(Formula_Input *This, void *v) { This->callback_handler(v); } -void fld::widget::Formula_Input::callback_handler(void *v) { +void Formula_Input::callback_handler(void *v) { if (user_callback_) (*user_callback_)(this, v); // do *not* update the value to show the evaluated formula here, because the @@ -63,7 +63,7 @@ void fld::widget::Formula_Input::callback_handler(void *v) { the last character of the variable name when returning. \return the integer value that was found or calculated */ -int fld::widget::Formula_Input::eval_var(uchar *&s) const { +int Formula_Input::eval_var(uchar *&s) const { if (!vars_) return 0; // find the end of the variable name @@ -86,7 +86,7 @@ int fld::widget::Formula_Input::eval_var(uchar *&s) const { \param prio priority of current operation \return the value so far */ -int fld::widget::Formula_Input::eval(uchar *&s, int prio) const { +int Formula_Input::eval(uchar *&s, int prio) const { int v = 0, sgn = 1; uchar c = *s++; @@ -158,7 +158,7 @@ int fld::widget::Formula_Input::eval(uchar *&s, int prio) const { \param s formula as a C string \return the calculated value */ -int fld::widget::Formula_Input::eval(const char *s) const +int Formula_Input::eval(const char *s) const { // duplicate the text, so we can modify it uchar *buf = (uchar*)fl_strdup(s); @@ -180,14 +180,14 @@ int fld::widget::Formula_Input::eval(const char *s) const /** Evaluate the formula and return the result. */ -int fld::widget::Formula_Input::value() const { +int Formula_Input::value() const { return eval(text()); } /** Set the field to an integer value, replacing previous texts. */ -void fld::widget::Formula_Input::value(int v) { +void Formula_Input::value(int v) { char buf[32]; fl_snprintf(buf, sizeof(buf), "%d", v); text(buf); @@ -196,7 +196,7 @@ void fld::widget::Formula_Input::value(int v) { /** Allow vertical mouse dragging and mouse wheel to interactively change the value. */ -int fld::widget::Formula_Input::handle(int event) { +int Formula_Input::handle(int event) { switch (event) { case FL_MOUSEWHEEL: if (Fl::event_dy()) { @@ -212,7 +212,7 @@ int fld::widget::Formula_Input::handle(int event) { /** Set the list of the available variables \param vars array of variables, last entry `has name_` set to `0` \param user_data is forwarded to the Variable callback */ -void fld::widget::Formula_Input::variables(Formula_Input_Vars *vars, void *user_data) { +void Formula_Input::variables(Formula_Input_Vars *vars, void *user_data) { vars_ = vars; vars_user_data_ = user_data; } diff --git a/fluid/widgets/Formula_Input.h b/fluid/widgets/Formula_Input.h index 53321ff21..ebe46973d 100644 --- a/fluid/widgets/Formula_Input.h +++ b/fluid/widgets/Formula_Input.h @@ -19,9 +19,6 @@ #include <FL/Fl_Input.H> -namespace fld { -namespace widget { - class Formula_Input; // Callback signature for function returning the value of a variable. @@ -63,11 +60,8 @@ public: /** Set the general callback for this widget. */ void callback(Fl_Callback *cb) { user_callback_ = cb; } - void variables(fld::widget::Formula_Input_Vars *vars, void *user_data); + void variables(Formula_Input_Vars *vars, void *user_data); int handle(int); }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_FORMULA_INPUT_H diff --git a/fluid/widgets/Node_Browser.cxx b/fluid/widgets/Node_Browser.cxx index 7482298b5..4aa3660ab 100644 --- a/fluid/widgets/Node_Browser.cxx +++ b/fluid/widgets/Node_Browser.cxx @@ -28,7 +28,7 @@ // ---- global variables /// Global access to the widget browser. -fld::widget::Node_Browser *widget_browser = 0; +Node_Browser *widget_browser = 0; @@ -49,18 +49,18 @@ fld::widget::Node_Browser *widget_browser = 0; // ---- static variables -Fl_Color fld::widget::Node_Browser::label_color = 72; -Fl_Font fld::widget::Node_Browser::label_font = FL_HELVETICA; -Fl_Color fld::widget::Node_Browser::class_color = FL_FOREGROUND_COLOR; -Fl_Font fld::widget::Node_Browser::class_font = FL_HELVETICA_BOLD; -Fl_Color fld::widget::Node_Browser::func_color = FL_FOREGROUND_COLOR; -Fl_Font fld::widget::Node_Browser::func_font = FL_HELVETICA; -Fl_Color fld::widget::Node_Browser::name_color = FL_FOREGROUND_COLOR; -Fl_Font fld::widget::Node_Browser::name_font = FL_HELVETICA; -Fl_Color fld::widget::Node_Browser::code_color = FL_FOREGROUND_COLOR; -Fl_Font fld::widget::Node_Browser::code_font = FL_HELVETICA; -Fl_Color fld::widget::Node_Browser::comment_color = FL_DARK_GREEN; -Fl_Font fld::widget::Node_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 @@ -75,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 fld::widget::Node_Browser(x,y,w,h)); + return (widget_browser = new Node_Browser(x,y,w,h)); } /** @@ -213,7 +213,7 @@ 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. */ -fld::widget::Node_Browser::Node_Browser(int X,int Y,int W,int H,const char*l) : +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); @@ -225,7 +225,7 @@ fld::widget::Node_Browser::Node_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 *fld::widget::Node_Browser::item_first() const { +void *Node_Browser::item_first() const { return Fluid.proj.tree.first; } @@ -234,7 +234,7 @@ void *fld::widget::Node_Browser::item_first() const { \param l this item \return the next item, irregardless of tree depth, or 0 at the end */ -void *fld::widget::Node_Browser::item_next(void *l) const { +void *Node_Browser::item_next(void *l) const { return ((Node*)l)->next; } @@ -243,7 +243,7 @@ void *fld::widget::Node_Browser::item_next(void *l) const { \param l this item \return the previous item, irregardless of tree depth, or 0 at the start */ -void *fld::widget::Node_Browser::item_prev(void *l) const { +void *Node_Browser::item_prev(void *l) const { return ((Node*)l)->prev; } @@ -253,7 +253,7 @@ void *fld::widget::Node_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 fld::widget::Node_Browser::item_selected(void *l) const { +int Node_Browser::item_selected(void *l) const { return ((Node*)l)->new_selected; } @@ -262,7 +262,7 @@ int fld::widget::Node_Browser::item_selected(void *l) const { \param l this item \param[in] v 1 if selecting, 0 if not */ -void fld::widget::Node_Browser::item_select(void *l,int v) { +void Node_Browser::item_select(void *l,int v) { ((Node*)l)->new_selected = v; } @@ -271,7 +271,7 @@ void fld::widget::Node_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 fld::widget::Node_Browser::item_height(void *l) const { +int Node_Browser::item_height(void *l) const { Node *t = (Node*)l; if (t->visible) { if (Fluid.show_comments && t->comment()) @@ -286,7 +286,7 @@ int fld::widget::Node_Browser::item_height(void *l) const { Override the method to return the estimated height of all items. \return height in FLTK units */ -int fld::widget::Node_Browser::incr_height() const { +int Node_Browser::incr_height() const { return textsize() + 5 + linespacing(); } @@ -311,7 +311,7 @@ int fld::widget::Node_Browser::incr_height() const { \param X,Y these give the position in window coordinates of the top left corner of this line */ -void fld::widget::Node_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 Node *l = (Node *)v; @@ -455,7 +455,7 @@ void fld::widget::Node_Browser::item_draw(void *v, int X, int Y, int, int) const \param v this item \return width in FLTK units */ -int fld::widget::Node_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 @@ -490,7 +490,7 @@ int fld::widget::Node_Browser::item_width(void *v) const { /** Callback to tell the Fluid UI when the list of selected items changed. */ -void fld::widget::Node_Browser::callback() { +void Node_Browser::callback() { selection_changed((Node*)selection()); } @@ -508,7 +508,7 @@ void fld::widget::Node_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 fld::widget::Node_Browser::handle(int e) { +int Node_Browser::handle(int e) { static Node *title; Node *l; int X,Y,W,H; bbox(X,Y,W,H); @@ -576,7 +576,7 @@ int fld::widget::Node_Browser::handle(int e) { /** Save the current scrollbar position during rebuild. */ -void fld::widget::Node_Browser::save_scroll_position() { +void Node_Browser::save_scroll_position() { saved_h_scroll_ = hposition(); saved_v_scroll_ = vposition(); } @@ -584,7 +584,7 @@ void fld::widget::Node_Browser::save_scroll_position() { /** Restore the previous scrollbar position after rebuild. */ -void fld::widget::Node_Browser::restore_scroll_position() { +void Node_Browser::restore_scroll_position() { hposition(saved_h_scroll_); vposition(saved_v_scroll_); } @@ -594,7 +594,7 @@ void fld::widget::Node_Browser::restore_scroll_position() { This clears internal caches, recalculates the scroll bar sizes, and sends a redraw() request to the widget. */ -void fld::widget::Node_Browser::rebuild() { +void Node_Browser::rebuild() { save_scroll_position(); new_list(); damage(FL_DAMAGE_SCROLL); @@ -606,7 +606,7 @@ void fld::widget::Node_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 Node. */ -void fld::widget::Node_Browser::display(Node *inNode) { +void Node_Browser::display(Node *inNode) { if (!inNode) { // Alternative: find the first (last?) visible selected item. return; @@ -640,7 +640,7 @@ void fld::widget::Node_Browser::display(Node *inNode) { vposition(newV); } -void fld::widget::Node_Browser::load_prefs() { +void Node_Browser::load_prefs() { int c; Fl_Preferences p(Fluid.preferences, "widget_browser"); p.get("label_color", c, 72); label_color = c; @@ -657,7 +657,7 @@ void fld::widget::Node_Browser::load_prefs() { p.get("comment_font", c, FL_HELVETICA); comment_font = c; } -void fld::widget::Node_Browser::save_prefs() { +void Node_Browser::save_prefs() { Fl_Preferences p(Fluid.preferences, "widget_browser"); p.set("label_color", (int)label_color); p.set("label_font", (int)label_font); diff --git a/fluid/widgets/Node_Browser.h b/fluid/widgets/Node_Browser.h index 5ca0ae566..aa7182575 100644 --- a/fluid/widgets/Node_Browser.h +++ b/fluid/widgets/Node_Browser.h @@ -21,9 +21,6 @@ class Node; -namespace fld { -namespace widget { - class Node_Browser : public Fl_Browser_ { friend class Node; @@ -73,9 +70,6 @@ public: static Fl_Font comment_font; }; -} // 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(Node *caller); @@ -84,6 +78,6 @@ extern void select_only(Node *o); extern void deselect(); extern void reveal_in_browser(Node *t); -extern fld::widget::Node_Browser *widget_browser; +extern Node_Browser *widget_browser; #endif // FLUID_WIDGETS_NODE_BROWSER_H diff --git a/fluid/widgets/Style_Parser.cxx b/fluid/widgets/Style_Parser.cxx index 9188e565e..6af057ac6 100644 --- a/fluid/widgets/Style_Parser.cxx +++ b/fluid/widgets/Style_Parser.cxx @@ -130,7 +130,7 @@ static void* search_types(char *find) { // Applies the current style, advances to next text + style char. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_char(int handle_crlf) { +int Style_Parser::parse_over_char(int handle_crlf) { char c = *tbuff; // End of line? @@ -157,7 +157,7 @@ int fld::widget::Style_Parser::parse_over_char(int handle_crlf) { // Parse over white space using current style // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_white() { +int Style_Parser::parse_over_white() { while ( len > 0 && strchr(" \t", *tbuff)) { if ( !parse_over_char() ) return 0; } return 1; @@ -166,7 +166,7 @@ int fld::widget::Style_Parser::parse_over_white() { // Parse over non-white alphabetic text // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_alpha() { +int Style_Parser::parse_over_alpha() { while ( len > 0 && isalpha(*tbuff) ) { if ( !parse_over_char() ) return 0; } return 1; @@ -175,7 +175,7 @@ int fld::widget::Style_Parser::parse_over_alpha() { // Parse to end of line in specified style. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_to_eol(char s) { +int Style_Parser::parse_to_eol(char s) { char save = style; style = s; while ( *tbuff != '\n' ) @@ -187,7 +187,7 @@ int fld::widget::Style_Parser::parse_to_eol(char s) { // Parse a block comment until end of comment or buffer. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_block_comment() { +int Style_Parser::parse_block_comment() { char save = style; style = 'C'; // block comment style while ( len > 0 ) { @@ -203,7 +203,7 @@ int fld::widget::Style_Parser::parse_block_comment() { } // Copy keyword from tbuff -> keyword[] buffer -void fld::widget::Style_Parser::buffer_keyword() { +void Style_Parser::buffer_keyword() { char *key = keyword; char *kend = key + sizeof(keyword) - 1; // end of buffer const char *s; @@ -216,7 +216,7 @@ void fld::widget::Style_Parser::buffer_keyword() { // Parse over specified 'key'word in specified style 's'. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_key(const char *key, char s) { +int Style_Parser::parse_over_key(const char *key, char s) { char save = style; style = s; // Parse over the keyword while applying style to sbuff @@ -230,7 +230,7 @@ int fld::widget::Style_Parser::parse_over_key(const char *key, char s) { // Parse over angle brackets <..> in specified style. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_angles(char s) { +int Style_Parser::parse_over_angles(char s) { if ( *tbuff != '<' ) return 1; // not <..>, early exit char save = style; style = s; @@ -246,7 +246,7 @@ int fld::widget::Style_Parser::parse_over_angles(char s) { // spi.keyword[] will contain parsed word. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_keyword() { +int Style_Parser::parse_keyword() { // Parse into 'keyword' buffer buffer_keyword(); char *key = keyword; @@ -263,7 +263,7 @@ int fld::widget::Style_Parser::parse_keyword() { // Style parse a quoted string, either "" or ''. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_quoted_string(char quote_char, // e.g. '"' or '\'' +int Style_Parser::parse_quoted_string(char quote_char, // e.g. '"' or '\'' char in_style) { // style for quoted text style = in_style; // start string style if ( !parse_over_char() ) return 0; // parse over opening quote @@ -290,7 +290,7 @@ int fld::widget::Style_Parser::parse_quoted_string(char quote_char, // e.g. '"' // Style parse a directive (#include, #define..) // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_directive() { +int Style_Parser::parse_directive() { style = 'E'; // start directive style if ( !parse_over_char() ) return 0; // Parse over '#' if ( !parse_over_white() ) return 0; // Parse over any whitespace after '#' @@ -304,7 +304,7 @@ int fld::widget::Style_Parser::parse_directive() { // Style parse a line comment to end of line. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_line_comment() { +int Style_Parser::parse_line_comment() { return parse_to_eol('B'); } @@ -313,7 +313,7 @@ int fld::widget::Style_Parser::parse_line_comment() { // a continuation of a line, such as in a multiline #directive. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_escape() { +int Style_Parser::parse_escape() { const char no_crlf = 0; if ( !parse_over_char(no_crlf) ) return 0; // backslash if ( !parse_over_char(no_crlf) ) return 0; // char escaped @@ -323,7 +323,7 @@ int fld::widget::Style_Parser::parse_escape() { // Parse all other non-specific characters // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_all_else() { +int Style_Parser::parse_all_else() { last = isalnum(*tbuff) || *tbuff == '_' || *tbuff == '.'; return parse_over_char(); } diff --git a/fluid/widgets/Style_Parser.h b/fluid/widgets/Style_Parser.h index fff38c529..7e054b856 100644 --- a/fluid/widgets/Style_Parser.h +++ b/fluid/widgets/Style_Parser.h @@ -18,9 +18,6 @@ #ifndef FLUID_WIDGETS_STYLE_PARSER_H #define FLUID_WIDGETS_STYLE_PARSER_H -namespace fld { -namespace widget { - // Class to manage style parsing, friend of Code_Editor class Style_Parser { public: @@ -53,7 +50,4 @@ public: int parse_all_else(); // all other code }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_STYLE_PARSER_H diff --git a/fluid/widgets/Text_Viewer.cxx b/fluid/widgets/Text_Viewer.cxx index 3cd89d4d8..f1e0bcdbb 100644 --- a/fluid/widgets/Text_Viewer.cxx +++ b/fluid/widgets/Text_Viewer.cxx @@ -24,11 +24,11 @@ /** - Create a fld::widget::Text_Viewer widget. + Create a Text_Viewer widget. \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -fld::widget::Text_Viewer::Text_Viewer(int X, int Y, int W, int H, const char *L) +Text_Viewer::Text_Viewer(int X, int Y, int W, int H, const char *L) : Fl_Text_Display(X, Y, W, H, L) { buffer(new Fl_Text_Buffer); @@ -37,7 +37,7 @@ fld::widget::Text_Viewer::Text_Viewer(int X, int Y, int W, int H, const char *L) /** Avoid memory leaks. */ -fld::widget::Text_Viewer::~Text_Viewer() { +Text_Viewer::~Text_Viewer() { Fl_Text_Buffer *buf = mBuffer; buffer(0); delete buf; @@ -46,7 +46,7 @@ fld::widget::Text_Viewer::~Text_Viewer() { /** Tricking Fl_Text_Display into using bearable colors for this specific task. */ -void fld::widget::Text_Viewer::draw() +void Text_Viewer::draw() { Fl_Color c = Fl::get_color(FL_SELECTION_COLOR); Fl::set_color(FL_SELECTION_COLOR, fl_color_average(FL_BACKGROUND_COLOR, FL_FOREGROUND_COLOR, 0.9f)); diff --git a/fluid/widgets/Text_Viewer.h b/fluid/widgets/Text_Viewer.h index dac23e855..ff2a04771 100644 --- a/fluid/widgets/Text_Viewer.h +++ b/fluid/widgets/Text_Viewer.h @@ -23,9 +23,6 @@ #include <FL/Fl_Text_Display.H> -namespace fld { -namespace widget { - /** A text viewer with an additional highlighting color scheme. */ @@ -39,7 +36,4 @@ public: int top_line() { return get_absolute_top_line_number(); } }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_TEXT_VIEWER_H |
