diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-03-24 01:20:08 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-03-24 01:20:08 +0000 |
| commit | 4a31fd7aed27f2429724922f2dc77c83f608c904 (patch) | |
| tree | a5dc238569974398c24b730731eed963c174ab7e /FL | |
| parent | abc12cd376a615af7182b81a435fa2ccb63e4e5d (diff) | |
Provide Fl_Window_Driver accessor methods for public Fl_Window attributes.
These methods are intended to be used instead of pWindow->method()
for better code readability and easier porting of methods from
Fl_Window to Fl_Window_Driver.
New methods: x(), y(), y(), h(), shown(), parent(), border(),
visible(), and visible_r().
We should add more such methods if appropriate.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11414 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Window_Driver.H | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/FL/Fl_Window_Driver.H b/FL/Fl_Window_Driver.H index 416a8c5f6..b6c8d3f01 100644 --- a/FL/Fl_Window_Driver.H +++ b/FL/Fl_Window_Driver.H @@ -25,10 +25,11 @@ #define FL_WINDOW_DRIVER_H #include <FL/Fl_Export.H> +#include <FL/Fl_Window.H> + #include <stdlib.h> -class Fl_Window; class Fl_X; class Fl_Image; class Fl_Shared_Image; @@ -52,6 +53,26 @@ public: virtual ~Fl_Window_Driver(); static Fl_Window_Driver *newWindowDriver(Fl_Window *); + // --- frequently used accessors to public window data + /** returns the x coordinate of the window. */ + int x() const { return pWindow->x(); } + /** returns the y coordinate of the window. */ + int y() const { return pWindow->y(); } + /** returns the width of the window. */ + int w() const { return pWindow->w(); } + /** returns the width of the window. */ + int h() const { return pWindow->h(); } + /** returns whether the window has a border. */ + int border() const { return pWindow->border(); } + /** returns whether the window itself is visible(). */ + int visible() const { return pWindow->visible(); } + /** returns whether the window and all its parents is visible(). */ + int visible_r() const { return pWindow->visible_r(); } + /** returns whether the window is shown(). */ + int shown() const { return pWindow->shown(); } + /** returns the parent of the window. */ + Fl_Group *parent() const { return pWindow->parent(); } + // --- accessors to private window data int minw(); int minh(); |
