mirror of
https://github.com/fltk/fltk.git
synced 2026-09-24 00:03:48 +08:00
Fluid: change fluid namespace name
* no actual code changes
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# Experimental FLTK clang-tidy file. This is not an officiel clang-tidy test yet.
|
||||
#
|
||||
|
||||
Checks:
|
||||
- '-*'
|
||||
- 'bugprone-*'
|
||||
- '-bugprone-narrowing-conversions'
|
||||
- 'cert-*'
|
||||
- '-cert-err58-cpp'
|
||||
- 'clang-analyzer-*'
|
||||
- 'cppcoreguidelines-*'
|
||||
- '-cppcoreguidelines-narrowing-conversions'
|
||||
# Disabled: intentional FLTK design decisions, not defects
|
||||
- '-cppcoreguidelines-avoid-c-arrays' # string buffers, image data
|
||||
- '-cppcoreguidelines-avoid-magic-numbers' # RGB values, widget sizes, etc.
|
||||
- '-cppcoreguidelines-avoid-non-const-global-variables' # Fl::first_window() etc.
|
||||
- '-cppcoreguidelines-macro-to-enum' # FL_RED/FL_BLUE style constants
|
||||
- '-cppcoreguidelines-macro-usage' # FL_EXPORT, FL_OVERRIDE, etc.
|
||||
- '-cppcoreguidelines-non-private-member-variables-in-classes'
|
||||
- '-cppcoreguidelines-owning-memory' # requires GSL; fires on all new/delete
|
||||
- '-cppcoreguidelines-pro-bounds-array-to-pointer-decay'
|
||||
- '-cppcoreguidelines-pro-bounds-pointer-arithmetic' # image/buffer manipulation
|
||||
- '-cppcoreguidelines-pro-type-reinterpret-cast' # OS handle idiom (Fl_X, etc.)
|
||||
- '-cppcoreguidelines-pro-type-vararg' # printf, fl_message, etc.
|
||||
- '-cppcoreguidelines-special-member-functions' # would require Rule-of-5 everywhere
|
||||
- '-cppcoreguidelines-use-enum-class' # Fl_Color/Fl_Font are public API
|
||||
|
||||
# Report warnings only in FLTK's own headers; suppress noise from bundled
|
||||
# third-party libraries (jpeg, png, zlib, nanosvg, libdecor).
|
||||
HeaderFilterRegex: '.*/fltk-1\.5\.git/(FL|src|fluid|fltk-options|test|util|public)/.*'
|
||||
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# Experimental FLTK clang-tidy file. This is not an officiel clang-tidy test yet.
|
||||
#
|
||||
|
||||
# Fluid-specific clang-tidy configuration.
|
||||
# Inherits bugprone-*, cert-*, clang-analyzer-*, cppcoreguidelines-* from the root .clang-tidy.
|
||||
# All modernize-* checks are restricted to C++11-compatible suggestions.
|
||||
# C++14+ checks (make-unique, transparent-functors, nodiscard, concat-nested-namespaces) are omitted.
|
||||
|
||||
InheritParentConfig: true
|
||||
|
||||
Checks:
|
||||
# --- C++11 modernization ---
|
||||
- 'modernize-avoid-bind'
|
||||
- 'modernize-deprecated-headers'
|
||||
- 'modernize-loop-convert'
|
||||
- 'modernize-make-shared'
|
||||
- 'modernize-pass-by-value'
|
||||
- 'modernize-redundant-void-arg'
|
||||
- 'modernize-replace-auto-ptr'
|
||||
- 'modernize-return-braced-init-list'
|
||||
- 'modernize-shrink-to-fit'
|
||||
- 'modernize-use-auto'
|
||||
- 'modernize-use-bool-literals'
|
||||
- 'modernize-use-default-member-init'
|
||||
- 'modernize-use-emplace'
|
||||
- 'modernize-use-equals-default'
|
||||
- 'modernize-use-equals-delete'
|
||||
- 'modernize-use-noexcept'
|
||||
- 'modernize-use-nullptr'
|
||||
- 'modernize-use-override'
|
||||
- 'modernize-use-using'
|
||||
# --- Readability / refactoring ---
|
||||
- 'readability-avoid-const-params-in-decls'
|
||||
- 'readability-braces-around-statements'
|
||||
- 'readability-const-return-type'
|
||||
- 'readability-container-size-empty'
|
||||
- 'readability-else-after-return'
|
||||
- 'readability-inconsistent-declaration-parameter-name'
|
||||
- 'readability-make-member-function-const'
|
||||
- 'readability-misleading-indentation'
|
||||
- 'readability-qualified-auto'
|
||||
- 'readability-redundant-access-specifiers'
|
||||
- 'readability-redundant-control-flow'
|
||||
- 'readability-redundant-member-init'
|
||||
- 'readability-redundant-smartptr-get'
|
||||
- 'readability-redundant-string-cstr'
|
||||
- 'readability-redundant-string-init'
|
||||
- 'readability-simplify-boolean-expr'
|
||||
- 'readability-static-accessed-through-instance'
|
||||
- 'readability-string-compare'
|
||||
- 'readability-uniqueptr-delete-release'
|
||||
# --- Performance ---
|
||||
- 'performance-for-range-copy'
|
||||
- 'performance-implicit-conversion-in-loop'
|
||||
- 'performance-inefficient-string-concatenation'
|
||||
- 'performance-move-constructor-init'
|
||||
- 'performance-unnecessary-copy-initialization'
|
||||
- 'performance-unnecessary-value-param'
|
||||
|
||||
CheckOptions:
|
||||
# Only suggest auto when the original type name is long enough to make auto a win
|
||||
- key: modernize-use-auto.MinTypeNameLength
|
||||
value: '5'
|
||||
# Accept range-for when the loop is clearly safe to transform
|
||||
- key: modernize-loop-convert.MinConfidence
|
||||
value: 'reasonable'
|
||||
# Pointer and integer conditions are idiomatic in FLTK / C-adjacent code
|
||||
- key: readability-implicit-bool-conversion.AllowIntegerConditions
|
||||
value: '1'
|
||||
- key: readability-implicit-bool-conversion.AllowPointerConditions
|
||||
value: '1'
|
||||
|
||||
# Warn on Fluid headers only; suppress noise from FLTK and system headers
|
||||
HeaderFilterRegex: '.*/fluid/.*'
|
||||
+20
-20
@@ -55,9 +55,9 @@
|
||||
#include "../src/flstring.h"
|
||||
|
||||
|
||||
fld::Application Fluid;
|
||||
fluid::Application Fluid;
|
||||
|
||||
using namespace fld;
|
||||
using namespace fluid;
|
||||
|
||||
|
||||
/**
|
||||
@@ -167,11 +167,11 @@ int Application::run(int argc,char **argv) {
|
||||
make_fluid_icon(main_window); // assign icon to main window
|
||||
position_window(main_window,"main_window_pos", 1, 10, 30, WINWIDTH, WINHEIGHT );
|
||||
if (g_shell_config) {
|
||||
g_shell_config->read(preferences, fld::Tool_Store::USER);
|
||||
g_shell_config->read(preferences, fluid::Tool_Store::USER);
|
||||
g_shell_config->update_settings_dialog();
|
||||
g_shell_config->rebuild_shell_menu();
|
||||
}
|
||||
Fluid.layout_list.read(preferences, fld::Tool_Store::USER);
|
||||
Fluid.layout_list.read(preferences, fluid::Tool_Store::USER);
|
||||
main_window->show(argc,argv);
|
||||
toggle_widget_bin();
|
||||
if (!c && openlast_button->value() && history.abspath[0][0] && args.autodoc_path.empty()) {
|
||||
@@ -181,7 +181,7 @@ int Application::run(int argc,char **argv) {
|
||||
toggle_codeview_cb(nullptr,nullptr);
|
||||
}
|
||||
proj.undo.suspend();
|
||||
if (c && !fld::io::read_file(proj, c,0)) {
|
||||
if (c && !fluid::io::read_file(proj, c,0)) {
|
||||
if (batch_mode) {
|
||||
fprintf(stderr,"%s : %s\n", c, strerror(errno));
|
||||
exit(1);
|
||||
@@ -204,7 +204,7 @@ int Application::run(int argc,char **argv) {
|
||||
}
|
||||
|
||||
if (args.update_file) { // fluid -u
|
||||
fld::io::write_file(proj, c, 0);
|
||||
fluid::io::write_file(proj, c, 0);
|
||||
if (!args.compile_file)
|
||||
exit(0);
|
||||
}
|
||||
@@ -294,8 +294,8 @@ void Application::quit() {
|
||||
delete help_dialog;
|
||||
|
||||
if (g_shell_config)
|
||||
g_shell_config->write(preferences, fld::Tool_Store::USER);
|
||||
Fluid.layout_list.write(preferences, fld::Tool_Store::USER);
|
||||
g_shell_config->write(preferences, fluid::Tool_Store::USER);
|
||||
Fluid.layout_list.write(preferences, fluid::Tool_Store::USER);
|
||||
|
||||
proj.undo.clear();
|
||||
|
||||
@@ -545,7 +545,7 @@ bool Application::merge_project_file(const std::string &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 (!fluid::io::read_file(proj, c, is_a_merge)) {
|
||||
proj.undo.resume();
|
||||
widget_browser->rebuild();
|
||||
proj.update_settings_dialog();
|
||||
@@ -611,7 +611,7 @@ void Application::save_project_file(void *v) {
|
||||
#endif
|
||||
if (v != (void *)2) proj.set_filename(c);
|
||||
}
|
||||
if (!fld::io::write_file(proj, c)) {
|
||||
if (!fluid::io::write_file(proj, c)) {
|
||||
fl_alert("Error writing %s: %s", c, strerror(errno));
|
||||
return;
|
||||
}
|
||||
@@ -633,7 +633,7 @@ void Application::revert_project() {
|
||||
"Cancel", "Revert", nullptr)) return;
|
||||
}
|
||||
proj.undo.suspend();
|
||||
if (!fld::io::read_file(proj, proj.proj_filename, 0)) {
|
||||
if (!fluid::io::read_file(proj, proj.proj_filename, 0)) {
|
||||
proj.undo.resume();
|
||||
widget_browser->rebuild();
|
||||
proj.update_settings_dialog();
|
||||
@@ -738,13 +738,13 @@ bool Application::new_project_from_template() {
|
||||
fclose(outfile);
|
||||
|
||||
proj.undo.suspend();
|
||||
fld::io::read_file(proj, cutfname(1), 0);
|
||||
fluid::io::read_file(proj, cutfname(1), 0);
|
||||
fl_unlink(cutfname(1));
|
||||
proj.undo.resume();
|
||||
} else {
|
||||
// No instance name, so read the template without replacements...
|
||||
proj.undo.suspend();
|
||||
fld::io::read_file(proj, tname, 0);
|
||||
fluid::io::read_file(proj, tname, 0);
|
||||
proj.undo.resume();
|
||||
}
|
||||
}
|
||||
@@ -853,7 +853,7 @@ int Application::write_code_files(bool dont_show_completion_dialog)
|
||||
}
|
||||
|
||||
// -- generate the file names with absolute paths
|
||||
fld::io::Code_Writer f(proj);
|
||||
fluid::io::Code_Writer f(proj);
|
||||
std::string code_filename = proj.codefile_path() + proj.codefile_name();
|
||||
std::string header_filename = proj.headerfile_path() + proj.headerfile_name();
|
||||
|
||||
@@ -901,7 +901,7 @@ void Application::cut_selected() {
|
||||
return;
|
||||
}
|
||||
flush_text_widgets();
|
||||
if (!fld::io::write_file(proj, cutfname(),1)) {
|
||||
if (!fluid::io::write_file(proj, cutfname(),1)) {
|
||||
fl_message("Can't write %s: %s", cutfname(), strerror(errno));
|
||||
return;
|
||||
}
|
||||
@@ -927,7 +927,7 @@ void Application::copy_selected() {
|
||||
}
|
||||
flush_text_widgets();
|
||||
ipasteoffset = 10;
|
||||
if (!fld::io::write_file(proj, cutfname(),1)) {
|
||||
if (!fluid::io::write_file(proj, cutfname(),1)) {
|
||||
fl_message("Can't write %s: %s", cutfname(), strerror(errno));
|
||||
return;
|
||||
}
|
||||
@@ -955,7 +955,7 @@ void Application::paste_from_clipboard() {
|
||||
//strategy = Strategy::FROM_FILE_AS_FIRST_CHILD;
|
||||
}
|
||||
}
|
||||
if (!fld::io::read_file(proj, cutfname(), 1, strategy)) {
|
||||
if (!fluid::io::read_file(proj, cutfname(), 1, strategy)) {
|
||||
widget_browser->rebuild();
|
||||
fl_message("Can't read %s: %s", cutfname(), strerror(errno));
|
||||
}
|
||||
@@ -998,7 +998,7 @@ void Application::duplicate_selected() {
|
||||
proj.tree.current = new_insert;
|
||||
|
||||
// write the selected widgets to a file:
|
||||
if (!fld::io::write_file(proj, cutfname(1),1)) {
|
||||
if (!fluid::io::write_file(proj, cutfname(1),1)) {
|
||||
fl_message("Can't write %s: %s", cutfname(1), strerror(errno));
|
||||
return;
|
||||
}
|
||||
@@ -1007,7 +1007,7 @@ void 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 (!fluid::io::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));
|
||||
@@ -1184,7 +1184,7 @@ void 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,BROWSERWIDTH,MENUHEIGHT);
|
||||
main_menubar = new fluid::widget::App_Menu_Bar(0,0,BROWSERWIDTH,MENUHEIGHT);
|
||||
main_menubar->menu(main_menu);
|
||||
// quick access to all dynamic menu items
|
||||
save_item = (Fl_Menu_Item*)main_menubar->find_item(menu_file_save_cb);
|
||||
|
||||
+4
-4
@@ -46,7 +46,7 @@ class Fl_Button;
|
||||
class Fl_Check_Button;
|
||||
class Fl_Help_Dialog;
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
namespace app {
|
||||
class Layout_List;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public: // Member Variables
|
||||
// TODO: make this into a class: app::GUI
|
||||
Fl_Window *main_window { nullptr };
|
||||
static Fl_Menu_Item main_menu[];
|
||||
fld::widget::App_Menu_Bar *main_menubar { nullptr };
|
||||
fluid::widget::App_Menu_Bar *main_menubar { nullptr };
|
||||
Fl_Menu_Item *save_item { nullptr };
|
||||
Fl_Menu_Item *history_item { nullptr };
|
||||
Fl_Menu_Item *widgetbin_item { nullptr };
|
||||
@@ -213,9 +213,9 @@ public: // Methods
|
||||
#endif // __APPLE__
|
||||
};
|
||||
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
extern fld::Application Fluid;
|
||||
extern fluid::Application Fluid;
|
||||
|
||||
|
||||
#endif // FLUID_FLUID_H
|
||||
|
||||
+4
-4
@@ -22,7 +22,7 @@
|
||||
#include "panels/settings_panel.h"
|
||||
#include "panels/codeview_panel.h"
|
||||
|
||||
using namespace fld;
|
||||
using namespace fluid;
|
||||
|
||||
// ---- project settings
|
||||
|
||||
@@ -167,8 +167,8 @@ std::string Project::stringsfile_name() const {
|
||||
if (!proj_filename) return std::string{};
|
||||
switch (i18n.type) {
|
||||
default: return fl_filename_setext_str(fl_filename_name(proj_filename), ".txt");
|
||||
case fld::I18n_Type::GNU: return fl_filename_setext_str(fl_filename_name(proj_filename), ".po");
|
||||
case fld::I18n_Type::POSIX: return fl_filename_setext_str(fl_filename_name(proj_filename), ".msg");
|
||||
case fluid::I18n_Type::GNU: return fl_filename_setext_str(fl_filename_name(proj_filename), ".po");
|
||||
case fluid::I18n_Type::POSIX: return fl_filename_setext_str(fl_filename_name(proj_filename), ".msg");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ void Project::write_strings() {
|
||||
if (!proj_filename) return;
|
||||
}
|
||||
std::string filename = stringsfile_path() + stringsfile_name();
|
||||
int x = fld::io::write_strings(*this, filename);
|
||||
int x = fluid::io::write_strings(*this, filename);
|
||||
if (Fluid.batch_mode) {
|
||||
if (x) {
|
||||
fprintf(stderr, "%s : %s\n", filename.c_str(), strerror(errno));
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@
|
||||
// ---- project class declaration
|
||||
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
|
||||
namespace app {
|
||||
class Layout_Preset;
|
||||
@@ -117,7 +117,7 @@ public: // Methods
|
||||
void set_modflag(int mf, int mfc = -1);
|
||||
};
|
||||
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
#endif // FLUID_PROJECT_H
|
||||
|
||||
|
||||
+4
-4
@@ -35,7 +35,7 @@ extern void layout_suite_marker(Fl_Widget *, void *user_data);
|
||||
extern void select_layout_preset_cb(Fl_Widget *, void *user_data);
|
||||
extern Fl_Menu_Item main_layout_submenu_[];
|
||||
|
||||
using namespace fld;
|
||||
using namespace fluid;
|
||||
|
||||
|
||||
void write_cb(Fl_Widget *, void *) {
|
||||
@@ -52,7 +52,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 *) { fluid::app::save_template(); }
|
||||
void mergeback_cb(Fl_Widget *, void *);
|
||||
|
||||
void manual_cb(Fl_Widget *, void *) {
|
||||
@@ -116,8 +116,8 @@ Fl_Menu_Item Application::main_menu[] = {
|
||||
{"&Quit", FL_COMMAND+'q', exit_cb},
|
||||
{nullptr},
|
||||
{"&Edit",0,nullptr,nullptr,FL_SUBMENU},
|
||||
{"&Undo", FL_COMMAND+'z', fld::proj::Undo::undo_cb},
|
||||
{"&Redo", FL_COMMAND+FL_SHIFT+'z', fld::proj::Undo::redo_cb, nullptr, FL_MENU_DIVIDER},
|
||||
{"&Undo", FL_COMMAND+'z', fluid::proj::Undo::undo_cb},
|
||||
{"&Redo", FL_COMMAND+FL_SHIFT+'z', fluid::proj::Undo::redo_cb, nullptr, FL_MENU_DIVIDER},
|
||||
{"C&ut", FL_COMMAND+'x', cut_cb},
|
||||
{"&Copy", FL_COMMAND+'c', copy_cb},
|
||||
{"&Paste", FL_COMMAND+'v', paste_cb},
|
||||
|
||||
+31
-31
@@ -34,8 +34,8 @@
|
||||
#undef max
|
||||
#include <algorithm>
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::app;
|
||||
using namespace fluid;
|
||||
using namespace fluid::app;
|
||||
|
||||
// TODO: warning if the user wants to change builtin layouts
|
||||
// TODO: move panel to global settings panel (move load & save to main pulldown, or to toolbox?)
|
||||
@@ -98,11 +98,11 @@ static Layout_Preset grid_tool = {
|
||||
0, 10, -1, 10 // labelfont/size, textfont/size
|
||||
};
|
||||
|
||||
Layout_Preset *fld::app::default_layout_preset = &fltk_app;
|
||||
Layout_Preset *fluid::app::default_layout_preset = &fltk_app;
|
||||
|
||||
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 }
|
||||
{ (char*)"FLTK", (char*)"@fd_beaker FLTK", { &fltk_app, &fltk_dlg, &fltk_tool }, fluid::Tool_Store::INTERNAL },
|
||||
{ (char*)"Grid", (char*)"@fd_beaker Grid", { &grid_app, &grid_dlg, &grid_tool }, fluid::Tool_Store::INTERNAL }
|
||||
};
|
||||
|
||||
Fl_Menu_Item main_layout_submenu_[] = {
|
||||
@@ -237,7 +237,7 @@ void Layout_Preset::read(Fl_Preferences &prefs) {
|
||||
/**
|
||||
Write presets to an .fl project file.
|
||||
*/
|
||||
void Layout_Preset::write(fld::io::Project_Writer *out) {
|
||||
void Layout_Preset::write(fluid::io::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,
|
||||
@@ -259,7 +259,7 @@ void Layout_Preset::write(fld::io::Project_Writer *out) {
|
||||
/**
|
||||
Read presets from an .fl project file.
|
||||
*/
|
||||
void Layout_Preset::read(fld::io::Project_Reader *in) {
|
||||
void Layout_Preset::read(fluid::io::Project_Reader *in) {
|
||||
const char *key;
|
||||
key = in->read_word(1);
|
||||
if (key && !strcmp(key, "{")) {
|
||||
@@ -356,7 +356,7 @@ void Layout_Suite::read(Fl_Preferences &prefs) {
|
||||
/**
|
||||
Write a presets suite to an .fl project file.
|
||||
*/
|
||||
void Layout_Suite::write(fld::io::Project_Writer *out) {
|
||||
void Layout_Suite::write(fluid::io::Project_Writer *out) {
|
||||
out->write_string(" suite {\n");
|
||||
out->write_string(" name "); out->write_word(name_); out->write_string("\n");
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
@@ -368,7 +368,7 @@ void Layout_Suite::write(fld::io::Project_Writer *out) {
|
||||
/**
|
||||
Read a presets suite from an .fl project file.
|
||||
*/
|
||||
void Layout_Suite::read(fld::io::Project_Reader *in) {
|
||||
void Layout_Suite::read(fluid::io::Project_Reader *in) {
|
||||
const char *key;
|
||||
key = in->read_word(1);
|
||||
if (key && !strcmp(key, "{")) {
|
||||
@@ -399,10 +399,10 @@ void Layout_Suite::read(fld::io::Project_Reader *in) {
|
||||
void Layout_Suite::update_label() {
|
||||
std::string sym;
|
||||
switch (storage_) {
|
||||
case fld::Tool_Store::INTERNAL: sym.assign("@fd_beaker "); break;
|
||||
case fld::Tool_Store::USER: sym.assign("@fd_user "); break;
|
||||
case fld::Tool_Store::PROJECT: sym.assign("@fd_project "); break;
|
||||
case fld::Tool_Store::FILE: sym.assign("@fd_file "); break;
|
||||
case fluid::Tool_Store::INTERNAL: sym.assign("@fd_beaker "); break;
|
||||
case fluid::Tool_Store::USER: sym.assign("@fd_user "); break;
|
||||
case fluid::Tool_Store::PROJECT: sym.assign("@fd_project "); break;
|
||||
case fluid::Tool_Store::FILE: sym.assign("@fd_file "); break;
|
||||
}
|
||||
sym.append(name_);
|
||||
if (menu_label)
|
||||
@@ -432,14 +432,14 @@ void Layout_Suite::init() {
|
||||
name_ = nullptr;
|
||||
menu_label = nullptr;
|
||||
layout[0] = layout[1] = layout[2] = nullptr;
|
||||
storage_ = fld::Tool_Store::INTERNAL;
|
||||
storage_ = fluid::Tool_Store::INTERNAL;
|
||||
}
|
||||
|
||||
/**
|
||||
Free all allocated resources.
|
||||
*/
|
||||
Layout_Suite::~Layout_Suite() {
|
||||
if (storage_ == fld::Tool_Store::INTERNAL) return;
|
||||
if (storage_ == fluid::Tool_Store::INTERNAL) return;
|
||||
if (name_) ::free(name_);
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
delete layout[i];
|
||||
@@ -615,7 +615,7 @@ Layout_List::~Layout_List() {
|
||||
::free(choice_menu_);
|
||||
for (int i = 0; i < list_size_; i++) {
|
||||
Layout_Suite &suite = list_[i];
|
||||
if (suite.storage_ != fld::Tool_Store::INTERNAL)
|
||||
if (suite.storage_ != fluid::Tool_Store::INTERNAL)
|
||||
suite.~Layout_Suite();
|
||||
}
|
||||
::free(list_);
|
||||
@@ -660,9 +660,9 @@ void Layout_List::update_menu_labels() {
|
||||
Load all user layouts from the FLUID user preferences.
|
||||
*/
|
||||
int Layout_List::load(const std::string &filename) {
|
||||
remove_all(fld::Tool_Store::FILE);
|
||||
remove_all(fluid::Tool_Store::FILE);
|
||||
Fl_Preferences prefs(filename.c_str(), "layout.fluid.fltk.org", nullptr, Fl_Preferences::C_LOCALE);
|
||||
read(prefs, fld::Tool_Store::FILE);
|
||||
read(prefs, fluid::Tool_Store::FILE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -673,14 +673,14 @@ int Layout_List::save(const std::string &filename) {
|
||||
assert(this);
|
||||
Fl_Preferences prefs(filename.c_str(), "layout.fluid.fltk.org", nullptr, (Fl_Preferences::Root)(Fl_Preferences::C_LOCALE|Fl_Preferences::CLEAR));
|
||||
prefs.clear();
|
||||
write(prefs, fld::Tool_Store::FILE);
|
||||
write(prefs, fluid::Tool_Store::FILE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Write Suite and Layout selection and selected layout data to Preferences database.
|
||||
*/
|
||||
void Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store storage) {
|
||||
void Layout_List::write(Fl_Preferences &prefs, fluid::Tool_Store storage) {
|
||||
Fl_Preferences prefs_list(prefs, "Layouts");
|
||||
prefs_list.clear();
|
||||
prefs_list.set("current_suite", list_[current_suite()].name_);
|
||||
@@ -698,7 +698,7 @@ void Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store storage) {
|
||||
/**
|
||||
Read Suite and Layout selection and selected layout data to Preferences database.
|
||||
*/
|
||||
void Layout_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) {
|
||||
void Layout_List::read(Fl_Preferences &prefs, fluid::Tool_Store storage) {
|
||||
Fl_Preferences prefs_list(prefs, "Layouts");
|
||||
std::string cs;
|
||||
int cp = 0;
|
||||
@@ -723,12 +723,12 @@ void 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 Layout_List::write(fld::io::Project_Writer *out) {
|
||||
void Layout_List::write(fluid::io::Project_Writer *out) {
|
||||
// Don't write the Snap field if no custom layout was used
|
||||
if ((current_suite()==0) && (current_preset()==0)) {
|
||||
int nSuite = 0;
|
||||
for (int i=0; i<list_size_; i++) {
|
||||
if (list_[i].storage_ == fld::Tool_Store::PROJECT) nSuite++;
|
||||
if (list_[i].storage_ == fluid::Tool_Store::PROJECT) nSuite++;
|
||||
}
|
||||
if (nSuite == 0) return;
|
||||
}
|
||||
@@ -737,7 +737,7 @@ void Layout_List::write(fld::io::Project_Writer *out) {
|
||||
out->write_string(" current_preset %d\n", current_preset());
|
||||
for (int i=0; i<list_size_; i++) {
|
||||
Layout_Suite &suite = list_[i];
|
||||
if (suite.storage_ == fld::Tool_Store::PROJECT)
|
||||
if (suite.storage_ == fluid::Tool_Store::PROJECT)
|
||||
suite.write(out);
|
||||
}
|
||||
out->write_string("}");
|
||||
@@ -746,7 +746,7 @@ void Layout_List::write(fld::io::Project_Writer *out) {
|
||||
/**
|
||||
Read Suite and Layout selection and project layout data from an .fl project file.
|
||||
*/
|
||||
void Layout_List::read(fld::io::Project_Reader *in) {
|
||||
void Layout_List::read(fluid::io::Project_Reader *in) {
|
||||
const char *key;
|
||||
key = in->read_word(1);
|
||||
if (key && !strcmp(key, "{")) {
|
||||
@@ -764,7 +764,7 @@ void Layout_List::read(fld::io::Project_Reader *in) {
|
||||
} else if (!strcmp(key, "suite")) {
|
||||
int n = add(in->filename_name());
|
||||
list_[n].read(in);
|
||||
list_[n].storage(fld::Tool_Store::PROJECT);
|
||||
list_[n].storage(fluid::Tool_Store::PROJECT);
|
||||
} else if (!strcmp(key, "}")) {
|
||||
break;
|
||||
} else {
|
||||
@@ -869,9 +869,9 @@ int Layout_List::add(const char *name) {
|
||||
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_;
|
||||
if (new_storage == fld::Tool_Store::INTERNAL)
|
||||
new_storage = fld::Tool_Store::USER;
|
||||
fluid::Tool_Store new_storage = old_suite.storage_;
|
||||
if (new_storage == fluid::Tool_Store::INTERNAL)
|
||||
new_storage = fluid::Tool_Store::USER;
|
||||
new_suite.storage(new_storage);
|
||||
main_menu_[n].label(new_suite.menu_label);
|
||||
main_menu_[n].callback(main_menu_[0].callback());
|
||||
@@ -912,9 +912,9 @@ void 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.
|
||||
\param[in] storage storage attribute, see fluid::Tool_Store::INTERNAL, etc.
|
||||
*/
|
||||
void Layout_List::remove_all(fld::Tool_Store storage) {
|
||||
void Layout_List::remove_all(fluid::Tool_Store storage) {
|
||||
for (int i=list_size_-1; i>=0; --i) {
|
||||
if (list_[i].storage_ == storage)
|
||||
remove(i);
|
||||
|
||||
+18
-18
@@ -26,15 +26,15 @@ class Fl_Preferences;
|
||||
|
||||
extern Fl_Menu_Item main_layout_submenu_[];
|
||||
|
||||
namespace fld {
|
||||
enum class Tool_Store; // fld::
|
||||
namespace fluid {
|
||||
enum class Tool_Store; // fluid::
|
||||
namespace io {
|
||||
class Project_Reader; // fld::io::
|
||||
class Project_Writer; // fld::io::
|
||||
class Project_Reader; // fluid::io::
|
||||
class Project_Writer; // fluid::io::
|
||||
} // namespace io
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
namespace app {
|
||||
|
||||
/**
|
||||
@@ -78,8 +78,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(fluid::io::Project_Writer*);
|
||||
void read(fluid::io::Project_Reader*);
|
||||
|
||||
int textsize_not_null();
|
||||
};
|
||||
@@ -99,13 +99,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.)
|
||||
fluid::Tool_Store storage_; ///< storage location (see fluid::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(fluid::io::Project_Writer*);
|
||||
void read(fluid::io::Project_Reader*);
|
||||
void update_label();
|
||||
void storage(fld::Tool_Store s) { storage_ = s; update_label(); }
|
||||
void storage(fluid::Tool_Store s) { storage_ = s; update_label(); }
|
||||
void name(const char *n);
|
||||
void init();
|
||||
~Layout_Suite();
|
||||
@@ -149,13 +149,13 @@ public:
|
||||
|
||||
int load(const std::string &filename);
|
||||
int save(const std::string &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, fluid::Tool_Store storage);
|
||||
void read(Fl_Preferences &prefs, fluid::Tool_Store storage);
|
||||
void write(fluid::io::Project_Writer*);
|
||||
void read(fluid::io::Project_Reader*);
|
||||
int add(Layout_Suite*);
|
||||
void remove(int index);
|
||||
void remove_all(fld::Tool_Store storage);
|
||||
void remove_all(fluid::Tool_Store storage);
|
||||
Layout_Preset *at(int);
|
||||
int size();
|
||||
};
|
||||
@@ -201,7 +201,7 @@ public:
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
|
||||
#endif // _FLUID_FD_SNAP_ACTION_H
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@
|
||||
#include <FL/filename.H>
|
||||
#include <FL/fl_ask.H>
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::app;
|
||||
using namespace fluid;
|
||||
using namespace fluid::app;
|
||||
|
||||
/**
|
||||
Load args from command line into variables.
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
namespace app {
|
||||
|
||||
class Args {
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
#endif // FLUID_APP_ARGS_H
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
#include "../src/flstring.h"
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::app;
|
||||
using namespace fluid;
|
||||
using namespace fluid::app;
|
||||
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ void History::update(std::string project_file) {
|
||||
Fluid.preferences.get("recent_files", max_files, 5);
|
||||
if (max_files > 10) max_files = 10;
|
||||
|
||||
std::string absolute = fld::fix_separators(fl_filename_absolute_str(project_file));
|
||||
std::string absolute = fluid::fix_separators(fl_filename_absolute_str(project_file));
|
||||
for (i = 0; i < max_files; i ++)
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
if (!strcasecmp(absolute.c_str(), abspath[i])) break;
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <FL/filename.H>
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
namespace app {
|
||||
|
||||
class History {
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
#endif // FLUID_APP_HISTORY_H
|
||||
|
||||
|
||||
+21
-21
@@ -62,7 +62,7 @@
|
||||
// TODO: make the settings dialog resizable
|
||||
// TODO: make g_shell_config static, not a pointer, but don't load anything in batch mode
|
||||
|
||||
// FEATURE: fld::Tool_Store icons are currently redundant with @file and @save and could be improved
|
||||
// FEATURE: fluid::Tool_Store icons are currently redundant with @file and @save and could be improved
|
||||
// FEATURE: hostname, username, getenv support?
|
||||
// FEATURE: add the files ./fluid.prefs and ./fluid.user.prefs as tool locations
|
||||
// FEATURE: interpret compiler output, for example: clang, and highlight errors and warnings
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
using namespace fld;
|
||||
using namespace fluid;
|
||||
|
||||
static std::string fltk_config_cmd;
|
||||
static Fl_Process s_proc;
|
||||
@@ -426,7 +426,7 @@ void run_shell_command(const std::string &cmd, int flags) {
|
||||
*/
|
||||
Fd_Shell_Command::Fd_Shell_Command()
|
||||
: shortcut(0),
|
||||
storage(fld::Tool_Store::USER),
|
||||
storage(fluid::Tool_Store::USER),
|
||||
condition(0),
|
||||
flags(0),
|
||||
shell_menu_item_(nullptr)
|
||||
@@ -460,7 +460,7 @@ Fd_Shell_Command::Fd_Shell_Command(const std::string &in_name)
|
||||
: name(in_name),
|
||||
label(in_name),
|
||||
shortcut(0),
|
||||
storage(fld::Tool_Store::USER),
|
||||
storage(fluid::Tool_Store::USER),
|
||||
condition(Fd_Shell_Command::ALWAYS),
|
||||
command("echo \"Hello, FLUID!\""),
|
||||
flags(Fd_Shell_Command::SAVE_PROJECT|Fd_Shell_Command::SAVE_SOURCECODE),
|
||||
@@ -483,7 +483,7 @@ Fd_Shell_Command::Fd_Shell_Command(const std::string &in_name)
|
||||
Fd_Shell_Command::Fd_Shell_Command(const std::string &in_name,
|
||||
const std::string &in_label,
|
||||
Fl_Shortcut in_shortcut,
|
||||
fld::Tool_Store in_storage,
|
||||
fluid::Tool_Store in_storage,
|
||||
int in_condition,
|
||||
const std::string &in_condition_data,
|
||||
const std::string &in_command,
|
||||
@@ -569,7 +569,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 = (fluid::Tool_Store)tmp;
|
||||
prefs.get("condition", condition, ALWAYS);
|
||||
prefs.get("condition_data", condition_data, "");
|
||||
prefs.get("command", command, "");
|
||||
@@ -587,10 +587,10 @@ void Fd_Shell_Command::write(Fl_Preferences &prefs, bool 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 fluid::io::Project_Reader *in) {
|
||||
const char *c = in->read_word(1);
|
||||
if (strcmp(c, "{")!=0) return; // expecting start of group
|
||||
storage = fld::Tool_Store::PROJECT;
|
||||
storage = fluid::Tool_Store::PROJECT;
|
||||
for (;;) {
|
||||
c = in->read_word(1);
|
||||
if (strcmp(c, "}")==0) break; // end of command list
|
||||
@@ -613,7 +613,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 fluid::io::Project_Writer *out) {
|
||||
out->write_string("\n command {");
|
||||
out->write_string("\n name "); out->write_word(name);
|
||||
out->write_string("\n label "); out->write_word(label);
|
||||
@@ -672,7 +672,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(fluid::Tool_Store storage) {
|
||||
for (int i=list_size-1; i>=0; i--) {
|
||||
if (list[i]->storage == storage) {
|
||||
remove(i);
|
||||
@@ -683,7 +683,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, fluid::Tool_Store storage) {
|
||||
// import the old shell commands from previous user settings
|
||||
if (&Fluid.preferences == &prefs) {
|
||||
int version;
|
||||
@@ -691,7 +691,7 @@ void Fd_Shell_Command_List::read(Fl_Preferences &prefs, fld::Tool_Store storage)
|
||||
if (version == 0) {
|
||||
int save_fl, save_code, save_strings;
|
||||
Fd_Shell_Command *cmd = new Fd_Shell_Command();
|
||||
cmd->storage = fld::Tool_Store::USER;
|
||||
cmd->storage = fluid::Tool_Store::USER;
|
||||
cmd->name = "Sample Shell Command";
|
||||
cmd->label = "Sample Shell Command";
|
||||
cmd->shortcut = FL_ALT+'g';
|
||||
@@ -712,7 +712,7 @@ void Fd_Shell_Command_List::read(Fl_Preferences &prefs, fld::Tool_Store storage)
|
||||
for (int i=0; i<n; i++) {
|
||||
Fl_Preferences cmd_prefs(shell_commands, Fl_Preferences::Name(i));
|
||||
Fd_Shell_Command *cmd = new Fd_Shell_Command();
|
||||
cmd->storage = fld::Tool_Store::USER;
|
||||
cmd->storage = fluid::Tool_Store::USER;
|
||||
cmd->read(cmd_prefs);
|
||||
add(cmd);
|
||||
}
|
||||
@@ -721,12 +721,12 @@ 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, fluid::Tool_Store storage) {
|
||||
Fl_Preferences shell_commands(prefs, "shell_commands");
|
||||
shell_commands.delete_all_groups();
|
||||
int index = 0;
|
||||
for (int i=0; i<list_size; i++) {
|
||||
if (list[i]->storage == fld::Tool_Store::USER) {
|
||||
if (list[i]->storage == fluid::Tool_Store::USER) {
|
||||
Fl_Preferences cmd(shell_commands, Fl_Preferences::Name(index++));
|
||||
list[i]->write(cmd);
|
||||
}
|
||||
@@ -736,10 +736,10 @@ 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(fluid::io::Project_Reader *in) {
|
||||
const char *c = in->read_word(1);
|
||||
if (strcmp(c, "{")!=0) return; // expecting start of group
|
||||
clear(fld::Tool_Store::PROJECT);
|
||||
clear(fluid::Tool_Store::PROJECT);
|
||||
for (;;) {
|
||||
c = in->read_word(1);
|
||||
if (strcmp(c, "}")==0) break; // end of command list
|
||||
@@ -756,16 +756,16 @@ 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(fluid::io::Project_Writer *out) {
|
||||
int n_in_project_file = 0;
|
||||
for (int i=0; i<list_size; i++) {
|
||||
if (list[i]->storage == fld::Tool_Store::PROJECT)
|
||||
if (list[i]->storage == fluid::Tool_Store::PROJECT)
|
||||
n_in_project_file++;
|
||||
}
|
||||
if (n_in_project_file > 0) {
|
||||
out->write_string("\nshell_commands {");
|
||||
for (int i=0; i<list_size; i++) {
|
||||
if (list[i]->storage == fld::Tool_Store::PROJECT)
|
||||
if (list[i]->storage == fluid::Tool_Store::PROJECT)
|
||||
list[i]->write(out);
|
||||
}
|
||||
out->write_string("\n}");
|
||||
@@ -953,7 +953,7 @@ void Fd_Shell_Command_List::import_from_file() {
|
||||
for (i = 0; i < n; i++) {
|
||||
Fl_Preferences cmd_prefs(shell_commands, Fl_Preferences::Name(i));
|
||||
Fd_Shell_Command *cmd = new Fd_Shell_Command();
|
||||
cmd->storage = fld::Tool_Store::USER;
|
||||
cmd->storage = fluid::Tool_Store::USER;
|
||||
cmd->read(cmd_prefs);
|
||||
g_shell_config->add(cmd);
|
||||
}
|
||||
|
||||
+11
-11
@@ -35,14 +35,14 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
namespace io {
|
||||
|
||||
class Project_Reader;
|
||||
class Project_Writer;
|
||||
|
||||
} // namespace io
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
struct Fl_Menu_Item;
|
||||
class Fl_Widget;
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
Fd_Shell_Command(const std::string &in_name,
|
||||
const std::string &in_label,
|
||||
Fl_Shortcut in_shortcut,
|
||||
fld::Tool_Store in_storage,
|
||||
fluid::Tool_Store in_storage,
|
||||
int in_condition,
|
||||
const std::string &in_condition_data,
|
||||
const std::string &in_command,
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
std::string name { };
|
||||
std::string label { };
|
||||
Fl_Shortcut shortcut = 0;
|
||||
fld::Tool_Store storage = fld::Tool_Store::USER;
|
||||
fluid::Tool_Store storage = fluid::Tool_Store::USER;
|
||||
int condition = ALWAYS; // always, hide, windows only, linux only, mac only, user, machine
|
||||
std::string condition_data { }; // user name, machine name
|
||||
std::string command { };
|
||||
@@ -113,8 +113,8 @@ public:
|
||||
void run();
|
||||
void read(Fl_Preferences &prefs);
|
||||
void write(Fl_Preferences &prefs, bool save_location = false);
|
||||
void read(class fld::io::Project_Reader*);
|
||||
void write(class fld::io::Project_Writer*);
|
||||
void read(class fluid::io::Project_Reader*);
|
||||
void write(class fluid::io::Project_Writer*);
|
||||
void update_shell_menu();
|
||||
bool is_active();
|
||||
};
|
||||
@@ -134,15 +134,15 @@ public:
|
||||
void insert(int index, Fd_Shell_Command *cmd);
|
||||
void remove(int index);
|
||||
void clear();
|
||||
void clear(fld::Tool_Store store);
|
||||
void clear(fluid::Tool_Store store);
|
||||
// void move_up();
|
||||
// void move_down();
|
||||
// int load(const std::string &filename);
|
||||
// int save(const std::string &filename);
|
||||
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 read(Fl_Preferences &prefs, fluid::Tool_Store storage);
|
||||
void write(Fl_Preferences &prefs, fluid::Tool_Store storage);
|
||||
void read(class fluid::io::Project_Reader*);
|
||||
void write(class fluid::io::Project_Writer*);
|
||||
void rebuild_shell_menu();
|
||||
void update_settings_dialog();
|
||||
|
||||
|
||||
@@ -28,14 +28,14 @@
|
||||
#include <FL/Fl_PNG_Image.H>
|
||||
#include "../src/flstring.h"
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::app;
|
||||
using namespace fluid;
|
||||
using namespace fluid::app;
|
||||
|
||||
/**
|
||||
Save a design template.
|
||||
\todo We should document the concept of templates.
|
||||
*/
|
||||
void fld::app::save_template() {
|
||||
void fluid::app::save_template() {
|
||||
// Setup the template panel...
|
||||
if (!template_panel) make_template_panel();
|
||||
|
||||
@@ -96,7 +96,7 @@ void fld::app::save_template() {
|
||||
"Replace", nullptr, c) == 0) return;
|
||||
}
|
||||
|
||||
if (!fld::io::write_file(Fluid.proj, filename)) {
|
||||
if (!fluid::io::write_file(Fluid.proj, filename)) {
|
||||
fl_alert("Error writing %s: %s", filename, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
#ifndef FLUID_APP_TEMPLATES_H
|
||||
#define FLUID_APP_TEMPLATES_H
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
namespace app {
|
||||
|
||||
void save_template();
|
||||
|
||||
} // namespace app
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
#endif // FLUID_APP_TEMPLATES_H
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::io;
|
||||
using namespace fld::proj;
|
||||
using namespace fluid;
|
||||
using namespace fluid::io;
|
||||
using namespace fluid::proj;
|
||||
|
||||
/**
|
||||
Return true if c can be in a C identifier.
|
||||
@@ -698,14 +698,14 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
|
||||
}
|
||||
}
|
||||
std::string loc_include, loc_conditional;
|
||||
if (proj_.i18n.type==fld::I18n_Type::GNU) {
|
||||
if (proj_.i18n.type==fluid::I18n_Type::GNU) {
|
||||
loc_include = proj_.i18n.gnu_include;
|
||||
loc_conditional = proj_.i18n.gnu_conditional;
|
||||
} else {
|
||||
loc_include = proj_.i18n.posix_include;
|
||||
loc_conditional = proj_.i18n.posix_conditional;
|
||||
}
|
||||
if ((proj_.i18n.type != fld::I18n_Type::NONE) && !loc_include.empty()) {
|
||||
if ((proj_.i18n.type != fluid::I18n_Type::NONE) && !loc_include.empty()) {
|
||||
int conditional = !loc_conditional.empty();
|
||||
if (conditional) {
|
||||
write_c("#ifdef %s\n", loc_conditional.c_str());
|
||||
@@ -715,7 +715,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
|
||||
write_c("#%sinclude \"%s\"\n", indent(), loc_include.c_str());
|
||||
else
|
||||
write_c("#%sinclude %s\n", indent(), loc_include.c_str());
|
||||
if (proj_.i18n.type == fld::I18n_Type::POSIX) {
|
||||
if (proj_.i18n.type == fluid::I18n_Type::POSIX) {
|
||||
if (!proj_.i18n.posix_file.empty()) {
|
||||
write_c("extern nl_catd %s;\n", proj_.i18n.posix_file.c_str());
|
||||
} else {
|
||||
@@ -727,14 +727,14 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
|
||||
}
|
||||
if (conditional) {
|
||||
write_c("#else\n");
|
||||
if (proj_.i18n.type == fld::I18n_Type::GNU) {
|
||||
if (proj_.i18n.type == fluid::I18n_Type::GNU) {
|
||||
if (!proj_.i18n.gnu_function.empty()) {
|
||||
write_c("#%sifndef %s\n", indent(), proj_.i18n.gnu_function.c_str());
|
||||
write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_function.c_str());
|
||||
write_c("#%sendif\n", indent());
|
||||
}
|
||||
}
|
||||
if (proj_.i18n.type == fld::I18n_Type::POSIX) {
|
||||
if (proj_.i18n.type == fluid::I18n_Type::POSIX) {
|
||||
write_c("#%sifndef catgets\n", indent());
|
||||
write_c("#%sdefine catgets(catalog, set, msgid, text) text\n", indent_plus(1));
|
||||
write_c("#%sendif\n", indent());
|
||||
@@ -742,7 +742,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
|
||||
indentation--;
|
||||
write_c("#endif\n");
|
||||
}
|
||||
if (proj_.i18n.type == fld::I18n_Type::GNU && proj_.i18n.gnu_static_function[0]) {
|
||||
if (proj_.i18n.type == fluid::I18n_Type::GNU && proj_.i18n.gnu_static_function[0]) {
|
||||
write_c("#ifndef %s\n", proj_.i18n.gnu_static_function.c_str());
|
||||
write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_static_function.c_str());
|
||||
write_c("#endif\n");
|
||||
|
||||
@@ -35,7 +35,7 @@ struct Fd_Pointer_Tree;
|
||||
|
||||
int is_id(char c);
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
|
||||
class Project;
|
||||
|
||||
@@ -136,6 +136,6 @@ public:
|
||||
};
|
||||
|
||||
} // namespace io
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
#endif // FLUID_IO_CODE_WRITER_H
|
||||
|
||||
@@ -39,13 +39,13 @@
|
||||
/// \defgroup flfile .fl Project File Operations
|
||||
/// \{
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::io;
|
||||
using namespace fluid;
|
||||
using namespace fluid::io;
|
||||
|
||||
// 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 fluid::io::fdesign_flip = 0;
|
||||
|
||||
/** \brief Read a .fl project file.
|
||||
|
||||
@@ -57,7 +57,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 fluid::io::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);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
class Node;
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
|
||||
class Project;
|
||||
|
||||
@@ -78,6 +78,6 @@ public:
|
||||
};
|
||||
|
||||
} // namespace io
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
#endif // FLUID_IO_PROJECT_READER_H
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
/// \defgroup flfile .fl Project File Operations
|
||||
/// \{
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::io;
|
||||
using namespace fluid;
|
||||
using namespace fluid::io;
|
||||
|
||||
/** \brief Write an .fl design description file.
|
||||
|
||||
@@ -42,7 +42,7 @@ using namespace fld::io;
|
||||
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 fluid::io::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);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
class Node;
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
|
||||
class Project;
|
||||
|
||||
@@ -63,6 +63,6 @@ public:
|
||||
};
|
||||
|
||||
} // namespace io
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
#endif // FLUID_IO_PROJECT_WRITER_H
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#include "nodes/Window_Node.h"
|
||||
#include "nodes/Function_Node.h"
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::io;
|
||||
using namespace fluid;
|
||||
using namespace fluid::io;
|
||||
|
||||
/**
|
||||
Write a string to a file, replacing all non-ASCII characters with octal codes.
|
||||
@@ -60,7 +60,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 std::string &filename) {
|
||||
int fluid::io::write_strings(Project &proj, const std::string &filename) {
|
||||
Node *p;
|
||||
Widget_Node *w;
|
||||
int i;
|
||||
@@ -69,7 +69,7 @@ int fld::io::write_strings(Project &proj, const std::string &filename) {
|
||||
if (!fp) return 1;
|
||||
|
||||
switch (proj.i18n.type) {
|
||||
case fld::I18n_Type::NONE : /* None, just put static text out */
|
||||
case fluid::I18n_Type::NONE : /* None, just put static text out */
|
||||
fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n",
|
||||
FL_VERSION);
|
||||
for (auto w: proj.tree.all_widgets()) {
|
||||
@@ -83,7 +83,7 @@ int fld::io::write_strings(Project &proj, const std::string &filename) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case fld::I18n_Type::GNU : /* GNU gettext, put a .po file out */
|
||||
case fluid::I18n_Type::GNU : /* GNU gettext, put a .po file out */
|
||||
fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n",
|
||||
FL_VERSION);
|
||||
for (p = proj.tree.first; p; p = p->next) {
|
||||
@@ -112,7 +112,7 @@ int fld::io::write_strings(Project &proj, const std::string &filename) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case fld::I18n_Type::POSIX : /* POSIX catgets, put a .msg file out */
|
||||
case fluid::I18n_Type::POSIX : /* POSIX catgets, put a .msg file out */
|
||||
fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n",
|
||||
FL_VERSION);
|
||||
fprintf(fp, "$set %s\n", proj.i18n.posix_set.c_str());
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
|
||||
class Project;
|
||||
|
||||
@@ -28,6 +28,6 @@ namespace io {
|
||||
int write_strings(Project &proj, const std::string &filename);
|
||||
|
||||
} // namespace io
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
#endif // FLUID_IO_STRING_WRITER_H
|
||||
|
||||
@@ -60,14 +60,14 @@ void Button_Node::ideal_size(int &w, int &h) {
|
||||
auto layout = Fluid.proj.layout;
|
||||
h = layout->labelsize + 8;
|
||||
w = layout->labelsize * 4 + 8;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::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(fluid::io::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(fluid::io::Project_Reader &f, const char *c) {
|
||||
Fl_Button *btn = (Fl_Button*)o;
|
||||
if (!strcmp(c, "compact")) {
|
||||
btn->compact((uchar)atol(f.read_word()));
|
||||
@@ -98,7 +98,7 @@ void Return_Button_Node::ideal_size(int &w, int &h) {
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
|
||||
Fl_Widget *Return_Button_Node::widget(int x, int y, int w, int h) {
|
||||
@@ -123,7 +123,7 @@ void Light_Button_Node::ideal_size(int &w, int &h) {
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
|
||||
Fl_Widget *Light_Button_Node::widget(int x, int y, int w, int h) {
|
||||
@@ -139,7 +139,7 @@ void Check_Button_Node::ideal_size(int &w, int &h) {
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
|
||||
Fl_Widget *Check_Button_Node::widget(int x, int y, int w, int h) {
|
||||
@@ -155,7 +155,7 @@ void Round_Button_Node::ideal_size(int &w, int &h) {
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
|
||||
Fl_Widget *Round_Button_Node::widget(int x, int y, int w, int h) {
|
||||
|
||||
@@ -38,8 +38,8 @@ public:
|
||||
int is_button() const override { return 1; }
|
||||
Type type() const override { return Type::Button; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Button) ? true : super::is_a(inType); }
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
void copy_properties() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
|
||||
extern void open_panel();
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::io;
|
||||
using namespace fld::proj;
|
||||
using namespace fluid;
|
||||
using namespace fluid::io;
|
||||
using namespace fluid::proj;
|
||||
|
||||
/// Set a current class, so that the code of the children is generated correctly.
|
||||
Class_Node *current_class = nullptr;
|
||||
@@ -218,7 +218,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(fluid::io::Project_Writer &f) {
|
||||
Node::write_properties(f);
|
||||
switch (public_) {
|
||||
case 0: f.write_string("private"); break;
|
||||
@@ -235,7 +235,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"private")) {
|
||||
public_ = 0;
|
||||
} else if (!strcmp(c,"protected")) {
|
||||
@@ -312,9 +312,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(fluid::io::Code_Writer& f)
|
||||
*/
|
||||
void Function_Node::write_code1(fld::io::Code_Writer& f) {
|
||||
void Function_Node::write_code1(fluid::io::Code_Writer& f) {
|
||||
constructor=0;
|
||||
havewidgets = 0;
|
||||
Node *child;
|
||||
@@ -443,9 +443,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(fluid::io::Code_Writer& f)
|
||||
*/
|
||||
void Function_Node::write_code2(fld::io::Code_Writer& f) {
|
||||
void Function_Node::write_code2(fluid::io::Code_Writer& f) {
|
||||
Node *child;
|
||||
const char *var = "w";
|
||||
char havechildren = 0;
|
||||
@@ -542,7 +542,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(fluid::io::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
|
||||
@@ -553,7 +553,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(fluid::io::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
|
||||
@@ -651,7 +651,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(fluid::io::Project_Writer &f) {
|
||||
Node::write_properties(f);
|
||||
if (!end_code().empty()) {
|
||||
f.write_string("after");
|
||||
@@ -662,7 +662,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"after")) {
|
||||
end_code(f.read_word());
|
||||
} else {
|
||||
@@ -680,7 +680,7 @@ void CodeBlock_Node::open() {
|
||||
/**
|
||||
Write the "before" code.
|
||||
*/
|
||||
void CodeBlock_Node::write_code1(fld::io::Code_Writer& f) {
|
||||
void CodeBlock_Node::write_code1(fluid::io::Code_Writer& f) {
|
||||
const char* c = name();
|
||||
f.write_c("%s%s {\n", f.indent(), c ? c : "");
|
||||
f.indentation++;
|
||||
@@ -689,7 +689,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(fluid::io::Code_Writer& f) {
|
||||
f.indentation--;
|
||||
if (!end_code().empty())
|
||||
f.write_c("%s} %s\n", f.indent(), end_code().c_str());
|
||||
@@ -753,7 +753,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(fluid::io::Project_Writer &f) {
|
||||
Node::write_properties(f);
|
||||
switch (public_) {
|
||||
case 0: f.write_string("private"); break;
|
||||
@@ -769,7 +769,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"public")) {
|
||||
public_ = 1;
|
||||
} else if (!strcmp(c,"private")) {
|
||||
@@ -797,7 +797,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(fluid::io::Code_Writer& f) {
|
||||
const char* c = name();
|
||||
if (!c) return;
|
||||
// handle a few keywords differently if inside a class
|
||||
@@ -903,7 +903,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(fluid::io::Project_Writer &f) {
|
||||
Decl_Node::write_properties(f);
|
||||
if (!filename().empty()) {
|
||||
f.write_string("filename");
|
||||
@@ -921,7 +921,7 @@ void Data_Node::write_properties(fld::io::Project_Writer &f) {
|
||||
/**
|
||||
Read specific properties.
|
||||
*/
|
||||
void Data_Node::read_property(fld::io::Project_Reader &f, const char *c) {
|
||||
void Data_Node::read_property(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"filename")) {
|
||||
storestring(f.read_word(), filename_, 1);
|
||||
} else if (!strcmp(c,"textmode")) {
|
||||
@@ -949,7 +949,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(fluid::io::Code_Writer& f) {
|
||||
const char *message = nullptr;
|
||||
const char *c = name();
|
||||
if (!c) return;
|
||||
@@ -1194,7 +1194,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(fluid::io::Project_Writer &f) {
|
||||
Node::write_properties(f);
|
||||
// deprecated
|
||||
if (is_public()) f.write_string("public");
|
||||
@@ -1208,7 +1208,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if(!strcmp(c,"public")) {
|
||||
write_map_ |= CODE_IN_HEADER;
|
||||
} else if(!strcmp(c,"protected")) {
|
||||
@@ -1233,7 +1233,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(fluid::io::Code_Writer& f) {
|
||||
const char* c = name();
|
||||
if (c && *c) {
|
||||
if (write_map_ & STATIC_IN_HEADER)
|
||||
@@ -1246,7 +1246,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(fluid::io::Code_Writer& f) {
|
||||
if (!end_code().empty()) {
|
||||
if (write_map_ & STATIC_IN_HEADER)
|
||||
f.write_h("%s\n", end_code().c_str());
|
||||
@@ -1259,7 +1259,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(fluid::io::Code_Writer& f) {
|
||||
const char* c = name();
|
||||
if (c && *c) {
|
||||
if (write_map_ & CODE_IN_HEADER)
|
||||
@@ -1272,7 +1272,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(fluid::io::Code_Writer& f) {
|
||||
if (!end_code().empty()) {
|
||||
if (write_map_ & CODE_IN_HEADER)
|
||||
f.write_h("%s\n", end_code().c_str());
|
||||
@@ -1323,7 +1323,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(fluid::io::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");
|
||||
@@ -1332,7 +1332,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"in_source")) {
|
||||
in_c_ = 1;
|
||||
} else if (!strcmp(c,"not_in_source")) {
|
||||
@@ -1378,7 +1378,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(fluid::io::Code_Writer& f) {
|
||||
const char* c = name();
|
||||
if (!c) return;
|
||||
if (!in_c_ && !in_h_) return;
|
||||
@@ -1463,7 +1463,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(fluid::io::Project_Writer &f) {
|
||||
Node::write_properties(f);
|
||||
if (!base_class().empty()) {
|
||||
f.write_string(":");
|
||||
@@ -1478,7 +1478,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"private")) {
|
||||
public_ = 0;
|
||||
} else if (!strcmp(c,"protected")) {
|
||||
@@ -1500,7 +1500,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(fluid::io::Code_Writer& f) {
|
||||
parent_class = current_class;
|
||||
current_class = this;
|
||||
write_public_state = 0;
|
||||
@@ -1519,7 +1519,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(fluid::io::Code_Writer& f) {
|
||||
f.write_h("};\n");
|
||||
current_class = parent_class;
|
||||
}
|
||||
|
||||
+34
-34
@@ -62,8 +62,8 @@ public:
|
||||
~Function_Node() override = default;
|
||||
|
||||
Node *make(Strategy strategy) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
void open() override;
|
||||
int ismain() {return name_ == nullptr;}
|
||||
const char *type_name() override {return "Function";}
|
||||
@@ -73,8 +73,8 @@ public:
|
||||
int is_public() const override;
|
||||
Type type() const override { return Type::Function; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Function) ? true : super::is_a(inType); }
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
int has_signature(const char *, const char*) const;
|
||||
std::string return_type() const { return return_type_; }
|
||||
void return_type(const std::string& t) { storestring(t, return_type_); }
|
||||
@@ -103,9 +103,9 @@ public:
|
||||
~Code_Node() override = default;
|
||||
|
||||
Node *make(Strategy strategy) override;
|
||||
void write(fld::io::Project_Writer &f) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override { }
|
||||
void write(fluid::io::Project_Writer &f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override { }
|
||||
void open() override;
|
||||
const char *type_name() override {return "code";}
|
||||
int is_code_block() const override {return 0;}
|
||||
@@ -130,7 +130,7 @@ class CodeBlock_Node : public Node
|
||||
public:
|
||||
typedef Node super;
|
||||
static CodeBlock_Node prototype;
|
||||
|
||||
|
||||
private:
|
||||
std::string end_code_;
|
||||
|
||||
@@ -139,8 +139,8 @@ public:
|
||||
~CodeBlock_Node() override = default;
|
||||
|
||||
Node *make(Strategy strategy) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
void open() override;
|
||||
const char *type_name() override {return "codeblock";}
|
||||
int is_code_block() const override {return 1;}
|
||||
@@ -148,8 +148,8 @@ public:
|
||||
int is_public() const override { return -1; }
|
||||
Type type() const override { return Type::CodeBlock; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::CodeBlock) ? true : super::is_a(inType); }
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
std::string end_code() const { return end_code_; }
|
||||
void end_code(const std::string& c) { storestring(c, end_code_); }
|
||||
};
|
||||
@@ -171,12 +171,12 @@ public:
|
||||
~Decl_Node() override = default;
|
||||
|
||||
Node *make(Strategy strategy) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override { }
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override { }
|
||||
void open() override;
|
||||
const char *type_name() override {return "decl";}
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
int is_public() const override;
|
||||
Type type() const override { return Type::Decl; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Decl) ? true : super::is_a(inType); }
|
||||
@@ -203,12 +203,12 @@ public:
|
||||
~Data_Node() override = default;
|
||||
|
||||
Node *make(Strategy strategy) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override {}
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override {}
|
||||
void open() override;
|
||||
const char *type_name() override {return "data";}
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
Type type() const override { return Type::Data; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Data) ? true : super::is_a(inType); }
|
||||
void filename(const std::string& fn) { storestring(fn, filename_); }
|
||||
@@ -240,14 +240,14 @@ public:
|
||||
~DeclBlock_Node() override = default;
|
||||
|
||||
Node *make(Strategy strategy) override;
|
||||
void write_static(fld::io::Code_Writer& f) override;
|
||||
void write_static_after(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_static(fluid::io::Code_Writer& f) override;
|
||||
void write_static_after(fluid::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
void open() override;
|
||||
const char *type_name() override {return "declblock";}
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
int can_have_children() const override {return 1;}
|
||||
int is_decl_block() const override {return 1;}
|
||||
int is_public() const override;
|
||||
@@ -277,12 +277,12 @@ public:
|
||||
~Comment_Node() override = default;
|
||||
|
||||
Node *make(Strategy strategy) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override { }
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override { }
|
||||
void open() override;
|
||||
const char *type_name() override {return "comment";}
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
int is_public() const override { return 1; }
|
||||
Type type() const override { return Type::Comment; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Comment) ? true : super::is_a(inType); }
|
||||
@@ -314,8 +314,8 @@ public:
|
||||
Class_Node* parent_class; // save class if nested
|
||||
|
||||
Node *make(Strategy strategy) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
void open() override;
|
||||
const char *type_name() override {return "class";}
|
||||
int can_have_children() const override {return 1;}
|
||||
@@ -324,8 +324,8 @@ public:
|
||||
int is_public() const override;
|
||||
Type type() const override { return Type::Class; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Class) ? true : super::is_a(inType); }
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
|
||||
/** Get base class access and name. */
|
||||
std::string base_class() const { return base_class_; }
|
||||
|
||||
@@ -343,7 +343,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(fluid::io::Project_Writer &f)
|
||||
{
|
||||
super::write_properties(f);
|
||||
Fl_Grid* grid = (Fl_Grid*)o;
|
||||
@@ -408,7 +408,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(fluid::io::Project_Reader &f, const char *c)
|
||||
{
|
||||
Fl_Grid* grid = (Fl_Grid*)o;
|
||||
if (!strcmp(c,"dimensions")) {
|
||||
@@ -458,7 +458,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(fluid::io::Project_Writer &f, Node *child, bool encapsulate) {
|
||||
Fl_Grid *grid;
|
||||
Fl_Widget *child_widget;
|
||||
Fl_Grid::Cell *cell;
|
||||
@@ -505,7 +505,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(fluid::io::Project_Reader &f, Node *child, const char *property) {
|
||||
if (!child->is_true_widget()) {
|
||||
super::read_parent_property(f, child, property);
|
||||
return;
|
||||
@@ -544,7 +544,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(fluid::io::Code_Writer& f) {
|
||||
const char *var = name() ? name() : "o";
|
||||
Fl_Grid* grid = (Fl_Grid*)o;
|
||||
Widget_Node::write_code1(f);
|
||||
@@ -608,7 +608,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(fluid::io::Code_Writer& f) {
|
||||
const char *var = name() ? name() : "o";
|
||||
Fl_Grid* grid = (Fl_Grid*)o;
|
||||
bool first_cell = true;
|
||||
|
||||
@@ -57,16 +57,16 @@ public:
|
||||
Fl_Widget *widget(int X,int Y,int W,int H) override;
|
||||
Type type() const override { return Type::Grid; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Grid) ? true : super::is_a(inType); }
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate) override;
|
||||
void read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
void write_parent_properties(fluid::io::Project_Writer &f, Node *child, bool encapsulate) override;
|
||||
void read_parent_property(fluid::io::Project_Reader &f, Node *child, const char *property) override;
|
||||
Fl_Widget *enter_live_mode(int top=0) override;
|
||||
void leave_live_mode() override;
|
||||
void copy_properties() override;
|
||||
void copy_properties_for_children() override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
void add_child(Node*, Node*) override;
|
||||
void move_child(Node*, Node*) override;
|
||||
void remove_child(Node*) override;
|
||||
|
||||
@@ -194,14 +194,14 @@ void Group_Node::ideal_size(int &w, int &h) {
|
||||
w = 140;
|
||||
h = 140;
|
||||
}
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
|
||||
void Group_Node::write_code1(fld::io::Code_Writer& f) {
|
||||
void Group_Node::write_code1(fluid::io::Code_Writer& f) {
|
||||
Widget_Node::write_code1(f);
|
||||
}
|
||||
|
||||
void Group_Node::write_code2(fld::io::Code_Writer& f) {
|
||||
void Group_Node::write_code2(fluid::io::Code_Writer& f) {
|
||||
const char *var = name() ? name() : "o";
|
||||
write_extra_code(f);
|
||||
f.write_c("%s%s->end();\n", f.indent(), var);
|
||||
@@ -352,7 +352,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(fluid::io::Project_Writer &f)
|
||||
{
|
||||
Group_Node::write_properties(f);
|
||||
Fl_Flex* flex = (Fl_Flex*)o;
|
||||
@@ -377,7 +377,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(fluid::io::Project_Reader &f, const char *c)
|
||||
{
|
||||
Fl_Flex* flex = (Fl_Flex*)o;
|
||||
suspend_auto_layout = 1;
|
||||
@@ -425,7 +425,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(fluid::io::Code_Writer& f) {
|
||||
const char *var = name() ? name() : "o";
|
||||
Fl_Flex* flex = (Fl_Flex*)o;
|
||||
int lm, tm, rm, bm;
|
||||
@@ -714,7 +714,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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
|
||||
// ---- Tabs_Node --------------------------------------------------- MARK: -
|
||||
|
||||
@@ -56,8 +56,8 @@ public:
|
||||
Fl_Widget *widget(int X,int Y,int W,int H) override {
|
||||
Fl_Group_Proxy *g = new Fl_Group_Proxy(X,Y,W,H); Fl_Group::current(nullptr); return g;}
|
||||
Widget_Node *_make() override {return new Group_Node();}
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
void add_child(Node*, Node*) override;
|
||||
void move_child(Node*, Node*) override;
|
||||
void remove_child(Node*) override;
|
||||
@@ -122,13 +122,13 @@ public:
|
||||
Fl_Flex *g = new Fl_Flex_Proxy(X,Y,W,H); Fl_Group::current(nullptr); return g;}
|
||||
Type type() const override { return Type::Flex; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Flex) ? true : super::is_a(inType); }
|
||||
void write_properties(fld::io::Project_Writer &f) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
Fl_Widget *enter_live_mode(int top=0) override;
|
||||
void copy_properties() override;
|
||||
void copy_properties_for_children() override;
|
||||
void postprocess_read() override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
// void add_child(Node*, Node*) override;
|
||||
// void move_child(Node*, Node*) override;
|
||||
void remove_child(Node*) override;
|
||||
|
||||
+21
-21
@@ -44,8 +44,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::proj;
|
||||
using namespace fluid;
|
||||
using namespace fluid::proj;
|
||||
|
||||
Fl_Menu_Item menu_item_type_menu[] = {
|
||||
{"Normal",0,nullptr,(void*)nullptr},
|
||||
@@ -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(fluid::io::Code_Writer& f, int& i) {
|
||||
i = 0;
|
||||
Node* t = prev;
|
||||
while (t && t->is_a(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(fluid::io::Code_Writer& f) {
|
||||
if (active_image.asset && 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(fluid::io::Code_Writer& f)
|
||||
f.write_c("Fl_Menu_Item* %s::%s;\n", k, c);
|
||||
}
|
||||
}
|
||||
@@ -475,7 +475,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(fluid::io::Code_Writer& f) {
|
||||
static const char * const labeltypes[] = {
|
||||
"FL_NORMAL_LABEL",
|
||||
"FL_NO_LABEL",
|
||||
@@ -494,13 +494,13 @@ void Menu_Item_Node::write_item(fld::io::Code_Writer& f) {
|
||||
// Label, can not be nullptr which has a special meaning here
|
||||
if (label() && label()[0])
|
||||
switch (Fluid.proj.i18n.type) {
|
||||
case fld::I18n_Type::GNU:
|
||||
case fluid::I18n_Type::GNU:
|
||||
// we will call i18n when the menu is instantiated for the first time
|
||||
f.write_c("%s(", Fluid.proj.i18n.gnu_static_function.c_str());
|
||||
f.write_cstring(label());
|
||||
f.write_c(")");
|
||||
break;
|
||||
case fld::I18n_Type::POSIX:
|
||||
case fluid::I18n_Type::POSIX:
|
||||
// fall through: strings can't be translated before a catalog is chosen
|
||||
default:
|
||||
f.write_cstring(label());
|
||||
@@ -563,7 +563,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(fluid::io::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);
|
||||
@@ -571,7 +571,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(fluid::io::Code_Writer& f) {
|
||||
int i; const char* mname = menu_name(f, i);
|
||||
|
||||
if (!prev->is_a(Type::Menu_Item)) {
|
||||
@@ -618,12 +618,12 @@ void Menu_Item_Node::write_code1(fld::io::Code_Writer& f) {
|
||||
f.write_c("%sml->labela = (char*)", f.indent());
|
||||
active_image.asset->write_inline(f);
|
||||
f.write_c(";\n");
|
||||
if (Fluid.proj.i18n.type==fld::I18n_Type::NONE) {
|
||||
if (Fluid.proj.i18n.type==fluid::I18n_Type::NONE) {
|
||||
f.write_c("%sml->labelb = o->label();\n", f.indent());
|
||||
} else if (Fluid.proj.i18n.type==fld::I18n_Type::GNU) {
|
||||
} else if (Fluid.proj.i18n.type==fluid::I18n_Type::GNU) {
|
||||
f.write_c("%sml->labelb = %s(o->label());\n",
|
||||
f.indent(), Fluid.proj.i18n.gnu_function.c_str());
|
||||
} else if (Fluid.proj.i18n.type==fld::I18n_Type::POSIX) {
|
||||
} else if (Fluid.proj.i18n.type==fluid::I18n_Type::POSIX) {
|
||||
f.write_c("%sml->labelb = catgets(%s,%s,i+%d,o->label());\n",
|
||||
f.indent(),
|
||||
Fluid.proj.i18n.posix_file.empty() ? "_catalog" : Fluid.proj.i18n.posix_file.c_str(),
|
||||
@@ -636,17 +636,17 @@ void Menu_Item_Node::write_code1(fld::io::Code_Writer& f) {
|
||||
active_image.asset->write_code(f, 0, "o");
|
||||
}
|
||||
}
|
||||
if ((Fluid.proj.i18n.type != fld::I18n_Type::NONE) && label() && label()[0]) {
|
||||
if ((Fluid.proj.i18n.type != fluid::I18n_Type::NONE) && label() && label()[0]) {
|
||||
Fl_Labeltype t = o->labeltype();
|
||||
if (active_image.asset) {
|
||||
// label was already copied a few lines up
|
||||
} else if ( t==FL_NORMAL_LABEL || t==FL_SHADOW_LABEL
|
||||
|| t==FL_ENGRAVED_LABEL || t==FL_EMBOSSED_LABEL) {
|
||||
start_menu_initialiser(f, menuItemInitialized, mname, i);
|
||||
if (Fluid.proj.i18n.type==fld::I18n_Type::GNU) {
|
||||
if (Fluid.proj.i18n.type==fluid::I18n_Type::GNU) {
|
||||
f.write_c("%so->label(%s(o->label()));\n",
|
||||
f.indent(), Fluid.proj.i18n.gnu_function.c_str());
|
||||
} else if (Fluid.proj.i18n.type==fld::I18n_Type::POSIX) {
|
||||
} else if (Fluid.proj.i18n.type==fluid::I18n_Type::POSIX) {
|
||||
f.write_c("%so->label(catgets(%s,%s,i+%d,o->label()));\n",
|
||||
f.indent(),
|
||||
Fluid.proj.i18n.posix_file.empty() ? "_catalog" : Fluid.proj.i18n.posix_file.c_str(),
|
||||
@@ -666,7 +666,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(fluid::io::Code_Writer&) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// This is the base class for widgets that contain a menu (ie
|
||||
@@ -758,7 +758,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(fluid::io::Code_Writer& f) {
|
||||
if (next && next->is_a(Type::Menu_Item)) {
|
||||
f.write_c("%s%s->menu(%s);\n", f.indent(), name() ? name() : "o",
|
||||
f.unique_id(this, "menu", name(), label()));
|
||||
@@ -872,7 +872,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(fluid::io::Code_Writer& f) {
|
||||
super::write_static(f);
|
||||
if (is_sys_menu_bar()) {
|
||||
f.write_h_once("#include <FL/Fl_Sys_Menu_Bar.H>");
|
||||
@@ -892,7 +892,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(fluid::io::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",
|
||||
@@ -900,7 +900,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(fluid::io::Code_Writer& f) {
|
||||
// super::write_code2(f);
|
||||
//}
|
||||
|
||||
|
||||
+10
-10
@@ -65,12 +65,12 @@ public:
|
||||
int is_button() const override {return 1;} // this gets shortcut to work
|
||||
Fl_Widget* widget(int,int,int,int) override {return nullptr;}
|
||||
Widget_Node* _make() override {return nullptr;}
|
||||
virtual const char* menu_name(fld::io::Code_Writer& f, int& i);
|
||||
virtual const char* menu_name(fluid::io::Code_Writer& f, int& i);
|
||||
int flags();
|
||||
void write_static(fld::io::Code_Writer& f) override;
|
||||
void write_item(fld::io::Code_Writer& f);
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_static(fluid::io::Code_Writer& f) override;
|
||||
void write_item(fluid::io::Code_Writer& f);
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
int is_true_widget() const override { return 0; }
|
||||
Type type() const override { return Type::Menu_Item; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Menu_Item) ? true : super::is_a(inType); }
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
int can_have_children() const override {return 1;}
|
||||
int menusize;
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
void move_child(Node*, Node*) override { build_menu(); }
|
||||
void remove_child(Node*) override { build_menu();}
|
||||
Node* click_test(int x, int y) override = 0;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
void copy_properties() override = 0;
|
||||
Type type() const override { return Type::Menu_Manager_; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Menu_Manager_) ? true : super::is_a(inType); }
|
||||
@@ -302,9 +302,9 @@ public:
|
||||
const char *alt_type_name() override {return "fltk::MenuBar";}
|
||||
Fl_Widget *widget(int X,int Y,int W,int H) override {return new Fl_Menu_Bar(X,Y,W,H);}
|
||||
Widget_Node *_make() override {return new Menu_Bar_Node();}
|
||||
void write_static(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
// void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_static(fluid::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
// void write_code2(fluid::io::Code_Writer& f) override;
|
||||
Type type() const override { return Type::Menu_Bar; }
|
||||
bool is_a(Type inType) const override { return (inType==Type::Menu_Bar) ? true : super::is_a(inType); }
|
||||
bool is_sys_menu_bar();
|
||||
|
||||
+18
-18
@@ -401,7 +401,7 @@ void delete_all(int selected_only) {
|
||||
if(!selected_only) {
|
||||
// reset the setting for the external shell command
|
||||
if (g_shell_config) {
|
||||
g_shell_config->clear(fld::Tool_Store::PROJECT);
|
||||
g_shell_config->clear(fluid::Tool_Store::PROJECT);
|
||||
g_shell_config->rebuild_shell_menu();
|
||||
g_shell_config->update_settings_dialog();
|
||||
}
|
||||
@@ -409,7 +409,7 @@ void delete_all(int selected_only) {
|
||||
widget_browser->hposition(0);
|
||||
widget_browser->vposition(0);
|
||||
}
|
||||
Fluid.layout_list.remove_all(fld::Tool_Store::PROJECT);
|
||||
Fluid.layout_list.remove_all(fluid::Tool_Store::PROJECT);
|
||||
Fluid.layout_list.current_suite(0);
|
||||
Fluid.layout_list.current_preset(0);
|
||||
Fluid.layout_list.update_dialogs();
|
||||
@@ -891,7 +891,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(fluid::io::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);
|
||||
@@ -923,7 +923,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(fluid::io::Project_Writer &f) {
|
||||
// repeat this for each attribute:
|
||||
if (Fluid.proj.write_mergeback_data && uid_) {
|
||||
f.write_word("uid");
|
||||
@@ -957,7 +957,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"uid")) {
|
||||
const char *hex = f.read_word();
|
||||
int x = 0;
|
||||
@@ -1022,13 +1022,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(fluid::io::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(fluid::io::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
|
||||
@@ -1055,14 +1055,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(fluid::io::Project_Writer &f, Node *child, bool encapsulate)
|
||||
\see Grid_Node::read_parent_property(fluid::io::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(fluid::io::Project_Reader &f, Node *child, const char *property) {
|
||||
(void)child;
|
||||
f.read_error("Unknown parent property \"%s\"", property);
|
||||
}
|
||||
@@ -1074,7 +1074,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(fluid::io::Code_Writer& f, const char *pre)
|
||||
{
|
||||
if (comment() && *comment()) {
|
||||
f.write_h("%s/**\n", pre);
|
||||
@@ -1097,7 +1097,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(fluid::io::Code_Writer& f, const char *pre)
|
||||
{
|
||||
if (comment() && *comment()) {
|
||||
f.write_c("%s/**\n", pre);
|
||||
@@ -1122,7 +1122,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(fluid::io::Code_Writer& f, const char *pre)
|
||||
{
|
||||
if (comment() && *comment()) {
|
||||
const char *s = comment();
|
||||
@@ -1202,7 +1202,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(fluid::io::Code_Writer& f) {
|
||||
if (is_name(callback())) return callback();
|
||||
return f.unique_id(this, "cb", name(), label());
|
||||
}
|
||||
@@ -1255,18 +1255,18 @@ bool Node::is_in_class() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Node::write_static(fld::io::Code_Writer&) {
|
||||
void Node::write_static(fluid::io::Code_Writer&) {
|
||||
}
|
||||
|
||||
void Node::write_static_after(fld::io::Code_Writer&) {
|
||||
void Node::write_static_after(fluid::io::Code_Writer&) {
|
||||
}
|
||||
|
||||
void Node::write_code1(fld::io::Code_Writer& f) {
|
||||
void Node::write_code1(fluid::io::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(fluid::io::Code_Writer&) {
|
||||
}
|
||||
|
||||
/** Set a uid that is unique within the project.
|
||||
|
||||
+17
-17
@@ -28,14 +28,14 @@ class Node;
|
||||
class Group_Node;
|
||||
class Window_Node;
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
namespace io {
|
||||
|
||||
class Project_Reader;
|
||||
class Project_Writer;
|
||||
|
||||
} // namespace io
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
/**
|
||||
Declare where a new type is placed and how to create it.
|
||||
@@ -55,8 +55,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 *fluid::io::Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options)
|
||||
int fluid::io::Project_Reader::read_project(const char *filename, int merge, Strategy strategy)
|
||||
*/
|
||||
typedef struct Strategy {
|
||||
enum Flags {
|
||||
@@ -197,7 +197,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(fluid::io::Code_Writer& f);
|
||||
|
||||
// text positions of this type in code, header, and project file (see codeview)
|
||||
int code_static_start, code_static_end;
|
||||
@@ -259,22 +259,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(fluid::io::Project_Writer &f);
|
||||
virtual void write_properties(fluid::io::Project_Writer &f);
|
||||
virtual void read_property(fluid::io::Project_Reader &f, const char *);
|
||||
virtual void write_parent_properties(fluid::io::Project_Writer &f, Node *child, bool encapsulate);
|
||||
virtual void read_parent_property(fluid::io::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=nullptr); // write the commentary text
|
||||
virtual void write_static(fluid::io::Code_Writer& f); // write static stuff to .c file
|
||||
virtual void write_static_after(fluid::io::Code_Writer& f); // write static stuff after children
|
||||
virtual void write_code1(fluid::io::Code_Writer& f); // code and .h before children
|
||||
virtual void write_code2(fluid::io::Code_Writer& f); // code and .h after children
|
||||
void write_comment_h(fluid::io::Code_Writer& f, const char *ind=""); // write the commentary text into the header file
|
||||
void write_comment_c(fluid::io::Code_Writer& f, const char *ind=""); // write the commentary text into the source file
|
||||
void write_comment_inline_c(fluid::io::Code_Writer& f, const char *ind=nullptr); // write the commentary text
|
||||
|
||||
// live mode
|
||||
virtual Fl_Widget *enter_live_mode(int top=0); // build widgets needed for live mode
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
#include "Project.h"
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::node;
|
||||
using namespace fluid;
|
||||
using namespace fluid::node;
|
||||
|
||||
|
||||
Tree::Iterator::Iterator(Node *t, bool only_selected)
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@
|
||||
|
||||
class Node;
|
||||
|
||||
namespace fld {
|
||||
namespace fluid {
|
||||
|
||||
class Project;
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
};
|
||||
|
||||
} // namespace node
|
||||
} // namespace fld
|
||||
} // namespace fluid
|
||||
|
||||
|
||||
#endif // FLUID_NODES_TREE_H
|
||||
|
||||
@@ -76,7 +76,7 @@ void Widget_Image::apply_to_widget(Fl_Widget* w, bool deimage) const {
|
||||
Delegates to Image_Asset::write_static() using this slot's \c compress setting.
|
||||
Does nothing when no asset is loaded or the asset has already been written.
|
||||
*/
|
||||
void Widget_Image::write_static(fld::io::Code_Writer& f) const {
|
||||
void Widget_Image::write_static(fluid::io::Code_Writer& f) const {
|
||||
if (asset && !f.c_contains(asset.get()))
|
||||
asset->write_static(f, compress);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ void Widget_Image::write_static(fld::io::Code_Writer& f) const {
|
||||
of \c scale_w or \c scale_h is nonzero, the matching \c ->scale() call.
|
||||
Does nothing when no asset is loaded.
|
||||
*/
|
||||
void Widget_Image::write_code(fld::io::Code_Writer& f, const char* var, bool deimage) const {
|
||||
void Widget_Image::write_code(fluid::io::Code_Writer& f, const char* var, bool deimage) const {
|
||||
if (!asset) return;
|
||||
asset->write_code(f, bind, var, deimage ? 1 : 0);
|
||||
if (scale_w || scale_h) {
|
||||
@@ -112,7 +112,7 @@ void Widget_Image::write_code(fld::io::Code_Writer& f, const char* var, bool dei
|
||||
Writes nothing when \c name is empty; omits the scale and bind entries when they
|
||||
hold their default values.
|
||||
*/
|
||||
void Widget_Image::write_properties(fld::io::Project_Writer& f, bool deimage) const {
|
||||
void Widget_Image::write_properties(fluid::io::Project_Writer& f, bool deimage) const {
|
||||
if (!name.empty()) {
|
||||
if (scale_w || scale_h)
|
||||
f.write_string(deimage ? "scale_deimage {%d %d}" : "scale_image {%d %d}", scale_w, scale_h);
|
||||
|
||||
@@ -57,13 +57,13 @@ public:
|
||||
void apply_to_widget(Fl_Widget* w, bool deimage) const;
|
||||
|
||||
/// Write static image data into the generated source file.
|
||||
void write_static(fld::io::Code_Writer& f) const;
|
||||
void write_static(fluid::io::Code_Writer& f) const;
|
||||
|
||||
/// Write widget image setup code (e.g., widget->image(img); image->scale(...)).
|
||||
void write_code(fld::io::Code_Writer& f, const char* var, bool deimage) const;
|
||||
void write_code(fluid::io::Code_Writer& f, const char* var, bool deimage) const;
|
||||
|
||||
/// Write image properties into a .fl project file.
|
||||
void write_properties(fld::io::Project_Writer& f, bool deimage) const;
|
||||
void write_properties(fluid::io::Project_Writer& f, bool deimage) const;
|
||||
};
|
||||
|
||||
#endif // FLUID_NODES_WIDGET_IMAGE_H
|
||||
|
||||
+38
-38
@@ -46,8 +46,8 @@
|
||||
#undef max
|
||||
#include <algorithm>
|
||||
|
||||
using namespace fld;
|
||||
using namespace fld::proj;
|
||||
using namespace fluid;
|
||||
using namespace fluid::proj;
|
||||
|
||||
extern void redraw_browser();
|
||||
|
||||
@@ -95,7 +95,7 @@ std::string subclassname(Node* l) {
|
||||
void Widget_Node::ideal_size(int &w, int &h) {
|
||||
w = 120;
|
||||
h = 100;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -359,88 +359,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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::Formula_Input*, void* v) {
|
||||
Node* t = ((Node*)v)->prev_sibling();
|
||||
if (t && t->is_widget())
|
||||
return ((Widget_Node*)t)->o->h();
|
||||
@@ -469,27 +469,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 fluid::widget::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 fluid::widget::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 fluid::widget::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 fluid::widget::Formula_Input*, void* v) {
|
||||
calculate_bbox((Node*)v);
|
||||
return bbox_b - bbox_y;
|
||||
}
|
||||
|
||||
fld::widget::Formula_Input_Vars widget_vars[] = {
|
||||
fluid::widget::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 },
|
||||
@@ -1446,7 +1446,7 @@ int isdeclare(const char* c) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Widget_Node::write_static(fld::io::Code_Writer& f) {
|
||||
void Widget_Node::write_static(fluid::io::Code_Writer& f) {
|
||||
std::string t = subclassname(this);
|
||||
if (subclass().empty() || (is_class() && (t.compare(0, 3, "Fl_")==0))) {
|
||||
f.write_h_once("#include <FL/Fl.H>");
|
||||
@@ -1533,7 +1533,7 @@ void Widget_Node::write_static(fld::io::Code_Writer& f) {
|
||||
inactive_image.write_static(f);
|
||||
}
|
||||
|
||||
void Widget_Node::write_code1(fld::io::Code_Writer& f) {
|
||||
void Widget_Node::write_code1(fluid::io::Code_Writer& f) {
|
||||
std::string t = subclassname(this);
|
||||
const char* c = array_name(this);
|
||||
if (c) {
|
||||
@@ -1631,15 +1631,15 @@ void Widget_Node::write_code1(fld::io::Code_Writer& f) {
|
||||
if (label() && *label()) {
|
||||
f.write_c(", ");
|
||||
switch (Fluid.proj.i18n.type) {
|
||||
case fld::I18n_Type::NONE : /* None */
|
||||
case fluid::I18n_Type::NONE : /* None */
|
||||
f.write_cstring(label());
|
||||
break;
|
||||
case fld::I18n_Type::GNU : /* GNU gettext */
|
||||
case fluid::I18n_Type::GNU : /* GNU gettext */
|
||||
f.write_c("%s(", Fluid.proj.i18n.gnu_function.c_str());
|
||||
f.write_cstring(label());
|
||||
f.write_c(")");
|
||||
break;
|
||||
case fld::I18n_Type::POSIX : /* POSIX catgets */
|
||||
case fluid::I18n_Type::POSIX : /* POSIX catgets */
|
||||
f.write_c("catgets(%s,%s,%d,",
|
||||
Fluid.proj.i18n.posix_file.empty() ? "_catalog" : Fluid.proj.i18n.posix_file.c_str(),
|
||||
Fluid.proj.i18n.posix_set.c_str(), msgnum());
|
||||
@@ -1659,7 +1659,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(fluid::io::Code_Writer& f, const char* field, Fl_Color color) {
|
||||
const char* color_name = nullptr;
|
||||
switch (color) {
|
||||
case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break;
|
||||
@@ -1697,23 +1697,23 @@ 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(fluid::io::Code_Writer& f) for Window_Node:
|
||||
void Widget_Node::write_widget_code(fluid::io::Code_Writer& f) {
|
||||
Fl_Widget* tplate = ((Widget_Node*)factory)->o;
|
||||
const char* var = is_class() ? "this" : name() ? name() : "o";
|
||||
|
||||
if (!tooltip().empty()) {
|
||||
f.write_c("%s%s->tooltip(",f.indent(), var);
|
||||
switch (Fluid.proj.i18n.type) {
|
||||
case fld::I18n_Type::NONE : /* None */
|
||||
case fluid::I18n_Type::NONE : /* None */
|
||||
f.write_cstring(tooltip().c_str());
|
||||
break;
|
||||
case fld::I18n_Type::GNU : /* GNU gettext */
|
||||
case fluid::I18n_Type::GNU : /* GNU gettext */
|
||||
f.write_c("%s(", Fluid.proj.i18n.gnu_function.c_str());
|
||||
f.write_cstring(tooltip().c_str());
|
||||
f.write_c(")");
|
||||
break;
|
||||
case fld::I18n_Type::POSIX : /* POSIX catgets */
|
||||
case fluid::I18n_Type::POSIX : /* POSIX catgets */
|
||||
f.write_c("catgets(%s,%s,%d,",
|
||||
Fluid.proj.i18n.posix_file.empty() ? "_catalog" : Fluid.proj.i18n.posix_file.c_str(),
|
||||
Fluid.proj.i18n.posix_set.c_str(),
|
||||
@@ -1879,26 +1879,26 @@ 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(fluid::io::Code_Writer& f) {
|
||||
for (int n=0; n < NUM_EXTRA_CODE; n++)
|
||||
if (!extra_code(n).empty() && !isdeclare(extra_code(n).c_str()))
|
||||
f.write_c("%s%s\n", f.indent(), extra_code(n).c_str());
|
||||
}
|
||||
|
||||
void Widget_Node::write_block_close(fld::io::Code_Writer& f) {
|
||||
void Widget_Node::write_block_close(fluid::io::Code_Writer& f) {
|
||||
f.indentation--;
|
||||
f.write_c("%s} // %s* %s\n", f.indent(), subclassname(this).c_str(),
|
||||
name() ? name() : "o");
|
||||
}
|
||||
|
||||
void Widget_Node::write_code2(fld::io::Code_Writer& f) {
|
||||
void Widget_Node::write_code2(fluid::io::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(fluid::io::Project_Writer &f) {
|
||||
Node::write_properties(f);
|
||||
f.write_indent(level+1);
|
||||
switch (public_) {
|
||||
@@ -2021,7 +2021,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(fluid::io::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;
|
||||
@@ -2239,7 +2239,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 (fluid::io::fdesign_flip) {
|
||||
Node* p;
|
||||
for (p = parent; p && !p->is_a(Type::Window); p = p->parent) {/*empty*/}
|
||||
if (p && p->is_widget()) y = ((Widget_Node*)p)->o->h()-(y+h);
|
||||
|
||||
@@ -62,13 +62,13 @@ protected:
|
||||
/// disabling the output of the "hide" property by the Widget Type.
|
||||
uchar override_visible_ = 0;
|
||||
|
||||
void write_static(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
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) override;
|
||||
void write_color(fld::io::Code_Writer& f, const char*, Fl_Color);
|
||||
void write_static(fluid::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_widget_code(fluid::io::Code_Writer& f);
|
||||
void write_extra_code(fluid::io::Code_Writer& f);
|
||||
void write_block_close(fluid::io::Code_Writer& f);
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
void write_color(fluid::io::Code_Writer& f, const char*, Fl_Color);
|
||||
|
||||
/// Pointer to widget representing this node in live mode.
|
||||
Fl_Widget* live_widget = nullptr;
|
||||
@@ -122,8 +122,8 @@ public:
|
||||
int is_true_widget() const override { return 1; }
|
||||
int is_public() const override;
|
||||
|
||||
void write_properties(fld::io::Project_Writer& f) override;
|
||||
void read_property(fld::io::Project_Reader& f, const char*) override;
|
||||
void write_properties(fluid::io::Project_Writer& f) override;
|
||||
void read_property(fluid::io::Project_Reader& f, const char*) override;
|
||||
int read_fdesign(const char*, const char*) override;
|
||||
|
||||
Fl_Widget* enter_live_mode(int top = 0) override;
|
||||
|
||||
+21
-21
@@ -77,19 +77,19 @@ 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<fluid::I18n_Type>(c->value());
|
||||
Fluid.proj.set_modflag(1);
|
||||
}
|
||||
switch (Fluid.proj.i18n.type) {
|
||||
case fld::I18n_Type::NONE : /* None */
|
||||
case fluid::I18n_Type::NONE : /* None */
|
||||
i18n_gnu_group->hide();
|
||||
i18n_posix_group->hide();
|
||||
break;
|
||||
case fld::I18n_Type::GNU : /* GNU gettext */
|
||||
case fluid::I18n_Type::GNU : /* GNU gettext */
|
||||
i18n_gnu_group->show();
|
||||
i18n_posix_group->hide();
|
||||
break;
|
||||
case fld::I18n_Type::POSIX : /* POSIX cat */
|
||||
case fluid::I18n_Type::POSIX : /* POSIX cat */
|
||||
i18n_gnu_group->hide();
|
||||
i18n_posix_group->show();
|
||||
break;
|
||||
@@ -339,7 +339,7 @@ void Window_Node::ideal_size(int &w, int &h) {
|
||||
Fl::screen_work_area(sx, sy, sw, sh, screen);
|
||||
w = std::min(w, sw*3/4); h = std::min(h, sh*3/4);
|
||||
}
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
|
||||
|
||||
@@ -359,7 +359,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::Undo::OnceType::WINDOW_RESIZE))
|
||||
if (Fluid.proj.undo.checkpoint(fluid::proj::Undo::OnceType::WINDOW_RESIZE))
|
||||
Fluid.proj.set_modflag(1);
|
||||
}
|
||||
|
||||
@@ -404,8 +404,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);
|
||||
fluid::app::Snap_Data data = { mydx, mydy, bx, by, br, bt, drag, 4, 4, mydx, mydy, (Widget_Node*)selection, this };
|
||||
fluid::app::Snap_Action::check_all(data);
|
||||
if (data.x_dist < 4) mydx = data.dx_out;
|
||||
if (data.y_dist < 4) mydy = data.dy_out;
|
||||
}
|
||||
@@ -652,8 +652,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);
|
||||
fluid::app::Snap_Data data = { dx, dy, sx, sy, sr, st, drag, 4, 4, dx, dy, (Widget_Node*)selection, this};
|
||||
fluid::app::Snap_Action::draw_all(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1165,9 +1165,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);
|
||||
fluid::app::Snap_Action::get_resize_stepsize(x_step, y_step);
|
||||
else
|
||||
fld::app::Snap_Action::get_move_stepsize(x_step, y_step);
|
||||
fluid::app::Snap_Action::get_move_stepsize(x_step, y_step);
|
||||
dx *= x_step;
|
||||
dy *= y_step;
|
||||
}
|
||||
@@ -1202,7 +1202,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(fluid::io::Code_Writer& f) {
|
||||
Widget_Node::write_code1(f);
|
||||
}
|
||||
|
||||
@@ -1211,7 +1211,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(fluid::io::Code_Writer& f) {
|
||||
const char *var = is_class() ? "this" : name() ? name() : "o";
|
||||
// make the window modal or non-modal
|
||||
if (modal) {
|
||||
@@ -1246,7 +1246,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(fluid::io::Project_Writer &f) {
|
||||
Widget_Node::write_properties(f);
|
||||
if (modal) f.write_string("modal");
|
||||
else if (non_modal) f.write_string("non_modal");
|
||||
@@ -1257,7 +1257,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"modal")) {
|
||||
modal = 1;
|
||||
} else if (!strcmp(c,"non_modal")) {
|
||||
@@ -1345,7 +1345,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(fluid::io::Project_Writer &f) {
|
||||
Window_Node::write_properties(f);
|
||||
if (wc_relative==1)
|
||||
f.write_string("position_relative");
|
||||
@@ -1353,7 +1353,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(fluid::io::Project_Reader &f, const char *c) {
|
||||
if (!strcmp(c,"position_relative")) {
|
||||
wc_relative = 1;
|
||||
} else if (!strcmp(c,"position_relative_rescale")) {
|
||||
@@ -1376,9 +1376,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(fluid::io::Code_Writer& f) {
|
||||
#if 0
|
||||
Widget_Node::write_code1(fld::io::Code_Writer& f);
|
||||
Widget_Node::write_code1(fluid::io::Code_Writer& f);
|
||||
#endif // 0
|
||||
|
||||
current_widget_class = this;
|
||||
@@ -1446,7 +1446,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(fluid::io::Code_Writer& f) {
|
||||
// make the window modal or non-modal
|
||||
if (modal) {
|
||||
f.write_c("%sset_modal();\n", f.indent());
|
||||
|
||||
@@ -70,8 +70,8 @@ protected:
|
||||
void newposition(Widget_Node *,int &x,int &y,int &w,int &h);
|
||||
int handle(int);
|
||||
void setlabel(const char *) override;
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
Widget_Node *_make() override {return nullptr;} // we don't call this
|
||||
Fl_Widget *widget(int,int,int,int) override {return nullptr;}
|
||||
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) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
int read_fdesign(const char*, const char*) override;
|
||||
|
||||
void add_child(Node*, Node*) override;
|
||||
@@ -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) override;
|
||||
void read_property(fld::io::Project_Reader &f, const char *) override;
|
||||
void write_properties(fluid::io::Project_Writer &f) override;
|
||||
void read_property(fluid::io::Project_Reader &f, const char *) override;
|
||||
|
||||
void write_code1(fld::io::Code_Writer& f) override;
|
||||
void write_code2(fld::io::Code_Writer& f) override;
|
||||
void write_code1(fluid::io::Code_Writer& f) override;
|
||||
void write_code2(fluid::io::Code_Writer& f) override;
|
||||
Node *make(Strategy strategy) override;
|
||||
const char *type_name() override {return "widget_class";}
|
||||
Type type() const override { return Type::Widget_Class; }
|
||||
|
||||
+17
-17
@@ -122,7 +122,7 @@ public:
|
||||
void ideal_size(int &w, int &h) override {
|
||||
w = 120;
|
||||
h = 160;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Browser_"; }
|
||||
const char *alt_type_name() override { return "fltk::Browser_"; }
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
void ideal_size(int &w, int &h) override {
|
||||
w = 120;
|
||||
h = 160;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Tree"; }
|
||||
const char *alt_type_name() override { return "fltk::TreeBrowser"; }
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
void ideal_size(int &w, int &h) override {
|
||||
w = 160;
|
||||
h = 120;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Help_View"; }
|
||||
const char *alt_type_name() override { return "fltk::HelpView"; }
|
||||
@@ -393,7 +393,7 @@ public:
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Counter"; }
|
||||
const char *alt_type_name() override { return "fltk::Counter"; }
|
||||
@@ -423,7 +423,7 @@ public:
|
||||
auto layout = Fluid.proj.layout;
|
||||
h = layout->labelsize + 8;
|
||||
w = 3 * h;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Adjuster"; }
|
||||
const char *alt_type_name() override { return "fltk::Adjuster"; }
|
||||
@@ -460,7 +460,7 @@ private:
|
||||
public:
|
||||
void ideal_size(int &w, int &h) override {
|
||||
w = 60; h = 60;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Dial"; }
|
||||
const char *alt_type_name() override { return "fltk::Dial"; }
|
||||
@@ -498,7 +498,7 @@ public:
|
||||
auto layout = Fluid.proj.layout;
|
||||
w = layout->labelsize + 8;
|
||||
h = 4 * w;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Roller"; }
|
||||
const char *alt_type_name() override { return "fltk::Roller"; }
|
||||
@@ -542,7 +542,7 @@ public:
|
||||
auto layout = Fluid.proj.layout;
|
||||
w = layout->labelsize + 8;
|
||||
h = 4 * w;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Slider"; }
|
||||
const char *alt_type_name() override { return "fltk::Slider"; }
|
||||
@@ -652,7 +652,7 @@ public:
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Value_Input"; }
|
||||
const char *alt_type_name() override { return "fltk::ValueInput"; }
|
||||
@@ -695,7 +695,7 @@ public:
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Value_Output"; }
|
||||
const char *alt_type_name() override { return "fltk::ValueOutput"; }
|
||||
@@ -754,7 +754,7 @@ public:
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Input"; }
|
||||
const char *alt_type_name() override { return "fltk::Input"; }
|
||||
@@ -796,7 +796,7 @@ public:
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_File_Input"; }
|
||||
const char *alt_type_name() override { return "fltk::FileInput"; }
|
||||
@@ -880,7 +880,7 @@ public:
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Text_Display"; }
|
||||
const char *alt_type_name() override { return "fltk::TextDisplay"; }
|
||||
@@ -1043,7 +1043,7 @@ public:
|
||||
public:
|
||||
void ideal_size(int &w, int &h) override {
|
||||
w = 100; h = 100;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Box"; }
|
||||
const char *alt_type_name() override { return "fltk::Widget"; }
|
||||
@@ -1072,7 +1072,7 @@ public:
|
||||
public:
|
||||
void ideal_size(int &w, int &h) override {
|
||||
w = 80; h = 80;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Clock"; }
|
||||
const char *alt_type_name() override { return "fltk::Clock"; }
|
||||
@@ -1104,7 +1104,7 @@ public:
|
||||
auto layout = Fluid.proj.layout;
|
||||
h = layout->labelsize + 8;
|
||||
w = layout->labelsize * 12;
|
||||
fld::app::Snap_Action::better_size(w, h);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Progress"; }
|
||||
const char *alt_type_name() override { return "fltk::ProgressBar"; }
|
||||
@@ -1156,7 +1156,7 @@ public:
|
||||
auto 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);
|
||||
fluid::app::Snap_Action::better_size(w, h);
|
||||
}
|
||||
const char *type_name() override { return "Fl_Spinner"; }
|
||||
const char *alt_type_name() override { return "fltk::Spinner"; }
|
||||
|
||||
@@ -161,7 +161,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);
|
||||
fluid::io::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);
|
||||
@@ -171,13 +171,13 @@ void update_codeview_cb(class Fl_Button*, 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);
|
||||
fluid::io::write_strings(Fluid.proj, fn);
|
||||
int top = cv_strings->top_line();
|
||||
cv_strings->buffer()->loadfile(fn);
|
||||
cv_strings->scroll(top, 0);
|
||||
} else if (cv_source->visible_r() || cv_header->visible_r()) {
|
||||
// Generate code into in-memory ostringstream buffers (no temp files).
|
||||
fld::io::Code_Writer f(Fluid.proj);
|
||||
fluid::io::Code_Writer f(Fluid.proj);
|
||||
std::string code_filename = Fluid.proj.codefile_path() + Fluid.proj.codefile_name();
|
||||
std::string header_filename = Fluid.proj.headerfile_path() + Fluid.proj.headerfile_name();
|
||||
if (Fluid.proj.proj_filename)
|
||||
@@ -257,13 +257,13 @@ Fl_Tabs* cv_tab = (Fl_Tabs*)nullptr;
|
||||
|
||||
Fl_Group* cv_source_tab = (Fl_Group*)nullptr;
|
||||
|
||||
fld::widget::Code_Viewer* cv_source = (fld::widget::Code_Viewer*)nullptr;
|
||||
fluid::widget::Code_Viewer* cv_source = (fluid::widget::Code_Viewer*)nullptr;
|
||||
|
||||
fld::widget::Code_Viewer* cv_header = (fld::widget::Code_Viewer*)nullptr;
|
||||
fluid::widget::Code_Viewer* cv_header = (fluid::widget::Code_Viewer*)nullptr;
|
||||
|
||||
fld::widget::Text_Viewer* cv_strings = (fld::widget::Text_Viewer*)nullptr;
|
||||
fluid::widget::Text_Viewer* cv_strings = (fluid::widget::Text_Viewer*)nullptr;
|
||||
|
||||
fld::widget::Text_Viewer* cv_project = (fld::widget::Text_Viewer*)nullptr;
|
||||
fluid::widget::Text_Viewer* cv_project = (fluid::widget::Text_Viewer*)nullptr;
|
||||
|
||||
Fl_Group* cv_find_row = (Fl_Group*)nullptr;
|
||||
|
||||
@@ -392,7 +392,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);
|
||||
{ fluid::widget::Code_Viewer* o = cv_source = new fluid::widget::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);
|
||||
@@ -407,14 +407,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
|
||||
} // fluid::widget::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);
|
||||
{ fluid::widget::Code_Viewer* o = cv_header = new fluid::widget::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);
|
||||
@@ -429,13 +429,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
|
||||
} // fluid::widget::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);
|
||||
{ fluid::widget::Text_Viewer* o = cv_strings = new fluid::widget::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);
|
||||
@@ -450,13 +450,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
|
||||
} // fluid::widget::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);
|
||||
{ fluid::widget::Text_Viewer* o = cv_project = new fluid::widget::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);
|
||||
@@ -471,7 +471,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
|
||||
} // fluid::widget::Text_Viewer* cv_project
|
||||
o->end();
|
||||
} // Fl_Group* o
|
||||
cv_tab->end();
|
||||
|
||||
@@ -187,7 +187,7 @@ if (!cv_design_filename) {
|
||||
}
|
||||
|
||||
if (cv_project->visible_r()) {
|
||||
fld::io::write_file(Fluid.proj, cv_design_filename, false, true);
|
||||
fluid::io::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);
|
||||
@@ -197,13 +197,13 @@ if (cv_project->visible_r()) {
|
||||
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);
|
||||
fluid::io::write_strings(Fluid.proj, fn);
|
||||
int top = cv_strings->top_line();
|
||||
cv_strings->buffer()->loadfile(fn);
|
||||
cv_strings->scroll(top, 0);
|
||||
} else if (cv_source->visible_r() || cv_header->visible_r()) {
|
||||
// Generate code into in-memory ostringstream buffers (no temp files).
|
||||
fld::io::Code_Writer f(Fluid.proj);
|
||||
fluid::io::Code_Writer f(Fluid.proj);
|
||||
std::string code_filename = Fluid.proj.codefile_path() + Fluid.proj.codefile_name();
|
||||
std::string header_filename = Fluid.proj.headerfile_path() + Fluid.proj.headerfile_name();
|
||||
if (Fluid.proj.proj_filename)
|
||||
@@ -297,7 +297,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 {fluid::widget::Code_Viewer}
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
@@ -309,7 +309,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 {fluid::widget::Code_Viewer}
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
@@ -321,7 +321,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 {fluid::widget::Text_Viewer}
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
@@ -333,7 +333,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 {fluid::widget::Text_Viewer}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 fluid::widget::Code_Viewer* cv_source;
|
||||
extern fluid::widget::Code_Viewer* cv_header;
|
||||
#include "widgets/Text_Viewer.h"
|
||||
extern fld::widget::Text_Viewer* cv_strings;
|
||||
extern fld::widget::Text_Viewer* cv_project;
|
||||
extern fluid::widget::Text_Viewer* cv_strings;
|
||||
extern fluid::widget::Text_Viewer* cv_project;
|
||||
extern Fl_Group* cv_find_row;
|
||||
#include <FL/Fl_Button.H>
|
||||
extern Fl_Button* cv_find_text_case;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user