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..ca395157a 100644 --- a/configh.cmake.in +++ b/configh.cmake.in @@ -186,25 +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: - * - * It is possible your GL has an overlay even if X does not. If so, - * set this to 1. - */ - -#define HAVE_GL_OVERLAY HAVE_OVERLAY /* * WORDS_BIGENDIAN: diff --git a/configh.in b/configh.in index 8dc34486b..0894117a0 100644 --- a/configh.in +++ b/configh.in @@ -186,26 +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: - * - * It is possible your GL has an overlay even if X does not. If so, - * set this to 1. - */ - -#define HAVE_GL_OVERLAY HAVE_OVERLAY - /* * 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 ]) - 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_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 06253bfd4..e637d7efe 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -162,7 +162,6 @@ void Fl_Gl_Window::swap_buffers() { void Fl_Gl_Window::flush() { if (!shown()) return; uchar save_valid = valid_f_ & 1; - if (pGlWindowDriver->flush_begin(valid_f_) ) return; make_current(); if (mode_ & FL_DOUBLE) { diff --git a/src/Fl_Gl_Window_Driver.H b/src/Fl_Gl_Window_Driver.H index ae2c66ff2..9d14d2222 100644 --- a/src/Fl_Gl_Window_Driver.H +++ b/src/Fl_Gl_Window_Driver.H @@ -67,7 +67,6 @@ public: virtual void swap_buffers() {} virtual void resize(int is_a_resize, int w, int h) {} virtual char swap_type(); - virtual int flush_begin(char& valid_f) {return 0;} virtual void gl_hide_before(void *& overlay) {} // the default implementation may be enough static Fl_Gl_Choice *find_begin(int m, const int *alistp); static void add_context(GLContext ctx); @@ -93,7 +92,6 @@ public: static void draw_string_legacy_glut(const char* str, int n); // support for gl_draw() virtual void get_list(Fl_Font_Descriptor* fd, int r) {} // support for gl_draw() without textures virtual void gl_bitmap_font(Fl_Font_Descriptor *fl_fontsize) {} // support for gl_font() without textures - virtual int overlay_color(Fl_Color i) {return 0;} // support for gl_color() with HAVE_GL_OVERLAY static void draw_string_with_texture(const char* str, int n); // cross-platform // support for gl_draw(). The cross-platform version may be enough. virtual char *alpha_mask_for_string(const char *str, int n, int w, int h, Fl_Fontsize fs); 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 #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/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx index 54810cabf..3232196ba 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx @@ -31,28 +31,6 @@ // Implementation of fl_color(i), fl_color(r,g,b). void Fl_OpenGL_Graphics_Driver::color(Fl_Color i) { - // FIXME: do we need the code below? - /* -#if HAVE_GL_OVERLAY -#if defined(_WIN32) - if (fl_overlay && fl_overlay_depth) { - if (fl_overlay_depth < 8) { - // only black & white produce the expected colors. This could - // be improved by fixing the colormap set in Fl_Gl_Overlay.cxx - int size = 1<= size-2) glIndexi(size-1); - else glIndexi(i); - } else { - glIndexi(i ? i : FL_GRAY_RAMP); - } - return; - } -#else - if (fl_overlay) {glIndexi(int(fl_xpixel(i))); return;} -#endif -#endif -*/ if (i & 0xffffff00) { unsigned rgb = (unsigned)i; color((uchar)(rgb >> 24), (uchar)(rgb >> 16), (uchar)(rgb >> 8)); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx index 1dbc9f77d..b4947d337 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx @@ -44,7 +44,6 @@ class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver { virtual void make_current_after(); virtual void swap_buffers(); virtual void invalidate() {} - virtual int flush_begin(char& valid_f); 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); @@ -56,12 +55,6 @@ class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver { virtual void gl_bitmap_font(Fl_Font_Descriptor *fl_fontsize); virtual void get_list(Fl_Font_Descriptor *fd, int r); virtual int genlistsize(); -#if HAVE_GL_OVERLAY - virtual void gl_hide_before(void *& overlay); - virtual int can_do_overlay(); - virtual int overlay_color(Fl_Color i); - void make_overlay(void*&overlay); -#endif }; // Describes crap needed to create a GLContext. @@ -194,13 +187,6 @@ void Fl_WinAPI_Gl_Window_Driver::delete_gl_context(GLContext context) { void Fl_WinAPI_Gl_Window_Driver::make_overlay_current() { -#if HAVE_GL_OVERLAY - if (overlay() != this) { - set_gl_context(pWindow, (GLContext)overlay()); - // if (fl_overlay_depth) - // wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE); - } else -#endif glDrawBuffer(GL_FRONT); } @@ -208,89 +194,6 @@ void Fl_WinAPI_Gl_Window_Driver::redraw_overlay() { pWindow->damage(FL_DAMAGE_OVERLAY); } -#if HAVE_GL_OVERLAY - -// Methods on Fl_Gl_Window_driver that create an overlay window. - -// Under win32 another GLX context is created to draw into the overlay -// and it is stored in the "overlay" pointer. - -// If overlay hardware is unavailable, the overlay is -// "faked" by drawing into the main layers. This is indicated by -// setting overlay == this. - -//static COLORREF *palette; -static int fl_overlay_depth = 0; - -void Fl_WinAPI_Gl_Window_Driver::gl_hide_before(void *& overlay) { - if (overlay && overlay != pWindow) { - delete_gl_context((GLContext)overlay); - overlay = 0; - } -} - -void Fl_WinAPI_Gl_Window_Driver::make_overlay(void*&overlay) { - if (overlay) return; - - GLContext context = create_gl_context(pWindow, g(), 1); - if (!context) {overlay = pWindow; return;} // fake the overlay - - HDC hdc = Fl_WinAPI_Window_Driver::driver(pWindow)->private_dc; - overlay = context; - LAYERPLANEDESCRIPTOR pfd; - wglDescribeLayerPlane(hdc, g()->pixelformat, 1, sizeof(pfd), &pfd); - if (!pfd.iPixelType) { - ; // full-color overlay - } else { - fl_overlay_depth = pfd.cColorBits; // used by gl_color() - if (fl_overlay_depth > 8) fl_overlay_depth = 8; - COLORREF palette[256]; - int n = (1<valid(0); - return; -} - -int Fl_WinAPI_Gl_Window_Driver::can_do_overlay() { - if (!g()) { - g( find(mode(), alist()) ); - if (!g()) return 0; - } - return (g()->pfd.bReserved & 15) != 0; -} - -int Fl_WinAPI_Gl_Window_Driver::overlay_color(Fl_Color i) { - if (Fl_Xlib_Graphics_Driver::fl_overlay && fl_overlay_depth) { - if (fl_overlay_depth < 8) { - // only black & white produce the expected colors. This could - // be improved by fixing the colormap set in Fl_Gl_Overlay.cxx - int size = 1<= size-2) glIndexi(size-1); - else glIndexi(i); - } else { - glIndexi(i ? i : FL_GRAY_RAMP); - } - return 1; - } - return 0; -} - -#endif // HAVE_GL_OVERLAY - Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w) { @@ -330,45 +233,11 @@ void Fl_WinAPI_Gl_Window_Driver::make_current_after() { #endif // USE_COLORMAP } -//#define HAVE_GL_OVERLAY 1 //test only void Fl_WinAPI_Gl_Window_Driver::swap_buffers() { -# if HAVE_GL_OVERLAY - // Do not swap the overlay, to match GLX: - BOOL ret = wglSwapLayerBuffers(Fl_WinAPI_Window_Driver::driver(pWindow)->private_dc, WGL_SWAP_MAIN_PLANE); - DWORD err = GetLastError(); -# else SwapBuffers(Fl_WinAPI_Window_Driver::driver(pWindow)->private_dc); -# endif } -#if HAVE_GL_OVERLAY -#endif - -int Fl_WinAPI_Gl_Window_Driver::flush_begin(char& valid_f_) { -#if HAVE_GL_OVERLAY - char save_valid_f = valid_f_; - // Draw into hardware overlay planes if they are damaged: - if (overlay() && overlay() != pWindow - && (pWindow->damage()&(FL_DAMAGE_OVERLAY|FL_DAMAGE_EXPOSE) || !save_valid_f & 1)) { - set_gl_context(pWindow, (GLContext)overlay()); - if (fl_overlay_depth) - wglRealizeLayerPalette(Fl_WinAPI_Window_Driver::driver(pWindow)->private_dc, 1, TRUE); - glDisable(GL_SCISSOR_TEST); - glClear(GL_COLOR_BUFFER_BIT); - Fl_Xlib_Graphics_Driver::fl_overlay = 1; - draw_overlay(); - Fl_Xlib_Graphics_Driver::fl_overlay = 0; - valid_f_ = save_valid_f; - wglSwapLayerBuffers(Fl_WinAPI_Window_Driver::driver(pWindow)->private_dc, WGL_SWAP_OVERLAY1); - // if only the overlay was damaged we are done, leave main layer alone: - if (pWindow->damage() == FL_DAMAGE_OVERLAY) { - return 1; - } - } -#endif - return 0; -} void* Fl_WinAPI_Gl_Window_Driver::GetProcAddress(const char *procName) { return (void*)wglGetProcAddress((LPCSTR)procName); 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 #include -#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/gl_draw.cxx b/src/gl_draw.cxx index 1ec4798bf..86aae542e 100644 --- a/src/gl_draw.cxx +++ b/src/gl_draw.cxx @@ -233,7 +233,6 @@ void gl_draw_image(const uchar* b, int x, int y, int w, int h, int d, int ld) { right if the window uses the default colormap! */ void gl_color(Fl_Color i) { - if (Fl_Gl_Window_Driver::global()->overlay_color(i)) return; uchar red, green, blue; Fl::get_color(i, red, green, blue); glColor3ub(red, green, blue); 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