summaryrefslogtreecommitdiff
path: root/FL/Fl_Image.H
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-06-15 19:05:34 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-06-15 19:05:47 +0200
commit46b89686df06102af64454bc7b2e722c1ff16927 (patch)
tree8e73dc3298cb6a24069c8f2fd8abedb7f71e9ca0 /FL/Fl_Image.H
parent91b78572c7ab2e4bd7692d2aa5352fcbbb33b236 (diff)
Allow using an Fl_SVG_Image object as window icon.
Fix for issue #90: Setting an svg image as a window icon causes a segfault.
Diffstat (limited to 'FL/Fl_Image.H')
-rw-r--r--FL/Fl_Image.H8
1 files changed, 8 insertions, 0 deletions
diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H
index aafd39742..decc5bdeb 100644
--- a/FL/Fl_Image.H
+++ b/FL/Fl_Image.H
@@ -273,6 +273,7 @@ public:
static bool register_images_done;
};
+class Fl_SVG_Image;
/**
The Fl_RGB_Image class supports caching and drawing
@@ -291,6 +292,7 @@ class FL_EXPORT Fl_RGB_Image : public Fl_Image {
public:
/** Points to the start of the object's data array
+ \see class Fl_SVG_Image which delays initialization of this member variable.
*/
const uchar *array;
/** If non-zero, the object's data array is delete[]'d when deleting the object.
@@ -332,6 +334,12 @@ public:
\sa void Fl_RGB_Image::max_size(size_t)
*/
static size_t max_size() {return max_size_;}
+ /** Returns whether an image is an Fl_SVG_Image or not.
+ This virtual method returns a pointer to the Fl_SVG_Image if this object is an instance of Fl_SVG_Image or NULL if not. */
+ virtual Fl_SVG_Image *as_svg_image() { return NULL; }
+ /** Makes sure the object is fully initialized.
+ In particular, makes sure member variable \ref array is non-null. */
+ virtual void normalize() {}
};
#endif // !Fl_Image_H