summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-03-25 18:47:29 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-03-25 18:47:29 +0100
commit499ec5c2915530bc3b0d72ef37ff74801cfc67a7 (patch)
tree38938c8818aa76fc01e439a367fb68d9d7167623 /src
parent258116c5a61cf1861058ab5c4ef07ffe73fc4912 (diff)
Replace static void Fl_Window_Driver::default_icons() by virtual Fl_Screen_Driver::default_icons()
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Screen_Driver.H2
-rw-r--r--src/Fl_Screen_Driver.cxx2
-rw-r--r--src/Fl_Window.cxx4
-rw-r--r--src/Fl_Window_Driver.H2
-rw-r--r--src/Fl_cocoa.mm19
-rw-r--r--src/Fl_win32.cxx2
-rw-r--r--src/Fl_x.cxx2
-rw-r--r--src/drivers/Android/Fl_Android_Window_Driver.cxx2
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx4
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H1
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.H1
11 files changed, 11 insertions, 30 deletions
diff --git a/src/Fl_Screen_Driver.H b/src/Fl_Screen_Driver.H
index 4c2587f1d..8ae19a816 100644
--- a/src/Fl_Screen_Driver.H
+++ b/src/Fl_Screen_Driver.H
@@ -188,6 +188,8 @@ public:
/* Number of pixels per drawing unit for the display.
The default implementation may be enough. */
virtual float retina_factor() { return 1; }
+ // supports Fl_Window::default_icons()
+ virtual void default_icons(const Fl_RGB_Image *icons[], int count);
};
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index c572115f7..71f878096 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -487,6 +487,8 @@ int Fl_Screen_Driver::parse_color(const char* p, uchar& r, uchar& g, uchar& b)
return 1;
}
+void Fl_Screen_Driver::default_icons(const Fl_RGB_Image *icons[], int count) {}
+
/**
\}
\endcond
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx
index f664b1fc9..27ff2ae9d 100644
--- a/src/Fl_Window.cxx
+++ b/src/Fl_Window.cxx
@@ -25,6 +25,7 @@
#include <FL/Fl.H>
#include <FL/platform.H>
#include "Fl_Window_Driver.H"
+#include "Fl_Screen_Driver.H"
#include <FL/Fl_RGB_Image.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Tooltip.H>
@@ -317,7 +318,8 @@ void Fl_Window::default_icon(const Fl_RGB_Image *icon) {
\see Fl_Window::icons(const Fl_RGB_Image *[], int)
*/
void Fl_Window::default_icons(const Fl_RGB_Image *icons[], int count) {
- Fl_Window_Driver::default_icons(icons, count);
+ Fl::screen_driver()->open_display();
+ Fl::screen_driver()->default_icons(icons, count);
}
/** Sets or resets a single window icon.
diff --git a/src/Fl_Window_Driver.H b/src/Fl_Window_Driver.H
index 8bf8a89a8..e31323d72 100644
--- a/src/Fl_Window_Driver.H
+++ b/src/Fl_Window_Driver.H
@@ -181,8 +181,6 @@ public:
virtual const void *icon() const {return NULL;}
virtual void icon(const void * ic) {}
virtual void free_icons() {}
- // each platform implements this its own way
- static void default_icons(const Fl_RGB_Image *icons[], int count);
// --- window printing/drawing helper
virtual void capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_RGB_Image*& left,
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 5d32dd1b3..462d2fa3c 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -151,25 +151,6 @@ void fl_set_status(int x, int y, int w, int h)
{
}
-/**
- * @cond DriverDev
- * @addtogroup DriverDeveloper
- * @{
- */
-
-/**
- * Set the default icon for the window decoration.
- *
- * @todo This method should probably be virtual and should be overriden for
- * a give targte platform. This implementation however lives in Fl_Cocoa.m
- * which is a Mac specific file.
- */
-void Fl_Window_Driver::default_icons(const Fl_RGB_Image *icons[], int count) {}
-
-/**
- * @}
- * @endcond
- */
/*
* Mac keyboard lookup table
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index a5af6f5bf..bc2cb5d90 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -2321,7 +2321,7 @@ static const Fl_RGB_Image *find_best_icon(int ideal_width, const Fl_RGB_Image *i
return best;
}
-void Fl_Window_Driver::default_icons(const Fl_RGB_Image *icons[], int count) {
+void Fl_WinAPI_Screen_Driver::default_icons(const Fl_RGB_Image *icons[], int count) {
const Fl_RGB_Image *best_big, *best_small;
if (default_big_icon != NULL)
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index a2225319c..36418ffe8 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -2799,7 +2799,7 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count,
}
}
-void Fl_Window_Driver::default_icons(const Fl_RGB_Image *icons[], int count) {
+void Fl_X11_Screen_Driver::default_icons(const Fl_RGB_Image *icons[], int count) {
if (default_net_wm_icons) {
delete [] default_net_wm_icons;
default_net_wm_icons = 0L;
diff --git a/src/drivers/Android/Fl_Android_Window_Driver.cxx b/src/drivers/Android/Fl_Android_Window_Driver.cxx
index 1c845c7c6..5781c0361 100644
--- a/src/drivers/Android/Fl_Android_Window_Driver.cxx
+++ b/src/drivers/Android/Fl_Android_Window_Driver.cxx
@@ -38,8 +38,6 @@ Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *w)
return new Fl_Android_Window_Driver(w);
}
-void Fl_Window_Driver::default_icons(Fl_RGB_Image const**, int) {
-}
Window fl_window = 0;
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx
index 208a90063..2335f799c 100644
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx
+++ b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx
@@ -31,10 +31,6 @@ Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *win)
}
-void Fl_Window_Driver::default_icons(Fl_RGB_Image const**, int) {
-}
-
-
Fl_PicoSDL_Window_Driver::Fl_PicoSDL_Window_Driver(Fl_Window *win)
: Fl_Pico_Window_Driver(win)
{
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H
index 82205cca7..16bf3ebdf 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H
@@ -92,6 +92,7 @@ public:
scale_of_screen[n] = f;
}
virtual void desktop_scale_factor();
+ virtual void default_icons(const Fl_RGB_Image *icons[], int count);
};
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H
index deaaafdcf..b348dfc3e 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.H
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.H
@@ -103,6 +103,7 @@ public:
virtual void close_display();
// --- compute dimensions of an Fl_Offscreen
virtual void offscreen_size(Fl_Offscreen o, int &width, int &height);
+ virtual void default_icons(const Fl_RGB_Image *icons[], int count);
};