avoid early include of Fl.H option
This commit is contained in:
parent
9a2b3ef798
commit
42a93eb8de
@ -242,8 +242,10 @@ const char* Fl_Menu_Item_Type::menu_name(int& i) {
|
||||
}
|
||||
|
||||
void Fl_Menu_Item_Type::write_static() {
|
||||
if (image && label() && label()[0])
|
||||
if (image && label() && label()[0]) {
|
||||
write_declare("#include <FL/Fl.H>");
|
||||
write_declare("#include <FL/Fl_Multi_Label.H>");
|
||||
}
|
||||
if (callback() && is_name(callback()) && !user_defined(callback()))
|
||||
write_declare("extern void %s(Fl_Menu_*, %s);", callback(),
|
||||
user_data_type() ? user_data_type() : "void*");
|
||||
|
@ -183,6 +183,7 @@ void delete_all(int selected_only) {
|
||||
include_H_from_C=1;
|
||||
use_FL_COMMAND=0;
|
||||
utf8_in_src = 0;
|
||||
avoid_early_includes = 0;
|
||||
// reset the setting for the external shell command
|
||||
shell_prefs_get();
|
||||
shell_settings_write();
|
||||
|
@ -2015,6 +2015,7 @@ int isdeclare(const char *c) {
|
||||
void Fl_Widget_Type::write_static() {
|
||||
const char* t = subclassname(this);
|
||||
if (!subclass() || (is_class() && !strncmp(t, "Fl_", 3))) {
|
||||
write_declare("#include <FL/Fl.H>");
|
||||
write_declare("#include <FL/%s.H>", t);
|
||||
}
|
||||
for (int n=0; n < NUM_EXTRA_CODE; n++) {
|
||||
|
@ -45,6 +45,7 @@
|
||||
int include_H_from_C = 1;
|
||||
int use_FL_COMMAND = 0;
|
||||
int utf8_in_src = 0;
|
||||
int avoid_early_includes = 0;
|
||||
|
||||
extern Fl_Preferences fluid_prefs;
|
||||
|
||||
@ -194,6 +195,7 @@ void show_project_cb(Fl_Widget *, void *) {
|
||||
include_H_from_C_button->value(include_H_from_C);
|
||||
use_FL_COMMAND_button->value(use_FL_COMMAND);
|
||||
utf8_in_src_button->value(utf8_in_src);
|
||||
avoid_early_includes_button->value(avoid_early_includes);
|
||||
header_file_input->value(header_file_name);
|
||||
code_file_input->value(code_file_name);
|
||||
i18n_type_chooser->value(i18n_type);
|
||||
@ -292,6 +294,13 @@ void utf8_in_src_cb(Fl_Check_Button *b, void*) {
|
||||
}
|
||||
}
|
||||
|
||||
void avoid_early_includes_cb(Fl_Check_Button *b, void*) {
|
||||
if (avoid_early_includes != b->value()) {
|
||||
set_modflag(1);
|
||||
avoid_early_includes = b->value();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
Fl_Menu_Item window_type_menu[] = {
|
||||
|
@ -28,6 +28,7 @@ class Fl_Widget_Class_Type;
|
||||
extern int include_H_from_C;
|
||||
extern int use_FL_COMMAND;
|
||||
extern int utf8_in_src;
|
||||
extern int avoid_early_includes;
|
||||
|
||||
extern Fl_Menu_Item window_type_menu[];
|
||||
extern Fl_Widget_Class_Type *current_widget_class;
|
||||
|
@ -38,6 +38,8 @@ Fl_Check_Button *use_FL_COMMAND_button=(Fl_Check_Button *)0;
|
||||
|
||||
Fl_Check_Button *utf8_in_src_button=(Fl_Check_Button *)0;
|
||||
|
||||
Fl_Check_Button *avoid_early_includes_button=(Fl_Check_Button *)0;
|
||||
|
||||
Fl_Choice *i18n_type_chooser=(Fl_Choice *)0;
|
||||
|
||||
Fl_Menu_Item menu_i18n_type_chooser[] = {
|
||||
@ -60,15 +62,15 @@ Fl_Input *i18n_function_input=(Fl_Input *)0;
|
||||
Fl_Input *i18n_static_function_input=(Fl_Input *)0;
|
||||
|
||||
Fl_Double_Window* make_project_window() {
|
||||
{ project_window = new Fl_Double_Window(399, 275, "Project Settings");
|
||||
{ Fl_Button* o = new Fl_Button(328, 239, 60, 25, "Close");
|
||||
{ project_window = new Fl_Double_Window(399, 298, "Project Settings");
|
||||
{ Fl_Button* o = new Fl_Button(328, 267, 60, 25, "Close");
|
||||
o->tooltip("Close this dialog.");
|
||||
o->callback((Fl_Callback*)cb_Close);
|
||||
} // Fl_Button* o
|
||||
{ Fl_Tabs* o = new Fl_Tabs(10, 10, 379, 218);
|
||||
{ Fl_Tabs* o = new Fl_Tabs(10, 10, 379, 246);
|
||||
o->selection_color((Fl_Color)12);
|
||||
o->labelcolor(FL_BACKGROUND2_COLOR);
|
||||
{ Fl_Group* o = new Fl_Group(10, 36, 379, 192, "Output");
|
||||
{ Fl_Group* o = new Fl_Group(10, 36, 379, 220, "Output");
|
||||
{ Fl_Box* o = new Fl_Box(20, 49, 340, 49, "Use \"name.ext\" to set a file name or just \".ext\" to set extension.");
|
||||
o->align(Fl_Align(132|FL_ALIGN_INSIDE));
|
||||
} // Fl_Box* o
|
||||
@ -105,9 +107,14 @@ ped using octal notation `\\0123`. If this option is checked, Fluid will write\
|
||||
utf8_in_src_button->down_box(FL_DOWN_BOX);
|
||||
utf8_in_src_button->callback((Fl_Callback*)utf8_in_src_cb);
|
||||
} // Fl_Check_Button* utf8_in_src_button
|
||||
{ avoid_early_includes_button = new Fl_Check_Button(117, 222, 272, 20, "avoid early include of Fl.H");
|
||||
avoid_early_includes_button->tooltip("Do not emit #include <FL//Fl.H> until it is needed by another include file.");
|
||||
avoid_early_includes_button->down_box(FL_DOWN_BOX);
|
||||
avoid_early_includes_button->callback((Fl_Callback*)avoid_early_includes_cb);
|
||||
} // Fl_Check_Button* avoid_early_includes_button
|
||||
o->end();
|
||||
} // Fl_Group* o
|
||||
{ Fl_Group* o = new Fl_Group(10, 36, 378, 192, "Internationalization");
|
||||
{ Fl_Group* o = new Fl_Group(10, 36, 378, 220, "Internationalization");
|
||||
o->hide();
|
||||
{ i18n_type_chooser = new Fl_Choice(128, 48, 136, 25, "Use:");
|
||||
i18n_type_chooser->tooltip("Type of internationalization to use.");
|
||||
|
@ -35,7 +35,7 @@ decl {\#include <FL/Fl_Text_Buffer.H>} {public local
|
||||
decl {\#include <FL/Fl_Text_Display.H>} {public local
|
||||
}
|
||||
|
||||
decl {\#include <FL/filename.H>} {public local
|
||||
decl {\#include <FL/filename.H>} {selected public local
|
||||
}
|
||||
|
||||
decl {\#include <FL/Fl_Preferences.H>} {private global
|
||||
@ -54,7 +54,7 @@ Function {make_project_window()} {open
|
||||
} {
|
||||
Fl_Window project_window {
|
||||
label {Project Settings} open
|
||||
xywh {472 246 399 275} type Double
|
||||
xywh {472 246 399 298} type Double
|
||||
code0 {\#include <FL/Fl_Preferences.H>}
|
||||
code1 {\#include <FL/Fl_Tooltip.H>} modal visible
|
||||
} {
|
||||
@ -62,14 +62,14 @@ Function {make_project_window()} {open
|
||||
label Close
|
||||
callback {project_window->hide();
|
||||
set_modflag(-1, -1);}
|
||||
tooltip {Close this dialog.} xywh {328 239 60 25}
|
||||
tooltip {Close this dialog.} xywh {328 267 60 25}
|
||||
}
|
||||
Fl_Tabs {} {open
|
||||
xywh {10 10 379 218} selection_color 12 labelcolor 7
|
||||
xywh {10 10 379 246} selection_color 12 labelcolor 7
|
||||
} {
|
||||
Fl_Group {} {
|
||||
label Output open selected
|
||||
xywh {10 36 379 192}
|
||||
label Output open
|
||||
xywh {10 36 379 220}
|
||||
} {
|
||||
Fl_Box {} {
|
||||
label {Use "name.ext" to set a file name or just ".ext" to set extension.}
|
||||
@ -102,10 +102,15 @@ set_modflag(-1, -1);}
|
||||
callback utf8_in_src_cb
|
||||
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 {117 199 272 20} down_box DOWN_BOX
|
||||
}
|
||||
Fl_Check_Button avoid_early_includes_button {
|
||||
label {avoid early include of Fl.H}
|
||||
callback avoid_early_includes_cb
|
||||
tooltip {Do not emit \#include <FL//Fl.H> until it is needed by another include file.} xywh {117 222 272 20} down_box DOWN_BOX
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
label Internationalization open
|
||||
xywh {10 36 378 192} hide
|
||||
xywh {10 36 378 220} hide
|
||||
} {
|
||||
Fl_Choice i18n_type_chooser {
|
||||
label {Use:}
|
||||
|
@ -46,6 +46,8 @@ extern void use_FL_COMMAND_button_cb(Fl_Check_Button*, void*);
|
||||
extern Fl_Check_Button *use_FL_COMMAND_button;
|
||||
extern void utf8_in_src_cb(Fl_Check_Button*, void*);
|
||||
extern Fl_Check_Button *utf8_in_src_button;
|
||||
extern void avoid_early_includes_cb(Fl_Check_Button*, void*);
|
||||
extern Fl_Check_Button *avoid_early_includes_button;
|
||||
#include <FL/Fl_Choice.H>
|
||||
extern void i18n_type_cb(Fl_Choice*, void*);
|
||||
extern Fl_Choice *i18n_type_chooser;
|
||||
|
@ -584,7 +584,9 @@ int write_code(const char *s, const char *t) {
|
||||
fprintf(header_file, "#define %s\n", define_name);
|
||||
}
|
||||
|
||||
write_declare("#include <FL/Fl.H>");
|
||||
if (avoid_early_includes==0) {
|
||||
write_declare("#include <FL/Fl.H>");
|
||||
}
|
||||
if (t && include_H_from_C) {
|
||||
if (*header_file_name == '.' && strchr(header_file_name, '/') == NULL) {
|
||||
write_c("#include \"%s\"\n", fl_filename_name(t));
|
||||
|
@ -383,6 +383,8 @@ int write_file(const char *filename, int selected_only) {
|
||||
write_string("\nuse_FL_COMMAND");
|
||||
if (utf8_in_src)
|
||||
write_string("\nutf8_in_src");
|
||||
if (avoid_early_includes)
|
||||
write_string("\navoid_early_includes");
|
||||
if (i18n_type) {
|
||||
write_string("\ni18n_type %d", i18n_type);
|
||||
write_string("\ni18n_include"); write_word(i18n_include);
|
||||
@ -504,6 +506,10 @@ static void read_children(Fl_Type *p, int paste, Strategy strategy, char skip_op
|
||||
utf8_in_src=1;
|
||||
goto CONTINUE;
|
||||
}
|
||||
if (!strcmp(c,"avoid_early_includes")) {
|
||||
avoid_early_includes=1;
|
||||
goto CONTINUE;
|
||||
}
|
||||
if (!strcmp(c,"i18n_type")) {
|
||||
i18n_type = atoi(read_word());
|
||||
goto CONTINUE;
|
||||
|
Loading…
Reference in New Issue
Block a user