Fl_Overlay_Window.H 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // "$Id: Fl_Overlay_Window.H 9637 2012-07-24 04:37:22Z matt $"
  3. //
  4. // Overlay window header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2010 by Bill Spitzak and others.
  7. //
  8. // This library is free software. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. /* \file
  19. Fl_Overlay_Window class . */
  20. #ifndef Fl_Overlay_Window_H
  21. #define Fl_Overlay_Window_H
  22. #include "Fl_Double_Window.H"
  23. /**
  24. This window provides double buffering and also the ability to draw the
  25. "overlay" which is another picture placed on top of the main image. The
  26. overlay is designed to be a rapidly-changing but simple graphic such as
  27. a mouse selection box. Fl_Overlay_Window uses the overlay
  28. planes provided by your graphics hardware if they are available.
  29. <P>If no hardware support is found the overlay is simulated by drawing
  30. directly into the on-screen copy of the double-buffered window, and
  31. "erased" by copying the backbuffer over it again. This means the
  32. overlay will blink if you change the image in the window.
  33. */
  34. class FL_EXPORT Fl_Overlay_Window : public Fl_Double_Window {
  35. #ifndef FL_DOXYGEN
  36. friend class _Fl_Overlay;
  37. #endif
  38. protected:
  39. /**
  40. You must subclass Fl_Overlay_Window and provide this method.
  41. It is just like a draw() method, except it draws the overlay.
  42. The overlay will have already been "cleared" when this is called. You
  43. can use any of the routines described in &lt;FL/fl_draw.H&gt;.
  44. */
  45. virtual void draw_overlay() = 0;
  46. private:
  47. Fl_Window *overlay_;
  48. public:
  49. void show();
  50. void flush();
  51. void hide();
  52. void resize(int,int,int,int);
  53. ~Fl_Overlay_Window();
  54. /** Returns non-zero if there's hardware overlay support */
  55. int can_do_overlay();
  56. void redraw_overlay();
  57. protected:
  58. /**
  59. See Fl_Overlay_Window::Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0)
  60. */
  61. Fl_Overlay_Window(int W, int H, const char *l=0);
  62. /**
  63. Creates a new Fl_Overlay_Window widget using the given
  64. position, size, and label (title) string. If the
  65. positions (x,y) are not given, then the window manager
  66. will choose them.
  67. */
  68. Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0);
  69. public:
  70. void show(int a, char **b) {Fl_Double_Window::show(a,b);}
  71. DECLARE_CLASS_CHEAP_RTTI_2(Fl_Overlay_Window, Fl_Double_Window)
  72. };
  73. #endif
  74. //
  75. // End of "$Id: Fl_Overlay_Window.H 9637 2012-07-24 04:37:22Z matt $".
  76. //