|
I propose the series of modifications given in the attached patch to fix for 1.4 issue #254: remove hardware overlay support. This would remove one milestone item for Release 1.4
The proposal leaves unchanged the support of HAVE_GL_OVERLAY for the WIN32 platform. Can someone give info about whether this is functional? With Windows inside VirtualBox, there's no access to such feature.
Any comment?
--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/a63ddeb6-59d3-4496-a090-f79720b4b451n%40googlegroups.com.
diff --git a/FL/Fl_Menu_Window.H b/FL/Fl_Menu_Window.H
index deae888af..dbd9cae09 100644
--- a/FL/Fl_Menu_Window.H
+++ b/FL/Fl_Menu_Window.H
@@ -30,17 +30,6 @@
*/
class FL_EXPORT Fl_Menu_Window : public Fl_Single_Window {
public:
- void show();
- void erase();
- void flush();
- void hide();
- /** Tells if hardware overlay mode is set */
- unsigned int overlay() {return !(flags()&NO_OVERLAY);}
- /** Tells FLTK to use hardware overlay planes if they are available. */
- void set_overlay() {clear_flag(NO_OVERLAY);}
- /** Tells FLTK to use normal drawing planes instead of overlay planes.
- This is usually necessary if your menu contains multi-color pixmaps. */
- void clear_overlay() {set_flag(NO_OVERLAY);}
~Fl_Menu_Window();
/** Creates a new Fl_Menu_Window widget using the given size, and label string. */
Fl_Menu_Window(int W, int H, const char *l = 0);
diff --git a/configh.cmake.in b/configh.cmake.in
index 61bcfdb64..ac9d39cb0 100644
--- a/configh.cmake.in
+++ b/configh.cmake.in
@@ -186,17 +186,6 @@
#cmakedefine USE_SDL 1
-/*
- * HAVE_OVERLAY:
- *
- * Use the X overlay extension? FLTK will try to use an overlay
- * visual for Fl_Overlay_Window, the Gl_Window overlay, and for the
- * menus. Setting this to zero will remove a substantial amount of
- * code from FLTK. Overlays have only been tested on SGI servers!
- */
-
-#define HAVE_OVERLAY 0
-
/*
* HAVE_GL_OVERLAY:
*
@@ -204,7 +193,7 @@
* set this to 1.
*/
-#define HAVE_GL_OVERLAY HAVE_OVERLAY
+#define HAVE_GL_OVERLAY 0
/*
* WORDS_BIGENDIAN:
diff --git a/configh.in b/configh.in
index 8dc34486b..7897dcbfe 100644
--- a/configh.in
+++ b/configh.in
@@ -186,17 +186,6 @@
#undef USE_SDL
-/*
- * HAVE_OVERLAY:
- *
- * Use the X overlay extension? FLTK will try to use an overlay
- * visual for Fl_Overlay_Window, the Gl_Window overlay, and for the
- * menus. Setting this to zero will remove a substantial amount of
- * code from FLTK. Overlays have only been tested on SGI servers!
- */
-
-#define HAVE_OVERLAY 0
-
/*
* HAVE_GL_OVERLAY:
*
@@ -204,7 +193,7 @@
* set this to 1.
*/
-#define HAVE_GL_OVERLAY HAVE_OVERLAY
+#define HAVE_GL_OVERLAY 0
/*
* WORDS_BIGENDIAN:
diff --git a/configure.ac b/configure.ac
index 68ca0a5ab..a758f65f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1207,24 +1207,6 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
AC_DEFINE([HAVE_X11_XREGION_H])
], [], [#include <X11/Xlib.h>])
- dnl Check for overlay visuals...
- AC_PATH_PROG([XPROP], [xprop])
- AC_CACHE_CHECK([for X overlay visuals], [ac_cv_have_overlay], [
- AS_IF([test "x$XPROP" != x], [
- AS_IF([$XPROP -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null], [
- ac_cv_have_overlay=yes
- ], [
- ac_cv_have_overlay=no
- ])
- ], [
- ac_cv_have_overlay=no
- ])
- ])
-
- AS_IF([test x$ac_cv_have_overlay = xyes], [
- AC_DEFINE([HAVE_OVERLAY])
- ])
-
# Make symlinks since UNIX/Linux is case sensitive,
# but Cygwin in general not.
AS_CASE([$host_os], [cygwin*], [
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8b64485a6..3c00f0da9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -144,7 +144,6 @@ set (CPPFILES
fl_open_uri.cxx
fl_oval_box.cxx
fl_overlay.cxx
- fl_overlay_visual.cxx
fl_plastic.cxx
fl_read_image.cxx
fl_rect.cxx
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 0274501b8..a9fe73291 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -283,7 +283,6 @@ menutitle::menutitle(int X, int Y, int W, int H, const Fl_Menu_Item* L) :
clear_border();
set_menu_window();
menu = L;
- if (L->labelcolor_ || Fl::scheme() || L->labeltype_ > FL_NO_LABEL) clear_overlay();
}
menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
@@ -363,7 +362,6 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
}
}
}
- if (m->labelcolor_ || Fl::scheme() || m->labeltype_ > FL_NO_LABEL) clear_overlay();
}
shortcutWidth = hotKeysw;
if (selected >= 0 && !Wp) X -= W/2;
diff --git a/src/Fl_Menu_Window.cxx b/src/Fl_Menu_Window.cxx
index 559dbe533..3bc916cac 100644
--- a/src/Fl_Menu_Window.cxx
+++ b/src/Fl_Menu_Window.cxx
@@ -24,27 +24,6 @@
#include <FL/Fl_Menu_Window.H>
#include "Fl_Window_Driver.H"
-void Fl_Menu_Window::show() {
- Fl_Window_Driver::driver(this)->show_menu();
-}
-
-void Fl_Menu_Window::flush() {
- if (!shown()) return;
- Fl_Window_Driver::driver(this)->flush_menu();
-}
-
-/** Erases the window, does nothing if HAVE_OVERLAY is not defined in config.h */
-void Fl_Menu_Window::erase() {
- Fl_Window_Driver::driver(this)->erase_menu();
-}
-
-// Fix the colormap flashing on Maximum Impact Graphics by erasing the
-// menu before unmapping it:
-void Fl_Menu_Window::hide() {
- erase();
- Fl_Single_Window::hide();
-}
-
/** Destroys the window and all of its children.*/
Fl_Menu_Window::~Fl_Menu_Window() {
hide();
diff --git a/src/Fl_Window_Driver.H b/src/Fl_Window_Driver.H
index aa1a62b9a..048a4281a 100644
--- a/src/Fl_Window_Driver.H
+++ b/src/Fl_Window_Driver.H
@@ -134,8 +134,6 @@ public:
virtual void flush(); // the default implementation may be enough
virtual void flush_double();
virtual void flush_overlay();
- virtual void flush_menu();
- virtual void erase_menu() {}
/** Usable for platform-specific code executed before the platform-independent part of Fl_Window::draw() */
virtual void draw_begin();
/** Usable for platform-specific code executed after the platform-independent part of Fl_Window::draw() */
@@ -148,7 +146,6 @@ public:
virtual void wait_for_expose();
virtual void destroy_double_buffer();
virtual void show();
- virtual void show_menu();
virtual void resize(int X,int Y,int W,int H) {}
virtual void hide() {}
int hide_common();
diff --git a/src/Fl_Window_Driver.cxx b/src/Fl_Window_Driver.cxx
index b9da6e0fd..4df892997 100644
--- a/src/Fl_Window_Driver.cxx
+++ b/src/Fl_Window_Driver.cxx
@@ -72,8 +72,6 @@ unsigned char Fl_Window_Driver::size_range_set() {return pWindow->size_range_set
void Fl_Window_Driver::flush_Fl_Window() { pWindow->Fl_Window::flush(); }
-void Fl_Window_Driver::flush_menu() { pWindow->Fl_Window::flush(); }
-
/**
Draw the window content.
A new driver can add code before or after drawing an individua window.
@@ -92,8 +90,6 @@ void Fl_Window_Driver::make_current() { }
*/
void Fl_Window_Driver::show() { }
-void Fl_Window_Driver::show_menu() { pWindow->Fl_Window::show(); }
-
/**
Change the window title.
A new drive should provide an interface to change the title of the window
diff --git a/src/Makefile b/src/Makefile
index e38040332..0d27e8c61 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -146,7 +146,6 @@ CPPFILES = \
fl_open_uri.cxx \
fl_oval_box.cxx \
fl_overlay.cxx \
- fl_overlay_visual.cxx \
fl_plastic.cxx \
fl_read_image.cxx \
fl_rect.cxx \
@@ -676,7 +675,6 @@ Fl_Image.o: ../FL/mac.H ../FL/win32.H
fl_line_style.o: ../FL/mac.H ../FL/win32.H
Fl_Menu_Window.o: ../FL/mac.H ../FL/win32.H
fl_overlay.o: ../FL/mac.H ../FL/win32.H
-fl_overlay_visual.o: ../FL/mac.H ../FL/win32.H
Fl_Overlay_Window.o: ../FL/mac.H ../FL/win32.H
Fl_own_colormap.o: ../FL/mac.H ../FL/win32.H
Fl_Pixmap.o: ../FL/mac.H ../FL/win32.H
diff --git a/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
index ac7041f19..19b8ffed1 100644
--- a/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
@@ -35,18 +35,11 @@ class Fl_X11_Gl_Window_Driver : public Fl_Gl_Window_Driver {
virtual void before_show(int& need_after);
virtual int mode_(int m, const int *a);
virtual void swap_buffers();
- virtual void resize(int is_a_resize, int w, int h);
virtual char swap_type();
virtual Fl_Gl_Choice *find(int m, const int *alistp);
virtual GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer = 0);
virtual void set_gl_context(Fl_Window* w, GLContext context);
virtual void delete_gl_context(GLContext);
-#if HAVE_GL_OVERLAY
- virtual void make_overlay(void *&o);
- virtual int can_do_overlay();
- virtual void hide_overlay();
- virtual int overlay_color(Fl_Color i);
-#endif
virtual void make_overlay_current();
virtual void redraw_overlay();
virtual void waitGL();
@@ -357,122 +350,13 @@ void Fl_X11_Gl_Window_Driver::delete_gl_context(GLContext context) {
void Fl_X11_Gl_Window_Driver::make_overlay_current() {
-#if HAVE_GL_OVERLAY
- if (overlay() != pWindow) {
- ((Fl_Gl_Window*)overlay())->make_current();
- } else
-#endif
glDrawBuffer(GL_FRONT);
}
void Fl_X11_Gl_Window_Driver::redraw_overlay() {
- if (overlay() != pWindow)
- ((Fl_Gl_Window*)overlay())->redraw();
- else
pWindow->damage(FL_DAMAGE_OVERLAY);
}
-#if HAVE_GL_OVERLAY
-
-// Methods on Fl_Gl_Window_Driver that create an overlay window.
-
-// Under X this is done by creating another window, of class _Fl_Gl_Overlay
-// which is a subclass of Fl_Gl_Window except it uses the overlay planes.
-// A pointer to this is stored in the "overlay" pointer of the Fl_Gl_Window.
-
-// If overlay hardware is unavailable, the overlay is
-// "faked" by drawing into the main layers. This is indicated by
-// setting overlay == this.
-
-extern XVisualInfo *fl_find_overlay_visual();
-extern XVisualInfo *fl_overlay_visual;
-extern Colormap fl_overlay_colormap;
-extern unsigned long fl_transparent_pixel;
-//extern uchar fl_overlay;
-
-int Fl_X11_Gl_Window_Driver::overlay_color(Fl_Color i) {
- if (Fl_Xlib_Graphics_Driver::fl_overlay) {glIndexi(int(fl_xpixel(i))); return 1;}
- return 0;
-}
-
-
-class _Fl_Gl_Overlay : public Fl_Gl_Window {
- void flush();
- void draw();
-public:
- void show();
- _Fl_Gl_Overlay(int x, int y, int w, int h) :
- Fl_Gl_Window(x,y,w,h) {
- set_flag(INACTIVE);
- }
-};
-
-void _Fl_Gl_Overlay::flush() {
- make_current();
-#ifdef BOXX_BUGS
- // The BoXX overlay is broken and you must not call swap-buffers. This
- // code will make it work, but we lose because machines that do support
- // double-buffered overlays will blink when they don't have to
- glDrawBuffer(GL_FRONT);
- draw();
-#else
- draw();
- swap_buffers();
-#endif
- glFlush();
- valid(1);
-}
-
-void _Fl_Gl_Overlay::draw() {
- if (!valid()) glClearIndex((GLfloat)fl_transparent_pixel);
- if (damage() != FL_DAMAGE_EXPOSE) glClear(GL_COLOR_BUFFER_BIT);
- Fl_Gl_Window *w = (Fl_Gl_Window *)parent();
- uchar save_valid = w->valid();
- w->valid(valid());
- Fl_Xlib_Graphics_Driver::fl_overlay = 1;
- Fl_Gl_Window_Driver::driver(w)->draw_overlay();
- Fl_Xlib_Graphics_Driver::fl_overlay = 0;
- valid(w->valid());
- w->valid(save_valid);
-}
-
-void _Fl_Gl_Overlay::show() {
- if (!shown()) {
- fl_background_pixel = int(fl_transparent_pixel);
- Fl_X::make_xid(this, fl_overlay_visual, fl_overlay_colormap);
- fl_background_pixel = -1;
- // find the outermost window to tell wm about the colormap:
- Fl_Window *w = window();
- for (;;) {Fl_Window *w1 = w->window(); if (!w1) break; w = w1;}
- XSetWMColormapWindows(fl_display, fl_xid(w), &(Fl_X::i(this)->xid), 1);
- context(Fl_X11_Gl_Window_Driver::create_gl_context(fl_overlay_visual), 1);
- valid(0);
- }
- Fl_Gl_Window::show();
-}
-
-void Fl_X11_Gl_Window_Driver::hide_overlay() {
- if (overlay() && overlay() != pWindow) ((Fl_Gl_Window*)overlay())->hide();
-}
-
-int Fl_X11_Gl_Window_Driver::can_do_overlay() {
- return fl_find_overlay_visual() != 0;
-}
-
-
-void Fl_X11_Gl_Window_Driver::make_overlay(void *¤t) {
- if (current) return;
- if (can_do_overlay()) {
- _Fl_Gl_Overlay* o = new _Fl_Gl_Overlay(0, 0, pWindow->w(), pWindow->h());
- current = o;
- pWindow->add(*o);
- o->show();
- } else {
- current = pWindow; // fake the overlay
- }
-}
-#endif // HAVE_GL_OVERLAY
-
Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
{
@@ -482,7 +366,6 @@ Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
void Fl_X11_Gl_Window_Driver::before_show(int&) {
Fl_X11_Gl_Choice *g = (Fl_X11_Gl_Choice*)this->g();
Fl_X::make_xid(pWindow, g->vis, g->colormap);
- if (overlay() && overlay() != pWindow) ((Fl_Gl_Window*)overlay())->show();
}
float Fl_X11_Gl_Window_Driver::pixels_per_unit()
@@ -523,12 +406,6 @@ void Fl_X11_Gl_Window_Driver::swap_buffers() {
glXSwapBuffers(fl_display, fl_xid(pWindow));
}
-void Fl_X11_Gl_Window_Driver::resize(int is_a_resize, int W, int H) {
- if (is_a_resize && !pWindow->resizable() && overlay() && overlay() != pWindow) {
- ((Fl_Gl_Window*)overlay())->resize(0,0,W,H);
- }
-}
-
char Fl_X11_Gl_Window_Driver::swap_type() {return copy;}
void Fl_X11_Gl_Window_Driver::waitGL() {
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H
index 098808c72..da25d276e 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.H
+++ b/src/drivers/X11/Fl_X11_Window_Driver.H
@@ -104,12 +104,9 @@ public:
virtual void take_focus();
virtual void flush_double();
virtual void flush_overlay();
- virtual void flush_menu();
- virtual void erase_menu();
virtual void draw_begin();
virtual void make_current();
virtual void show();
- virtual void show_menu();
virtual void resize(int X,int Y,int W,int H);
virtual void label(const char *name, const char *mininame);
virtual void destroy_double_buffer();
@@ -135,8 +132,6 @@ public:
virtual void free_icons();
void set_icons(); // driver-internal support function
virtual void capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_RGB_Image*& left, Fl_RGB_Image*& bottom, Fl_RGB_Image*& right);
- virtual int can_do_overlay();
- virtual void redraw_overlay();
virtual int scroll(int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, void (*draw_area)(void*, int,int,int,int), void* data);
};
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx
index 5dea0fb29..b98bdda99 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx
@@ -35,13 +35,6 @@
#define ShapeBounding 0
#define ShapeSet 0
-#if HAVE_OVERLAY
-extern XVisualInfo *fl_find_overlay_visual();
-extern XVisualInfo *fl_overlay_visual;
-extern Colormap fl_overlay_colormap;
-extern unsigned long fl_transparent_pixel;
-#endif
-
Window fl_window;
#if USE_XDBE
@@ -463,20 +456,6 @@ void Fl_X11_Window_Driver::make_current() {
}
-void Fl_X11_Window_Driver::show_menu()
-{
-#if HAVE_OVERLAY
- if (!shown() && ((Fl_Menu_Window*)pWindow)->overlay() && fl_find_overlay_visual()) {
- XInstallColormap(fl_display, fl_overlay_colormap);
- fl_background_pixel = int(fl_transparent_pixel);
- Fl_X::make_xid(pWindow, fl_overlay_visual, fl_overlay_colormap);
- fl_background_pixel = -1;
- } else
-#endif
- pWindow->Fl_Window::show();
-}
-
-
void Fl_X11_Window_Driver::hide() {
Fl_X* ip = Fl_X::i(pWindow);
if (hide_common()) return;
@@ -570,107 +549,6 @@ void Fl_X11_Window_Driver::show_with_args_end(int argc, char **argv) {
}
}
-
-#if HAVE_OVERLAY
-
-class _Fl_Overlay : public Fl_Window {
- friend class Fl_Overlay_Window;
- void flush();
- void show();
-public:
- _Fl_Overlay(int x, int y, int w, int h) : Fl_Window(x,y,w,h) {
- set_flag(INACTIVE);
- }
-};
-
-/*int Fl_Overlay_Window::can_do_overlay() {
- return fl_find_overlay_visual() != 0;
- }*/
-
-void _Fl_Overlay::show() {
- if (shown()) {Fl_Window::show(); return;}
- fl_background_pixel = int(fl_transparent_pixel);
- Fl_X::make_xid(this, fl_overlay_visual, fl_overlay_colormap);
- fl_background_pixel = -1;
- // find the outermost window to tell wm about the colormap:
- Fl_Window *w = window();
- for (;;) {Fl_Window *w1 = w->window(); if (!w1) break; w = w1;}
- XSetWMColormapWindows(fl_display, fl_xid(w), &(Fl_X::i(this)->xid), 1);
-}
-
-void _Fl_Overlay::flush() {
- fl_window = fl_xid(this);
-#if defined(FLTK_USE_CAIRO)
- if (Fl::cairo_autolink_context()) Fl::cairo_make_current(this); // capture gc changes automatically to update the cairo context adequately
-#endif
- Fl_Xlib_Graphics_Driver::fl_overlay = 1;
- Fl_Overlay_Window *w = (Fl_Overlay_Window *)parent();
- Fl_X *myi = Fl_X::i(this);
- if (damage() != FL_DAMAGE_EXPOSE) XClearWindow(fl_display, fl_xid(this));
- fl_clip_region(myi->region); myi->region = 0;
- w->draw_overlay();
- Fl_Xlib_Graphics_Driver::fl_overlay = 0;
-}
-#endif // HAVE_OVERLAY
-
-
-int Fl_X11_Window_Driver::can_do_overlay() {
-#if HAVE_OVERLAY
- return fl_find_overlay_visual() != 0;
-#endif
- return Fl_Window_Driver::can_do_overlay();
-}
-
-void Fl_X11_Window_Driver::redraw_overlay() {
-#if HAVE_OVERLAY
- if (!fl_display) return; // this prevents fluid -c from opening display
- if (!overlay()) {
- if (can_do_overlay()) {
- Fl_Group::current(pWindow);
- overlay(new _Fl_Overlay(0,0,w(),h()));
- Fl_Group::current(0);
- } else {
- overlay(pWindow); // fake the overlay
- }
- }
- if (shown()) {
- if (overlay() == pWindow) {
- pWindow->clear_damage(pWindow->damage()|FL_DAMAGE_OVERLAY);
- Fl::damage(FL_DAMAGE_CHILD);
- } else if (!overlay()->shown())
- overlay()->show();
- else
- overlay()->redraw();
- }
- return;
-#endif
- Fl_Window_Driver::redraw_overlay();
-}
-
-void Fl_X11_Window_Driver::flush_menu() {
-#if HAVE_OVERLAY
- if (!fl_overlay_visual || !overlay()) {flush_Fl_Window(); return;}
- Fl_X *myi = Fl_X::i(pWindow);
- fl_window = myi->xid;
-# if defined(FLTK_USE_CAIRO)
- // capture gc changes automatically to update the cairo context adequately
- if(Fl::autolink_context()) Fl::cairo_make_current(fl_graphics_driver->gc());
-# endif
- Fl_Xlib_Graphics_Driver::fl_overlay = 1;
- fl_clip_region(myi->region); myi->region = 0; current(pWindow);
- draw();
- Fl_Xlib_Graphics_Driver::fl_overlay = 0;
-#else
- flush_Fl_Window();
-#endif
-}
-
-void Fl_X11_Window_Driver::erase_menu() {
-#if HAVE_OVERLAY
- if (pWindow->shown()) XClearWindow(fl_display, fl_xid(pWindow));
-#endif
-}
-
int Fl_X11_Window_Driver::scroll(int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y,
void (*draw_area)(void*, int,int,int,int), void* data)
{
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx
index 910681702..0e344413d 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx
@@ -93,16 +93,7 @@ static void figure_out_visual() {
}
-# if HAVE_OVERLAY
-/** HAVE_OVERLAY determines whether fl_xmap is one or two planes */
-Fl_XColor fl_xmap[2][256];
-Colormap fl_overlay_colormap;
-XVisualInfo* fl_overlay_visual;
-ulong fl_transparent_pixel;
-# else
-/** HAVE_OVERLAY determines whether fl_xmap is one or two planes */
Fl_XColor fl_xmap[1][256];
-# endif
void Fl_Xlib_Graphics_Driver::color(Fl_Color i) {
if (i & 0xffffff00) {
@@ -204,9 +195,6 @@ ulong fl_xpixel(Fl_Color i) {
# if USE_COLORMAP
Colormap colormap = fl_colormap;
-# if HAVE_OVERLAY
- if (Fl_Xlib_Graphics_Driver::fl_overlay) colormap = fl_overlay_colormap; else
-# endif
if (fl_redmask) {
# endif
// return color for a truecolor visual:
@@ -221,15 +209,8 @@ ulong fl_xpixel(Fl_Color i) {
) >> fl_extrashift;
# if USE_COLORMAP
}
-# if HAVE_OVERLAY
- static XColor* ac[2];
- XColor*& allcolors = ac[Fl_Xlib_Graphics_Driver::fl_overlay];
- static int nc[2];
- int& numcolors = nc[Fl_Xlib_Graphics_Driver::fl_overlay];
-# else
static XColor *allcolors;
static int numcolors;
-# endif
// I don't try to allocate colors with XAllocColor once it fails
// with any color. It is possible that it will work, since a color
@@ -249,9 +230,6 @@ ulong fl_xpixel(Fl_Color i) {
// I only read the colormap once. Again this is due to the slowness
// of round-trips to the X server, even though other programs may alter
// the colormap after this and make decisions here wrong.
-# if HAVE_OVERLAY
- if (Fl_Xlib_Graphics_Driver::fl_overlay) numcolors = fl_overlay_visual->colormap_size; else
-# endif
numcolors = fl_visual->colormap_size;
if (!allcolors) allcolors = new XColor[numcolors];
for (int p = numcolors; p--;) allcolors[p].pixel = p;
@@ -262,9 +240,6 @@ ulong fl_xpixel(Fl_Color i) {
int mindist = 0x7FFFFFFF;
unsigned int bestmatch = 0;
for (unsigned int n = numcolors; n--;) {
-# if HAVE_OVERLAY
- if (Fl_Xlib_Graphics_Driver::fl_overlay && n == fl_transparent_pixel) continue;
-# endif
XColor &a = allcolors[n];
int d, t;
t = int(r)-int(a.red>>8); d = t*t;
@@ -303,17 +278,10 @@ ulong fl_xpixel(Fl_Color i) {
\param[in] overlay 0 for normal, 1 for overlay color
*/
void Fl_Xlib_Graphics_Driver::free_color(Fl_Color i, int overlay) {
-# if HAVE_OVERLAY
-# else
if (overlay) return;
-# endif
if (fl_xmap[overlay][i].mapped) {
# if USE_COLORMAP
-# if HAVE_OVERLAY
- Colormap colormap = overlay ? fl_overlay_colormap : fl_colormap;
-# else
Colormap colormap = fl_colormap;
-# endif
if (fl_xmap[overlay][i].mapped == 1)
XFreeColors(fl_display, colormap, &(fl_xmap[overlay][i].pixel), 1, 0);
# endif
@@ -329,9 +297,6 @@ void Fl_Xlib_Graphics_Driver::free_color(Fl_Color i, int overlay) {
void Fl_Xlib_Graphics_Driver::set_color(Fl_Color i, unsigned c) {
if (fl_cmap[i] != c) {
free_color(i,0);
-# if HAVE_OVERLAY
- free_color(i,1);
-# endif
fl_cmap[i] = c;
}
}
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
index a755d881f..10e0df938 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
@@ -31,15 +31,6 @@
#include <X11/Xft/Xft.h>
#include <X11/Xft/XftCompat.h>
-#define USE_OVERLAY 0
-
-#if USE_OVERLAY
-// Currently Xft does not work with colormapped visuals, so this probably
-// does not work unless you have a true-color overlay.
-extern Colormap fl_overlay_colormap;
-extern XVisualInfo* fl_overlay_visual;
-#endif
-
Fl_XFont_On_Demand fl_xfont = 0;
static void fl_xft_font(Fl_Xlib_Graphics_Driver *driver, Fl_Font fnum, Fl_Fontsize size, int angle);
@@ -50,10 +41,6 @@ static void fl_xft_font(Fl_Xlib_Graphics_Driver *driver, Fl_Font fnum, Fl_Fontsi
XftDraw* Fl_Xlib_Graphics_Driver::draw_ = 0;
Window Fl_Xlib_Graphics_Driver::draw_window = (Window)0;
-#if USE_OVERLAY
-static XftDraw* draw_overlay;
-static Window draw_overlay_window;
-#endif
#if ! USE_PANGO
@@ -794,16 +781,6 @@ void Fl_Xlib_Graphics_Driver::draw_unscaled(const char *str, int n, int x, int y
int y1 = y + floor(offset_y_) ;
if (y1 < clip_min() || y1 > clip_max()) return;
-#if USE_OVERLAY
- XftDraw*& draw_ = fl_overlay ? draw_overlay : ::draw_;
- if (fl_overlay) {
- if (!draw_)
- draw_ = XftDrawCreate(fl_display, draw_overlay_window = fl_window,
- fl_overlay_visual->visual, fl_overlay_colormap);
- else //if (draw_overlay_window != fl_window)
- XftDrawChange(draw_, draw_overlay_window = fl_window);
- } else
-#endif
if (!draw_)
draw_ = XftDrawCreate(fl_display, draw_window = fl_window,
fl_visual->visual, fl_colormap);
@@ -840,16 +817,6 @@ void Fl_Xlib_Graphics_Driver::draw_unscaled(int angle, const char *str, int n, i
}
void Fl_Xlib_Graphics_Driver::drawUCS4(const void *str, int n, int x, int y) {
-#if USE_OVERLAY
- XftDraw*& draw_ = fl_overlay ? draw_overlay : ::draw_;
- if (fl_overlay) {
- if (!draw_)
- draw_ = XftDrawCreate(fl_display, draw_overlay_window = fl_window,
- fl_overlay_visual->visual, fl_overlay_colormap);
- else //if (draw_overlay_window != fl_window)
- XftDrawChange(draw_, draw_overlay_window = fl_window);
- } else
-#endif
if (!draw_)
draw_ = XftDrawCreate(fl_display, draw_window = fl_window,
fl_visual->visual, fl_colormap);
@@ -1022,10 +989,6 @@ Fl_Xlib_Font_Descriptor::~Fl_Xlib_Font_Descriptor() {
void Fl_Xlib_Graphics_Driver::destroy_xft_draw(Window id) {
if (id == draw_window)
XftDrawChange(draw_, draw_window = fl_message_window);
-#if USE_OVERLAY
- if (id == draw_overlay_window)
- XftDrawChange(draw_overlay, draw_overlay_window = fl_message_window);
-#endif
}
void *fl_xftfont = 0; // always 0 under Pango
diff --git a/src/makedepend b/src/makedepend
index 3161fa458..78310c64e 100644
--- a/src/makedepend
+++ b/src/makedepend
@@ -2422,7 +2422,6 @@ fl_overlay.o: ../FL/Fl_Widget.H
fl_overlay.o: ../FL/platform.H
fl_overlay.o: ../FL/platform_types.h
fl_overlay.o: Fl_Screen_Driver.H
-fl_overlay_visual.o: ../config.h
Fl_Overlay_Window.o: ../FL/abi-version.h
Fl_Overlay_Window.o: ../FL/Enumerations.H
Fl_Overlay_Window.o: ../FL/Fl.H
[ Direct Link to Message ] | |