mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 22:04:26 +08:00
FLUID: Fixes regression #777
Wrote wrong path in #inlude statement under certain conditions. Also removed 'snap' tag if not needed.
This commit is contained in:
@@ -714,6 +714,14 @@ void Fd_Layout_List::read(Fl_Preferences &prefs, int storage) {
|
|||||||
Write Suite and Layout selection and project layout data to an .fl project file.
|
Write Suite and Layout selection and project layout data to an .fl project file.
|
||||||
*/
|
*/
|
||||||
void Fd_Layout_List::write(Fd_Project_Writer *out) {
|
void Fd_Layout_List::write(Fd_Project_Writer *out) {
|
||||||
|
// Don't write the Snap field if no custom layout was used
|
||||||
|
if ((current_suite()==0) && (current_preset()==0)) {
|
||||||
|
int nSuite = 0;
|
||||||
|
for (int i=0; i<list_size_; i++) {
|
||||||
|
if (list_[i].storage_ == FD_STORE_PROJECT) nSuite++;
|
||||||
|
}
|
||||||
|
if (nSuite == 0) return;
|
||||||
|
}
|
||||||
out->write_string("\nsnap {\n ver 1\n");
|
out->write_string("\nsnap {\n ver 1\n");
|
||||||
out->write_string(" current_suite "); out->write_word(list_[current_suite()].name_); out->write_string("\n");
|
out->write_string(" current_suite "); out->write_word(list_[current_suite()].name_); out->write_string("\n");
|
||||||
out->write_string(" current_preset %d\n", current_preset());
|
out->write_string(" current_preset %d\n", current_preset());
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
comment {//
|
comment {//
|
||||||
// About dialog for the Fast Light Tool Kit (FLTK).
|
// About dialog for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ code_name {.cxx}
|
|||||||
snap {
|
snap {
|
||||||
ver 1
|
ver 1
|
||||||
current_suite FLTK
|
current_suite FLTK
|
||||||
current_preset 1
|
current_preset 0
|
||||||
suite {
|
suite {
|
||||||
name {FLUID (based on FLTK)}
|
name {FLUID (based on FLTK)}
|
||||||
preset { 1
|
preset { 1
|
||||||
|
|||||||
+1
-1
@@ -771,7 +771,7 @@ int Fd_Code_Writer::write_code(const char *s, const char *t, bool to_sourceview)
|
|||||||
} else if (g_project.header_file_name[0] == '.' && strchr(g_project.header_file_name.c_str(), '/') == NULL) {
|
} else if (g_project.header_file_name[0] == '.' && strchr(g_project.header_file_name.c_str(), '/') == NULL) {
|
||||||
write_c("#include \"%s\"\n", fl_filename_name(t));
|
write_c("#include \"%s\"\n", fl_filename_name(t));
|
||||||
} else {
|
} else {
|
||||||
write_c("#include \"%s\"\n", t);
|
write_c("#include \"%s\"\n", g_project.header_file_name.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Fl_String loc_include, loc_conditional;
|
Fl_String loc_include, loc_conditional;
|
||||||
|
|||||||
+14
-8
@@ -311,6 +311,10 @@ void Fluid_Project::reset() {
|
|||||||
code_file_set = 0;
|
code_file_set = 0;
|
||||||
header_file_name = ".h";
|
header_file_name = ".h";
|
||||||
code_file_name = ".cxx";
|
code_file_name = ".cxx";
|
||||||
|
|
||||||
|
g_layout_list.remove_all(FD_STORE_PROJECT);
|
||||||
|
g_layout_list.current_suite(0);
|
||||||
|
g_layout_list.current_preset(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fluid_Project::update_settings_dialog() {
|
void Fluid_Project::update_settings_dialog() {
|
||||||
@@ -1127,29 +1131,31 @@ int write_code_files()
|
|||||||
// -- write the code and header files
|
// -- write the code and header files
|
||||||
if (!batch_mode) enter_project_dir();
|
if (!batch_mode) enter_project_dir();
|
||||||
int x = f.write_code(code_filename.c_str(), header_filename.c_str());
|
int x = f.write_code(code_filename.c_str(), header_filename.c_str());
|
||||||
|
Fl_String code_filename_rel = fl_filename_relative(code_filename);
|
||||||
|
Fl_String header_filename_rel = fl_filename_relative(header_filename);
|
||||||
if (!batch_mode) leave_project_dir();
|
if (!batch_mode) leave_project_dir();
|
||||||
|
|
||||||
// -- print error message in batch mode or pop up an error or confirmation dialog box
|
// -- print error message in batch mode or pop up an error or confirmation dialog box
|
||||||
if (batch_mode) {
|
if (batch_mode) {
|
||||||
if (!x) {
|
if (!x) {
|
||||||
fprintf(stderr, "%s and %s: %s\n",
|
fprintf(stderr, "%s and %s: %s\n",
|
||||||
code_filename.c_str(),
|
code_filename_rel.c_str(),
|
||||||
header_filename.c_str(),
|
header_filename_rel.c_str(),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!x) {
|
if (!x) {
|
||||||
fl_message("Can't write %s and %s: %s",
|
fl_message("Can't write %s or %s: %s",
|
||||||
code_filename.c_str(),
|
code_filename_rel.c_str(),
|
||||||
header_filename.c_str(),
|
header_filename_rel.c_str(),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
set_modflag(-1, 0);
|
set_modflag(-1, 0);
|
||||||
if (completion_button->value()) {
|
if (completion_button->value()) {
|
||||||
fl_message("Wrote %s and %s",
|
fl_message("Wrote %s and %s",
|
||||||
g_project.codefile_name().c_str(),
|
code_filename_rel.c_str(),
|
||||||
g_project.headerfile_name().c_str());
|
header_filename_rel.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2080,7 +2086,7 @@ int main(int argc,char **argv) {
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't lock up if silly command line arguments were given
|
// don't lock up if inconsistent command line arguments were given
|
||||||
if (batch_mode)
|
if (batch_mode)
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
comment {//
|
comment {//
|
||||||
// Code dialogs for the Fast Light Tool Kit (FLTK).
|
// Code dialogs for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
comment {//
|
comment {//
|
||||||
// FLUID print panel for the Fast Light Tool Kit (FLTK).
|
// FLUID print panel for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
comment {//
|
comment {//
|
||||||
// Code dialogs for the Fast Light Tool Kit (FLTK).
|
// Code dialogs for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -31,7 +26,7 @@ decl {\#include "fluid.h"} {private local
|
|||||||
decl {\#include "file.h"} {private local
|
decl {\#include "file.h"} {private local
|
||||||
}
|
}
|
||||||
|
|
||||||
decl {\#include "../src/flstring.h"} {selected private local
|
decl {\#include "../src/flstring.h"} {private local
|
||||||
}
|
}
|
||||||
|
|
||||||
decl {\#include <FL/Fl_Tabs.H>} {private local
|
decl {\#include <FL/Fl_Tabs.H>} {private local
|
||||||
@@ -136,8 +131,6 @@ and load those into the Code Viewer widgets.} open return_type void
|
|||||||
sv_strings->buffer()->loadfile(fn);
|
sv_strings->buffer()->loadfile(fn);
|
||||||
sv_strings->scroll(top, 0);
|
sv_strings->scroll(top, 0);
|
||||||
} else if (sv_source->visible_r() || sv_header->visible_r()) {
|
} else if (sv_source->visible_r() || sv_header->visible_r()) {
|
||||||
g_project.basename = fl_filename_name(sv_source_filename);
|
|
||||||
g_project.basename = fl_filename_setext(g_project.basename, "");
|
|
||||||
Fl_String code_file_name_bak = g_project.code_file_name;
|
Fl_String code_file_name_bak = g_project.code_file_name;
|
||||||
g_project.code_file_name = sv_source_filename;
|
g_project.code_file_name = sv_source_filename;
|
||||||
Fl_String header_file_name_bak = g_project.header_file_name;
|
Fl_String header_file_name_bak = g_project.header_file_name;
|
||||||
@@ -162,7 +155,8 @@ and load those into the Code Viewer widgets.} open return_type void
|
|||||||
|
|
||||||
g_project.code_file_name = code_file_name_bak;
|
g_project.code_file_name = code_file_name_bak;
|
||||||
g_project.header_file_name = header_file_name_bak;
|
g_project.header_file_name = header_file_name_bak;
|
||||||
}} {}
|
}} {selected
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Function {update_sourceview_timer(void*)} {
|
Function {update_sourceview_timer(void*)} {
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
comment {//
|
comment {//
|
||||||
// FLUID template support for the Fast Light Tool Kit (FLTK).
|
// FLUID template support for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
comment {//
|
comment {//
|
||||||
// Widget panel for the Fast Light Tool Kit (FLTK).
|
// Widget panel for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ window->hide();} open
|
|||||||
} {}
|
} {}
|
||||||
Fl_Button newButton {
|
Fl_Button newButton {
|
||||||
callback {newdir();}
|
callback {newdir();}
|
||||||
image {new.xbm} xywh {455 10 25 25} labelsize 8
|
image {new.xbm} compress_image 0 xywh {455 10 25 25} labelsize 8
|
||||||
code0 {\#include <FL/Fl_Preferences.H>}
|
code0 {\#include <FL/Fl_Preferences.H>}
|
||||||
code1 {o->tooltip(new_directory_tooltip);}
|
code1 {o->tooltip(new_directory_tooltip);}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
class CubeViewUI {open
|
class CubeViewUI {open
|
||||||
} {
|
} {
|
||||||
Function {CubeViewUI()} {open
|
Function {CubeViewUI()} {open
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 0
|
|
||||||
}
|
|
||||||
comment {//
|
comment {//
|
||||||
// Checkers images for the Fast Light Tool Kit (FLTK).
|
// Checkers images for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
Function {} {open
|
Function {} {open
|
||||||
} {
|
} {
|
||||||
Fl_Window {} {open selected
|
Fl_Window {} {open selected
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
Function {} {open
|
Function {} {open
|
||||||
} {
|
} {
|
||||||
Fl_Window {} {open
|
Fl_Window {} {open
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
Function {make_window()} {open
|
Function {make_window()} {open
|
||||||
} {
|
} {
|
||||||
Fl_Window my_window {open
|
Fl_Window my_window {open
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 0
|
|
||||||
}
|
|
||||||
decl {\#include "mandelbrot.h"} {public local
|
decl {\#include "mandelbrot.h"} {public local
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ i18n_gnu_function gettext
|
|||||||
i18n_gnu_static_function gettext_noop
|
i18n_gnu_static_function gettext_noop
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 0
|
|
||||||
}
|
|
||||||
comment {About test/preferences:
|
comment {About test/preferences:
|
||||||
|
|
||||||
The preferences app shows two features of FLTK and FLUID.
|
The preferences app shows two features of FLTK and FLUID.
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
Function {button_cb(Fl_Button *b, void *)} {
|
Function {button_cb(Fl_Button *b, void *)} {
|
||||||
comment {Buttons test callback} open private return_type void
|
comment {Buttons test callback} open private return_type void
|
||||||
} {
|
} {
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
Function {} {open
|
Function {} {open
|
||||||
} {
|
} {
|
||||||
Fl_Window {} {open selected
|
Fl_Window {} {open selected
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 0
|
|
||||||
}
|
|
||||||
Function {} {open
|
Function {} {open
|
||||||
} {
|
} {
|
||||||
Fl_Window foo_window {
|
Fl_Window foo_window {
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 1
|
|
||||||
}
|
|
||||||
decl {\#include <stdio.h>} {public global
|
decl {\#include <stdio.h>} {public global
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
version 1.0400
|
version 1.0400
|
||||||
header_name {.h}
|
header_name {.h}
|
||||||
code_name {.cxx}
|
code_name {.cxx}
|
||||||
snap {
|
|
||||||
ver 1
|
|
||||||
current_suite FLTK
|
|
||||||
current_preset 0
|
|
||||||
}
|
|
||||||
decl {\#include <FL/Fl_Simple_Terminal.H>} {public global
|
decl {\#include <FL/Fl_Simple_Terminal.H>} {public global
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user