Fl_Widget_Surface.H 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // "$Id: Fl_Widget_Surface.H 12196 2017-03-13 23:31:38Z AlbrechtS $"
  3. //
  4. // Drivers code for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2016 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. #ifndef Fl_Widget_Surface_h
  19. #define Fl_Widget_Surface_h
  20. #include <FL/Fl_Device.H>
  21. #include <FL/Fl_Window.H>
  22. /** A surface on which any FLTK widget can be drawn.
  23. */
  24. class FL_EXPORT Fl_Widget_Surface : public Fl_Surface_Device {
  25. private:
  26. void traverse(Fl_Widget *widget); // finds subwindows of widget and prints them
  27. protected:
  28. /** \brief horizontal offset to the origin of graphics coordinates */
  29. int x_offset;
  30. /** \brief vertical offset to the origin of graphics coordinates */
  31. int y_offset;
  32. Fl_Widget_Surface(Fl_Graphics_Driver *d);
  33. public:
  34. /**
  35. Translates the current graphics origin accounting for the current rotation.
  36. Each translate() call must be matched by an untranslate() call.
  37. Successive translate() calls add up their effects.
  38. */
  39. virtual void translate(int x, int y);
  40. /**
  41. Undoes the effect of a previous translate() call.
  42. */
  43. virtual void untranslate(void) {}
  44. void draw(Fl_Widget* widget, int delta_x = 0, int delta_y = 0);
  45. virtual void draw_decorated_window(Fl_Window *win, int x_offset = 0, int y_offset = 0);
  46. virtual void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x = 0, int delta_y = 0);
  47. virtual int printable_rect(int *w, int *h);
  48. virtual void origin(int x, int y);
  49. virtual void origin(int *x, int *y);
  50. };
  51. #endif /* Fl_Widget_Surface_h */
  52. //
  53. // End of "$Id: Fl_Widget_Surface.H 12196 2017-03-13 23:31:38Z AlbrechtS $".
  54. //