From f58b1a91b37e5ad758b3d0a3d9be950e8feb5d0c Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 16 Jun 2014 11:39:32 +0000 Subject: Add ability to set custom icons for windows. STR #2816. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10197 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Window.H | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'FL/Fl_Window.H') diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H index c26f474d2..92e76676f 100644 --- a/FL/Fl_Window.H +++ b/FL/Fl_Window.H @@ -22,6 +22,10 @@ #ifndef Fl_Window_H #define Fl_Window_H +#ifdef WIN32 +#include +#endif + #include "Fl_Group.H" #define FL_WINDOW 0xF0 ///< window type id all subclasses have type() >= this @@ -89,9 +93,19 @@ class FL_EXPORT Fl_Window : public Fl_Group { friend class Fl_X; Fl_X *i; // points at the system-specific stuff + struct icon_data { + const void *legacy_icon; + Fl_RGB_Image **icons; + int count; +#ifdef WIN32 + HICON big_icon; + HICON small_icon; +#endif + }; + const char* iconlabel_; char* xclass_; - const void* icon_; + struct icon_data *icon_; // size_range stuff: int minw, minh, maxw, maxh; int dw, dh, aspect; @@ -141,6 +155,8 @@ protected: */ int force_position() const { return ((flags() & FORCE_POSITION)?1:0); } + void free_icons(); + public: /** @@ -370,6 +386,18 @@ public: static const char *default_xclass(); const char* xclass() const; void xclass(const char* c); + + static void default_icon(const Fl_RGB_Image*); + static void default_icons(const Fl_RGB_Image*[], int); + void icon(const Fl_RGB_Image*); + void icons(const Fl_RGB_Image*[], int); + +#ifdef WIN32 + static void default_icons(HICON big_icon, HICON small_icon); + void icons(HICON big_icon, HICON small_icon); +#endif + + /* for legacy compatibility */ const void* icon() const; void icon(const void * ic); -- cgit v1.2.3