diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-01-26 15:23:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-26 15:23:43 +0100 |
| commit | 179771acd25ee5ff8e36a5fd192682d4d55c52af (patch) | |
| tree | f7d32685bccef27e64a6f706e7c0e0c9d099c372 /fluid/Fluid_Image.h | |
| parent | f314ca75feab8c472a9b136fd25636d2d2da68a7 (diff) | |
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
Diffstat (limited to 'fluid/Fluid_Image.h')
| -rw-r--r-- | fluid/Fluid_Image.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fluid/Fluid_Image.h b/fluid/Fluid_Image.h index deb9ecfa9..73387ffd4 100644 --- a/fluid/Fluid_Image.h +++ b/fluid/Fluid_Image.h @@ -23,6 +23,8 @@ #include <FL/Fl_Shared_Image.H> +#include "code.h" + class Fluid_Image { bool is_animated_gif_; const char *name_; @@ -32,9 +34,9 @@ class Fluid_Image { protected: Fluid_Image(const char *name); // no public constructor ~Fluid_Image(); // no public destructor - size_t write_static_binary(const char* fmt); - size_t write_static_text(const char* fmt); - void write_static_rgb(const char* idata_name); + size_t write_static_binary(Fd_Code_Writer& f, const char* fmt); + size_t write_static_text(Fd_Code_Writer& f, const char* fmt); + void write_static_rgb(Fd_Code_Writer& f, const char* idata_name); public: int written; static Fluid_Image* find(const char *); @@ -42,11 +44,11 @@ public: void increment(); void image(Fl_Widget *); // set the image of this widget void deimage(Fl_Widget *); // set the deimage of this widget - void write_static(int compressed); - void write_initializer(const char *type_name, const char *format, ...); - void write_code(int bind, const char *var, int inactive = 0); - void write_inline(int inactive = 0); - void write_file_error(const char *fmt); + void write_static(Fd_Code_Writer& f, int compressed); + void write_initializer(Fd_Code_Writer& f, const char *type_name, const char *format, ...); + void write_code(Fd_Code_Writer& f, int bind, const char *var, int inactive = 0); + void write_inline(Fd_Code_Writer& f, int inactive = 0); + void write_file_error(Fd_Code_Writer& f, const char *fmt); const char *name() const {return name_;} }; |
