From 3ae2b1d74e35a4ac0d80b35e3eaa23088ccffeb4 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 30 Oct 2016 07:26:13 +0000 Subject: Add virtual Fl_RGB_Image* Fl_Image::as_rgb_image() to detect whether an Fl_Image is derived from Fl_RGB_Image git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12061 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Image.H | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'FL') diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H index 203a91d3b..09d84a6de 100644 --- a/FL/Fl_Image.H +++ b/FL/Fl_Image.H @@ -30,6 +30,7 @@ class Fl_Widget; class Fl_Pixmap; struct Fl_Menu_Item; struct Fl_Label; +class Fl_RGB_Image; /** \enum Fl_RGB_Scaling @@ -186,6 +187,12 @@ public: // get RGB image scaling method static Fl_RGB_Scaling RGB_scaling(); + /** Use this method if you have an Fl_Image object and want to know whether it is derived + from class Fl_RGB_Image. + If the method returns non-NULL, then the image in question is + derived from Fl_RGB_Image, and the returned value is a pointer to this image. + */ + virtual Fl_RGB_Image *as_rgb_image() {return NULL;} }; @@ -249,6 +256,7 @@ public: \sa void Fl_RGB_Image::max_size(size_t) */ static size_t max_size() {return max_size_;} + virtual Fl_RGB_Image *as_rgb_image() {return this;} }; #endif // !Fl_Image_H -- cgit v1.2.3