Tweak themes for more color consistency.
[ntk.git] / src / Fl_Overlay_Window.cxx
bloba19ea6576d9ecae8586e5a56c09eb1c3b04d617f
1 //
2 // "$Id: Fl_Overlay_Window.cxx 8198 2011-01-06 10:24:58Z manolo $"
3 //
4 // Overlay window code for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 by Bill Spitzak and others.
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 // USA.
23 // Please report all bugs and problems on the following page:
25 // http://www.fltk.org/str.php
28 /** \fn virtual void Fl_Overlay_Window::draw_overlay() = 0
29 You must subclass Fl_Overlay_Window and provide this method.
30 It is just like a draw() method, except it draws the overlay.
31 The overlay will have already been "cleared" when this is called. You
32 can use any of the routines described in <FL/fl_draw.H>.
35 // A window using double-buffering and able to draw an overlay
36 // on top of that. Uses the hardware to draw the overlay if
37 // possible, otherwise it just draws in the front buffer.
39 #include <config.h>
40 #include <FL/Fl.H>
41 #include <FL/Fl_Overlay_Window.H>
42 #include <FL/fl_draw.H>
43 #include <FL/x.H>
45 void Fl_Overlay_Window::flush() {
46 #ifdef BOXX_BUGS
47 if (overlay_ && overlay_ != this && overlay_->shown()) {
48 // all drawing to windows hidden by overlay windows is ignored, fix this
49 XUnmapWindow(fl_display, fl_xid(overlay_));
50 Fl_Double_Window::flush(0);
51 XMapWindow(fl_display, fl_xid(overlay_));
52 return;
54 #endif
55 int erase_overlay = (damage()&FL_DAMAGE_OVERLAY);
56 clear_damage(damage()&~FL_DAMAGE_OVERLAY);
57 Fl_Double_Window::flush(erase_overlay);
58 Fl_X* myi = Fl_X::i(this);
59 draw_overlay();
62 /**
63 Destroys the window and all child widgets.
65 Fl_Overlay_Window::~Fl_Overlay_Window() {
66 hide();
67 // delete overlay; this is done by ~Fl_Group
70 int Fl_Overlay_Window::can_do_overlay() {return 0;}
72 /**
73 Call this to indicate that the overlay data has changed and needs to
74 be redrawn. The overlay will be clear until the first time this is
75 called, so if you want an initial display you must call this after
76 calling show().
78 void Fl_Overlay_Window::redraw_overlay() {
79 clear_damage(damage()|FL_DAMAGE_OVERLAY);
80 Fl::damage(FL_DAMAGE_CHILD);
85 // End of "$Id: Fl_Overlay_Window.cxx 8198 2011-01-06 10:24:58Z manolo $".