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 /src/Fl_x.cxx | |
| 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 'src/Fl_x.cxx')
| -rw-r--r-- | src/Fl_x.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index d73a22dba..26a399f1f 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2125,26 +2125,26 @@ fprintf(stderr,"\n");*/ //////////////////////////////////////////////////////////////// void Fl_X11_Window_Driver::resize(int X,int Y,int W,int H) { - int is_a_move = (X != pWindow->x() || Y != pWindow->y()); - int is_a_resize = (W != pWindow->w() || H != pWindow->h()); + int is_a_move = (X != x() || Y != y()); + int is_a_resize = (W != w() || H != h()); int resize_from_program = (pWindow != resize_bug_fix); if (!resize_from_program) resize_bug_fix = 0; if (is_a_move && resize_from_program) force_position(1); else if (!is_a_resize && !is_a_move) return; if (is_a_resize) { pWindow->Fl_Group::resize(X,Y,W,H); - if (pWindow->shown()) {pWindow->redraw();} + if (shown()) {pWindow->redraw();} } else { x(X); y(Y); } if (resize_from_program && is_a_resize && !pWindow->resizable()) { - pWindow->size_range(pWindow->w(), pWindow->h(), pWindow->w(), pWindow->h()); + pWindow->size_range(w(), h(), w(), h()); } - if (resize_from_program && pWindow->shown()) { + if (resize_from_program && shown()) { if (is_a_resize) { - if (!pWindow->resizable()) pWindow->size_range(pWindow->w(), pWindow->h(), pWindow->w(), pWindow->h()); + if (!pWindow->resizable()) pWindow->size_range(w(), h(), w(), h()); if (is_a_move) { XMoveResizeWindow(fl_display, fl_xid(pWindow), X, Y, W>0 ? W : 1, H>0 ? H : 1); } else { @@ -2255,7 +2255,7 @@ void Fl_X11_Window_Driver::fullscreen_on() { right = fullscreen_screen_right(); if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { - top = Fl::screen_num(pWindow->x(), pWindow->y(), pWindow->w(), pWindow->h()); + top = Fl::screen_num(x(), y(), w(), h()); bottom = top; left = top; right = top; @@ -2867,7 +2867,7 @@ const char *fl_filename_name(const char *name) { } void Fl_X11_Window_Driver::label(const char *name, const char *iname) { - if (pWindow->shown() && !pWindow->parent()) { + if (shown() && !parent()) { if (!name) name = ""; int namelen = strlen(name); if (!iname) iname = fl_filename_name(name); @@ -2896,7 +2896,7 @@ void Fl_X11_Window_Driver::label(const char *name, const char *iname) { static inline int can_boxcheat(uchar b) {return (b==1 || ((b&2) && b<=15));} void Fl_X11_Window_Driver::show() { - if (!pWindow->shown()) { + if (!shown()) { fl_open_display(); // Don't set background pixel for double-buffered windows... if (pWindow->type() != FL_DOUBLE_WINDOW && can_boxcheat(pWindow->box())) { |
