Replace static void Fl_Window_Driver::default_icons() by virtual Fl_Screen_Driver::default_icons()

This commit is contained in:
ManoloFLTK 2019-03-25 18:47:29 +01:00
parent 258116c5a6
commit 499ec5c291
11 changed files with 11 additions and 30 deletions

View File

@ -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);
};

View File

@ -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

View File

@ -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.

View File

@ -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,

View File

@ -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

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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)
{

View File

@ -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);
};

View File

@ -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);
};