From 179771acd25ee5ff8e36a5fd192682d4d55c52af Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 26 Jan 2023 15:23:43 +0100 Subject: Fixing FLUID file corruption from issue #653 (#662) Removing all globals in file writer (#653 ) Fix some static analyser complaints Valgrind: handle width==0 in GfxDrivers on Wayland and X11 Don't use `Fl_Input_::static_value`, it accesses previous buffer that may be deleted Project file write encapsulated, removing globals Encapsulating project file reader, removing states in glbals Project i/o increased source code readability --- fluid/Fl_Window_Type.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fluid/Fl_Window_Type.h') diff --git a/fluid/Fl_Window_Type.h b/fluid/Fl_Window_Type.h index 4e4ac8a48..519af347b 100644 --- a/fluid/Fl_Window_Type.h +++ b/fluid/Fl_Window_Type.h @@ -51,8 +51,8 @@ protected: void newposition(Fl_Widget_Type *,int &x,int &y,int &w,int &h); int handle(int); void setlabel(const char *) FL_OVERRIDE; - void write_code1() FL_OVERRIDE; - void write_code2() FL_OVERRIDE; + void write_code1(Fd_Code_Writer& f) FL_OVERRIDE; + void write_code2(Fd_Code_Writer& f) FL_OVERRIDE; Fl_Widget_Type *_make() FL_OVERRIDE {return 0;} // we don't call this Fl_Widget *widget(int,int,int,int) FL_OVERRIDE {return 0;} int recalc; // set by fix_overlay() @@ -84,8 +84,8 @@ public: void fix_overlay(); // Update the bounding box, etc uchar *read_image(int &ww, int &hh); // Read an image of the window - void write_properties() FL_OVERRIDE; - void read_property(const char *) FL_OVERRIDE; + void write_properties(Fd_Project_Writer &f) FL_OVERRIDE; + void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE; int read_fdesign(const char*, const char*) FL_OVERRIDE; void add_child(Fl_Type*, Fl_Type*) FL_OVERRIDE; @@ -118,11 +118,11 @@ public: char write_public_state; // true when public: has been printed char wc_relative; // if 1, reposition all children, if 2, reposition and resize - void write_properties() FL_OVERRIDE; - void read_property(const char *) FL_OVERRIDE; + void write_properties(Fd_Project_Writer &f) FL_OVERRIDE; + void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE; - void write_code1() FL_OVERRIDE; - void write_code2() FL_OVERRIDE; + void write_code1(Fd_Code_Writer& f) FL_OVERRIDE; + void write_code2(Fd_Code_Writer& f) FL_OVERRIDE; Fl_Type *make(Strategy strategy) FL_OVERRIDE; const char *type_name() FL_OVERRIDE {return "widget_class";} int pixmapID() FL_OVERRIDE { return 48; } -- cgit v1.2.3