diff options
| author | Manolo Gouy <Manolo> | 2016-04-13 14:41:55 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-13 14:41:55 +0000 |
| commit | 70f7738c920fac5ff84c40a673bb7b87245d4d0c (patch) | |
| tree | d472fdb4fd2fd6a1d370478478376eb0ca57b090 /src | |
| parent | 8653a5353e2296269685dcb1f61bc64f0a79bd3a (diff) | |
Rewrite Fl_own_colormap.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11601 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_own_colormap.cxx | 44 | ||||
| -rw-r--r-- | src/config_lib.h | 2 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_System_Driver.H | 2 |
3 files changed, 21 insertions, 27 deletions
diff --git a/src/Fl_own_colormap.cxx b/src/Fl_own_colormap.cxx index ea04d30a4..49b640a96 100644 --- a/src/Fl_own_colormap.cxx +++ b/src/Fl_own_colormap.cxx @@ -24,36 +24,17 @@ // and copy the first 16 colors from the default colormap so that we won't // get huge color changes when switching windows. -#include <config.h> +#include "config_lib.h" #include <FL/Fl.H> #include <FL/x.H> +#include <FL/Fl_System_Driver.H> -/** \fn Fl::own_colormap() - Makes FLTK use its own colormap. This may make FLTK display better - and will reduce conflicts with other programs that want lots of colors. - However the colors may flash as you move the cursor between windows. - - <P>This does nothing if the current visual is not colormapped. -*/ -#ifdef WIN32 -// There is probably something relevant to do on MSWindows 8-bit displays -// but I don't know what it is - -void Fl::own_colormap() {} - -#elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform colormap -// MacOS X always provides a TrueColor interface... - -void Fl::own_colormap() {} - -#elif defined(FL_PORTING) - -# pragma message "FL_PORTING: implement color map handling if you don't have an RGB screen" -#else +#ifdef FL_CFG_WIN_X11 // X version +#include "drivers/X11/Fl_X11_System_Driver.H" -void Fl::own_colormap() { +void Fl_X11_System_Driver::own_colormap() { fl_open_display(); #if USE_COLORMAP switch (fl_visual->c_class) { @@ -76,10 +57,21 @@ void Fl::own_colormap() { // Copy those first 16 colors to our own colormap: for (i = 0; i < 16; i ++) XAllocColor(fl_display, fl_colormap, colors + i); -#endif +#endif // USE_COLORMAP } -#endif +#endif // FL_CFG_WIN_X11 + +/** \fn Fl::own_colormap() + Makes FLTK use its own colormap. This may make FLTK display better + and will reduce conflicts with other programs that want lots of colors. + However the colors may flash as you move the cursor between windows. + + <P>This does nothing if the current visual is not colormapped. + */ +void Fl::own_colormap() { + Fl::system_driver()->own_colormap(); +} // // End of "$Id$". diff --git a/src/config_lib.h b/src/config_lib.h index 465c1bfa6..56bc8af91 100644 --- a/src/config_lib.h +++ b/src/config_lib.h @@ -43,7 +43,7 @@ #ifdef __APPLE__ // default configurations # define FL_CFG_PRN_QUARTZ #elif defined(WIN32) -# define FL_CFG_WIN_WIN32 +# define FL_CFG_PRN_WIN32 #elif defined(FL_PORTING) # pragma message "FL_PORTING: please choose a printer driver" #else // X11 diff --git a/src/drivers/X11/Fl_X11_System_Driver.H b/src/drivers/X11/Fl_X11_System_Driver.H index 0b309dc34..dc97c5f99 100644 --- a/src/drivers/X11/Fl_X11_System_Driver.H +++ b/src/drivers/X11/Fl_X11_System_Driver.H @@ -43,6 +43,8 @@ public: const char *application); virtual int preferences_need_protection_check() {return 1;} virtual int utf8locale(); + // this one is in Fl_own_colormap.cxx + virtual void own_colormap(); }; #endif /* FL_X11_SYSTEM_DRIVER_H */ |
