FLTK logo

[master] 98265d8 - Remove FL_CFG_WIN_X11 preprocessor variable from Fl_own_colormap.cxx

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 98265d8 - Remove FL_CFG_WIN_X11 preprocessor variable from Fl_own_colormap.cxx "ManoloFLTK" Feb 16, 2021  
 
commit 98265d81a2c3fdfa76fa7d96fc9400f78113ddf7
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Feb 16 13:40:18 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Feb 16 15:50:15 2021 +0100

    Remove FL_CFG_WIN_X11 preprocessor variable from Fl_own_colormap.cxx

 src/Fl_own_colormap.cxx                  | 37 +-------------------------------
 src/drivers/X11/Fl_X11_System_Driver.cxx | 27 +++++++++++++++++++++++
 2 files changed, 28 insertions(+), 36 deletions(-)

diff --git src/Fl_own_colormap.cxx src/Fl_own_colormap.cxx
index 1615f58..b606c3c 100644
--- src/Fl_own_colormap.cxx
+++ src/Fl_own_colormap.cxx
@@ -1,7 +1,7 @@
 //
 // Private colormap support for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2021 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -22,44 +22,9 @@
 // and copy the first 16 colors from the default colormap so that we won't
 // get huge color changes when switching windows.
 
-#include "config_lib.h"
 #include <FL/Fl.H>
-#include <FL/platform.H>
 #include "Fl_System_Driver.H"
 
-
-#if defined(FL_CFG_WIN_X11) && !defined(FL_DOXYGEN)
-// X version
-#include "drivers/X11/Fl_X11_System_Driver.H"
-
-void Fl_X11_System_Driver::own_colormap() {
-  fl_open_display();
-#if USE_COLORMAP
-  switch (fl_visual->c_class) {
-  case GrayScale :
-  case PseudoColor :
-  case DirectColor :
-    break;
-  default:
-    return; // don't do anything for non-colormapped visuals
-  }
-  int i;
-  XColor colors[16];
-  // Get the first 16 colors from the default colormap...
-  for (i = 0; i < 16; i ++) colors[i].pixel = i;
-  XQueryColors(fl_display, fl_colormap, colors, 16);
-  // Create a new colormap...
-  fl_colormap = XCreateColormap(fl_display,
-                                RootWindow(fl_display,fl_screen),
-                                fl_visual->visual, AllocNone);
-  // Copy those first 16 colors to our own colormap:
-  for (i = 0; i < 16; i ++)
-    XAllocColor(fl_display, fl_colormap, colors + i);
-#endif // USE_COLORMAP
-}
-
-#endif // FL_CFG_WIN_X11
-
 /** \fn Fl::own_colormap()
  Makes FLTK use its <a href="fltk-colormap.png">own colormap</a>.  This may make FLTK display better
  and will reduce conflicts with other programs that want lots of colors.
diff --git src/drivers/X11/Fl_X11_System_Driver.cxx src/drivers/X11/Fl_X11_System_Driver.cxx
index 801189b..1281e5d 100644
--- src/drivers/X11/Fl_X11_System_Driver.cxx
+++ src/drivers/X11/Fl_X11_System_Driver.cxx
@@ -18,6 +18,7 @@
 #include "Fl_X11_System_Driver.H"
 #include <FL/Fl_File_Browser.H>
 #include <FL/fl_string.h>  // fl_strdup
+#include <FL/platform.H>
 #include "../../flstring.h"
 
 #include <X11/Xlib.h>
@@ -713,4 +714,30 @@ const char *Fl_X11_System_Driver::shortcut_add_key_name(unsigned key, char *p, c
   }
 }
 
+void Fl_X11_System_Driver::own_colormap() {
+  fl_open_display();
+#if USE_COLORMAP
+  switch (fl_visual->c_class) {
+  case GrayScale :
+  case PseudoColor :
+  case DirectColor :
+    break;
+  default:
+    return; // don't do anything for non-colormapped visuals
+  }
+  int i;
+  XColor colors[16];
+  // Get the first 16 colors from the default colormap...
+  for (i = 0; i < 16; i ++) colors[i].pixel = i;
+  XQueryColors(fl_display, fl_colormap, colors, 16);
+  // Create a new colormap...
+  fl_colormap = XCreateColormap(fl_display,
+                                RootWindow(fl_display,fl_screen),
+                                fl_visual->visual, AllocNone);
+  // Copy those first 16 colors to our own colormap:
+  for (i = 0; i < 16; i ++)
+    XAllocColor(fl_display, fl_colormap, colors + i);
+#endif // USE_COLORMAP
+}
+
 #endif // !defined(FL_DOXYGEN)
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.