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/Fluid.cxx | |
| parent | b4995f979d127cea667b4e2b71c91e9db4ab52ef (diff) | |
wip
Diffstat (limited to 'fluid/Fluid.cxx')
| -rw-r--r-- | fluid/Fluid.cxx | 104 |
1 files changed, 52 insertions, 52 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 |
