mirror of https://github.com/fltk/fltk
Replace static protected bool Fl_Window_Driver::is_a_rescale by a private static variable and a public getter.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12364 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
879c4df5bd
commit
c88466928d
|
@ -44,16 +44,14 @@ class FL_EXPORT Fl_Window_Driver
|
|||
{
|
||||
friend class Fl_Window;
|
||||
friend class Fl_X;
|
||||
friend class Fl_Group;
|
||||
friend class Fl_Gl_Window;
|
||||
friend class Fl_Double_Window;
|
||||
private:
|
||||
static bool is_a_rescale_; // true when a top-level window is being rescaled
|
||||
|
||||
protected:
|
||||
Fl_Window *pWindow;
|
||||
struct shape_data_type;
|
||||
shape_data_type *shape_data_; ///< non-null means the window has a non-rectangular shape
|
||||
void flush_Fl_Window(); // accessor to protected Fl_Window::flush()
|
||||
static bool is_a_rescale; // true when the window is rescaling
|
||||
public:
|
||||
Fl_Window_Driver(Fl_Window *);
|
||||
virtual ~Fl_Window_Driver();
|
||||
|
@ -62,6 +60,8 @@ public:
|
|||
Fl_Offscreen other_xid; // offscreen bitmap (overlay and double-buffered windows)
|
||||
virtual int screen_num();
|
||||
virtual void screen_num(int) {}
|
||||
static bool is_a_rescale() {return is_a_rescale_;};
|
||||
|
||||
|
||||
// --- frequently used accessors to public window data
|
||||
/** returns the x coordinate of the window. */
|
||||
|
|
|
@ -55,7 +55,7 @@ void Fl_Double_Window::resize(int X,int Y,int W,int H) {
|
|||
int oh = h();
|
||||
Fl_Window::resize(X,Y,W,H);
|
||||
Fl_X *myi = Fl_X::i(this);
|
||||
if (myi && driver()->other_xid && (ow < w() || oh < h() || Fl_Window_Driver::is_a_rescale))
|
||||
if (myi && driver()->other_xid && (ow < w() || oh < h() || Fl_Window_Driver::is_a_rescale()))
|
||||
driver()->destroy_double_buffer();
|
||||
}
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) {
|
|||
// printf("Fl_Gl_Window::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H);
|
||||
// printf("current: x()=%d, y()=%d, w()=%d, h()=%d\n", x(), y(), w(), h());
|
||||
|
||||
int is_a_resize = (W != Fl_Widget::w() || H != Fl_Widget::h() || Fl_Window_Driver::is_a_rescale);
|
||||
int is_a_resize = (W != Fl_Widget::w() || H != Fl_Widget::h() || Fl_Window_Driver::is_a_rescale());
|
||||
if (is_a_resize) valid(0);
|
||||
pGlWindowDriver->resize(is_a_resize, W, H);
|
||||
Fl_Window::resize(X,Y,W,H);
|
||||
|
|
|
@ -700,7 +700,7 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
|
|||
|
||||
Fl_Widget::resize(X,Y,W,H); // make new xywh values visible for children
|
||||
|
||||
if ((!resizable() || (dw==0 && dh==0 )) && !Fl_Window_Driver::is_a_rescale) {
|
||||
if ((!resizable() || (dw==0 && dh==0 )) && !Fl_Window_Driver::is_a_rescale()) {
|
||||
|
||||
if (!as_window()) {
|
||||
Fl_Widget*const* a = array();
|
||||
|
|
|
@ -257,7 +257,7 @@ int Fl_Window_Driver::screen_num() {
|
|||
return Fl::screen_num(x(), y(), w(), h());
|
||||
}
|
||||
|
||||
bool Fl_Window_Driver::is_a_rescale = false;
|
||||
bool Fl_Window_Driver::is_a_rescale_ = false;
|
||||
|
||||
void Fl_Window_Driver::resize_after_scale_change(int ns, float old_f, float new_f) {
|
||||
screen_num(ns);
|
||||
|
@ -268,10 +268,10 @@ void Fl_Window_Driver::resize_after_scale_change(int ns, float old_f, float new_
|
|||
} else {
|
||||
W = pWindow->w(); H = pWindow->h();
|
||||
}
|
||||
is_a_rescale = true;
|
||||
is_a_rescale_ = true;
|
||||
size_range();
|
||||
pWindow->resize(pWindow->x()*old_f/new_f, pWindow->y()*old_f/new_f, W, H);
|
||||
is_a_rescale = false;
|
||||
is_a_rescale_ = false;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -1682,10 +1682,10 @@ int Fl_WinAPI_Window_Driver::fake_X_wm(int &X,int &Y, int &bt,int &bx, int &by)
|
|||
void Fl_WinAPI_Window_Driver::resize(int X,int Y,int W,int H) {
|
||||
UINT flags = SWP_NOSENDCHANGING | SWP_NOZORDER
|
||||
| SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
||||
int is_a_resize = (W != w() || H != h() || is_a_rescale);
|
||||
int is_a_resize = (W != w() || H != h() || is_a_rescale());
|
||||
int resize_from_program = (pWindow != resize_bug_fix);
|
||||
if (!resize_from_program) resize_bug_fix = 0;
|
||||
if (X != x() || Y != y() || is_a_rescale) {
|
||||
if (X != x() || Y != y() || is_a_rescale()) {
|
||||
force_position(1);
|
||||
} else {
|
||||
if (!is_a_resize) return;
|
||||
|
|
|
@ -2106,8 +2106,8 @@ fprintf(stderr,"\n");*/
|
|||
////////////////////////////////////////////////////////////////
|
||||
|
||||
void Fl_X11_Window_Driver::resize(int X,int Y,int W,int H) {
|
||||
int is_a_move = (X != x() || Y != y() || is_a_rescale);
|
||||
int is_a_resize = (W != w() || H != h() || is_a_rescale);
|
||||
int is_a_move = (X != x() || Y != y() || is_a_rescale());
|
||||
int is_a_resize = (W != w() || H != h() || is_a_rescale());
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue