diff options
| author | Manolo Gouy <Manolo> | 2016-02-26 12:51:47 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-26 12:51:47 +0000 |
| commit | 682f95079691dd9c9b0677cb66e727397f910e0d (patch) | |
| tree | 9be00996ebe41d8d87fb1965ceff4f6f69b41310 /FL/Fl_Widget_Surface.H | |
| parent | e1f5f5f7ec75ed203fb14571e6bcbf6b0bd30771 (diff) | |
Create class Fl_Widget_Surface that supports draw(Fl_Widget *, int, int).
This simplifies the implementation of Fl_Copy_Surface and Fl_Image_Surface
which now are made to derive from Fl_Widget_Surface.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11220 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Widget_Surface.H')
| -rw-r--r-- | FL/Fl_Widget_Surface.H | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/FL/Fl_Widget_Surface.H b/FL/Fl_Widget_Surface.H new file mode 100644 index 000000000..c123db560 --- /dev/null +++ b/FL/Fl_Widget_Surface.H @@ -0,0 +1,61 @@ +// +// "$Id: Fl_Widget_Surface.H 11217 2016-02-25 17:56:48Z manolo $" +// +// Drivers code for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2016 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// http://www.fltk.org/COPYING.php +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// + +#ifndef Fl_Widget_Surface_h +#define Fl_Widget_Surface_h + +#include <FL/Fl_Device.H> +#include <FL/Fl_Window.H> + +/** A surface on which any FLTK widget can be drawn. + */ +class FL_EXPORT Fl_Widget_Surface : public Fl_Surface_Device { +private: + void traverse(Fl_Widget *widget); // finds subwindows of widget and prints them +protected: + /** \brief horizontal offset to the origin of graphics coordinates */ + int x_offset; + /** \brief vertical offset to the origin of graphics coordinates */ + int y_offset; +public: + Fl_Widget_Surface(Fl_Graphics_Driver *d); + /** + Translates the current graphics origin accounting for the current rotation. + + This function is only useful after a rotate() call. + Each translate() call must be matched by an untranslate() call. + Successive translate() calls add up their effects. + */ + virtual void translate(int x, int y) {} + /** + Undoes the effect of a previous translate() call. + */ + virtual void untranslate(void) {} + virtual void draw(Fl_Widget* widget, int delta_x = 0, int delta_y = 0); + virtual void draw_decorated_window(Fl_Window *win, int x_offset = 0, int y_offset = 0); + virtual void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x = 0, int delta_y = 0); + virtual int printable_rect(int *w, int *h); + virtual void origin(int x, int y); + virtual void origin(int *x, int *y); +}; + +#endif /* Fl_Widget_Surface_h */ + +// +// End of "$Id: Fl_Widget_Surface.H 11217 2016-02-25 17:56:48Z manolo $". +// |
