Fix for "Rename Fl_X* Fl_Window::i private class member" (#223)

This commit is contained in:
ManoloFLTK 2023-01-13 21:16:17 +01:00
parent dd6b9b90ee
commit f3e21ddad2
20 changed files with 78 additions and 74 deletions

View File

@ -72,7 +72,7 @@ private:
// TODO: it would make sense to merge the use of Fl_X and Fl_Window_Driver, maybe simply by
// TODO: deriving Fl_Window_Driver from Fl_X. However, there are a lot of historic kludges
// TODO: for some platforms around Fl_X.
Fl_X *i; // points at the system-specific stuff, but exists only after the window is mapped
Fl_X *flx_; // points at the system-specific stuff, but exists only after the window is mapped
Fl_Window_Driver *pWindowDriver; // points at the system-specific stuff at window creation time
const char* iconlabel_;
@ -400,7 +400,7 @@ public:
). You can tell if a window is iconified with (w->shown()
&& !w->visible()).
*/
int shown() {return i != 0;}
int shown() {return flx_ != 0;}
/**
Puts the window on the screen. Usually (on X) this has the side
effect of opening the display.

View File

@ -57,14 +57,15 @@ public:
Fl_X *next;
// static variables, static functions and member functions
static Fl_X* first;
static Fl_X* i(const Fl_Window* w) {return w ? (Fl_X*)w->i : 0;}
static Fl_X* flx(const Fl_Window* w) {return w ? (Fl_X*)w->flx_ : 0;}
# if defined(FLTK_USE_X11) && FLTK_USE_X11 // for backward compatibility
static void make_xid(Fl_Window*, XVisualInfo* =fl_visual, Colormap=fl_colormap);
static Fl_X* set_xid(Fl_Window*, Window);
static inline Fl_X* i(const Fl_Window* w) {return flx(w);}
# endif
};
inline Window fl_xid(const Fl_Window* w) { Fl_X *xTemp = Fl_X::i(w); return xTemp ? (Window)xTemp->xid : 0; }
inline Window fl_xid(const Fl_Window* w) { Fl_X *xTemp = Fl_X::flx(w); return xTemp ? (Window)xTemp->xid : 0; }
#else
extern FL_EXPORT Window fl_xid_(const Fl_Window* w);
# define fl_xid(w) fl_xid_(w)

View File

@ -331,7 +331,7 @@ in here.
\par
The X region that is a combination of all \c damage()
calls done so far is in <tt>Fl_X::i(this)->region</tt>. If
calls done so far is in <tt>Fl_X::flx(this)->region</tt>. If
\c NULL then you should redraw the entire window. The
undocumented function \c fl_clip_region(XRegion) will
initialize the FLTK clip stack with a region or \c NULL
@ -348,13 +348,16 @@ undamaged image (such as a backing buffer) around.
Here is a sample where an undamaged image is kept somewhere:
\code
void MyWindow::flush() {
fl_clip_region(Fl_X::i(this)->region);
Fl_X::i(this)->region = 0;
fl_clip_region(Fl_X::flx(this)->region);
Fl_X::flx(this)->region = 0;
if (damage() != 2) {... draw things into backing store ...}
... copy backing store to window ...
}
\endcode
\note For compatibility with FLTK versions before 1.4, member function
\c Fl_X::flx(Fl_Window*) can also be written \c Fl_X::i(Fl_Window*).
virtual void Fl_Window::hide()
\par

View File

@ -719,7 +719,7 @@ Fl_Window* Fl::first_window() {
\param[in] window must be shown and not NULL
*/
Fl_Window* Fl::next_window(const Fl_Window* window) {
Fl_X* i = window ? Fl_X::i(window) : 0;
Fl_X* i = window ? Fl_X::flx(window) : 0;
if (!i) {
Fl::error("Fl::next_window() failed: window (%p) not shown.", window);
return 0;
@ -738,7 +738,7 @@ Fl_Window* Fl::next_window(const Fl_Window* window) {
*/
void Fl::first_window(Fl_Window* window) {
if (!window || !window->shown()) return;
Fl_Window_Driver::find( Fl_X::i(window)->xid );
Fl_Window_Driver::find( Fl_X::flx(window)->xid );
}
/**
@ -1616,7 +1616,7 @@ void Fl_Widget::damage(uchar fl) {
damage(fl, x(), y(), w(), h());
} else {
// damage entire window by deleting the region:
Fl_X* i = Fl_X::i((Fl_Window*)this);
Fl_X* i = Fl_X::flx((Fl_Window*)this);
if (!i) return; // window not mapped, so ignore it
if (i->region) {
fl_graphics_driver->XDestroyRegion(i->region);
@ -1636,7 +1636,7 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
if (!wi) return;
fl = FL_DAMAGE_CHILD;
}
Fl_X* i = Fl_X::i((Fl_Window*)wi);
Fl_X* i = Fl_X::flx((Fl_Window*)wi);
if (!i) return; // window not mapped, so ignore it
// clip the damage to the window and quit if none:
@ -2156,7 +2156,7 @@ FL_EXPORT bool fl_disable_wayland = true;
#endif // FL_DOXYGEN
FL_EXPORT Window fl_xid_(const Fl_Window *w) {
Fl_X *temp = Fl_X::i(w);
Fl_X *temp = Fl_X::flx(w);
return temp ? (Window)temp->xid : 0;
}
/** \addtogroup group_macosx

View File

@ -51,14 +51,14 @@ void Fl_Double_Window::resize(int X,int Y,int W,int H) {
int ow = w();
int oh = h();
Fl_Window::resize(X,Y,W,H);
Fl_X *myi = Fl_X::i(this);
Fl_X *myi = Fl_X::flx(this);
if (myi && Fl_Window_Driver::driver(this)->other_xid && (ow < w() || oh < h() || is_a_rescale()))
Fl_Window_Driver::driver(this)->destroy_double_buffer();
}
void Fl_Double_Window::hide() {
Fl_X *myi = Fl_X::i(this);
Fl_X *myi = Fl_X::flx(this);
if (myi && Fl_Window_Driver::driver(this)->other_xid) {
Fl_Window_Driver::driver(this)->destroy_double_buffer();
}

View File

@ -50,7 +50,7 @@ void Fl_Window::_Fl_Window() {
} else {
labeltype(FL_NO_LABEL);
}
i = 0;
flx_ = 0;
xclass_ = 0;
iconlabel_ = 0;
resizable(0);
@ -482,8 +482,8 @@ void Fl_Window::flush()
{
if (!shown()) return;
make_current();
fl_clip_region(i->region);
i->region = 0;
fl_clip_region(flx_->region);
flx_->region = 0;
draw();
}

View File

@ -111,7 +111,7 @@ public:
void current(Fl_Window *c);
char show_iconic() { return Fl_Window::show_iconic_; }
void show_iconic(char c) { Fl_Window::show_iconic_ = c; }
void i(Fl_X *x) { pWindow->i = x; }
void flx(Fl_X *x) { pWindow->flx_ = x; }
/** for an Fl_Overlay_Window, returns the value of its overlay_ member variable */
Fl_Window *overlay() {
return pWindow->as_overlay_window() ? pWindow->as_overlay_window()->overlay_ : NULL;

View File

@ -144,12 +144,12 @@ int Fl_Window_Driver::hide_common() {
if (!shown()) return 1;
// remove from the list of windows:
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
Fl_X** pp = &Fl_X::first;
for (; *pp != ip; pp = &(*pp)->next) if (!*pp) return 1;
*pp = ip->next;
pWindow->i = 0;
pWindow->flx_ = 0;
// recursively remove any subwindows:
for (Fl_X *wi = Fl_X::first; wi;) {
@ -213,7 +213,7 @@ int Fl_Window_Driver::set_cursor(const Fl_RGB_Image*, int, int) {
void Fl_Window_Driver::wait_for_expose() {
if (!shown()) return;
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
while (!i || wait_for_expose_value) {
Fl::wait();
}
@ -264,7 +264,7 @@ void Fl_Window_Driver::menu_window_area(int &X, int &Y, int &W, int &H, int nscr
/** Returns the platform-specific reference of the given window, or NULL if that window isn't shown.
\version 1.4.0 */
fl_uintptr_t Fl_Window_Driver::xid(const Fl_Window *win) {
Fl_X *flx = win->i;
Fl_X *flx = win->flx_;
return flx ? flx->xid : 0;
}

View File

@ -2274,7 +2274,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
FLWindow *cw = (FLWindow*)[self window];
Fl_Window *window = [cw getFl_Window];
if (!window) return; // may happen after closing full-screen window
if (!Fl_X::i(window)) return; // reported to happen with Gmsh (issue #434)
if (!Fl_X::flx(window)) return; // reported to happen with Gmsh (issue #434)
fl_lock_function();
Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(window);
if (!through_Fl_X_flush
@ -2289,7 +2289,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
window->size(window->w(), window->h()); // sends message [GLcontext update]
}
}
Fl_X *i = Fl_X::i(window);
Fl_X *i = Fl_X::flx(window);
if ( i->region ) {
Fl_Graphics_Driver::default_driver().XDestroyRegion(i->region);
i->region = 0;
@ -2362,7 +2362,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
}
- (void)resetCursorRects {
Fl_Window *w = [(FLWindow*)[self window] getFl_Window];
Fl_X *i = (w ? Fl_X::i(w) : NULL);
Fl_X *i = (w ? Fl_X::flx(w) : NULL);
if (!i) return; // fix for STR #3128
// We have to have at least one cursor rect for invalidateCursorRectsForView
// to work, hence the "else" clause.
@ -2978,7 +2978,7 @@ void Fl_Cocoa_Window_Driver::makeWindow()
}
x->xid = (fl_uintptr_t)cw;
x->w = w;
i(x);
flx(x);
wait_for_expose_value = 1;
if (!w->parent()) {
x->next = Fl_X::first;
@ -3189,7 +3189,7 @@ void Fl_Cocoa_Window_Driver::use_border() {
* Tell the OS what window sizes we want to allow
*/
void Fl_Cocoa_Window_Driver::size_range() {
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
if (i && i->xid) {
float s = Fl::screen_driver()->scale(0);
int bt = get_window_frame_sizes(pWindow);
@ -3213,7 +3213,7 @@ void Fl_Cocoa_Window_Driver::wait_for_expose()
* set the window title bar name
*/
void Fl_Cocoa_Window_Driver::label(const char *name, const char *mininame) {
if (shown() || Fl_X::i(pWindow)) {
if (shown() || Fl_X::flx(pWindow)) {
q_set_window_title(fl_xid(pWindow), name, mininame);
if (fl_sys_menu_bar && Fl_Sys_Menu_Bar_Driver::window_menu_style())
Fl_MacOS_Sys_Menu_Bar_Driver::driver()->rename_window(pWindow);
@ -3226,12 +3226,12 @@ void Fl_Cocoa_Window_Driver::label(const char *name, const char *mininame) {
*/
void Fl_Cocoa_Window_Driver::show() {
Fl_X *top = NULL;
if (parent()) top = Fl_X::i(pWindow->top_window());
if (parent()) top = Fl_X::flx(pWindow->top_window());
if (!shown() && (!parent() || (top && ![(FLWindow*)top->xid isMiniaturized]))) {
makeWindow();
} else {
if ( !parent() ) {
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
if ([(FLWindow*)i->xid isMiniaturized]) {
i->w->redraw();
[(FLWindow*)i->xid deminiaturize:nil];
@ -3319,7 +3319,7 @@ void Fl_Cocoa_Window_Driver::resize(int X, int Y, int W, int H) {
void Fl_Cocoa_Window_Driver::make_current()
{
q_release_context();
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
//NSLog(@"region-count=%d damage=%u",i->region?i->region->count:0, pWindow->damage());
fl_window = (FLWindow*)i->xid;
((Fl_Quartz_Graphics_Driver&)Fl_Graphics_Driver::default_driver()).high_resolution( mapped_to_retina() );

View File

@ -1290,7 +1290,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
case WM_PAINT: {
HRGN R, R2;
Fl_X *i = Fl_X::i(window);
Fl_X *i = Fl_X::flx(window);
Fl_Window_Driver::driver(window)->wait_for_expose_value = 0;
char redraw_whole_window = false;
if (!i->region && window->damage()) {
@ -1920,7 +1920,7 @@ void Fl_WinAPI_Window_Driver::resize(int X, int Y, int W, int H) {
pWindow->redraw();
// only wait for exposure if this window has a size - a window
// with no width or height will never get an exposure event
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
if (i && W > 0 && H > 0)
wait_for_expose_value = 1;
}
@ -2011,7 +2011,7 @@ void Fl_WinAPI_Window_Driver::makeWindow() {
// mark this window visible, so that mapping the parent at a later
// point in time will call this function again to finally map the subwindow.
Fl_Window *w = pWindow;
if (w->parent() && !Fl_X::i(w->window())) {
if (w->parent() && !Fl_X::flx(w->window())) {
w->set_visible();
return;
}
@ -2165,7 +2165,7 @@ void Fl_WinAPI_Window_Driver::makeWindow() {
Fl_X *x = new Fl_X;
other_xid = 0;
x->w = w;
i(x);
flx(x);
x->region = 0;
Fl_WinAPI_Window_Driver::driver(w)->private_dc = 0;
cursor = LoadCursor(NULL, IDC_ARROW);
@ -2449,7 +2449,7 @@ void Fl_Window::icons(HICON big_icon, HICON small_icon) {
Fl_WinAPI_Window_Driver::driver(this)->icon_->big_icon = CopyIcon(big_icon);
if (small_icon != NULL)
Fl_WinAPI_Window_Driver::driver(this)->icon_->small_icon = CopyIcon(small_icon);
if (Fl_X::i(this))
if (Fl_X::flx(this))
Fl_WinAPI_Window_Driver::driver(this)->set_icons();
}
@ -2618,7 +2618,7 @@ void Fl_WinAPI_Window_Driver::show() {
makeWindow();
} else {
// Once again, we would lose the capture if we activated the window.
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
if (IsIconic((HWND)i->xid))
OpenIcon((HWND)i->xid);
if (!fl_capture)

View File

@ -1525,7 +1525,7 @@ int fl_handle(const XEvent& thisevent)
case DestroyNotify: { // an X11 window was closed externally from the program
Fl::handle(FL_CLOSE, window);
Fl_X* X = Fl_X::i(window);
Fl_X* X = Fl_X::flx(window);
if (X) { // indicates the FLTK window was not closed
X->xid = (Window)0; // indicates the X11 window was already destroyed
window->hide();
@ -1987,7 +1987,7 @@ int fl_handle(const XEvent& thisevent)
case EnterNotify:
if (xevent.xcrossing.detail == NotifyInferior) break;
// XInstallColormap(fl_display, Fl_X::i(window)->colormap);
// XInstallColormap(fl_display, Fl_X::flx(window)->colormap);
set_event_xy(window);
Fl::e_state = xevent.xcrossing.state << 16;
event = FL_ENTER;
@ -2251,7 +2251,7 @@ void Fl_X11_Window_Driver::activate_window() {
Window prev = 0;
if (fl_xfocus) {
Fl_X *x = Fl_X::i(fl_xfocus);
Fl_X *x = Fl_X::flx(fl_xfocus);
if (!x)
return;
prev = x->xid;
@ -2315,7 +2315,7 @@ Fl_X* Fl_X::set_xid(Fl_Window* win, Window winxid) {
Fl_X *xp = new Fl_X;
xp->xid = winxid;
Fl_Window_Driver::driver(win)->other_xid = 0;
xp->w = win; win->i = xp;
xp->w = win; win->flx_ = xp;
xp->next = Fl_X::first;
xp->region = 0;
Fl_Window_Driver::driver(win)->wait_for_expose_value = 1;
@ -2387,7 +2387,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap)
// if the window is a subwindow and our parent is not mapped yet, we
// mark this window visible, so that mapping the parent at a later
// point in time will call this function again to finally map the subwindow.
if (win->parent() && !Fl_X::i(win->window())) {
if (win->parent() && !Fl_X::flx(win->window())) {
win->set_visible();
return;
}

View File

@ -282,7 +282,7 @@ void Fl_Cocoa_Gl_Window_Driver::after_show() {
float Fl_Cocoa_Gl_Window_Driver::pixels_per_unit()
{
int retina = (fl_mac_os_version >= 100700 && Fl::use_high_res_GL() && Fl_X::i(pWindow) &&
int retina = (fl_mac_os_version >= 100700 && Fl::use_high_res_GL() && Fl_X::flx(pWindow) &&
Fl_Cocoa_Window_Driver::driver(pWindow)->mapped_to_retina()) ? 2 : 1;
return retina * Fl_Graphics_Driver::default_driver().scale();
}

View File

@ -180,7 +180,7 @@ void Fl_Cocoa_Screen_Driver::grab(Fl_Window* win)
{
if (win) {
if (!Fl::grab_) {
fl_capture = (FLWindow*)(Fl_X::i(Fl::first_window())->xid);
fl_capture = (FLWindow*)(Fl_X::flx(Fl::first_window())->xid);
Fl_Cocoa_Window_Driver::driver(Fl::first_window())->set_key_window();
}
Fl::grab_ = win;

View File

@ -58,7 +58,7 @@ void Fl_Cocoa_Window_Driver::flush_overlay()
oWindow->clear_damage(FL_DAMAGE_ALL);
}
if (oWindow->damage() & ~FL_DAMAGE_EXPOSE) {
Fl_X *myi = Fl_X::i(pWindow);
Fl_X *myi = Fl_X::flx(pWindow);
fl_clip_region(myi->region); myi->region = 0;
fl_begin_offscreen(other_xid);
draw();
@ -215,7 +215,7 @@ void Fl_Cocoa_Window_Driver::shape(const Fl_Image* img) {
void Fl_Cocoa_Window_Driver::hide() {
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
// MacOS X manages a single pointer per application. Make sure that hiding
// a toplevel window will not leave us with some random pointer shape, or
// worst case, an invisible pointer

View File

@ -1537,7 +1537,7 @@ void *Fl_Wayland_Screen_Driver::control_maximize_button(void *data) {
Fl_Window *win = Fl::first_window();
while (win) {
if (!win->parent() && win->border() &&
!( ((struct wld_window*)Fl_X::i(win)->xid)->state & LIBDECOR_WINDOW_STATE_MAXIMIZED) ) {
!( ((struct wld_window*)Fl_X::flx(win)->xid)->state & LIBDECOR_WINDOW_STATE_MAXIMIZED) ) {
win_dims *dim = new win_dims;
dim->tracker = new Fl_Widget_Tracker(win);
Fl_Window_Driver *dr = Fl_Window_Driver::driver(win);

View File

@ -185,7 +185,7 @@ void Fl_Wayland_Window_Driver::flush_overlay()
oWindow->clear_damage(FL_DAMAGE_ALL);
}
if (oWindow->damage() & ~FL_DAMAGE_EXPOSE) {
Fl_X *myi = Fl_X::i(pWindow);
Fl_X *myi = Fl_X::flx(pWindow);
fl_clip_region(myi->region); myi->region = 0;
fl_begin_offscreen(other_xid);
draw();
@ -363,7 +363,7 @@ void Fl_Wayland_Window_Driver::make_current() {
Fl_Region clip_region = fl_graphics_driver->XRectangleRegion(extents->x, extents->y,
extents->width, extents->height);
//printf("make_current: %dx%d %dx%d\n",extents->x, extents->y, extents->width, extents->height);
Fl_X::i(pWindow)->region = clip_region;
Fl_X::flx(pWindow)->region = clip_region;
}
else fl_graphics_driver->clip_region(0);
@ -390,8 +390,8 @@ void Fl_Wayland_Window_Driver::flush() {
struct wld_window *window = fl_wl_xid(pWindow);
if (!window || !window->configured_width) return;
Fl_X *i = Fl_X::i(pWindow);
struct flCairoRegion* r = (struct flCairoRegion*)i->region;
Fl_X *ip = Fl_X::flx(pWindow);
struct flCairoRegion* r = (struct flCairoRegion*)ip->region;
float f = Fl::screen_scale(pWindow->screen_num());
if (r && window->buffer) {
for (int i = 0; i < r->count; i++) {
@ -435,7 +435,7 @@ static void delayed_delete_Fl_X(Fl_X *i) {
void Fl_Wayland_Window_Driver::hide() {
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
if (hide_common()) return;
if (ip->region) {
Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region);
@ -492,7 +492,7 @@ void Fl_Wayland_Window_Driver::hide() {
void Fl_Wayland_Window_Driver::map() {
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
struct wld_window *wl_win = (struct wld_window*)ip->xid;
if (wl_win->kind == SUBWINDOW && !wl_win->subsurface) {
struct wld_window *parent = fl_wl_xid(pWindow->window());
@ -514,7 +514,7 @@ void Fl_Wayland_Window_Driver::map() {
void Fl_Wayland_Window_Driver::unmap() {
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
struct wld_window *wl_win = (struct wld_window*)ip->xid;
if (wl_win->kind == SUBWINDOW && wl_win->wl_surface) {
wl_surface_attach(wl_win->wl_surface, NULL, 0, 0);
@ -527,7 +527,7 @@ void Fl_Wayland_Window_Driver::unmap() {
void Fl_Wayland_Window_Driver::size_range() {
if (shown()) {
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
struct wld_window *wl_win = (struct wld_window*)ip->xid;
float f = Fl::screen_scale(pWindow->screen_num());
if (wl_win->kind == DECORATED && wl_win->frame) {
@ -555,7 +555,7 @@ void Fl_Wayland_Window_Driver::size_range() {
void Fl_Wayland_Window_Driver::iconize() {
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
struct wld_window *wl_win = (struct wld_window*)ip->xid;
if (wl_win->kind == DECORATED) {
libdecor_frame_set_minimized(wl_win->frame);
@ -1197,7 +1197,7 @@ void Fl_Wayland_Window_Driver::makeWindow()
xp->xid = (fl_uintptr_t)new_window;
other_xid = 0;
xp->w = pWindow;
i(xp);
flx(xp);
xp->region = 0;
if (!pWindow->parent()) {
xp->next = Fl_X::first;

View File

@ -137,7 +137,7 @@ Fl_Gl_Choice *Fl_WinAPI_Gl_Window_Driver::find(int m, const int *alistp)
GLContext Fl_WinAPI_Gl_Window_Driver::do_create_gl_context(Fl_Window* window,
const Fl_Gl_Choice* g, int layer)
{
Fl_X* i = Fl_X::i(window);
Fl_X* i = Fl_X::flx(window);
HDC hdc = Fl_WinAPI_Window_Driver::driver(window)->private_dc;
if (!hdc) {
hdc = Fl_WinAPI_Window_Driver::driver(window)->private_dc = GetDCEx((HWND)i->xid, 0, DCX_CACHE);
@ -186,7 +186,7 @@ void Fl_WinAPI_Gl_Window_Driver::make_overlay_current() {
if (overlay() != this) {
set_gl_context(pWindow, (GLContext)overlay());
// if (fl_overlay_depth)
// wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE);
// wglRealizeLayerPalette(Fl_X::flx(this)->private_dc, 1, TRUE);
} else
#endif
glDrawBuffer(GL_FRONT);

View File

@ -286,7 +286,7 @@ void Fl_WinAPI_Window_Driver::flush_double()
{
if (!shown()) return;
pWindow->make_current(); // make sure fl_gc is non-zero
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
if (!i) return; // window not yet created
if (!other_xid) {
@ -332,7 +332,7 @@ void Fl_WinAPI_Window_Driver::flush_overlay()
if (!shown()) return;
pWindow->make_current(); // make sure fl_gc is non-zero
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
if (!i) return; // window not yet created
int eraseoverlay = (pWindow->damage()&FL_DAMAGE_OVERLAY);
@ -371,7 +371,7 @@ void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) {
}
}
if (Fl_X::i(pWindow))
if (Fl_X::flx(pWindow))
set_icons();
}
@ -442,7 +442,7 @@ extern void fl_clipboard_notify_retarget(HWND wnd);
extern void fl_update_clipboard(void);
void Fl_WinAPI_Window_Driver::hide() {
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
// STR#3079: if there remains a window and a non-modal window, and the window is deleted,
// the app remains running without any apparent window.
// Bug mechanism: hiding an owner window unmaps the owned (non-modal) window(s)
@ -582,7 +582,7 @@ void Fl_WinAPI_Window_Driver::fullscreen_off(int X, int Y, int W, int H) {
// Remove the xid temporarily so that Fl_WinAPI_Window_Driver::fake_X_wm() behaves like it
// does in Fl_WinAPI_Window_Driver::makeWindow().
HWND xid = fl_xid(pWindow);
Fl_X::i(pWindow)->xid = 0;
Fl_X::flx(pWindow)->xid = 0;
int wx, wy, bt, bx, by;
switch (fake_X_wm(wx, wy, bt, bx, by)) {
case 0:
@ -596,7 +596,7 @@ void Fl_WinAPI_Window_Driver::fullscreen_off(int X, int Y, int W, int H) {
}
break;
}
Fl_X::i(pWindow)->xid = (fl_uintptr_t)xid;
Fl_X::flx(pWindow)->xid = (fl_uintptr_t)xid;
// compute window position and size in scaled units
float s = Fl::screen_driver()->scale(screen_num());
int scaledX = int(ceil(X*s)), scaledY= int(ceil(Y*s)), scaledW = int(ceil(W*s)), scaledH = int(ceil(H*s));

View File

@ -81,7 +81,7 @@ void Fl_X11_Window_Driver::decorated_win_size(int &w, int &h)
if (!win->shown() || win->parent() || !win->border() || !win->visible()) return;
Window root, parent, *children;
unsigned n = 0;
Status status = XQueryTree(fl_display, Fl_X::i(win)->xid, &root, &parent, &children, &n);
Status status = XQueryTree(fl_display, Fl_X::flx(win)->xid, &root, &parent, &children, &n);
if (status != 0 && n) XFree(children);
// when compiz is used, root and parent are the same window
// and I don't know where to find the window decoration
@ -91,7 +91,7 @@ void Fl_X11_Window_Driver::decorated_win_size(int &w, int &h)
// sometimes, very wide window borders are reported
// ignore them all:
XWindowAttributes w_attributes;
XGetWindowAttributes(fl_display, Fl_X::i(win)->xid, &w_attributes);
XGetWindowAttributes(fl_display, Fl_X::flx(win)->xid, &w_attributes);
if (attributes.width - w_attributes.width >= 20) {
attributes.height -= (attributes.width - w_attributes.width);
attributes.width = w_attributes.width;
@ -124,7 +124,7 @@ int Fl_X11_Window_Driver::decorated_w()
void Fl_X11_Window_Driver::take_focus()
{
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
if (!Fl_X11_Screen_Driver::ewmh_supported()) {
// Save and restore the current group because 'show()' sets it to NULL.
@ -162,7 +162,7 @@ void Fl_X11_Window_Driver::flush_double()
void Fl_X11_Window_Driver::flush_double(int erase_overlay)
{
pWindow->make_current(); // make sure fl_gc is non-zero
Fl_X *i = Fl_X::i(pWindow);
Fl_X *i = Fl_X::flx(pWindow);
if (!other_xid) {
other_xid = fl_create_offscreen(w(), h());
#if FLTK_USE_CAIRO
@ -201,7 +201,7 @@ void Fl_X11_Window_Driver::flush_overlay()
#if FLTK_USE_CAIRO
float scale = fl_graphics_driver->scale();
int W = pWindow->w() * scale, H = pWindow->h() * scale;
cairo_surface_t *s = cairo_xlib_surface_create(fl_display, Fl_X::i(pWindow)->xid, fl_visual->visual, W, H);
cairo_surface_t *s = cairo_xlib_surface_create(fl_display, Fl_X::flx(pWindow)->xid, fl_visual->visual, W, H);
cairo_t *overlay_cairo = cairo_create(s);
cairo_surface_destroy(s);
cairo_save(overlay_cairo);
@ -323,7 +323,7 @@ void Fl_X11_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) {
}
}
if (Fl_X::i(pWindow))
if (Fl_X::flx(pWindow))
set_icons();
}
@ -433,7 +433,7 @@ void Fl_X11_Window_Driver::make_current() {
void Fl_X11_Window_Driver::hide() {
Fl_X* ip = Fl_X::i(pWindow);
Fl_X* ip = Fl_X::flx(pWindow);
if (hide_common()) return;
if (ip->region) Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region);
# if USE_XFT && ! FLTK_USE_CAIRO

View File

@ -126,7 +126,7 @@ void Fl_Window::cursor(Fl_Cursor c) {
if (c == FL_CURSOR_DEFAULT)
c = cursor_default;
if (!i)
if (!flx_)
return;
ret = pWindowDriver->set_cursor(c);
@ -163,7 +163,7 @@ void Fl_Window::cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
return;
}
if (!i)
if (!flx_)
return;
ret = pWindowDriver->set_cursor(image, hotx, hoty);