summaryrefslogtreecommitdiff
path: root/src/Fl_own_colormap.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_own_colormap.cxx')
-rw-r--r--src/Fl_own_colormap.cxx44
1 files changed, 18 insertions, 26 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$".