summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fluid/Fl_Function_Type.cxx3
-rw-r--r--fluid/Fl_Menu_Type.cxx5
-rw-r--r--fluid/Fl_Type.cxx64
-rw-r--r--fluid/Fl_Type.h6
-rw-r--r--fluid/Fl_Widget_Type.cxx5
-rw-r--r--fluid/README_fl.txt1
-rw-r--r--fluid/alignment_panel.cxx229
-rw-r--r--fluid/alignment_panel.fl450
-rw-r--r--fluid/alignment_panel.h1
-rw-r--r--fluid/code.cxx379
-rw-r--r--fluid/code.h25
-rw-r--r--fluid/file.cxx7
-rw-r--r--fluid/fluid.cxx27
-rw-r--r--fluid/fluid.h1
-rw-r--r--fluid/widget_panel.cxx36
-rw-r--r--fluid/widget_panel.fl36
-rw-r--r--fluid/widget_panel.h6
17 files changed, 950 insertions, 331 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx
index 10d9443a4..883212e3e 100644
--- a/fluid/Fl_Function_Type.cxx
+++ b/fluid/Fl_Function_Type.cxx
@@ -663,8 +663,9 @@ void Fl_Code_Type::write_code1(Fd_Code_Writer& f) {
if ( handle_editor_changes() == 1 ) {
main_window->redraw(); // tell fluid to redraw; edits may affect tree's contents
}
-
+ f.tag(FD_TAG_GENERIC, 0);
f.write_c_indented(name(), 0, '\n');
+ f.tag(FD_TAG_CODE, get_uid());
}
/**
diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx
index e190feb94..938ca0f8f 100644
--- a/fluid/Fl_Menu_Type.cxx
+++ b/fluid/Fl_Menu_Type.cxx
@@ -277,6 +277,7 @@ void Fl_Menu_Item_Type::write_static(Fd_Code_Writer& f) {
f.write_c(", %s", ut);
if (use_v) f.write_c(" v");
f.write_c(") {\n");
+ f.tag(FD_TAG_GENERIC, 0);
f.write_c_indented(callback(), 1, 0);
if (*(d-1) != ';' && *(d-1) != '}') {
const char *p = strrchr(callback(), '\n');
@@ -286,7 +287,9 @@ void Fl_Menu_Item_Type::write_static(Fd_Code_Writer& f) {
// statement...
if (*p != '#' && *p) f.write_c(";");
}
- f.write_c("\n}\n");
+ f.write_c("\n");
+ f.tag(FD_TAG_MENU_CALLBACK, get_uid());
+ f.write_c("}\n");
if (k) {
f.write_c("void %s::%s(Fl_Menu_* o, %s v) {\n", k, cn, ut);
f.write_c("%s((%s*)(o", f.indent(1), k);
diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx
index bc31755b7..7bb37b585 100644
--- a/fluid/Fl_Type.cxx
+++ b/fluid/Fl_Type.cxx
@@ -348,6 +348,7 @@ void update_visibility_flag(Fl_Type *p) {
Constructor and base for any node in the widget tree.
*/
Fl_Type::Fl_Type() :
+uid_(0),
code_static_start(-1), code_static_end(-1),
code1_start(-1), code1_end(-1),
code2_start(-1), code2_end(-1),
@@ -501,6 +502,14 @@ void Fl_Type::add(Fl_Type *p, Strategy strategy) {
last = end;
prev = end->next = 0;
}
+ { // make sure that we have no duplicate uid's
+ Fl_Type *tp = this;
+ do {
+ tp->set_uid(tp->uid_);
+ tp = tp->next;
+ } while (tp!=end && tp!=NULL);
+ }
+
// tell this that it was added, so it can update itself
if (p) p->add_child(this,0);
open_ = 1;
@@ -551,6 +560,13 @@ void Fl_Type::insert(Fl_Type *g) {
end->next = g;
g->prev = end;
update_visibility_flag(this);
+ { // make sure that we have no duplicate uid's
+ Fl_Type *tp = this;
+ do {
+ tp->set_uid(tp->uid_);
+ tp = tp->next;
+ } while (tp!=end && tp!=NULL);
+ }
// tell parent that it has a new child, so it can update itself
if (parent) parent->add_child(this, g);
widget_browser->redraw();
@@ -709,6 +725,10 @@ void Fl_Type::write(Fd_Project_Writer &f) {
void Fl_Type::write_properties(Fd_Project_Writer &f) {
// repeat this for each attribute:
+ if (g_project.write_mergeback_data && uid_) {
+ f.write_word("uid");
+ f.write_string("%d", uid_);
+ }
if (label()) {
f.write_indent(level+1);
f.write_word("label");
@@ -738,7 +758,9 @@ void Fl_Type::write_properties(Fd_Project_Writer &f) {
}
void Fl_Type::read_property(Fd_Project_Reader &f, const char *c) {
- if (!strcmp(c,"label"))
+ if (!strcmp(c,"uid"))
+ set_uid(f.read_int());
+ else if (!strcmp(c,"label"))
label(f.read_word());
else if (!strcmp(c,"user_data"))
user_data(f.read_word());
@@ -1024,6 +1046,46 @@ void Fl_Type::write_code1(Fd_Code_Writer& f) {
void Fl_Type::write_code2(Fd_Code_Writer&) {
}
+/** Set a uid that is unique within the project.
+
+ Try to set the given id as the unique id for this node. If the suggested id
+ is 0, or it is already taken inside this project, we try another random id
+ until we find one that is unique.
+
+ \param[in] suggested_uid the preferred uid for this node
+ \return the actualt uid that was given to the node
+ */
+unsigned short Fl_Type::set_uid(unsigned short suggested_uid) {
+ if (suggested_uid==0)
+ suggested_uid = (unsigned short)rand();
+ for (;;) {
+ Fl_Type *tp = Fl_Type::first;
+ for ( ; tp; tp = tp->next)
+ if (tp!=this && tp->uid_==suggested_uid)
+ break;
+ if (tp==NULL)
+ break;
+ suggested_uid = (unsigned short)rand();
+ }
+ uid_ = suggested_uid;
+ return suggested_uid;
+}
+
+/** Find a node by its unique id.
+
+ Every node in a type tree has an id that is unique for the current project.
+ Walk the tree and return the node with this uid.
+
+ \param[in] uid any number between 0 and 65535
+ \return the node with this uid, or NULL if not found
+ */
+Fl_Type *Fl_Type::find_by_uid(unsigned short uid) {
+ for (Fl_Type *tp = Fl_Type::first; tp; tp = tp->next) {
+ if (tp->uid_ == uid) return tp;
+ }
+ return NULL;
+}
+
/** Find a type node by using the sourceview text positions.
\param[in] text_type 0=source file, 1=header, 2=.fl project file
diff --git a/fluid/Fl_Type.h b/fluid/Fl_Type.h
index 246294e26..28611fb90 100644
--- a/fluid/Fl_Type.h
+++ b/fluid/Fl_Type.h
@@ -121,6 +121,8 @@ protected:
/** Optional comment for every node in the graph. Visible in browser and
panels, and will also be copied to the source code. */
const char *comment_;
+ /** a unique ID within the project */
+ unsigned short uid_;
public: // things that should not be public:
@@ -249,6 +251,10 @@ public:
int has_function(const char*, const char*) const;
+ unsigned short set_uid(unsigned short suggested_uid=0);
+ unsigned short get_uid() { return uid_; }
+ static Fl_Type *find_by_uid(unsigned short uid);
+
static Fl_Type *find_in_text(int text_type, int crsr);
};
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index ad46187e3..fb76315fa 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -2846,6 +2846,7 @@ void Fl_Widget_Type::write_static(Fd_Code_Writer& f) {
f.write_c(", %s", ut);
if (use_v) f.write_c(" v");
f.write_c(") {\n");
+ f.tag(FD_TAG_GENERIC, 0);
f.write_c_indented(callback(), 1, 0);
if (*(d-1) != ';' && *(d-1) != '}') {
const char *p = strrchr(callback(), '\n');
@@ -2855,7 +2856,9 @@ void Fl_Widget_Type::write_static(Fd_Code_Writer& f) {
// statement...
if (*p != '#' && *p) f.write_c(";");
}
- f.write_c("\n}\n");
+ f.write_c("\n");
+ f.tag(FD_TAG_WIDGET_CALLBACK, get_uid());
+ f.write_c("}\n");
if (k) {
f.write_c("void %s::%s(%s* o, %s v) {\n", k, cn, t, ut);
f.write_c("%s((%s*)(o", f.indent(1), k);
diff --git a/fluid/README_fl.txt b/fluid/README_fl.txt
index 3e101dea6..a5e4a1749 100644
--- a/fluid/README_fl.txt
+++ b/fluid/README_fl.txt
@@ -377,6 +377,7 @@ See Fl_Grid for an example.
Type Fl_Type <word>
+ "uid" <word> : since Oct 2023, optional, a unique id for this node within the project file
“label” <word> : text
“user_data” <word> : a value or an expression
“user_data_type” <word> : usually “void*” or “long”
diff --git a/fluid/alignment_panel.cxx b/fluid/alignment_panel.cxx
index 4b20f9a9a..132d354d0 100644
--- a/fluid/alignment_panel.cxx
+++ b/fluid/alignment_panel.cxx
@@ -29,9 +29,11 @@ int w_settings_shell_list_selected;
Fl_Double_Window *script_panel=(Fl_Double_Window *)0;
static void cb_script_panel(Fl_Double_Window*, void*) {
+//~fl~0~0000~d63cf325~~
if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape)
return; // ignore Escape
script_panel->hide(); // otherwise hide..;
+//~fl~3~962d~653ca372~~
}
Fl_Text_Editor *script_input=(Fl_Text_Editor *)0;
@@ -72,9 +74,11 @@ Fl_Double_Window* make_script_panel() {
o->size_range(200, 150);
script_panel->end();
} // Fl_Double_Window* script_panel
+//~fl~0~0000~fa5002f6~~
// Enable line numbers
script_input->linenumber_width(60);
script_input->linenumber_size(script_input->Fl_Text_Display::textsize());
+//~fl~1~7788~95aed424~~
return script_panel;
}
@@ -83,7 +87,9 @@ Fl_Double_Window *settings_window=(Fl_Double_Window *)0;
Fl_Tabs *w_settings_tabs=(Fl_Tabs *)0;
static void cb_w_settings_tabs(Fl_Tabs* o, void* v) {
+//~fl~0~0000~b2ea2cd0~~
propagate_load(o, v);
+//~fl~3~b492~50833204~~
}
#include <FL/Fl_PNG_Image.H>
@@ -196,7 +202,9 @@ static Fl_Image *image_general_64() {
}
static void cb_(Fl_Group* o, void* v) {
+//~fl~0~0000~8b6a4f13~~
propagate_load(o, v);
+//~fl~3~5133~50833204~~
}
Fl_Scheme_Choice *scheme_choice=(Fl_Scheme_Choice *)0;
@@ -204,62 +212,81 @@ Fl_Scheme_Choice *scheme_choice=(Fl_Scheme_Choice *)0;
Fl_Check_Button *tooltips_button=(Fl_Check_Button *)0;
static void cb_tooltips_button(Fl_Check_Button*, void*) {
+//~fl~0~0000~22407b10~~
Fl_Tooltip::enable(tooltips_button->value());
fluid_prefs.set("show_tooltips", tooltips_button->value());
+//~fl~3~0f0d~b60eb0d5~~
}
Fl_Check_Button *completion_button=(Fl_Check_Button *)0;
static void cb_completion_button(Fl_Check_Button*, void*) {
+//~fl~0~0000~e63c99e7~~
fluid_prefs.set("show_completion_dialogs", completion_button->value());
+//~fl~3~5023~75f43754~~
}
Fl_Check_Button *openlast_button=(Fl_Check_Button *)0;
static void cb_openlast_button(Fl_Check_Button*, void*) {
+//~fl~0~0000~19e86ad0~~
fluid_prefs.set("open_previous_file", openlast_button->value());
+//~fl~3~6ae5~eb6803cb~~
}
Fl_Check_Button *prevpos_button=(Fl_Check_Button *)0;
static void cb_prevpos_button(Fl_Check_Button*, void*) {
+//~fl~0~0000~1eb02531~~
+ // Test!
fluid_prefs.set("prev_window_pos", prevpos_button->value());
+//~fl~3~f85f~5e08b15b~~
}
Fl_Check_Button *show_comments_button=(Fl_Check_Button *)0;
static void cb_show_comments_button(Fl_Check_Button*, void*) {
+//~fl~0~0000~20984206~~
show_comments = show_comments_button->value();
fluid_prefs.set("show_comments", show_comments);
redraw_browser();
+//~fl~3~3530~7e12c220~~
}
static void cb_1(Fl_Group* o, void* v) {
+//~fl~0~0000~8a50c4af~~
propagate_load(o, v);
+//~fl~3~22d1~50833204~~
}
Fl_Spinner *recent_spinner=(Fl_Spinner *)0;
static void cb_recent_spinner(Fl_Spinner*, void*) {
+//~fl~0~0000~b1d67afc~~
fluid_prefs.set("recent_files", recent_spinner->value());
load_history();
+//~fl~3~f6c8~c11dca25~~
}
Fl_Check_Button *use_external_editor_button=(Fl_Check_Button *)0;
static void cb_use_external_editor_button(Fl_Check_Button*, void*) {
+//~fl~0~0000~692aa10e~~
G_use_external_editor = use_external_editor_button->value();
fluid_prefs.set("use_external_editor", G_use_external_editor);
redraw_browser();
+//~fl~3~c561~9406f8e4~~
}
Fl_Input *editor_command_input=(Fl_Input *)0;
static void cb_editor_command_input(Fl_Input*, void*) {
+//~fl~0~0000~f3b84b34~~
strncpy(G_external_editor_command, editor_command_input->value(), sizeof(G_external_editor_command)-1);
G_external_editor_command[sizeof(G_external_editor_command)-1] = 0;
fluid_prefs.set("external_editor_command", G_external_editor_command);
redraw_browser();
+//~fl~3~680c~2c28d30d~~
}
Fl_Check_Button *guides_button=(Fl_Check_Button *)0;
@@ -269,7 +296,9 @@ Fl_Check_Button *restricted_button=(Fl_Check_Button *)0;
Fl_Group *w_settings_project_tab=(Fl_Group *)0;
static void cb_w_settings_project_tab(Fl_Group* o, void* v) {
+//~fl~0~0000~a52da131~~
propagate_load(o, v);
+//~fl~3~5081~50833204~~
}
static const unsigned char idata_document_64[] =
@@ -325,6 +354,7 @@ static Fl_Image *image_document_64() {
Fl_Input *header_file_input=(Fl_Input *)0;
static void cb_header_file_input(Fl_Input* o, void* v) {
+//~fl~0~0000~ebfa1479~~
if (v == LOAD) {
o->value(g_project.header_file_name.c_str());
} else {
@@ -333,11 +363,13 @@ static void cb_header_file_input(Fl_Input* o, void* v) {
set_modflag(1);
}
}
+//~fl~3~1ba2~d94de24c~~
}
Fl_Input *code_file_input=(Fl_Input *)0;
static void cb_code_file_input(Fl_Input* o, void* v) {
+//~fl~0~0000~3d36c33a~~
if (v == LOAD) {
o->value(g_project.code_file_name.c_str());
} else {
@@ -346,11 +378,13 @@ static void cb_code_file_input(Fl_Input* o, void* v) {
set_modflag(1);
}
}
+//~fl~3~339c~9ccae002~~
}
Fl_Check_Button *include_H_from_C_button=(Fl_Check_Button *)0;
static void cb_include_H_from_C_button(Fl_Check_Button* o, void* v) {
+//~fl~0~0000~364552dd~~
if (v == LOAD) {
o->value(g_project.include_H_from_C);
} else {
@@ -359,11 +393,13 @@ static void cb_include_H_from_C_button(Fl_Check_Button* o, void* v) {
g_project.include_H_from_C = o->value();
}
}
+//~fl~3~66b4~a9382397~~
}
Fl_Check_Button *use_FL_COMMAND_button=(Fl_Check_Button *)0;
static void cb_use_FL_COMMAND_button(Fl_Check_Button* o, void* v) {
+//~fl~0~0000~1638bd23~~
if (v == LOAD) {
o->value(g_project.use_FL_COMMAND);
} else {
@@ -372,11 +408,13 @@ static void cb_use_FL_COMMAND_button(Fl_Check_Button* o, void* v) {
g_project.use_FL_COMMAND = o->value();
}
}
+//~fl~3~9267~5de48539~~
}
Fl_Check_Button *utf8_in_src_button=(Fl_Check_Button *)0;
static void cb_utf8_in_src_button(Fl_Check_Button* o, void* v) {
+//~fl~0~0000~9410c9c6~~
if (v == LOAD) {
o->value(g_project.utf8_in_src);
} else {
@@ -385,11 +423,13 @@ static void cb_utf8_in_src_button(Fl_Check_Button* o, void* v) {
g_project.utf8_in_src = o->value();
}
}
+//~fl~3~ac2a~3b6fa627~~
}
Fl_Check_Button *avoid_early_includes_button=(Fl_Check_Button *)0;
static void cb_avoid_early_includes_button(Fl_Check_Button* o, void* v) {
+//~fl~0~0000~3bdf0f16~~
if (v == LOAD) {
o->value(g_project.avoid_early_includes);
} else {
@@ -398,12 +438,30 @@ static void cb_avoid_early_includes_button(Fl_Check_Button* o, void* v) {
g_project.avoid_early_includes = o->value();
}
}
+//~fl~3~34ca~06858aea~~
+}
+
+Fl_Check_Button *w_proj_mergeback=(Fl_Check_Button *)0;
+
+static void cb_w_proj_mergeback(Fl_Check_Button* o, void* v) {
+//~fl~0~0000~5d00a773~~
+ if (v == LOAD) {
+ o->value(g_project.write_mergeback_data);
+ } else {
+ if (g_project.write_mergeback_data != o->value()) {
+ set_modflag(1);
+ g_project.write_mergeback_data = o->value();
+ }
+ }
+//~fl~3~1248~145f3302~~
}
Fl_Group *w_settings_layout_tab=(Fl_Group *)0;
static void cb_w_settings_layout_tab(Fl_Group* o, void* v) {
+//~fl~0~0000~e43cacfc~~
propagate_load(o, v);
+//~fl~3~a0c5~50833204~~
}
static const unsigned char idata_layout_64[] =
@@ -438,6 +496,7 @@ static Fl_Image *image_layout_64() {
Fl_Choice *layout_choice=(Fl_Choice *)0;
static void cb_layout_choice(Fl_Choice* o, void* v) {
+//~fl~0~0000~404277fb~~
if (v == LOAD) {
o->value(g_layout_list.current_suite());
} else {
@@ -445,6 +504,7 @@ static void cb_layout_choice(Fl_Choice* o, void* v) {
g_layout_list.current_suite(index);
g_layout_list.update_dialogs();
}
+//~fl~3~22b0~841c3967~~
}
Fl_Menu_Item menu_layout_choice[] = {
@@ -454,6 +514,7 @@ Fl_Menu_Item menu_layout_choice[] = {
};
static void cb_2(Fl_Button*, void* v) {
+//~fl~0~0000~ef630678~~
// Clone the current layout suite
if (v == LOAD) return;
@@ -466,11 +527,13 @@ static void cb_2(Fl_Button*, void* v) {
g_layout_list.add(new_name);
g_layout_list.update_dialogs();
+//~fl~3~2b8a~28d4d389~~
}
Fl_Menu_Button *w_layout_menu=(Fl_Menu_Button *)0;
static void cb_w_layout_menu(Fl_Menu_Button*, void* v) {
+//~fl~0~0000~7387a6f8~~
if (v == LOAD) {
Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
if (suite.storage_ == FD_STORE_INTERNAL) {
@@ -484,9 +547,11 @@ static void cb_w_layout_menu(Fl_Menu_Button*, void* v) {
}
w_layout_menu_storage[suite.storage_]->setonly();
}
+//~fl~3~91e5~27881b25~~
}
static void cb_w_layout_menu_rename(Fl_Menu_*, void*) {
+//~fl~0~0000~2667563f~~
// Rename the current layout suite
Fl_String old_name = g_layout_list[g_layout_list.current_suite()].name_;
@@ -496,33 +561,43 @@ static void cb_w_layout_menu_rename(Fl_Menu_*, void*) {
g_layout_list.rename(new_name);
g_layout_list.update_dialogs();
+//~fl~2~6a9b~71cc7c62~~
}
static void cb_w_layout_menu_storage(Fl_Menu_*, void*) {
+//~fl~0~0000~0e7b558d~~
Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_INTERNAL);
g_layout_list.update_dialogs();
+//~fl~2~f84d~eea63d0a~~
}
static void cb_w_layout_menu_storage1(Fl_Menu_*, void*) {
+//~fl~0~0000~f9136a03~~
Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_USER);
g_layout_list.update_dialogs();
+//~fl~2~c339~daeea163~~
}
static void cb_w_layout_menu_storage2(Fl_Menu_*, void*) {
+//~fl~0~0000~c06bc743~~
Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_PROJECT);
g_layout_list.update_dialogs();
+//~fl~2~f5f6~f7c135cb~~
}
static void cb_w_layout_menu_storage3(Fl_Menu_*, void*) {
+//~fl~0~0000~d743a383~~
Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_FILE);
g_layout_list.update_dialogs();
+//~fl~2~07f7~19d71da4~~
}
static void cb_w_layout_menu_load(Fl_Menu_*, void*) {
+//~fl~0~0000~ec15d339~~
// Give the user a file chooser and load that file
Fl_Native_File_Chooser fnfc;
fnfc.title("Load Layout Settings:");
@@ -535,9 +610,11 @@ static void cb_w_layout_menu_load(Fl_Menu_*, void*) {
g_layout_list.load(new_filename);
//g_layout_list.current_suite(n);
g_layout_list.update_dialogs();
+//~fl~2~26e8~3c8717b8~~
}
static void cb_w_layout_menu_save(Fl_Menu_*, void*) {
+//~fl~0~0000~548a8f84~~
// Give the user a file chooser with a suggested name
Fl_Native_File_Chooser fnfc;
fnfc.title("Save Layout Settings:");
@@ -552,13 +629,16 @@ static void cb_w_layout_menu_save(Fl_Menu_*, void*) {
if (!new_filename) return;
g_layout_list.filename_ = new_filename;
g_layout_list.save(new_filename);
+//~fl~2~4ca1~f136697d~~
}
static void cb_w_layout_menu_delete(Fl_Menu_*, void*) {
+//~fl~0~0000~a7923711~~
// remove the current suite
g_layout_list.remove(g_layout_list.current_suite());
g_layout_list.update_dialogs();
+//~fl~2~1005~437d0f96~~
}
Fl_Menu_Item menu_w_layout_menu[] = {
@@ -576,195 +656,243 @@ Fl_Menu_Item menu_w_layout_menu[] = {
Fl_Button *preset_choice[3]={(Fl_Button *)0};
static void cb_Left(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~258cf08a~~
if (v == LOAD) {
o->value((double)layout->left_window_margin);
} else {
layout->left_window_margin = (int)o->value();
}
+//~fl~3~4ce4~aa182acd~~
}
static void cb_Top(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~828bcdb2~~
if (v == LOAD) {
o->value((double)layout->top_window_margin);
} else {
layout->top_window_margin = (int)o->value();
}
+//~fl~3~3c5b~f61c794a~~
}
static void cb_Right(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~f9212ca5~~
if (v == LOAD) {
o->value((double)layout->right_window_margin);
} else {
layout->right_window_margin = (int)o->value();
}
+//~fl~3~bbfa~30018da3~~
}
static void cb_Bottom(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~a351318c~~
if (v == LOAD) {
o->value((double)layout->bottom_window_margin);
} else {
layout->bottom_window_margin = (int)o->value();
}
+//~fl~3~546c~9d6618c2~~
}
static void cb_Horizontal(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~66fe2b77~~
if (v == LOAD) {
o->value((double)layout->window_grid_x);
} else {
layout->window_grid_x = (int)o->value();
}
+//~fl~3~1151~73e0a613~~
}
static void cb_Vertical(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~8e022d1a~~
if (v == LOAD) {
o->value((double)layout->window_grid_y);
} else {
layout->window_grid_y = (int)o->value();
}
+//~fl~3~f3e2~f5065f10~~
}
static void cb_Left1(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~5c8cce39~~
if (v == LOAD) {
o->value((double)layout->left_group_margin);
} else {
layout->left_group_margin = (int)o->value();
}
+//~fl~3~100c~ac52b044~~
}
static void cb_Top1(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~136bd57e~~
if (v == LOAD) {
o->value((double)layout->top_group_margin);
} else {
layout->top_group_margin = (int)o->value();
}
+//~fl~3~9ee1~69c82c2d~~
}
static void cb_Right1(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~90c3fa58~~
if (v == LOAD) {
o->value((double)layout->right_group_margin);
} else {
layout->right_group_margin = (int)o->value();
}
+//~fl~3~fd06~cd20c87f~~
}
static void cb_Bottom1(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~d22b1229~~
if (v == LOAD) {
o->value((double)layout->bottom_group_margin);
} else {
layout->bottom_group_margin = (int)o->value();
}
+//~fl~3~a698~635e9e6a~~
}
static void cb_Horizontal1(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~f88196a7~~
if (v == LOAD) {
o->value((double)layout->group_grid_x);
} else {
layout->group_grid_x = (int)o->value();
}
+//~fl~3~b761~e47e8565~~
}
static void cb_Vertical1(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~cb6a7744~~
if (v == LOAD) {
o->value((double)layout->group_grid_y);
} else {
layout->group_grid_y = (int)o->value();
}
+//~fl~3~5fff~5d0edca1~~
}
static void cb_Top2(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~da74ddc1~~
if (v == LOAD) {
o->value((double)layout->top_tabs_margin);
} else {
layout->top_tabs_margin = (int)o->value();
}
+//~fl~3~fc1e~95ebcf51~~
}
static void cb_Bottom2(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~1b341a96~~
if (v == LOAD) {
o->value((double)layout->bottom_tabs_margin);
} else {
layout->bottom_tabs_margin = (int)o->value();
}
+//~fl~3~3b19~03319093~~
}
static void cb_Minimum(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~63926d5a~~
if (v == LOAD) {
o->value((double)layout->widget_min_w);
} else {
layout->widget_min_w = (int)o->value();
}
+//~fl~3~3250~098b8cca~~
}
static void cb_Increment(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~bdc0cef8~~
if (v == LOAD) {
o->value((double)layout->widget_inc_w);
} else {
layout->widget_inc_w = (int)o->value();
}
+//~fl~3~42e9~2c06e402~~
}
static void cb_Gap(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~1071c4b8~~
if (v == LOAD) {
o->value((double)layout->widget_gap_x);
} else {
layout->widget_gap_x = (int)o->value();
}
+//~fl~3~0db7~dd5cc5f2~~
}
static void cb_3(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~af0fe6f1~~
if (v == LOAD) {
o->value((double)layout->widget_min_h);
} else {
layout->widget_min_h = (int)o->value();
}
+//~fl~3~af8f~16376d7c~~
}
static void cb_4(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~179af464~~
if (v == LOAD) {
o->value((double)layout->widget_inc_h);
} else {
layout->widget_inc_h = (int)o->value();
}
+//~fl~3~0fc3~33ba05b4~~
}
static void cb_5(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~e640f1ce~~
if (v == LOAD) {
o->value((double)layout->widget_gap_y);
} else {
layout->widget_gap_y = (int)o->value();
}
+//~fl~3~f43a~642c9c36~~
}
static void cb_6(Fl_Choice* o, void* v) {
+//~fl~0~0000~38c0dadb~~
if (v == LOAD) {
o->value(layout->labelfont+1);
} else {
layout->labelfont = (int)o->value()-1;
}
+//~fl~3~710f~de8ae6fa~~
}
static void cb_7(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~de85fcdb~~
if (v == LOAD) {
o->value(layout->labelsize);
} else {
layout->labelsize = (int)o->value();
}
+//~fl~3~9dc0~448a0cfa~~
}
static void cb_8(Fl_Choice* o, void* v) {
+//~fl~0~0000~461b5196~~
if (v == LOAD) {
o->value(layout->textfont+1);
} else {
layout->textfont = (int)o->value()-1;
}
+//~fl~3~9244~96100d58~~
}
static void cb_9(Fl_Value_Input* o, void* v) {
+//~fl~0~0000~74dedfb0~~
if (v == LOAD) {
o->value(layout->textsize);
} else {
layout->textsize = (int)o->value();
}
+//~fl~3~b455~435bca5e~~
}
Fl_Group *w_settings_shell_tab=(Fl_Group *)0;
@@ -816,6 +944,7 @@ static Fl_Image *image_shell_64() {
Fl_Browser *w_settings_shell_list=(Fl_Browser *)0;
static void cb_w_settings_shell_list(Fl_Browser* o, void* v) {
+//~fl~0~0000~a8ca82df~~
if (v == LOAD) {
// load from g_shell_config
if (g_shell_config) {
@@ -841,17 +970,21 @@ static void cb_w_settings_shell_list(Fl_Browser* o, void* v) {
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
}
+//~fl~3~5e50~26359753~~
}
Fl_Group *w_settings_shell_toolbox=(Fl_Group *)0;
static void cb_w_settings_shell_toolbox(Fl_Group* o, void* v) {
+//~fl~0~0000~2ef19102~~
if (v==LOAD) {
propagate_load(o, v);
}
+//~fl~3~04c9~56d23597~~
}
static void cb_a(Fl_Button*, void* v) {
+//~fl~0~0000~50aa3a7d~~
if (v != LOAD) {
int selected = w_settings_shell_list_selected;
Fd_Shell_Command *cmd = new Fd_Shell_Command("new shell command");
@@ -868,11 +1001,13 @@ static void cb_a(Fl_Button*, void* v) {
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
g_shell_config->rebuild_shell_menu();
}
+//~fl~3~65b2~ba9c6fa6~~
}
Fl_Button *w_settings_shell_dup=(Fl_Button *)0;
static void cb_w_settings_shell_dup(Fl_Button* o, void* v) {
+//~fl~0~0000~d75617a9~~
int selected = w_settings_shell_list_selected;
if (v==LOAD) {
if (selected) {
@@ -897,11 +1032,13 @@ static void cb_w_settings_shell_dup(Fl_Button* o, void* v) {
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
g_shell_config->rebuild_shell_menu();
}
+//~fl~3~98de~675a49a6~~
}
Fl_Button *w_settings_shell_remove=(Fl_Button *)0;
static void cb_w_settings_shell_remove(Fl_Button* o, void* v) {
+//~fl~0~0000~15ddc2ee~~
int selected = w_settings_shell_list_selected;
if (v==LOAD) {
if (selected) {
@@ -925,18 +1062,23 @@ static void cb_w_settings_shell_remove(Fl_Button* o, void* v) {
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
g_shell_config->rebuild_shell_menu();
}
+//~fl~3~22b2~aa5ce24d~~
}
Fl_Menu_Button *w_settings_shell_menu=(Fl_Menu_Button *)0;
static void cb_Import(Fl_Menu_*, void* v) {
+//~fl~0~0000~3835f3ea~~
if (v != LOAD)
Fd_Shell_Command_List::import_from_file();
+//~fl~2~a8b5~a52ce6b7~~
}
static void cb_Export(Fl_Menu_*, void* v) {
+//~fl~0~0000~b34c035b~~
if (v != LOAD)
Fd_Shell_Command_List::export_selected();
+//~fl~2~2de2~6437097d~~
}
Fl_Menu_Item menu_w_settings_shell_menu[] = {
@@ -953,6 +1095,7 @@ Fl_Menu_Item menu_w_settings_shell_menu[] = {
Fl_Button *w_settings_shell_play=(Fl_Button *)0;
static void cb_w_settings_shell_play(Fl_Button* o, void* v) {
+//~fl~0~0000~01bcfc3c~~
int selected = w_settings_shell_list_selected;
if (v==LOAD) {
if (selected) {
@@ -965,11 +1108,13 @@ static void cb_w_settings_shell_play(Fl_Button* o, void* v) {
Fd_Shell_Command *cmd = g_shell_config->list[selected-1];
cmd->run();
}
+//~fl~3~d2bd~88fbdd91~~
}
Fl_Group *w_settings_shell_cmd=(Fl_Group *)0;
static void cb_w_settings_shell_cmd(Fl_Group* o, void* v) {
+//~fl~0~0000~bfa081d7~~
if (v==LOAD) {
int selected = w_settings_shell_list_selected;
if (selected) {
@@ -979,9 +1124,11 @@ static void cb_w_settings_shell_cmd(Fl_Group* o, void* v) {
}
propagate_load(o, v);
}
+//~fl~3~adce~61a3273f~~
}
static void cb_Name(Fl_Input* o, void* v) {
+//~fl~0~0000~24a67cd4~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -997,9 +1144,11 @@ static void cb_Name(Fl_Input* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~d61f~774a9eda~~
}
static void cb_Menu(Fl_Input* o, void* v) {
+//~fl~0~0000~9ebf9577~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -1015,13 +1164,17 @@ static void cb_Menu(Fl_Input* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~cbf2~d6faeaaf~~
}
static void cb_b(Fl_Group* o, void* v) {
+//~fl~0~0000~168f150c~~
propagate_load(o, v);
+//~fl~3~a161~50833204~~
}
static void cb_Shortcut(Fl_Shortcut_Button* o, void* v) {
+//~fl~0~0000~df23ee48~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -1038,9 +1191,11 @@ static void cb_Shortcut(Fl_Shortcut_Button* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~f100~c8f9aa5b~~
}
static void cb_Store(Fl_Choice* o, void* v) {
+//~fl~0~0000~da90793a~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -1063,6 +1218,7 @@ static void cb_Store(Fl_Choice* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~778e~475d4ad4~~
}
Fl_Menu_Item menu_Store[] = {
@@ -1072,6 +1228,7 @@ Fl_Menu_Item menu_Store[] = {
};
static void cb_Condition(Fl_Choice* o, void* v) {
+//~fl~0~0000~18c4c68c~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -1089,6 +1246,7 @@ static void cb_Condition(Fl_Choice* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~ad97~70480294~~
}
Fl_Menu_Item menu_Condition[] = {
@@ -1102,16 +1260,19 @@ Fl_Menu_Item menu_Condition[] = {
};
static void cb_Label(Fl_Input* o, void* v) {
+//~fl~0~0000~bf1e5ee6~~
if (v == LOAD) {
// o->value(g_shell_command.c_str());
} else {
// g_shell_command = o->value();
}
+//~fl~3~1aa1~eb97b0e1~~
}
Fl_Text_Editor *w_settings_shell_command=(Fl_Text_Editor *)0;
static void cb_w_settings_shell_command(Fl_Text_Editor* o, void* v) {
+//~fl~0~0000~41a1eadd~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -1126,11 +1287,13 @@ static void cb_w_settings_shell_command(Fl_Text_Editor* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~b429~ce985002~~
}
Fl_Menu_Button *w_settings_shell_text_macros=(Fl_Menu_Button *)0;
static void cb_w_settings_shell_text_macros(Fl_Menu_Button* o, void*) {
+//~fl~0~0000~e24b9b56~~
const Fl_Menu_Item *mi = o->mvalue();
if (mi) {
char buffer[256];
@@ -1149,6 +1312,7 @@ static void cb_w_settings_shell_text_macros(Fl_Menu_Button* o, void*) {
}
w_settings_shell_command->do_callback(w_settings_shell_command, (void*)NULL);
}
+//~fl~3~475b~b6875296~~
}
Fl_Menu_Item menu_w_settings_shell_text_macros[] = {
@@ -1168,6 +1332,7 @@ Fl_Menu_Item menu_w_settings_shell_text_macros[] = {
};
static void cb_1fd_zoom(Fl_Button*, void*) {
+//~fl~0~0000~d5dc24f4~~
if (!script_panel) make_script_panel();
script_input->buffer()->text(w_settings_shell_command->buffer()->text());
script_panel->show();
@@ -1183,9 +1348,11 @@ static void cb_1fd_zoom(Fl_Button*, void*) {
w_settings_shell_command->do_callback();
BREAK2:
script_panel->hide();
+//~fl~3~5873~22f99a94~~
}
static void cb_save(Fl_Check_Button* o, void* v) {
+//~fl~0~0000~88af01b3~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -1205,9 +1372,11 @@ static void cb_save(Fl_Check_Button* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~9c64~58c14315~~
}
static void cb_save1(Fl_Check_Button* o, void* v) {
+//~fl~0~0000~1305d9d2~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -1227,9 +1396,11 @@ static void cb_save1(Fl_Check_Button* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~6de6~4da652b9~~
}
static void cb_save2(Fl_Check_Button* o, void* v) {
+//~fl~0~0000~481268c7~~
int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
@@ -1249,6 +1420,7 @@ static void cb_save2(Fl_Check_Button* o, void* v) {
if (cmd->storage == FD_STORE_PROJECT) set_modflag(1);
}
}
+//~fl~3~2f06~1c6d3453~~
}
Fl_Box *w_settings_shell_fd_project=(Fl_Box *)0;
@@ -1908,7 +2080,9 @@ static Fl_Image *image_fd_user() {
Fl_Group *w_settings_i18n_tab=(Fl_Group *)0;
static void cb_w_settings_i18n_tab(Fl_Group* o, void* v) {
+//~fl~0~0000~b806caa7~~
propagate_load(o, v);
+//~fl~3~8253~50833204~~
}
static const unsigned char idata_language_64[] =
@@ -1996,12 +2170,15 @@ Fl_Menu_Item menu_i18n_type_chooser[] = {
Fl_Group *i18n_gnu_group=(Fl_Group *)0;
static void cb_i18n_gnu_group(Fl_Group* o, void* v) {
+//~fl~0~0000~4e561a5c~~
propagate_load(o, v);
+//~fl~3~e1f8~50833204~~
}
Fl_Input *i18n_gnu_include_input=(Fl_Input *)0;
static void cb_i18n_gnu_include_input(Fl_Input* o, void* v) {
+//~fl~0~0000~c8ff5adf~~
if (v == LOAD) {
o->value(g_project.i18n_gnu_include.c_str());
} else {
@@ -2009,11 +2186,13 @@ static void cb_i18n_gnu_include_input(Fl_Input* o, void* v) {
g_project.i18n_gnu_include = o->value();
set_modflag(1);
}
+//~fl~3~8d65~3001413b~~
}
Fl_Input *i18n_gnu_conditional_input=(Fl_Input *)0;
static void cb_i18n_gnu_conditional_input(Fl_Input* o, void* v) {
+//~fl~0~0000~06d8e7c1~~
if (v == LOAD) {
o->value(g_project.i18n_gnu_conditional.c_str());
} else {
@@ -2021,11 +2200,13 @@ static void cb_i18n_gnu_conditional_input(Fl_Input* o, void* v) {
g_project.i18n_gnu_conditional = o->value();
set_modflag(1);
}
+//~fl~3~1d8f~47091379~~
}
Fl_Input *i18n_gnu_function_input=(Fl_Input *)0;
static void cb_i18n_gnu_function_input(Fl_Input* o, void* v) {
+//~fl~0~0000~6be4453c~~
if (v == LOAD) {
o->value(g_project.i18n_gnu_function.c_str());
} else {
@@ -2033,11 +2214,13 @@ static void cb_i18n_gnu_function_input(Fl_Input* o, void* v) {
g_project.i18n_gnu_function = o->value();
set_modflag(1);
}
+//~fl~3~a7b4~782b9047~~
}
Fl_Input *i18n_gnu_static_function_input=(Fl_Input *)0;
static void cb_i18n_gnu_static_function_input(Fl_Input* o, void* v) {
+//~fl~0~0000~45ce4926~~
if (v == LOAD) {
o->value(g_project.i18n_gnu_static_function.c_str());
} else {
@@ -2045,17 +2228,21 @@ static void cb_i18n_gnu_static_function_input(Fl_Input* o, void* v) {
g_project.i18n_gnu_static_function = o->value();
set_modflag(1);
}
+//~fl~3~52f0~21832541~~
}
Fl_Group *i18n_posix_group=(Fl_Group *)0;
static void cb_i18n_posix_group(Fl_Group* o, void* v) {
+//~fl~0~0000~257c37c8~~
propagate_load(o, v);
+//~fl~3~2980~50833204~~
}
Fl_Input *i18n_pos_include_input=(Fl_Input *)0;
static void cb_i18n_pos_include_input(Fl_Input* o, void* v) {
+//~fl~0~0000~d4cc6b45~~
if (v == LOAD) {
o->value(g_project.i18n_pos_include.c_str());
} else {
@@ -2063,11 +2250,13 @@ static void cb_i18n_pos_include_input(Fl_Input* o, void* v) {
g_project.i18n_pos_include = o->value();
set_modflag(1);
}
+//~fl~3~b3b7~41fa0d1c~~
}
Fl_Input *i18n_pos_conditional_input=(Fl_Input *)0;
static void cb_i18n_pos_conditional_input(Fl_Input* o, void* v) {
+//~fl~0~0000~fde185c1~~
if (v == LOAD) {
o->value(g_project.i18n_pos_conditional.c_str());
} else {
@@ -2075,11 +2264,13 @@ static void cb_i18n_pos_conditional_input(Fl_Input* o, void* v) {
g_project.i18n_pos_conditional = o->value();
set_modflag(1);
}
+//~fl~3~dacb~6bb5d246~~
}
Fl_Input *i18n_pos_file_input=(Fl_Input *)0;
static void cb_i18n_pos_file_input(Fl_Input* o, void* v) {
+//~fl~0~0000~97538505~~
if (v == LOAD) {
o->value(g_project.i18n_pos_file.c_str());
} else {
@@ -2087,15 +2278,19 @@ static void cb_i18n_pos_file_input(Fl_Input* o, void* v) {
g_project.i18n_pos_file = o->value();
set_modflag(1);
}
+//~fl~3~7b19~04796294~~
}
static void cb_c(Fl_Group* o, void* v) {
+//~fl~0~0000~f192b39b~~
propagate_load(o, v);
+//~fl~3~d7ee~50833204~~
}
Fl_Int_Input *i18n_pos_set_input=(Fl_Int_Input *)0;
static void cb_i18n_pos_set_input(Fl_Int_Input* o, void* v) {
+//~fl~0~0000~d09e0191~~
if (v == LOAD) {
o->value(g_project.i18n_pos_set.c_str());
} else {
@@ -2103,13 +2298,16 @@ static void cb_i18n_pos_set_input(Fl_Int_Input* o, void* v) {
g_project.i18n_pos_set = o->value();
set_modflag(1);
}
+//~fl~3~689a~a3e1b311~~
}
static void cb_Close(Fl_Button*, void*) {
+//~fl~0~0000~eaac9f35~~
if (g_shell_config)
g_shell_config->write(fluid_prefs, FD_STORE_USER);
g_layout_list.write(fluid_prefs, FD_STORE_USER);
settings_window->hide();
+//~fl~3~86cc~3f4611d9~~
}
Fl_Double_Window* make_settings_window() {
@@ -2294,17 +2492,17 @@ ps");
code_file_input->callback((Fl_Callback*)cb_code_file_input, (void*)(1));
code_file_input->when(FL_WHEN_CHANGED);
} // Fl_Input* code_file_input
- { Fl_Box* o = new Fl_Box(100, 205, 0, 20, "Options: ");
- o->labelfont(1);
- o->labelsize(11);
- o->align(Fl_Align(FL_ALIGN_LEFT));
- } // Fl_Box* o
{ include_H_from_C_button = new Fl_Check_Button(100, 162, 220, 20, "Include Header from Code");
include_H_from_C_button->tooltip("Include the header file from the code file.");
include_H_from_C_button->down_box(FL_DOWN_BOX);
include_H_from_C_button->labelsize(11);
include_H_from_C_button->callback((Fl_Callback*)cb_include_H_from_C_button);
} // Fl_Check_Button* include_H_from_C_button
+ { Fl_Box* o = new Fl_Box(100, 205, 0, 20, "Options: ");
+ o->labelfont(1);
+ o->labelsize(11);
+ o->align(Fl_Align(FL_ALIGN_LEFT));
+ } // Fl_Box* o
{ use_FL_COMMAND_button = new Fl_Check_Button(100, 205, 220, 20, "Menu shortcuts use FL_COMMAND");
use_FL_COMMAND_button->tooltip("Replace FL_CTRL and FL_META with FL_COMMAND when generating menu shortcuts");
use_FL_COMMAND_button->down_box(FL_DOWN_BOX);
@@ -2325,6 +2523,19 @@ ped using octal notation `\\0123`. If this option is checked, Fluid will write\
avoid_early_includes_button->labelsize(11);
avoid_early_includes_button->callback((Fl_Callback*)cb_avoid_early_includes_button);
} // Fl_Check_Button* avoid_early_includes_button
+ { Fl_Box* o = new Fl_Box(100, 283, 0, 20, "Experimental: ");
+ o->labelfont(1);
+ o->labelsize(11);
+ o->align(Fl_Align(FL_ALIGN_LEFT));
+ } // Fl_Box* o
+ { w_proj_mergeback = new Fl_Check_Button(100, 283, 220, 20, "generate MergeBack data");
+ w_proj_mergeback->tooltip("MergeBack is a feature under construction that allows changes in code files t\
+o be merged back into the project file. Checking this option will generate add\
+itional data in code and project files.");
+ w_proj_mergeback->down_box(FL_DOWN_BOX);
+ w_proj_mergeback->labelsize(11);
+ w_proj_mergeback->callback((Fl_Callback*)cb_w_proj_mergeback);
+ } // Fl_Check_Button* w_proj_mergeback
{ Fl_Box* o = new Fl_Box(100, 530, 220, 10);
o->hide();
Fl_Group::current()->resizable(o);
@@ -2663,7 +2874,7 @@ ped using octal notation `\\0123`. If this option is checked, Fluid will write\
w_settings_shell_tab->hide();
{ Fl_Group* o = new Fl_Group(10, 90, 320, 132);
o->callback((Fl_Callback*)propagate_load);
- { w_settings_shell_list = new Fl_Browser(100, 90, 220, 110, "Shell \ncommand \nlist:");
+ { w_settings_shell_list = new Fl_Browser(100, 90, 220, 110, "Shell\ncommand\nlist:");
w_settings_shell_list->type(3);
w_settings_shell_list->labelfont(1);
w_settings_shell_list->labelsize(11);
@@ -2984,7 +3195,9 @@ le FLTK_GETTEXT_FOUND");
settings_window->size_range(340, 580);
settings_window->end();
} // Fl_Double_Window* settings_window
+//~fl~0~0000~d0a79484~~
w_settings_tabs->do_callback(w_settings_tabs, LOAD);
+//~fl~1~c8a2~102614d8~~
return settings_window;
}
@@ -2993,18 +3206,22 @@ Fl_Double_Window *shell_run_window=(Fl_Double_Window *)0;
Fl_Simple_Terminal *shell_run_terminal=(Fl_Simple_Terminal *)0;
static void cb_Clear(Fl_Button*, void*) {
+//~fl~0~0000~e5195ca2~~
shell_run_terminal->clear();
+//~fl~3~fec1~9e598b81~~
}
Fl_Return_Button *shell_run_button=(Fl_Return_Button *)0;
static void cb_shell_run_button(Fl_Return_Button*, void*) {
+//~fl~0~0000~a6a701ac~~
Fl_Preferences pos(fluid_prefs, "shell_run_Window_pos");
pos.set("x", shell_run_window->x());
pos.set("y", shell_run_window->y());
pos.set("w", shell_run_window->w());
pos.set("h", shell_run_window->h());
shell_run_window->hide();
+//~fl~3~e2a5~f206a765~~
}
Fl_Double_Window* make_shell_window() {
diff --git a/fluid/alignment_panel.fl b/fluid/alignment_panel.fl
index f886c6776..eefc9c6c4 100644
--- a/fluid/alignment_panel.fl
+++ b/fluid/alignment_panel.fl
@@ -31,6 +31,7 @@ snap {
}
}
}
+mergeback 1
comment {//
// Setting and shell dialogs for the Fast Light Tool Kit (FLTK).
//
@@ -46,73 +47,73 @@ comment {//
//
// https://www.fltk.org/bugs.php
//
-} {in_source in_header
+} {uid 16807 in_source in_header
}
-decl {\#include "fluid.h"} {public global
+decl {\#include "fluid.h"} {uid 15089 public global
}
-decl {\#include "undo.h"} {private global
+decl {\#include "undo.h"} {uid 44249 private global
}
-decl {\#include "widget_browser.h"} {public global
+decl {\#include "widget_browser.h"} {uid 3114 public global
}
-decl {\#include "Fd_Snap_Action.h"} {public global
+decl {\#include "Fd_Snap_Action.h"} {uid 46978 public global
}
-decl {\#include "shell_command.h"} {public global
+decl {\#include "shell_command.h"} {uid 56008 public global
}
-decl {\#include <FL/Fl_Text_Buffer.H>} {public local
+decl {\#include <FL/Fl_Text_Buffer.H>} {uid 36568 public local
}
-decl {\#include <FL/Fl_Text_Display.H>} {public local
+decl {\#include <FL/Fl_Text_Display.H>} {uid 2558 public local
}
-decl {\#include "fluid_filename.h"} {public local
+decl {\#include "fluid_filename.h"} {uid 12099 public local
}
-decl {\#include <FL/fl_string_functions.h>} {public local
+decl {\#include <FL/fl_string_functions.h>} {uid 1101 public local
}
-decl {\#include <FL/Fl_Scheme_Choice.H>} {public local
+decl {\#include <FL/Fl_Scheme_Choice.H>} {uid 39064 public local
}
-decl {\#include <FL/Fl_Preferences.H>} {private global
+decl {\#include <FL/Fl_Preferences.H>} {uid 15445 private global
}
-decl {\#include <FL/Fl_Tooltip.H>} {private global
+decl {\#include <FL/Fl_Tooltip.H>} {uid 4748 private global
}
-decl {\#include <FL/fl_ask.H>} {private global
+decl {\#include <FL/fl_ask.H>} {uid 56290 private global
}
-decl {\#include <string.h>} {private global
+decl {\#include <string.h>} {uid 54451 private global
}
-decl {\#include "../src/flstring.h"} {private global
+decl {\#include "../src/flstring.h"} {uid 14151 private global
}
-decl {void init_scheme(void);} {
+decl {void init_scheme(void);} {uid 14615
comment {// initialize the scheme from preferences} public global
}
-decl {extern struct Fl_Menu_Item *dbmanager_item;} {public local
+decl {extern struct Fl_Menu_Item *dbmanager_item;} {uid 16657 public local
}
-decl {extern void i18n_cb(Fl_Choice *,void *);} {public local
+decl {extern void i18n_cb(Fl_Choice *,void *);} {uid 50072 public local
}
-decl {void scheme_cb(Fl_Scheme_Choice *, void *);} {public local
+decl {void scheme_cb(Fl_Scheme_Choice *, void *);} {uid 18772 public local
}
-decl {int w_settings_shell_list_selected;} {public local
+decl {int w_settings_shell_list_selected;} {uid 11823 public local
}
-Function {make_script_panel()} {open
+Function {make_script_panel()} {uid 11025 open
} {
- Fl_Window script_panel {
+ Fl_Window script_panel {uid 38445
label {Shell Script Editor}
callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape)
return; // ignore Escape
@@ -120,66 +121,67 @@ script_panel->hide(); // otherwise hide..} open
xywh {764 319 540 180} type Double labelsize 11 resizable
code0 {o->size_range(200, 150);} modal visible
} {
- Fl_Text_Editor script_input {
+ Fl_Text_Editor script_input {uid 35589
xywh {10 10 520 130} box DOWN_BOX labelsize 11 when 13 textfont 4 textsize 11 resizable
code0 {script_input->buffer(new Fl_Text_Buffer);}
}
- Fl_Group {} {open
+ Fl_Group {} {uid 12888 open
xywh {10 150 520 20} labelsize 11
} {
- Fl_Return_Button script_panel_ok {
+ Fl_Return_Button script_panel_ok {uid 26357
label OK
xywh {400 150 60 20} labelsize 11 hotspot
}
- Fl_Button script_panel_cancel {
+ Fl_Button script_panel_cancel {uid 33131
label Cancel
xywh {470 150 60 20} labelsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 40406
xywh {10 150 380 20} labelsize 11 resizable
}
}
}
code {// Enable line numbers
script_input->linenumber_width(60);
-script_input->linenumber_size(script_input->Fl_Text_Display::textsize());} {}
+script_input->linenumber_size(script_input->Fl_Text_Display::textsize());} {uid 30600
+ }
}
-Function {make_settings_window()} {open
+Function {make_settings_window()} {uid 40199 open
} {
- Fl_Window settings_window {
+ Fl_Window settings_window {uid 25753
label {FLUID Settings} open
xywh {392 362 340 580} type Double align 80 resizable size_range {340 580 0 0} visible
} {
- Fl_Tabs w_settings_tabs {
+ Fl_Tabs w_settings_tabs {uid 46226
callback {propagate_load(o, v);} open
xywh {10 10 320 530} selection_color 12 labelsize 11 labelcolor 255 resizable
} {
- Fl_Group {} {
- label General open selected
+ Fl_Group {} {uid 3912
+ label General open
image {icons/general_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 resizable
code0 {o->image()->scale(36, 24);}
} {
- Fl_Group {} {
+ Fl_Group {} {uid 20787
callback {propagate_load(o, v);} open
xywh {120 78 130 25}
} {
- Fl_Choice scheme_choice {
+ Fl_Choice scheme_choice {uid 61026
label {Scheme: }
callback scheme_cb open
xywh {120 78 120 25} down_box BORDER_BOX labelfont 1 labelsize 11
code0 {init_scheme();}
class Fl_Scheme_Choice
} {}
- Fl_Box {} {
+ Fl_Box {} {uid 37953
xywh {240 78 10 25} hide resizable
}
}
- Fl_Box {} {
+ Fl_Box {} {uid 19699
label {Options: }
xywh {120 115 0 20} labelfont 1 labelsize 11 align 4
}
- Fl_Check_Button tooltips_button {
+ Fl_Check_Button tooltips_button {uid 3853
label {Show Tooltips}
callback {Fl_Tooltip::enable(tooltips_button->value());
fluid_prefs.set("show_tooltips", tooltips_button->value());}
@@ -189,7 +191,7 @@ fluid_prefs.set("show_tooltips", tooltips_button->value());}
code2 {tooltips_button->value(b);}
code3 {Fl_Tooltip::enable(b);}
}
- Fl_Check_Button completion_button {
+ Fl_Check_Button completion_button {uid 20515
label {Show Completion Dialogs}
callback {fluid_prefs.set("show_completion_dialogs", completion_button->value());}
xywh {120 135 200 20} down_box DOWN_BOX labelsize 11
@@ -197,7 +199,7 @@ fluid_prefs.set("show_tooltips", tooltips_button->value());}
code1 {fluid_prefs.get("show_completion_dialogs", b, 1);}
code2 {completion_button->value(b);}
}
- Fl_Check_Button openlast_button {
+ Fl_Check_Button openlast_button {uid 27365
label {Open Previous File on Startup}
callback {fluid_prefs.set("open_previous_file", openlast_button->value());}
xywh {120 155 200 20} down_box DOWN_BOX labelsize 11
@@ -205,28 +207,29 @@ fluid_prefs.set("show_tooltips", tooltips_button->value());}
code1 {fluid_prefs.get("open_previous_file", b, 0);}
code2 {openlast_button->value(b);}
}
- Fl_Check_Button prevpos_button {
+ Fl_Check_Button prevpos_button {uid 63583
label {Remember Window Positions}
- callback {fluid_prefs.set("prev_window_pos", prevpos_button->value());}
+ callback {// Test!
+fluid_prefs.set("prev_window_pos", prevpos_button->value());}
xywh {120 175 200 20} down_box DOWN_BOX labelsize 11
code0 {int b;}
code1 {fluid_prefs.get("prev_window_pos", b, 1);}
code2 {prevpos_button->value(b);}
}
- Fl_Check_Button show_comments_button {
+ Fl_Check_Button show_comments_button {uid 13616
label {Show Comments in Browser}
callback {show_comments = show_comments_button->value();
fluid_prefs.set("show_comments", show_comments);
-redraw_browser();}
+redraw_browser();} selected
xywh {120 195 200 20} down_box DOWN_BOX labelsize 11
code1 {fluid_prefs.get("show_comments", show_comments, 1);}
code2 {show_comments_button->value(show_comments);}
}
- Fl_Group {} {
+ Fl_Group {} {uid 8913
callback {propagate_load(o, v);} open
xywh {120 225 50 20}
} {
- Fl_Spinner recent_spinner {
+ Fl_Spinner recent_spinner {uid 63176
label {\# Recent Files:}
callback {fluid_prefs.set("recent_files", recent_spinner->value());
load_history();}
@@ -236,11 +239,11 @@ load_history();}
code2 {recent_spinner->maximum(10);}
code3 {recent_spinner->value(c);}
}
- Fl_Box {} {
+ Fl_Box {} {uid 62957
xywh {160 225 10 20} hide resizable
}
}
- Fl_Check_Button use_external_editor_button {
+ Fl_Check_Button use_external_editor_button {uid 50529
label {Use for Code Nodes}
callback {G_use_external_editor = use_external_editor_button->value();
fluid_prefs.set("use_external_editor", G_use_external_editor);
@@ -249,7 +252,7 @@ redraw_browser();}
code1 {fluid_prefs.get("use_external_editor", G_use_external_editor, 0);}
code2 {use_external_editor_button->value(G_use_external_editor);}
}
- Fl_Input editor_command_input {
+ Fl_Input editor_command_input {uid 26636
label {External Editor:}
callback {strncpy(G_external_editor_command, editor_command_input->value(), sizeof(G_external_editor_command)-1);
G_external_editor_command[sizeof(G_external_editor_command)-1] = 0;
@@ -264,45 +267,45 @@ Examples:
code1 {fluid_prefs.get("external_editor_command", G_external_editor_command, "", sizeof(G_external_editor_command)-1);}
code2 {editor_command_input->value(G_external_editor_command);}
}
- Fl_Box {} {
+ Fl_Box {} {uid 5451
label {Overlays: }
xywh {120 300 0 20} labelfont 1 labelsize 11 align 4
}
- Fl_Check_Button guides_button {
+ Fl_Check_Button guides_button {uid 10498
label {Show Positioning Guides}
callback toggle_guides_cb
tooltip {show guides that help to position and resize widgets and enable snapping} xywh {120 300 200 20} down_box DOWN_BOX labelsize 11
code0 {o->value(show_guides);}
}
- Fl_Check_Button restricted_button {
+ Fl_Check_Button restricted_button {uid 21557
label {Show Restricted Areas}
callback toggle_restricted_cb
tooltip {show overlapping and out of bounds areas, show unfilled areas in Fl_Pack groups} xywh {120 320 200 20} down_box DOWN_BOX labelsize 11
code0 {o->value(show_restricted);}
}
- Fl_Box {} {
+ Fl_Box {} {uid 32825
xywh {120 530 200 10} hide resizable
}
}
- Fl_Group w_settings_project_tab {
+ Fl_Group w_settings_project_tab {uid 20609
label Project
callback {propagate_load(o, v);} open
image {icons/document_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide
code0 {o->image()->scale(36, 24);}
} {
- Fl_Group {} {open
+ Fl_Group {} {uid 25732 open
xywh {100 78 220 30}
} {
- Fl_Box {} {
+ Fl_Box {} {uid 9656
label {Use "name.ext" to set a file name
or just ".ext" to set extension.}
xywh {100 78 210 30} labelsize 11 align 148
}
- Fl_Box {} {
+ Fl_Box {} {uid 25876
xywh {310 78 10 30} hide resizable
}
}
- Fl_Input header_file_input {
+ Fl_Input header_file_input {uid 7074
label {Header File:}
user_data 1 user_data_type {void*}
callback {if (v == LOAD) {
@@ -315,7 +318,7 @@ or just ".ext" to set extension.}
}}
tooltip {The name of the generated header file.} xywh {100 112 220 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 when 1 textfont 4 textsize 11
}
- Fl_Input code_file_input {
+ Fl_Input code_file_input {uid 13212
label {Code File:}
user_data 1 user_data_type {void*}
callback {if (v == LOAD) {
@@ -328,11 +331,7 @@ or just ".ext" to set extension.}
}}
tooltip {The name of the generated code file.} xywh {100 137 220 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 when 1 textfont 4 textsize 11
}
- Fl_Box {} {
- label {Options: }
- xywh {100 205 0 20} labelfont 1 labelsize 11 align 4
- }
- Fl_Check_Button include_H_from_C_button {
+ Fl_Check_Button include_H_from_C_button {uid 26292
label {Include Header from Code}
callback {if (v == LOAD) {
o->value(g_project.include_H_from_C);
@@ -344,7 +343,11 @@ or just ".ext" to set extension.}
}}
tooltip {Include the header file from the code file.} xywh {100 162 220 20} down_box DOWN_BOX labelsize 11
}
- Fl_Check_Button use_FL_COMMAND_button {
+ Fl_Box {} {uid 61018
+ label {Options: }
+ xywh {100 205 0 20} labelfont 1 labelsize 11 align 4
+ }
+ Fl_Check_Button use_FL_COMMAND_button {uid 37479
label {Menu shortcuts use FL_COMMAND}
callback {if (v == LOAD) {
o->value(g_project.use_FL_COMMAND);
@@ -356,7 +359,7 @@ or just ".ext" to set extension.}
}}
tooltip {Replace FL_CTRL and FL_META with FL_COMMAND when generating menu shortcuts} xywh {100 205 220 20} down_box DOWN_BOX labelsize 11
}
- Fl_Check_Button utf8_in_src_button {
+ Fl_Check_Button utf8_in_src_button {uid 44074
label {allow Unicode UTF-8 in source code}
callback {if (v == LOAD) {
o->value(g_project.utf8_in_src);
@@ -368,7 +371,7 @@ or just ".ext" to set extension.}
}}
tooltip {For older compilers, characters outside of the printable ASCII range are escaped using octal notation `\\0123`. If this option is checked, Fluid will write UTF-8 characters unchanged.} xywh {100 230 220 20} down_box DOWN_BOX labelsize 11
}
- Fl_Check_Button avoid_early_includes_button {
+ Fl_Check_Button avoid_early_includes_button {uid 13514
label {avoid early include of Fl.H}
callback {if (v == LOAD) {
o->value(g_project.avoid_early_includes);
@@ -380,21 +383,37 @@ or just ".ext" to set extension.}
}}
tooltip {Do not emit \#include <FL//Fl.H> until it is needed by another include file.} xywh {100 255 220 20} down_box DOWN_BOX labelsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 56037
+ label {Experimental: }
+ xywh {100 283 0 20} labelfont 1 labelsize 11 align 4
+ }
+ Fl_Check_Button w_proj_mergeback {uid 4680
+ label {generate MergeBack data}
+ callback {if (v == LOAD) {
+ o->value(g_project.write_mergeback_data);
+} else {
+ if (g_project.write_mergeback_data != o->value()) {
+ set_modflag(1);
+ g_project.write_mergeback_data = o->value();
+ }
+}}
+ tooltip {MergeBack is a feature under construction that allows changes in code files to be merged back into the project file. Checking this option will generate additional data in code and project files.} xywh {100 283 220 20} down_box DOWN_BOX labelsize 11
+ }
+ Fl_Box {} {uid 18921
xywh {100 530 220 10} hide resizable
}
}
- Fl_Group w_settings_layout_tab {
+ Fl_Group w_settings_layout_tab {uid 41157
label Layout
callback {propagate_load(o, v);} open
image {icons/layout_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide
code0 {o->image()->scale(36, 24);}
} {
- Fl_Box {} {
+ Fl_Box {} {uid 1521
label {Layout:}
xywh {25 78 60 24} labelfont 1 labelsize 11 align 24
}
- Fl_Choice layout_choice {
+ Fl_Choice layout_choice {uid 8880
callback {if (v == LOAD) {
o->value(g_layout_list.current_suite());
} else {
@@ -404,16 +423,16 @@ or just ".ext" to set extension.}
}}
xywh {85 78 187 24} down_box BORDER_BOX
} {
- MenuItem {} {
+ MenuItem {} {uid 22212
label FLTK
xywh {0 0 31 20}
}
- MenuItem {} {
+ MenuItem {} {uid 39957
label Grid
xywh {0 0 31 20}
}
}
- Fl_Button {} {
+ Fl_Button {} {uid 11146
label {+}
callback {// Clone the current layout suite
@@ -429,7 +448,7 @@ g_layout_list.add(new_name);
g_layout_list.update_dialogs();}
xywh {272 78 24 24}
}
- Fl_Menu_Button w_layout_menu {
+ Fl_Menu_Button w_layout_menu {uid 37349
callback {if (v == LOAD) {
Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
if (suite.storage_ == FD_STORE_INTERNAL) {
@@ -445,7 +464,7 @@ g_layout_list.update_dialogs();}
}} open
xywh {296 78 24 24}
} {
- MenuItem w_layout_menu_rename {
+ MenuItem w_layout_menu_rename {uid 27291
label {Rename...}
callback {// Rename the current layout suite
@@ -458,35 +477,35 @@ g_layout_list.rename(new_name);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} divider
}
- MenuItem {w_layout_menu_storage[0]} {
+ MenuItem {w_layout_menu_storage[0]} {uid 63565
label {@fd_beaker FLUID Built-In}
callback {Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_INTERNAL);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio deactivate
}
- MenuItem {w_layout_menu_storage[1]} {
+ MenuItem {w_layout_menu_storage[1]} {uid 49977
label {@fd_user User Preference}
callback {Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_USER);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio
}
- MenuItem {w_layout_menu_storage[2]} {
+ MenuItem {w_layout_menu_storage[2]} {uid 62966
label {@fd_project Store in .fl Project File}
callback {Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_PROJECT);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio
}
- MenuItem {w_layout_menu_storage[3]} {
+ MenuItem {w_layout_menu_storage[3]} {uid 2039
label {@fd_file Store in External File}
callback {Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_FILE);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio divider
}
- MenuItem w_layout_menu_load {
+ MenuItem w_layout_menu_load {uid 9960
label {Load...}
callback {// Give the user a file chooser and load that file
Fl_Native_File_Chooser fnfc;
@@ -502,7 +521,7 @@ g_layout_list.load(new_filename);
g_layout_list.update_dialogs();}
xywh {0 0 31 20}
}
- MenuItem w_layout_menu_save {
+ MenuItem w_layout_menu_save {uid 19617
label {Save...}
callback {// Give the user a file chooser with a suggested name
Fl_Native_File_Chooser fnfc;
@@ -521,7 +540,7 @@ g_layout_list.update_dialogs();}
xywh {0 0 31 20} divider
code0 {\#include <FL/Fl_Native_File_Chooser.H>}
}
- MenuItem w_layout_menu_delete {
+ MenuItem w_layout_menu_delete {uid 4101
label Delete
callback {// remove the current suite
@@ -530,42 +549,42 @@ g_layout_list.update_dialogs();}
xywh {0 0 31 20}
}
}
- Fl_Box {} {
+ Fl_Box {} {uid 60115
label {Preset:}
xywh {25 107 60 20} labelfont 1 labelsize 11 align 24
}
- Fl_Group {} {
+ Fl_Group {} {uid 63742
callback propagate_load open
xywh {85 107 235 20} labelsize 11
} {
- Fl_Button {preset_choice[0]} {
+ Fl_Button {preset_choice[0]} {uid 62445
label Application
user_data 0 user_data_type long
callback edit_layout_preset_cb
xywh {85 107 78 20} type Radio value 1 selection_color 45 labelsize 11 compact 1
}
- Fl_Button {preset_choice[1]} {
+ Fl_Button {preset_choice[1]} {uid 19877
label Dialog
user_data 1 user_data_type long
callback edit_layout_preset_cb
xywh {163 107 79 20} type Radio selection_color 45 labelsize 11 compact 1
}
- Fl_Button {preset_choice[2]} {
+ Fl_Button {preset_choice[2]} {uid 47317
label Toolbox
user_data 2 user_data_type long
callback edit_layout_preset_cb
xywh {242 107 78 20} type Radio selection_color 45 labelsize 11 compact 1
}
}
- Fl_Box {} {
+ Fl_Box {} {uid 57587
label {---- Window ----}
xywh {85 132 235 20} labelfont 1 labelsize 11 align 20
}
- Fl_Box {} {
+ Fl_Box {} {uid 39641
label {Margin:}
xywh {25 167 60 20} labelsize 11 align 24
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 19684
label {Left:}
callback {if (v == LOAD) {
o->value((double)layout->left_window_margin);
@@ -574,7 +593,7 @@ g_layout_list.update_dialogs();}
}}
xywh {85 167 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 15451
label {Top:}
callback {if (v == LOAD) {
o->value((double)layout->top_window_margin);
@@ -583,7 +602,7 @@ g_layout_list.update_dialogs();}
}}
xywh {145 167 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 48122
label {Right:}
callback {if (v == LOAD) {
o->value((double)layout->right_window_margin);
@@ -592,7 +611,7 @@ g_layout_list.update_dialogs();}
}}
xywh {205 167 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 21612
label {Bottom:}
callback {if (v == LOAD) {
o->value((double)layout->bottom_window_margin);
@@ -601,11 +620,11 @@ g_layout_list.update_dialogs();}
}}
xywh {265 167 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 36291
label {Grid:}
xywh {32 201 53 20} labelsize 11 align 24
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 4433
label {Horizontal:}
callback {if (v == LOAD) {
o->value((double)layout->window_grid_x);
@@ -614,7 +633,7 @@ g_layout_list.update_dialogs();}
}}
xywh {85 201 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 62434
label {Vertical:}
callback {if (v == LOAD) {
o->value((double)layout->window_grid_y);
@@ -623,15 +642,15 @@ g_layout_list.update_dialogs();}
}}
xywh {145 201 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 39968
label {---- Group ----}
xywh {85 226 235 20} labelfont 1 labelsize 11 align 20
}
- Fl_Box {} {
+ Fl_Box {} {uid 8110
label {Margin:}
xywh {25 261 60 20} labelsize 11 align 24
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 4108
label {Left:}
callback {if (v == LOAD) {
o->value((double)layout->left_group_margin);
@@ -640,7 +659,7 @@ g_layout_list.update_dialogs();}
}}
xywh {85 261 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 40673
label {Top:}
callback {if (v == LOAD) {
o->value((double)layout->top_group_margin);
@@ -649,7 +668,7 @@ g_layout_list.update_dialogs();}
}}
xywh {145 261 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 64774
label {Right:}
callback {if (v == LOAD) {
o->value((double)layout->right_group_margin);
@@ -658,7 +677,7 @@ g_layout_list.update_dialogs();}
}}
xywh {205 261 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 42648
label {Bottom:}
callback {if (v == LOAD) {
o->value((double)layout->bottom_group_margin);
@@ -667,11 +686,11 @@ g_layout_list.update_dialogs();}
}}
xywh {265 261 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 24685
label {Grid:}
xywh {32 295 53 20} labelsize 11 align 24
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 46945
label {Horizontal:}
callback {if (v == LOAD) {
o->value((double)layout->group_grid_x);
@@ -680,7 +699,7 @@ g_layout_list.update_dialogs();}
}}
xywh {85 295 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 24575
label {Vertical:}
callback {if (v == LOAD) {
o->value((double)layout->group_grid_y);
@@ -689,15 +708,15 @@ g_layout_list.update_dialogs();}
}}
xywh {145 295 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 28980
label {---- Tabs ----}
xywh {85 320 235 20} labelfont 1 labelsize 11 align 20
}
- Fl_Box {} {
+ Fl_Box {} {uid 6305
label {Margin:}
xywh {25 355 60 20} labelsize 11 align 24
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 64542
label {Top:}
callback {if (v == LOAD) {
o->value((double)layout->top_tabs_margin);
@@ -706,7 +725,7 @@ g_layout_list.update_dialogs();}
}}
xywh {85 355 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 15129
label {Bottom:}
callback {if (v == LOAD) {
o->value((double)layout->bottom_tabs_margin);
@@ -715,15 +734,15 @@ g_layout_list.update_dialogs();}
}}
xywh {145 355 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 6909
label {---- Widget ----}
xywh {85 380 235 20} labelfont 1 labelsize 11 align 20
}
- Fl_Box {} {
+ Fl_Box {} {uid 55862
label {Horizontal:}
xywh {25 415 60 20} labelsize 11 align 24
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 12880
label {Minimum:}
callback {if (v == LOAD) {
o->value((double)layout->widget_min_w);
@@ -732,7 +751,7 @@ g_layout_list.update_dialogs();}
}}
xywh {85 414 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 17129
label {Increment:}
callback {if (v == LOAD) {
o->value((double)layout->widget_inc_w);
@@ -741,7 +760,7 @@ g_layout_list.update_dialogs();}
}}
xywh {145 414 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 3511
label {Gap:}
callback {if (v == LOAD) {
o->value((double)layout->widget_gap_x);
@@ -750,11 +769,11 @@ g_layout_list.update_dialogs();}
}}
xywh {205 414 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 39553
label {Vertical:}
xywh {32 440 53 20} labelsize 11 align 24
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 44943
callback {if (v == LOAD) {
o->value((double)layout->widget_min_h);
} else {
@@ -762,7 +781,7 @@ g_layout_list.update_dialogs();}
}}
xywh {85 440 55 20} labelsize 11 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 4035
callback {if (v == LOAD) {
o->value((double)layout->widget_inc_h);
} else {
@@ -770,7 +789,7 @@ g_layout_list.update_dialogs();}
}}
xywh {145 440 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 62522
callback {if (v == LOAD) {
o->value((double)layout->widget_gap_y);
} else {
@@ -778,12 +797,12 @@ g_layout_list.update_dialogs();}
}}
xywh {205 440 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
- Fl_Group {} {
+ Fl_Group {} {uid 17182
label {Label Font:}
callback propagate_load open
xywh {85 465 201 20} labelsize 11 align 4
} {
- Fl_Choice {} {
+ Fl_Choice {} {uid 28943
callback {if (v == LOAD) {
o->value(layout->labelfont+1);
} else {
@@ -793,7 +812,7 @@ g_layout_list.update_dialogs();}
code0 {extern Fl_Menu_Item fontmenu_w_default[];}
code1 {o->menu(fontmenu_w_default);}
} {}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 40384
callback {if (v == LOAD) {
o->value(layout->labelsize);
} else {
@@ -802,12 +821,12 @@ g_layout_list.update_dialogs();}
tooltip {The size of the label text.} xywh {235 465 50 20} labelsize 11 minimum 1 maximum 1000 step 1 value 14 textsize 11
}
}
- Fl_Group {} {
+ Fl_Group {} {uid 55084
label {Text Font:}
callback propagate_load open
xywh {85 490 200 20} labelsize 11 align 4
} {
- Fl_Choice {} {
+ Fl_Choice {} {uid 37444
callback {if (v == LOAD) {
o->value(layout->textfont+1);
} else {
@@ -817,7 +836,7 @@ g_layout_list.update_dialogs();}
code0 {extern Fl_Menu_Item fontmenu_w_default[];}
code1 {o->menu(fontmenu_w_default);}
} {}
- Fl_Value_Input {} {
+ Fl_Value_Input {} {uid 46165
callback {if (v == LOAD) {
o->value(layout->textsize);
} else {
@@ -826,21 +845,21 @@ g_layout_list.update_dialogs();}
tooltip {The value text size.} xywh {235 490 50 20} labelsize 11 maximum 1000 step 1 value 14 textsize 11
}
}
- Fl_Box {} {
+ Fl_Box {} {uid 19066
xywh {325 535 5 5} hide resizable
}
}
- Fl_Group w_settings_shell_tab {
+ Fl_Group w_settings_shell_tab {uid 36808
label Shell
callback propagate_load open
image {icons/shell_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide
code0 {o->image()->scale(36, 24);}
} {
- Fl_Group {} {
+ Fl_Group {} {uid 44715
callback propagate_load open
xywh {10 90 320 132}
} {
- Fl_Browser w_settings_shell_list {
+ Fl_Browser w_settings_shell_list {uid 24144
label {Shell
command
list:}
@@ -871,13 +890,13 @@ list:}
}}
xywh {100 90 220 110} type Multi labelfont 1 labelsize 11 align 4 textsize 13 resizable
}
- Fl_Group w_settings_shell_toolbox {
+ Fl_Group w_settings_shell_toolbox {uid 1225
callback {if (v==LOAD) {
propagate_load(o, v);
}} open
xywh {100 200 220 22}
} {
- Fl_Button {} {
+ Fl_Button {} {uid 26034
label {+}
callback {if (v != LOAD) {
int selected = w_settings_shell_list_selected;
@@ -897,7 +916,7 @@ list:}
}}
tooltip {insert a new shell command into the list after the selected command} xywh {100 200 24 22} labelfont 1 labelsize 11
}
- Fl_Button w_settings_shell_dup {
+ Fl_Button w_settings_shell_dup {uid 39134
label {++}
callback {int selected = w_settings_shell_list_selected;
if (v==LOAD) {
@@ -925,7 +944,7 @@ if (v==LOAD) {
}}
tooltip {duplicate the selected shell command and insert it into the list} xywh {124 200 24 22} labelfont 1 labelsize 11 deactivate
}
- Fl_Button w_settings_shell_remove {
+ Fl_Button w_settings_shell_remove {uid 8882
label DEL
callback {int selected = w_settings_shell_list_selected;
if (v==LOAD) {
@@ -952,46 +971,46 @@ if (v==LOAD) {
}}
tooltip {remove the selected shell command - this can not be undone} xywh {148 200 24 22} labelsize 10 deactivate
}
- Fl_Menu_Button w_settings_shell_menu {open
+ Fl_Menu_Button w_settings_shell_menu {uid 59638 open
xywh {172 200 24 22} labelsize 11 textsize 11
} {
- MenuItem {} {
+ MenuItem {} {uid 43189
label {Import...}
callback {if (v != LOAD)
Fd_Shell_Command_List::import_from_file();}
tooltip {import shell commands from an external file} xywh {90 90 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 11746
label {Export selected...}
callback {if (v != LOAD)
Fd_Shell_Command_List::export_selected();}
tooltip {export selected shell commands to an external file} xywh {10 10 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 23116
label {Example Scripts:}
xywh {20 20 100 20} labelfont 1 labelsize 10 hide deactivate
}
- MenuItem {} {
+ MenuItem {} {uid 24655
label {Compile with fltk-config}
xywh {30 30 100 20} labelsize 11 hide
}
- MenuItem {} {
+ MenuItem {} {uid 64477
label {Build and run}
xywh {40 40 100 20} labelsize 11 hide
}
- MenuItem {} {
+ MenuItem {} {uid 33695
label {Build with Xcode on macOS}
xywh {50 50 100 20} labelsize 11 hide
}
- MenuItem {} {
+ MenuItem {} {uid 23688
label {Build with CMake}
xywh {60 60 100 20} labelsize 11 hide
}
}
- Fl_Box {} {
+ Fl_Box {} {uid 61031
xywh {253 200 13 22} hide resizable
}
- Fl_Button w_settings_shell_play {
+ Fl_Button w_settings_shell_play {uid 53949
label Run
callback {int selected = w_settings_shell_list_selected;
if (v==LOAD) {
@@ -1009,7 +1028,7 @@ if (v==LOAD) {
}
}
}
- Fl_Group w_settings_shell_cmd {
+ Fl_Group w_settings_shell_cmd {uid 44494
callback {if (v==LOAD) {
int selected = w_settings_shell_list_selected;
if (selected) {
@@ -1021,7 +1040,7 @@ if (v==LOAD) {
}} open
xywh {10 235 320 291} resizable
} {
- Fl_Input {} {
+ Fl_Input {} {uid 54815
label {Name:}
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1040,7 +1059,7 @@ if (v == LOAD) {
}}
tooltip {file the shell command under this name in the shell command list} xywh {100 246 220 20} labelfont 1 labelsize 11 when 13 textfont 4 textsize 11
}
- Fl_Input {} {
+ Fl_Input {} {uid 52210
label {Menu Label:}
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1059,11 +1078,11 @@ if (v == LOAD) {
}}
tooltip {label text for the Shell menu in the main menu bar} xywh {100 272 220 20} labelfont 1 labelsize 11 textfont 4 textsize 11
}
- Fl_Group {} {
+ Fl_Group {} {uid 41313
callback {propagate_load(o, v);} open
xywh {100 297 140 71}
} {
- Fl_Button {} {
+ Fl_Button {} {uid 61696
label Shortcut
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1085,7 +1104,7 @@ if (v == LOAD) {
code0 {\#include <FL/Fl_Shortcut_Button.H>}
class Fl_Shortcut_Button
}
- Fl_Choice {} {
+ Fl_Choice {} {uid 30606
label {Store:}
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1111,18 +1130,18 @@ if (v == LOAD) {
}} open
tooltip {store this shell command as a user setting or save it with the .fl project file} xywh {100 322 130 20} down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11
} {
- MenuItem {} {
+ MenuItem {} {uid 9848
label {@fd_user User Setting}
user_data FD_STORE_USER user_data_type long
xywh {0 0 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 39319
label {@fd_project Project File}
user_data FD_STORE_PROJECT user_data_type long
xywh {0 0 100 20} labelsize 11
}
}
- Fl_Choice {} {
+ Fl_Choice {} {uid 44439
label {Condition:}
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1143,42 +1162,42 @@ if (v == LOAD) {
}} open
tooltip {add this command to the main menu bar only if this condition is true} xywh {100 348 130 20} down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11
} {
- MenuItem {} {
+ MenuItem {} {uid 42254
label {all platforms}
user_data {Fd_Shell_Command::ALWAYS} user_data_type long
xywh {0 0 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 23092
label {MS Windows only}
user_data {Fd_Shell_Command::WIN_ONLY} user_data_type long
xywh {0 0 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 10850
label {Linux only}
user_data {Fd_Shell_Command::UX_ONLY} user_data_type long
xywh {0 0 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 50951
label {macOS only}
user_data {Fd_Shell_Command::MAC_ONLY} user_data_type long
xywh {0 0 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 42199
label {Linux and macOS}
user_data {Fd_Shell_Command::MAC_AND_UX_ONLY} user_data_type long
xywh {0 0 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 11358
label {don't use}
user_data {Fd_Shell_Command::NEVER} user_data_type long
xywh {0 0 100 20} labelsize 11
}
}
- Fl_Box {} {
+ Fl_Box {} {uid 58439
xywh {230 297 10 71} hide resizable
}
}
- Fl_Input {} {
+ Fl_Input {} {uid 6817
label {Label:}
callback {if (v == LOAD) {
// o->value(g_shell_command.c_str());
@@ -1187,11 +1206,11 @@ if (v == LOAD) {
}}
xywh {230 348 90 20} labelfont 1 labelsize 11 textfont 4 textsize 11 hide
}
- Fl_Group {} {
+ Fl_Group {} {uid 18520
callback propagate_load open
xywh {100 373 220 80} resizable
} {
- Fl_Text_Editor w_settings_shell_command {
+ Fl_Text_Editor w_settings_shell_command {uid 46121
label {Shell script:}
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1210,10 +1229,10 @@ if (v == LOAD) {
xywh {100 373 196 80} labelfont 1 labelsize 11 align 4 textfont 4 textsize 12 resizable
code0 {o->buffer(new Fl_Text_Buffer);}
}
- Fl_Group {} {open
+ Fl_Group {} {uid 6286 open
xywh {296 373 24 80}
} {
- Fl_Menu_Button w_settings_shell_text_macros {
+ Fl_Menu_Button w_settings_shell_text_macros {uid 18267
callback {const Fl_Menu_Item *mi = o->mvalue();
if (mi) {
char buffer[256];
@@ -1234,53 +1253,53 @@ if (mi) {
}} open
tooltip {a list of text replacements available for the shell script} xywh {296 373 24 22} labelsize 11 textsize 11
} {
- MenuItem {} {
+ MenuItem {} {uid 47010
label {@@BASENAME@@}
xywh {80 80 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 3061
label {@@PROJECTFILE_PATH@@}
xywh {0 0 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 7010
label {@@PROJECTFILE_NAME@@}
xywh {10 10 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 52294
label {@@CODEFILE_PATH@@}
xywh {20 20 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 2438
label {@@CODEFILE_NAME@@}
xywh {30 30 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 30620
label {@@HEADERFILE_PATH@@}
xywh {40 40 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 48836
label {@@HEADERFILE_NAME@@}
xywh {50 50 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 16174
label {@@TEXTFILE_PATH@@}
xywh {60 60 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 9014
label {@@TEXTFILE_NAME@@}
xywh {70 70 100 20} labelfont 4 labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 51498
label {@@FLTK_CONFIG@@}
comment {Not yet implemented}
xywh {70 70 100 20} labelfont 4 labelsize 11 hide
}
- MenuItem {} {
+ MenuItem {} {uid 60674
label {@@TMPDIR@@}
xywh {70 70 100 20} labelfont 4 labelsize 11
}
}
- Fl_Button {} {
+ Fl_Button {} {uid 22643
label {@+1fd_zoom}
callback {if (!script_panel) make_script_panel();
script_input->buffer()->text(w_settings_shell_command->buffer()->text());
@@ -1299,12 +1318,12 @@ BREAK2:
script_panel->hide();}
tooltip {open the big code editor} xywh {296 395 24 22} labelsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 60434
xywh {296 417 24 10} hide resizable
}
}
}
- Fl_Check_Button {} {
+ Fl_Check_Button {} {uid 40036
label {save .fl project file}
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1327,7 +1346,7 @@ if (v == LOAD) {
}}
tooltip {save the project to the .fl file before running the command} xywh {100 458 220 20} down_box DOWN_BOX labelsize 11
}
- Fl_Check_Button {} {
+ Fl_Check_Button {} {uid 28134
label {save source code}
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1350,7 +1369,7 @@ if (v == LOAD) {
}}
tooltip {generate the source code and header file before running the command} xywh {100 478 220 19} down_box DOWN_BOX labelsize 11
}
- Fl_Check_Button {} {
+ Fl_Check_Button {} {uid 12038
label {save i18n strings}
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
@@ -1374,52 +1393,52 @@ if (v == LOAD) {
tooltip {save the internationalisation strings before running the command} xywh {100 497 220 20} down_box DOWN_BOX labelsize 11
}
}
- Fl_Box w_settings_shell_fd_project {
+ Fl_Box w_settings_shell_fd_project {uid 17287
image {pixmaps/fd_project.png} compress_image 1 bind_image 1 bind_deimage 1 xywh {20 70 16 15} labelsize 11 hide deactivate
code0 {o->image()->scale(16, 16);}
}
- Fl_Box w_settings_shell_fd_user {
+ Fl_Box w_settings_shell_fd_user {uid 23791
image {pixmaps/fd_user.png} compress_image 1 bind_image 1 bind_deimage 1 xywh {20 70 16 15} labelsize 11 hide deactivate
code0 {o->image()->scale(16, 16);}
}
}
- Fl_Group w_settings_i18n_tab {
+ Fl_Group w_settings_i18n_tab {uid 33363
label Locale
callback {propagate_load(o, v);} open
image {icons/language_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide
code0 {o->image()->scale(36, 24);}
} {
- Fl_Group {} {
+ Fl_Group {} {uid 13577
callback propagate_load open
xywh {100 78 170 20}
} {
- Fl_Choice i18n_type_chooser {
+ Fl_Choice i18n_type_chooser {uid 63697
label {i18n Library:}
callback i18n_type_cb open
tooltip {Type of internationalization to use.} xywh {100 78 160 20} box THIN_UP_BOX down_box BORDER_BOX labelsize 11 textsize 11
} {
- MenuItem {} {
+ MenuItem {} {uid 32520
label None
xywh {0 -11 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 6995
label {GNU gettext}
xywh {0 -11 100 20} labelsize 11
}
- MenuItem {} {
+ MenuItem {} {uid 9039
label {POSIX catgets}
xywh {0 -11 100 20} labelsize 11
}
}
- Fl_Box {} {
+ Fl_Box {} {uid 16977
xywh {260 78 10 20} hide resizable
}
}
- Fl_Group i18n_gnu_group {
+ Fl_Group i18n_gnu_group {uid 57848
callback {propagate_load(o, v);} open
xywh {100 103 220 95}
} {
- Fl_Input i18n_gnu_include_input {
+ Fl_Input i18n_gnu_include_input {uid 36197
label {\#include:}
callback {if (v == LOAD) {
o->value(g_project.i18n_gnu_include.c_str());
@@ -1430,7 +1449,7 @@ if (v == LOAD) {
}}
tooltip {The include file for internationalization.} xywh {100 103 220 20} box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11
}
- Fl_Input i18n_gnu_conditional_input {
+ Fl_Input i18n_gnu_conditional_input {uid 7567
label {Conditional:}
callback {if (v == LOAD) {
o->value(g_project.i18n_gnu_conditional.c_str());
@@ -1441,7 +1460,7 @@ if (v == LOAD) {
}}
tooltip {only include the header file if this preprocessor macro is defined, for example FLTK_GETTEXT_FOUND} xywh {100 128 220 20} box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11
}
- Fl_Input i18n_gnu_function_input {
+ Fl_Input i18n_gnu_function_input {uid 42932
label {Function:}
callback {if (v == LOAD) {
o->value(g_project.i18n_gnu_function.c_str());
@@ -1452,7 +1471,7 @@ if (v == LOAD) {
}}
tooltip {The function to call to translate labels and tooltips, usually "gettext" or "_"} xywh {100 153 220 20} box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11
}
- Fl_Input i18n_gnu_static_function_input {
+ Fl_Input i18n_gnu_static_function_input {uid 21232
label {Static Function:}
callback {if (v == LOAD) {
o->value(g_project.i18n_gnu_static_function.c_str());
@@ -1464,11 +1483,11 @@ if (v == LOAD) {
tooltip {function to call to translate static text, The function to call to internationalize labels and tooltips, usually "gettext_noop" or "N_"} xywh {100 178 220 20} box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11
}
}
- Fl_Group i18n_posix_group {
+ Fl_Group i18n_posix_group {uid 10624
callback {propagate_load(o, v);} open
xywh {100 103 220 95} hide
} {
- Fl_Input i18n_pos_include_input {
+ Fl_Input i18n_pos_include_input {uid 46007
label {\#include:}
callback {if (v == LOAD) {
o->value(g_project.i18n_pos_include.c_str());
@@ -1479,7 +1498,7 @@ if (v == LOAD) {
}}
tooltip {The include file for internationalization.} xywh {100 103 220 20} box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11
}
- Fl_Input i18n_pos_conditional_input {
+ Fl_Input i18n_pos_conditional_input {uid 56011
label {Conditional:}
callback {if (v == LOAD) {
o->value(g_project.i18n_pos_conditional.c_str());
@@ -1490,7 +1509,7 @@ if (v == LOAD) {
}}
tooltip {only include the header file if this preprocessor macro is defined, for example FLTK_GETTEXT_FOUND} xywh {100 128 220 20} box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11
}
- Fl_Input i18n_pos_file_input {
+ Fl_Input i18n_pos_file_input {uid 31513
label {File:}
callback {if (v == LOAD) {
o->value(g_project.i18n_pos_file.c_str());
@@ -1501,11 +1520,11 @@ if (v == LOAD) {
}}
tooltip {The name of the message catalog.} xywh {100 153 220 20} box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11
}
- Fl_Group {} {
+ Fl_Group {} {uid 55278
callback {propagate_load(o, v);} open
xywh {100 178 90 20}
} {
- Fl_Input i18n_pos_set_input {
+ Fl_Input i18n_pos_set_input {uid 26778
label {Set:}
callback {if (v == LOAD) {
o->value(g_project.i18n_pos_set.c_str());
@@ -1516,20 +1535,20 @@ if (v == LOAD) {
}}
tooltip {The message set number.} xywh {100 178 80 20} type Int box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 38123
xywh {180 178 10 20} hide resizable
}
}
}
- Fl_Box {} {
+ Fl_Box {} {uid 63959
xywh {100 530 220 10} hide resizable
}
}
}
- Fl_Group {} {open
+ Fl_Group {} {uid 44824 open
xywh {10 550 320 20}
} {
- Fl_Button {} {
+ Fl_Button {} {uid 34508
label Close
callback {if (g_shell_config)
g_shell_config->write(fluid_prefs, FD_STORE_USER);
@@ -1537,36 +1556,37 @@ g_layout_list.write(fluid_prefs, FD_STORE_USER);
settings_window->hide();}
tooltip {Close this dialog.} xywh {230 550 100 20} labelsize 11
}
- Fl_Box {} {
+ Fl_Box {} {uid 59471
xywh {220 550 10 20} hide resizable
}
}
}
- code {w_settings_tabs->do_callback(w_settings_tabs, LOAD);} {}
+ code {w_settings_tabs->do_callback(w_settings_tabs, LOAD);} {uid 51362
+ }
}
-Function {make_shell_window()} {open
+Function {make_shell_window()} {uid 17532 open
} {
- Fl_Window shell_run_window {
+ Fl_Window shell_run_window {uid 26508
label {Shell Command Output} open
xywh {769 585 555 430} type Double align 80 resizable visible
} {
- Fl_Simple_Terminal shell_run_terminal {
+ Fl_Simple_Terminal shell_run_terminal {uid 20535
xywh {10 10 535 375} resizable
code0 {shell_run_terminal->ansi(1);}
}
- Fl_Group {} {open
+ Fl_Group {} {uid 24031 open
xywh {10 395 535 25}
} {
- Fl_Button {} {
+ Fl_Button {} {uid 65217
label Clear
callback {shell_run_terminal->clear();}
xywh {10 395 94 25}
}
- Fl_Box {} {
+ Fl_Box {} {uid 21165
xywh {104 395 341 25} hide resizable
}
- Fl_Return_Button shell_run_button {
+ Fl_Return_Button shell_run_button {uid 58021
label Close
callback {Fl_Preferences pos(fluid_prefs, "shell_run_Window_pos");
pos.set("x", shell_run_window->x());
@@ -1580,5 +1600,5 @@ shell_run_window->hide();}
}
}
-decl {Fl_Menu_Item *w_layout_menu_storage[4];} {private global
+decl {Fl_Menu_Item *w_layout_menu_storage[4];} {uid 55761 private global
}
diff --git a/fluid/alignment_panel.h b/fluid/alignment_panel.h
index 104d96341..496d29dc8 100644
--- a/fluid/alignment_panel.h
+++ b/fluid/alignment_panel.h
@@ -74,6 +74,7 @@ extern Fl_Check_Button *include_H_from_C_button;
extern Fl_Check_Button *use_FL_COMMAND_button;
extern Fl_Check_Button *utf8_in_src_button;
extern Fl_Check_Button *avoid_early_includes_button;
+extern Fl_Check_Button *w_proj_mergeback;
extern Fl_Group *w_settings_layout_tab;
#include <FL/Fl_Choice.H>
extern Fl_Choice *layout_choice;
diff --git a/fluid/code.cxx b/fluid/code.cxx
index 896dcc9ea..6747d73ba 100644
--- a/fluid/code.cxx
+++ b/fluid/code.cxx
@@ -21,9 +21,11 @@
#include "Fl_Function_Type.h"
#include "alignment_panel.h"
#include "file.h"
+#include "undo.h"
#include <FL/Fl.H>
#include <FL/fl_string_functions.h>
+#include <FL/fl_ask.H>
#include "fluid_filename.h"
#include "../src/flstring.h"
@@ -31,6 +33,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include "zlib.h"
+
/// \defgroup cfile C Code File Operations
/// \{
@@ -359,7 +363,7 @@ int Fd_Code_Writer::write_c_once(const char *format, ...) {
else if (i < 0) p = &((*p)->left);
else p = &((*p)->right);
}
- fprintf(code_file,"%s\n",buf);
+ crc_printf("%s\n", buf);
*p = new Fd_Text_Tree(buf);
return 1;
}
@@ -404,21 +408,21 @@ void Fd_Code_Writer::write_cstring(const char *s, int length) {
// longer than four lines, we only render a placeholder.
if (write_sourceview && ((s==NULL) || (length>300))) {
if (length>=0)
- fprintf(code_file, "\" ... %d bytes of text... \"", length);
+ crc_printf("\" ... %d bytes of text... \"", length);
else
- fprintf(code_file, "\" ... text... \"");
+ crc_puts("\" ... text... \"");
return;
}
if (length==-1 || s==0L) {
- fprintf(code_file, "\n#error string not found\n");
- fprintf(code_file, "\" ... undefined size text... \"");
+ crc_puts("\n#error string not found\n");
+ crc_puts("\" ... undefined size text... \"");
return;
}
const char *p = s;
const char *e = s+length;
int linelength = 1;
- putc('\"', code_file);
+ crc_putc('\"');
for (; p < e;) {
int c = *p++;
switch (c) {
@@ -431,9 +435,9 @@ void Fd_Code_Writer::write_cstring(const char *s, int length) {
case '\'':
case '\\':
QUOTED:
- if (linelength >= 77) {fputs("\\\n",code_file); linelength = 0;}
- putc('\\', code_file);
- putc(c, code_file);
+ if (linelength >= 77) { crc_puts("\\\n"); linelength = 0; }
+ crc_putc('\\');
+ crc_putc(c);
linelength += 2;
break;
case '?': // prevent trigraphs by writing ?? as ?\?
@@ -442,8 +446,8 @@ void Fd_Code_Writer::write_cstring(const char *s, int length) {
default:
if (c >= ' ' && c < 127) {
// a legal ASCII character
- if (linelength >= 78) {fputs("\\\n",code_file); linelength = 0;}
- putc(c, code_file);
+ if (linelength >= 78) { crc_puts("\\\n"); linelength = 0; }
+ crc_putc(c);
linelength++;
break;
}
@@ -453,25 +457,25 @@ void Fd_Code_Writer::write_cstring(const char *s, int length) {
// This is the first character in a utf-8 sequence (0b11......).
// A line break would be ok here. Do not put linebreak in front of
// following characters (0b10......)
- if (linelength >= 78) {fputs("\\\n",code_file); linelength = 0;}
+ if (linelength >= 78) { crc_puts("\\\n"); linelength = 0; }
}
- putc(c, code_file);
+ crc_putc(c);
linelength++;
break;
}
// otherwise we must print it as an octal constant:
c &= 255;
if (c < 8) {
- if (linelength >= 76) {fputs("\\\n",code_file); linelength = 0;}
- fprintf(code_file, "\\%o",c);
+ if (linelength >= 76) { crc_puts("\\\n"); linelength = 0; }
+ crc_printf("\\%o", c);
linelength += 2;
} else if (c < 64) {
- if (linelength >= 75) {fputs("\\\n",code_file); linelength = 0;}
- fprintf(code_file, "\\%o",c);
+ if (linelength >= 75) { crc_puts("\\\n"); linelength = 0; }
+ crc_printf("\\%o", c);
linelength += 3;
} else {
- if (linelength >= 74) {fputs("\\\n",code_file); linelength = 0;}
- fprintf(code_file, "\\%o",c);
+ if (linelength >= 74) { crc_puts("\\\n"); linelength = 0; }
+ crc_printf("\\%o", c);
linelength += 4;
}
// We must not put more numbers after it, because some C compilers
@@ -479,14 +483,14 @@ void Fd_Code_Writer::write_cstring(const char *s, int length) {
// pasting to avoid this:
c = *p;
if (p < e && ( (c>='0'&&c<='9') || (c>='a'&&c<='f') || (c>='A'&&c<='F') )) {
- putc('\"', code_file); linelength++;
- if (linelength >= 79) {fputs("\n",code_file); linelength = 0;}
- putc('\"', code_file); linelength++;
+ crc_putc('\"'); linelength++;
+ if (linelength >= 79) { crc_puts("\n"); linelength = 0; }
+ crc_putc('\"'); linelength++;
}
break;
}
}
- putc('\"', code_file);
+ crc_putc('\"');
}
/**
@@ -510,30 +514,30 @@ void Fd_Code_Writer::write_cdata(const char *s, int length) {
}
if (write_sourceview) {
if (length>=0)
- fprintf(code_file, "{ /* ... %d bytes of binary data... */ }", length);
+ crc_printf("{ /* ... %d bytes of binary data... */ }", length);
else
- fprintf(code_file, "{ /* ... binary data... */ }");
+ crc_puts("{ /* ... binary data... */ }");
return;
}
if (length==-1) {
- fprintf(code_file, "\n#error data not found\n");
- fprintf(code_file, "{ /* ... undefined size binary data... */ }");
+ crc_puts("\n#error data not found\n");
+ crc_puts("{ /* ... undefined size binary data... */ }");
return;
}
const unsigned char *w = (const unsigned char *)s;
const unsigned char *e = w+length;
int linelength = 1;
- putc('{', code_file);
+ crc_putc('{');
for (; w < e;) {
unsigned char c = *w++;
if (c>99) linelength += 4;
else if (c>9) linelength += 3;
else linelength += 2;
- if (linelength >= 77) {fputs("\n",code_file); linelength = 0;}
- fprintf(code_file, "%d", c);
- if (w<e) putc(',', code_file);
+ if (linelength >= 77) {crc_puts("\n"); linelength = 0;}
+ crc_printf("%d", c);
+ if (w<e) crc_putc(',');
}
- putc('}', code_file);
+ crc_putc('}');
}
/**
@@ -546,7 +550,7 @@ void Fd_Code_Writer::vwrite_c(const char* format, va_list args) {
varused = 1;
return;
}
- vfprintf(code_file, format, args);
+ crc_vprintf(format, args);
}
/**
@@ -753,7 +757,7 @@ int Fd_Code_Writer::write_code(const char *s, const char *t, bool to_sourceview)
const char *hdr = "\
// generated by Fast Light User Interface Designer (fluid) version %.4f\n\n";
fprintf(header_file, hdr, FL_VERSION);
- fprintf(code_file, hdr, FL_VERSION);
+ crc_printf(hdr, FL_VERSION);
{char define_name[102];
const char* a = fl_filename_name(t);
@@ -899,11 +903,16 @@ Fd_Code_Writer::Fd_Code_Writer()
text_in_header(NULL),
text_in_code(NULL),
ptr_in_code(NULL),
+ block_crc_(0),
+ block_buffer_(NULL),
+ block_buffer_size_(0),
+ block_line_start_(true),
indentation(0),
write_sourceview(false),
varused_test(0),
varused(0)
{
+ block_crc_ = crc32(0, NULL, 0);
}
Fd_Code_Writer::~Fd_Code_Writer()
@@ -912,6 +921,308 @@ Fd_Code_Writer::~Fd_Code_Writer()
delete ptr_in_code;
delete text_in_code;
delete text_in_header;
+ if (block_buffer_) ::free(block_buffer_);
+}
+
+void Fd_Code_Writer::tag(int type, unsigned short uid) {
+ if (g_project.write_mergeback_data)
+ fprintf(code_file, "//~fl~%d~%04x~%08x~~\n", type, (int)uid, (unsigned int)block_crc_);
+ block_crc_ = crc32(0, NULL, 0);
+}
+
+void Fd_Code_Writer::crc_add(const void *data, int n) {
+ if (!data) return;
+ if (n==-1) n = (int)strlen((const char*)data);
+ const char *s = (const char*)data;
+ for (int i=n; n>0; --n, ++s) {
+ if (block_line_start_) {
+ // don't count leading spaces and tabs in a line
+ while (n>0 && *s>0 && isspace(*s)) { s++; n--; }
+ if (*s) block_line_start_ = false;
+ }
+ // don't count '\r' that may be introduces by MSWindows
+ if (n>0 && *s=='\r') { s++; n--; }
+ if (n>0 && *s=='\n') block_line_start_ = true;
+ if (n>0) {
+ block_crc_ = crc32(block_crc_, (const Bytef*)s, 1);
+ }
+ }
+}
+
+int Fd_Code_Writer::crc_printf(const char *format, ...) {
+ va_list args;
+ va_start(args, format);
+ int ret = crc_vprintf(format, args);
+ va_end(args);
+ return ret;
+}
+
+int Fd_Code_Writer::crc_vprintf(const char *format, va_list args) {
+ if (g_project.write_mergeback_data) {
+ int n = vsnprintf(block_buffer_, block_buffer_size_, format, args);
+ if (n > block_buffer_size_) {
+ block_buffer_size_ = n + 128;
+ if (block_buffer_) ::free(block_buffer_);
+ block_buffer_ = (char*)::malloc(block_buffer_size_+1);
+ n = vsnprintf(block_buffer_, block_buffer_size_, format, args);
+ }
+ crc_add(block_buffer_, n);
+ return fputs(block_buffer_, code_file);
+ } else {
+ return vfprintf(code_file, format, args);
+ }
+}
+
+int Fd_Code_Writer::crc_puts(const char *text) {
+ if (g_project.write_mergeback_data) {
+ crc_add(text);
+ }
+ return fputs(text, code_file);
+}
+
+int Fd_Code_Writer::crc_putc(int c) {
+ if (g_project.write_mergeback_data) {
+ uchar uc = (uchar)c;
+ crc_add(&uc, 1);
+ }
+ return fputc(c, code_file);
+}
+
+extern Fl_Window *the_panel;
+
+/** Remove the first two spaces at every line start.
+ \param[inout] s block of C code
+ */
+static void unindent(char *s) {
+ char *d = s;
+ bool line_start = true;
+ while (*s) {
+ if (line_start) {
+ if (*s>0 && isspace(*s)) s++;
+ if (*s>0 && isspace(*s)) s++;
+ line_start = false;
+ }
+ if (*s=='\r') s++;
+ if (*s=='\n') line_start = true;
+ *d++ = *s++;
+ }
+ *d = 0;
+}
+
+static Fl_String unindent_block(FILE *f, long start, long end) {
+ long bsize = end-start;
+ long here = ::ftell(f);
+ ::fseek(f, start, SEEK_SET);
+ char *block = (char*)::malloc(bsize+1);
+ fread(block, bsize, 1, f);
+ block[bsize] = 0;
+ unindent(block);
+ Fl_String str = block;
+ ::free(block);
+ ::fseek(f, here, SEEK_SET);
+ return str;
+}
+
+// TODO: add level of mergeback support to user settings
+// TODO: command line option for mergeback
+// TODO: automatic mergeback when a new project is loaded
+// TODO: automatic mergeback when FLUID becomes app in focus
+// NOTE: automatic mergeback on timer when file changes if app focus doesn't work
+// NOTE: we could also let the user edit comment blocks
+
+/**
+ Merge external changes in a source code file back into the current project.
+
+ This experimental function reads a source code file line by line. When it
+ encounters a special tag in a line, the crc32 stored in the line is compared
+ to the crc32 that was calculate from the code lines since the previous tag.
+
+ If the crc's differ, the user has modified the source file, and the given block
+ differs from the block as it was generated by FLUID. Depending on the block
+ type, the user has modified the widget code (FD_TAG_GENERIC), which can not be
+ transferred back into the project.
+
+ Modifications to code blocks and callbacks (CODE, CALLBACK) can be merged back
+ into the project. Their corresponding Fl_Type is found using the unique
+ node id that is part of the tag.
+
+ The caller must make sure that this code file was generated by the currently
+ loaded project.
+
+ Since this is an experimental function, the user is informed in detailed
+ dialogs what the function discovered, and FLUID offers the option to merge
+ or cancel to the user. Just in case this function is destructive, "undo"
+ restores the state before a MergeBack.
+
+ Callers can set different task. FD_MERGEBACK_CHECK checks if there are any
+ modifications in the code file and returns -1 if there was an error, or a
+ bit field where bit 0 is set if internal structures were modified, bit 1 or
+ bit 2 if code blocks or callbacks were changed, and bit 3 if modified blocks
+ were found, but no Type node.
+
+ FD_MERGEBACK_INTERACTIVE checks for changes and presents a status dialog box
+ to the user if there were conflicting changes or if a mergeback is possible,
+ presenting the user a list of options. Returns 0 if nothing changed, and 1 if
+ the user merged changes back. -1 is returned if an invalid tag was found.
+
+ FD_MERGEBACK_GO merges all changes back into the project without any
+ interaction. Returns 0 if nothing changed, and 1 if it merged any changes back.
+
+ FD_MERGEBACK_GO_SAFE merges changes back only if there are no conflicts.
+ Returns 0 if nothing changed, and 1 if it merged any changes back, and -1 if
+ there were conflicts.
+
+ \note this function is currently part of Fd_Code_Writer to get easy access
+ to our crc32 code that also wrote the code file originally.
+
+ \param[in] s path and filename of the source code file
+ \param[in] task see above
+ \return see above
+ */
+int Fd_Code_Writer::merge_back(const char *s, int task) {
+ // nothing to be done if the mergeback option is disabled in the project
+ if (!g_project.write_mergeback_data) return 0;
+
+ int ret = 0;
+ bool changed = false;
+ FILE *code = fl_fopen(s, "r");
+ if (!code) return 0;
+ int iter = 0;
+
+ for (iter = 0; ; ++iter) {
+ int line_no = 0;
+ long block_start = 0;
+ long block_end = 0;
+ long here = 0;
+ int num_changed_code = 0;
+ int num_changed_callback = 0;
+ int num_changed_structure = 0;
+ int num_uid_not_found = 0;
+ int tag_error = 0;
+ if (task==FD_MERGEBACK_GO)
+ undo_checkpoint();
+ // NOTE: if we can get the CRC from the current callback, and it's the same
+ // as the code file CRC, merging back is very safe.
+ block_crc_ = crc32(0, NULL, 0);
+ block_line_start_ = true;
+ ::fseek(code, 0, SEEK_SET);
+ changed = false;
+ for (;;) {
+ char line[1024];
+ if (fgets(line, 1023, code)==0) break;
+ line_no++;
+ const char *tag = strstr(line, "//~fl~");
+ if (!tag) {
+ crc_add(line);
+ block_end = ::ftell(code);
+ } else {
+ int type = -1;
+ int uid = 0;
+ unsigned long crc = 0;
+ int n = sscanf(tag, "//~fl~%d~%04x~%08lx~~", &type, &uid, &crc);
+ if (n!=3 || type<0 || type>FD_TAG_LAST ) { tag_error = 1; break; }
+ if (block_crc_ != crc) {
+ if (task==FD_MERGEBACK_GO) {
+ if (type==FD_TAG_MENU_CALLBACK || type==FD_TAG_WIDGET_CALLBACK) {
+ Fl_Type *tp = Fl_Type::find_by_uid(uid);
+ if (tp && tp->is_true_widget()) {
+ tp->callback(unindent_block(code, block_start, block_end).c_str());
+ changed = true;
+ }
+ } else if (type==FD_TAG_CODE) {
+ Fl_Type *tp = Fl_Type::find_by_uid(uid);
+ if (tp && tp->is_a(ID_Code)) {
+ tp->name(unindent_block(code, block_start, block_end).c_str());
+ changed = true;
+ }
+ }
+ } else {
+ bool find_node = false;
+ // TODO: if we find a modification, we must check if it was already
+ // merged into the current project, or we will remerge over
+ // and over, even if the current code is modified.
+ switch (type) {
+ case FD_TAG_GENERIC: num_changed_structure++; break;
+ case FD_TAG_CODE: num_changed_code++; find_node = true; break;
+ case FD_TAG_MENU_CALLBACK: num_changed_callback++; find_node = true; break;
+ case FD_TAG_WIDGET_CALLBACK: num_changed_callback++; find_node = true; break;
+ }
+ if (find_node) {
+ if (Fl_Type::find_by_uid(uid)==NULL) num_uid_not_found++;
+ }
+ }
+ }
+ // reset everything for the next block
+ block_crc_ = crc32(0, NULL, 0);
+ block_line_start_ = true;
+ block_start = ::ftell(code);
+ }
+ }
+ if (task==FD_MERGEBACK_CHECK) {
+ if (tag_error) { ret = -1; break; }
+ if (num_changed_structure) ret |= 1;
+ if (num_changed_code) ret |= 2;
+ if (num_changed_callback) ret |= 4;
+ if (num_uid_not_found) ret |= 8;
+ break;
+ } else if (task==FD_MERGEBACK_INTERACTIVE) {
+ if (tag_error) {
+ fl_message("MergeBack found an error in line %d while reading Tags\n"
+ "from the source code. MergeBack not possible.", line_no);
+ ret = -1;
+ break;
+ }
+ if (!num_changed_code && !num_changed_callback && !num_changed_structure) {
+ ret = 0;
+ break;
+ }
+ if (num_changed_structure && (num_changed_code==0 && num_changed_callback==0)) {
+ fl_message("MergeBack found %d modifications in the project structure\n"
+ "of the source code. These kind of changes can no be\n"
+ "merged back and will be lost.", num_changed_structure);
+ ret = -1;
+ break;
+ }
+ Fl_String msg = "MergeBack found %1$d modifications in Code Blocks and %2$d\n"
+ "modifications in callbacks.";
+ if (num_uid_not_found)
+ msg += "\n\nWARNING: for %3$d of these modifications no Type node\n"
+ "can be found. The project diverged substantially from the\n"
+ "code file and these modification can't be merged back.";
+ if (num_changed_structure)
+ msg += "\n\nWARNING: %4$d modifications in the project structure\n"
+ "can no be merged back and will be lost.";
+ msg += "\n\nClick Cancel to abort the MergeBack operation.\n"
+ "Click Merge to move code and callback changes back into\n"
+ "the project.";
+ int c = fl_choice(msg.c_str(), "Cancel", "Merge", NULL,
+ num_changed_code, num_changed_callback,
+ num_uid_not_found, num_changed_structure);
+ if (c==0) { ret = 1; break; }
+ task = FD_MERGEBACK_GO;
+ continue;
+ } else if (task==FD_MERGEBACK_GO) {
+ if (changed) ret = 1;
+ break;
+ } else if (task==FD_MERGEBACK_GO_SAFE) {
+ if (tag_error || num_changed_structure) {
+ ret = -1;
+ break;
+ }
+ if (num_changed_code==0 && num_changed_callback==0) {
+ ret = 0;
+ break;
+ }
+ task = FD_MERGEBACK_GO;
+ continue;
+ }
+ }
+ fclose(code);
+ if (changed) {
+ set_modflag(1);
+ if (the_panel) propagate_load(the_panel, LOAD);
+ }
+ return ret;
}
/// \}
diff --git a/fluid/code.h b/fluid/code.h
index 4374ac585..7d0eee140 100644
--- a/fluid/code.h
+++ b/fluid/code.h
@@ -31,6 +31,17 @@ struct Fd_Pointer_Tree;
int is_id(char c);
int write_strings(const Fl_String &filename);
+const int FD_TAG_GENERIC = 0;
+const int FD_TAG_CODE = 1;
+const int FD_TAG_MENU_CALLBACK = 2;
+const int FD_TAG_WIDGET_CALLBACK = 3;
+const int FD_TAG_LAST = 3;
+
+const int FD_MERGEBACK_CHECK = 0;
+const int FD_MERGEBACK_INTERACTIVE = 1;
+const int FD_MERGEBACK_GO = 2;
+const int FD_MERGEBACK_GO_SAFE = 3;
+
class Fd_Code_Writer
{
protected:
@@ -41,6 +52,16 @@ protected:
Fd_Text_Tree *text_in_code;
Fd_Pointer_Tree *ptr_in_code;
+ unsigned long block_crc_;
+ char *block_buffer_;
+ int block_buffer_size_;
+ bool block_line_start_;
+ void crc_add(const void *data, int n=-1);
+ int crc_printf(const char *format, ...);
+ int crc_vprintf(const char *format, va_list args);
+ int crc_puts(const char *text);
+ int crc_putc(int c);
+
public:
int indentation;
bool write_sourceview;
@@ -74,6 +95,10 @@ public:
Fl_Type* write_code(Fl_Type* p);
int write_code(const char *cfile, const char *hfile, bool to_sourceview=false);
void write_public(int state); // writes pubic:/private: as needed
+
+ void tag(int type, unsigned short uid);
+ int merge_back(const char *s, int task);
+
};
#endif // _FLUID_CODE_H
diff --git a/fluid/file.cxx b/fluid/file.cxx
index fdfc203a7..5af4d7404 100644
--- a/fluid/file.cxx
+++ b/fluid/file.cxx
@@ -333,6 +333,11 @@ void Fd_Project_Reader::read_children(Fl_Type *p, int paste, Strategy strategy,
}
goto CONTINUE;
}
+
+ if (!strcmp(c, "mergeback")) {
+ g_project.write_mergeback_data = read_int();
+ goto CONTINUE;
+ }
}
{
Fl_Type *t = add_new_widget_from_file(c, strategy);
@@ -808,6 +813,8 @@ int Fd_Project_Writer::write_project(const char *filename, int selected_only, bo
g_layout_list.write(this);
if (g_shell_config)
g_shell_config->write(this);
+ if (g_project.write_mergeback_data)
+ write_string("\nmergeback %d", g_project.write_mergeback_data);
}
for (Fl_Type *p = Fl_Type::first; p;) {
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index c75958493..a800c95b7 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -285,6 +285,7 @@ Fluid_Project::Fluid_Project() :
avoid_early_includes(0),
header_file_set(0),
code_file_set(0),
+ write_mergeback_data(0),
header_file_name(".h"),
code_file_name(".cxx")
{ }
@@ -314,6 +315,7 @@ void Fluid_Project::reset() {
code_file_set = 0;
header_file_name = ".h";
code_file_name = ".cxx";
+ write_mergeback_data = 0;
}
void Fluid_Project::update_settings_dialog() {
@@ -1269,6 +1271,30 @@ void write_cb(Fl_Widget *, void *) {
}
/**
+ Merge the possibly modified content of code files back into the project.
+ */
+int mergeback_code_files()
+{
+ flush_text_widgets();
+ if (!filename) return 1;
+
+ // -- generate the file names with absolute paths
+ Fd_Code_Writer f;
+ Fl_String code_filename = g_project.codefile_path() + g_project.codefile_name();
+
+ // -- write the code and header files
+ if (!batch_mode) enter_project_dir();
+ int c = f.merge_back(code_filename.c_str(), FD_MERGEBACK_INTERACTIVE);
+ if (!batch_mode) leave_project_dir();
+ if (c==0) fl_message("MergeBack found no external modifications\n"
+ "in the source code.");
+}
+
+void mergeback_cb(Fl_Widget *, void *) {
+ mergeback_code_files();
+}
+
+/**
Write the strings that are used in i18n.
*/
void write_strings_cb(Fl_Widget *, void *) {
@@ -1619,6 +1645,7 @@ Fl_Menu_Item Main_Menu[] = {
{"Save As &Template...", 0, save_template_cb, 0, FL_MENU_DIVIDER},
{"&Print...", FL_COMMAND+'p', print_menu_cb},
{"Write &Code...", FL_COMMAND+FL_SHIFT+'c', write_cb, 0},
+ {"MergeBack Code", FL_COMMAND+FL_SHIFT+'m', mergeback_cb, 0},
{"&Write Strings...", FL_COMMAND+FL_SHIFT+'w', write_strings_cb, 0, FL_MENU_DIVIDER},
{relative_history[0], FL_COMMAND+'1', menu_file_open_history_cb, absolute_history[0]},
{relative_history[1], FL_COMMAND+'2', menu_file_open_history_cb, absolute_history[1]},
diff --git a/fluid/fluid.h b/fluid/fluid.h
index 1e39f8095..0ac4258c8 100644
--- a/fluid/fluid.h
+++ b/fluid/fluid.h
@@ -133,6 +133,7 @@ public:
int avoid_early_includes;
int header_file_set;
int code_file_set;
+ int write_mergeback_data;
Fl_String header_file_name;
Fl_String code_file_name;
};
diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx
index ee6e539fe..062d5c760 100644
--- a/fluid/widget_panel.cxx
+++ b/fluid/widget_panel.cxx
@@ -23,40 +23,6 @@
#include <FL/Fl_Grid.H>
extern void set_modflag(int mf, int mfc=-1);
-Fl_Double_Window* make_window() {
- Fl_Double_Window* w;
- { Fl_Double_Window* o = new Fl_Double_Window(480, 320);
- w = o; (void)w;
- { Fl_Grid* o = new Fl_Grid(25, 25, 262, 160);
- o->labelsize(11);
- o->layout(4, 4);
- o->margin(10, 10, 16, 12);
- static const int colwidths[] = { 0, 100, 0, 0 };
- o->col_width(colwidths, 4);
- static const int colweights[] = { 50, 40, 50, 50 };
- o->col_weight(colweights, 4);
- { Fl_Button* o = new Fl_Button(70, 63, 129, 50, "Button");
- o->labelsize(11);
- } // Fl_Button* o
- { Fl_Group* o = new Fl_Group(224, 115, 40, 45);
- o->box(FL_BORDER_BOX);
- o->color((Fl_Color)11);
- o->labelsize(11);
- { Fl_Button* o = new Fl_Button(234, 120, 24, 20, "Button");
- o->labelsize(11);
- } // Fl_Button* o
- o->end();
- } // Fl_Group* o
- Fl_Grid::Cell *cell = NULL;
- cell = o->widget(o->child(0), 1, 1, 1, 1, 48);
- if (cell) cell->minimum_size(20, 20);
- o->end();
- } // Fl_Grid* o
- o->end();
- } // Fl_Double_Window* o
- return w;
-}
-
Fl_Tabs *widget_tabs=(Fl_Tabs *)0;
static void cb_widget_tabs(Fl_Tabs* o, void* v) {
@@ -575,7 +541,6 @@ Fl_Double_Window* make_widget_panel() {
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->when(FL_WHEN_NEVER);
- o->hide();
{ Fl_Group* o = new Fl_Group(95, 40, 309, 20, "Label:");
o->labelfont(1);
o->labelsize(11);
@@ -1449,6 +1414,7 @@ access the Widget pointer and \'v\' to access the user value.");
{ widget_tab_grid_child = new Fl_Group(10, 30, 400, 330, "Grid Child");
widget_tab_grid_child->labelsize(11);
widget_tab_grid_child->callback((Fl_Callback*)propagate_load);
+ widget_tab_grid_child->hide();
{ Fl_Group* o = new Fl_Group(95, 60, 315, 20, "Location:");
o->labelfont(1);
o->labelsize(11);
diff --git a/fluid/widget_panel.fl b/fluid/widget_panel.fl
index 847150b8b..824c5a9ac 100644
--- a/fluid/widget_panel.fl
+++ b/fluid/widget_panel.fl
@@ -43,36 +43,6 @@ decl {\#include "custom_widgets.h"} {public global
decl {extern void set_modflag(int mf, int mfc=-1);} {private local
}
-Function {make_window()} {open
-} {
- Fl_Window {} {open
- xywh {867 441 480 320} type Double visible
- } {
- Fl_Grid {} {open
- xywh {25 25 262 160} labelsize 11
- dimensions {4 4} margin {10 10 16 12}
- colwidths { 0 100 0 0 }
- colweights { 50 40 50 50 }
- } {
- Fl_Button {} {
- label Button
- xywh {70 63 129 50} labelsize 11
- parent_properties {
- location {1 1}
- }
- }
- Fl_Group {} {open
- xywh {224 115 40 45} box BORDER_BOX color 11 labelsize 11
- } {
- Fl_Button {} {
- label Button
- xywh {234 120 24 20} labelsize 11
- }
- }
- }
- }
-}
-
Function {make_widget_panel()} {
comment {Create a panel that can be used with all known widgets} open
} {
@@ -89,7 +59,7 @@ Function {make_widget_panel()} {
Fl_Group {} {
label GUI
callback propagate_load
- xywh {10 30 400 330} labelsize 11 when 0 hide resizable
+ xywh {10 30 400 330} labelsize 11 when 0 resizable
} {
Fl_Group {} {
label {Label:}
@@ -865,7 +835,7 @@ wCallback->do_callback(wCallback, v);} open
Fl_Group widget_tab_grid_child {
label {Grid Child}
callback propagate_load open
- xywh {10 30 400 330} labelsize 11
+ xywh {10 30 400 330} labelsize 11 hide
} {
Fl_Group {} {
label {Location:}
@@ -896,7 +866,7 @@ wCallback->do_callback(wCallback, v);} open
}
Fl_Input widget_grid_col_input {
label {Column:}
- callback grid_set_col_cb selected
+ callback grid_set_col_cb
xywh {175 60 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
diff --git a/fluid/widget_panel.h b/fluid/widget_panel.h
index 1a4021a9b..c8bf600a6 100644
--- a/fluid/widget_panel.h
+++ b/fluid/widget_panel.h
@@ -21,12 +21,9 @@
#include <FL/Fl.H>
#include "custom_widgets.h"
#include <FL/Fl_Double_Window.H>
-#include <FL/Fl_Grid.H>
-#include <FL/Fl_Button.H>
-#include <FL/Fl_Group.H>
-Fl_Double_Window* make_window();
#include <FL/Fl_Tabs.H>
extern Fl_Tabs *widget_tabs;
+#include <FL/Fl_Group.H>
extern void propagate_load(Fl_Group*, void*);
#include <FL/Fl_Input.H>
extern void label_cb(Fl_Input*, void*);
@@ -34,6 +31,7 @@ extern void label_cb(Fl_Input*, void*);
extern Fl_Menu_Item labeltypemenu[];
extern void labeltype_cb(Fl_Choice*, void*);
extern void image_cb(Fl_Input*, void*);
+#include <FL/Fl_Button.H>
extern void image_browse_cb(Fl_Button*, void*);
#include "pixmaps.h"
extern void compress_image_cb(Fl_Button*, void*);