Skip to content

Commit

Permalink
FLUID: even more
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasWM committed Nov 13, 2024
1 parent 41b1e01 commit 485ad05
Show file tree
Hide file tree
Showing 22 changed files with 515 additions and 476 deletions.
62 changes: 31 additions & 31 deletions fluid/Fl_Function_Type.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,14 @@ void Fl_Function_Type::open() {
}
c = f_comment_input->buffer()->text();
if (c && *c) {
if (!comment() || strcmp(c, comment())) { set_modflag(1); redraw_browser(); }
if (!comment() || strcmp(c, comment())) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(c);
} else {
if (comment()) { set_modflag(1); redraw_browser(); }
if (comment()) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(0);
}
if (c) free((void*)c);
if (mod) set_modflag(1);
if (mod) Fluid.project().set_modflag(1);
break;
}
BREAK2:
Expand Down Expand Up @@ -1000,25 +1000,25 @@ void Fl_Decl_Type::open() {
name(c);
if (is_in_class()) {
if (public_!=decl_class_choice->value()) {
set_modflag(1);
Fluid.project().set_modflag(1);
public_ = decl_class_choice->value();
}
} else {
if (public_!=(decl_choice->value()&1)) {
set_modflag(1);
Fluid.project().set_modflag(1);
public_ = (decl_choice->value()&1);
}
if (static_!=((decl_choice->value()>>1)&1)) {
set_modflag(1);
Fluid.project().set_modflag(1);
static_ = ((decl_choice->value()>>1)&1);
}
}
c = decl_comment_input->buffer()->text();
if (c && *c) {
if (!comment() || strcmp(c, comment())) { set_modflag(1); redraw_browser(); }
if (!comment() || strcmp(c, comment())) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(c);
} else {
if (comment()) { set_modflag(1); redraw_browser(); }
if (comment()) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(0);
}
if (c) free((void*)c);
Expand Down Expand Up @@ -1215,7 +1215,7 @@ void Fl_Data_Type::open() {
Fluid.project().leave_project_dir();
if (fn) {
if (strcmp(fn, data_filename->value()))
set_modflag(1);
Fluid.project().set_modflag(1);
data_filename->value(fn);
}
}
Expand Down Expand Up @@ -1253,16 +1253,16 @@ void Fl_Data_Type::open() {
// store flags
if (is_in_class()) {
if (public_!=data_class_choice->value()) {
set_modflag(1);
Fluid.project().set_modflag(1);
public_ = data_class_choice->value();
}
} else {
if (public_!=(data_choice->value()&1)) {
set_modflag(1);
Fluid.project().set_modflag(1);
public_ = (data_choice->value()&1);
}
if (static_!=((data_choice->value()>>1)&1)) {
set_modflag(1);
Fluid.project().set_modflag(1);
static_ = ((data_choice->value()>>1)&1);
}
}
Expand All @@ -1272,22 +1272,22 @@ void Fl_Data_Type::open() {
// store the filename
c = data_filename->value();
if (filename_ && strcmp(filename_, data_filename->value()))
set_modflag(1);
Fluid.project().set_modflag(1);
else if (!filename_ && *c)
set_modflag(1);
Fluid.project().set_modflag(1);
if (filename_) { free((void*)filename_); filename_ = 0L; }
if (c && *c) filename_ = fl_strdup(c);
// store the comment
c = data_comment_input->buffer()->text();
if (c && *c) {
if (!comment() || strcmp(c, comment())) { set_modflag(1); redraw_browser(); }
if (!comment() || strcmp(c, comment())) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(c);
} else {
if (comment()) { set_modflag(1); redraw_browser(); }
if (comment()) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(0);
}
if (c) free((void*)c);
set_modflag(1);
Fluid.project().set_modflag(1);
break;
}
BREAK2:
Expand Down Expand Up @@ -1569,53 +1569,53 @@ void Fl_DeclBlock_Type::open() {
if (write_map_ & STATIC_IN_HEADER) {
if (declblock_static_header->value()==0) {
write_map_ &= ~STATIC_IN_HEADER;
set_modflag(1);
Fluid.project().set_modflag(1);
}
} else {
if (declblock_static_header->value()) {
write_map_ |= STATIC_IN_HEADER;
set_modflag(1);
Fluid.project().set_modflag(1);
}
}
if (write_map_ & STATIC_IN_SOURCE) {
if (declblock_static_source->value()==0) {
write_map_ &= ~STATIC_IN_SOURCE;
set_modflag(1);
Fluid.project().set_modflag(1);
}
} else {
if (declblock_static_source->value()) {
write_map_ |= STATIC_IN_SOURCE;
set_modflag(1);
Fluid.project().set_modflag(1);
}
}
if (write_map_ & CODE_IN_HEADER) {
if (declblock_code_header->value()==0) {
write_map_ &= ~CODE_IN_HEADER;
set_modflag(1);
Fluid.project().set_modflag(1);
}
} else {
if (declblock_code_header->value()) {
write_map_ |= CODE_IN_HEADER;
set_modflag(1);
Fluid.project().set_modflag(1);
}
}
if (write_map_ & CODE_IN_SOURCE) {
if (declblock_code_source->value()==0) {
write_map_ &= ~CODE_IN_SOURCE;
set_modflag(1);
Fluid.project().set_modflag(1);
}
} else {
if (declblock_code_source->value()) {
write_map_ |= CODE_IN_SOURCE;
set_modflag(1);
Fluid.project().set_modflag(1);
}
}
c = declblock_comment_input->buffer()->text();
if (c && *c) {
if (!comment() || strcmp(c, comment())) { set_modflag(1); redraw_browser(); }
if (!comment() || strcmp(c, comment())) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(c);
} else {
if (comment()) { set_modflag(1); redraw_browser(); }
if (comment()) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(0);
}
if (c) free((void*)c);
Expand Down Expand Up @@ -1886,7 +1886,7 @@ void Fl_Comment_Type::open() {
in_h_ = comment_in_header->value();
mod = 1;
}
if (mod) set_modflag(1);
if (mod) Fluid.project().set_modflag(1);
break;
}
BREAK2:
Expand Down Expand Up @@ -2093,14 +2093,14 @@ void Fl_Class_Type::open() {
storestring(c, subclass_of);
if (public_ != c_public_button->value()) {
public_ = c_public_button->value();
set_modflag(1);
Fluid.project().set_modflag(1);
}
c = c_comment_input->buffer()->text();
if (c && *c) {
if (!comment() || strcmp(c, comment())) { set_modflag(1); redraw_browser(); }
if (!comment() || strcmp(c, comment())) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(c);
} else {
if (comment()) { set_modflag(1); redraw_browser(); }
if (comment()) { Fluid.project().set_modflag(1); redraw_browser(); }
comment(0);
}
if (c) free((void*)c);
Expand Down
7 changes: 4 additions & 3 deletions fluid/Fl_Grid_Type.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "fluid.h"
#include "application/application.h"
#include "project/project.h"
#include "file.h"
#include "code.h"
#include "widget_browser.h"
Expand Down Expand Up @@ -847,7 +848,7 @@ void grid_child_cb(Fluid_Coord_Input* i, void* v, int what) {
if (!cell && new_cell)
new_cell->minimum_size(20, 20);
g->need_layout(true);
set_modflag(1);
Fluid.project().set_modflag(1);
}
}
}
Expand Down Expand Up @@ -951,7 +952,7 @@ void grid_align_horizontal_cb(Fl_Choice* i, void* v) {
cell->align((Fl_Grid_Align)(v | (cell->align() & ~mask)));
g->need_layout(true);
g->redraw();
set_modflag(1);
Fluid.project().set_modflag(1);
}
}
}
Expand Down Expand Up @@ -986,7 +987,7 @@ void grid_align_vertical_cb(Fl_Choice* i, void* v) {
cell->align((Fl_Grid_Align)(v | (cell->align() & ~mask)));
g->need_layout(true);
g->redraw();
set_modflag(1);
Fluid.project().set_modflag(1);
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions fluid/Fl_Group_Type.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "fluid.h"
#include "application/application.h"
#include "project/project.h"
#include "file.h"
#include "code.h"
#include "widget_browser.h"
Expand Down Expand Up @@ -135,7 +136,7 @@ void group_cb(Fl_Widget *, void *) {
n->layout_widget();
widget_browser->rebuild();
undo_resume();
set_modflag(1);
Fluid.project().set_modflag(1);
}

extern void ungroup_selected_menuitems();
Expand Down Expand Up @@ -181,7 +182,7 @@ void ungroup_cb(Fl_Widget *, void *) {
Fl_Type::current = q;
widget_browser->rebuild();
undo_resume();
set_modflag(1);
Fluid.project().set_modflag(1);
}

void Fl_Group_Type::ideal_size(int &w, int &h) {
Expand Down Expand Up @@ -755,7 +756,7 @@ Fl_Type* Fl_Tabs_Type::click_test(int x, int y) {
t->handle(FL_PUSH);
Fl::pushed(t);
while (Fl::pushed()==t) Fl::wait();
if (changed) set_modflag(1);
if (changed) Fluid.project().set_modflag(1);
return (Fl_Type*)(t->value()->user_data());
}

Expand Down
7 changes: 4 additions & 3 deletions fluid/Fl_Menu_Type.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
//

#include "Fl_Menu_Type.h"
#include "application/application.h"
#include "project/project.h"
#include "fluid.h"
#include "Fl_Window_Type.h"
Expand Down Expand Up @@ -221,7 +222,7 @@ void group_selected_menuitems() {
}
widget_browser->rebuild();
undo_resume();
set_modflag(1);
Fluid.project().set_modflag(1);
}

void ungroup_selected_menuitems() {
Expand Down Expand Up @@ -252,7 +253,7 @@ void ungroup_selected_menuitems() {
Fl_Type::current = q;
widget_browser->rebuild();
undo_resume();
set_modflag(1);
Fluid.project().set_modflag(1);
}


Expand Down Expand Up @@ -916,6 +917,6 @@ void shortcut_in_cb(Fl_Shortcut_Button* i, void* v) {
if (b->shortcut() != (int)i->value()) mod = 1;
b->shortcut(i->value());
}
if (mod) set_modflag(1);
if (mod) Fluid.project().set_modflag(1);
}
}
9 changes: 5 additions & 4 deletions fluid/Fl_Type.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#include "Fl_Type.h"

#include "fluid.h"
#include "application/application.h"
#include "project/project.h"
#include "Fd_Snap_Action.h"
#include "Fl_Function_Type.h"
Expand Down Expand Up @@ -336,7 +337,7 @@ void earlier_cb(Fl_Widget*,void*) {
}
f = nxt;
}
if (mod) set_modflag(1);
if (mod) Fluid.project().set_modflag(1);
widget_browser->display(Fl_Type::current);
widget_browser->rebuild();
}
Expand All @@ -361,7 +362,7 @@ void later_cb(Fl_Widget*,void*) {
}
f = prv;
}
if (mod) set_modflag(1);
if (mod) Fluid.project().set_modflag(1);
widget_browser->display(Fl_Type::current);
widget_browser->rebuild();
}
Expand Down Expand Up @@ -445,7 +446,7 @@ int storestring(const char *n, const char * & p, int nostrip) {
strlcpy(q,n,length+1);
p = q;
}
set_modflag(1);
Fluid.project().set_modflag(1);
return 1;
}

Expand Down Expand Up @@ -706,7 +707,7 @@ void Fl_Type::add(Fl_Type *anchor, Strategy strategy) {
update_visibility_flag(t);
}

set_modflag(1);
Fluid.project().set_modflag(1);
widget_browser->redraw();

#if 0
Expand Down
Loading

0 comments on commit 485ad05

Please sign in to comment.