summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_System_Driver.H2
-rw-r--r--src/Fl_own_colormap.cxx44
-rw-r--r--src/config_lib.h2
-rw-r--r--src/drivers/X11/Fl_X11_System_Driver.H2
4 files changed, 23 insertions, 27 deletions
diff --git a/FL/Fl_System_Driver.H b/FL/Fl_System_Driver.H
index 6f92889f6..ff5b7ff90 100644
--- a/FL/Fl_System_Driver.H
+++ b/FL/Fl_System_Driver.H
@@ -180,6 +180,8 @@ public:
// the implementations of local_to_mac_roman() and mac_roman_to_local() are in fl_encoding_mac_roman.cxx
virtual const char *local_to_mac_roman(const char *t, int n);
virtual const char *mac_roman_to_local(const char *t, int n);
+ // the default implementation is most probably enough
+ virtual void own_colormap() {}
};
#endif // FL_SYSTEM_DRIVER_H
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 */