From 4a31fd7aed27f2429724922f2dc77c83f608c904 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 24 Mar 2016 01:20:08 +0000 Subject: 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 --- FL/Fl_Window_Driver.H | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'FL') 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 +#include + #include -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(); -- cgit v1.2.3