This avoids conflicts with GetMainWindow() defined in other wxWindow-derived
classes (such as wxDataViewCtrl and potentially user-defined classes as well).
Closes #11818.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63723
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual ~wxAdoptedWindow();
void SetHandle(WXWindow window) { m_mainWindow = window; m_clientWindow = window; }
virtual ~wxAdoptedWindow();
void SetHandle(WXWindow window) { m_mainWindow = window; m_clientWindow = window; }
- WXWindow GetHandle() const { return GetMainWindow(); }
+ WXWindow GetHandle() const { return X11GetMainWindow(); }
virtual void DragAcceptFiles(bool accept);
// Get the unique identifier of a window
virtual void DragAcceptFiles(bool accept);
// Get the unique identifier of a window
- virtual WXWindow GetHandle() const { return GetMainWindow(); }
+ virtual WXWindow GetHandle() const { return X11GetMainWindow(); }
// implementation from now on
// --------------------------
// implementation from now on
// --------------------------
// ---------
// Get main X11 window
// ---------
// Get main X11 window
- virtual WXWindow GetMainWindow() const;
+ virtual WXWindow X11GetMainWindow() const;
// Get X11 window representing the client area
virtual WXWindow GetClientAreaWindow() const;
// Get X11 window representing the client area
virtual WXWindow GetClientAreaWindow() const;
// If we only have one X11 window, always indicate
// that borders might have to be redrawn.
// If we only have one X11 window, always indicate
// that borders might have to be redrawn.
- if (win->GetMainWindow() == win->GetClientAreaWindow())
+ if (win->X11GetMainWindow() == win->GetClientAreaWindow())
win->NeedUpdateNcAreaInIdle();
// Only erase background, paint in idle time.
win->NeedUpdateNcAreaInIdle();
// Only erase background, paint in idle time.
m_font = window->GetFont();
m_font = window->GetFont();
- m_x11window = (WXWindow*) window->GetMainWindow();
+ m_x11window = (WXWindow*) window->X11GetMainWindow();
// not realized ?
if (!m_x11window)
// not realized ?
if (!m_x11window)
m_x11window = (WXWindow*) window->GetClientAreaWindow();
// Adjust the client area when the wxWindow is not using 2 X11 windows.
m_x11window = (WXWindow*) window->GetClientAreaWindow();
// Adjust the client area when the wxWindow is not using 2 X11 windows.
- if (m_x11window == (WXWindow*) window->GetMainWindow())
+ if (m_x11window == (WXWindow*) window->X11GetMainWindow())
{
wxPoint ptOrigin = window->GetClientAreaOrigin();
SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
{
wxPoint ptOrigin = window->GetClientAreaOrigin();
SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
old = XSetErrorHandler(ErrorHandler);
XReparentWindow( wxGlobalDisplay(),
old = XSetErrorHandler(ErrorHandler);
XReparentWindow( wxGlobalDisplay(),
- (Window) toReparent->GetMainWindow(),
- (Window) newParent->GetMainWindow(),
+ (Window) toReparent->X11GetMainWindow(),
+ (Window) newParent->X11GetMainWindow(),
0, 0);
if (!XQueryTree( wxGlobalDisplay(),
0, 0);
if (!XQueryTree( wxGlobalDisplay(),
- (Window) toReparent->GetMainWindow(),
+ (Window) toReparent->X11GetMainWindow(),
&returnroot, &returnparent,
&children, &numchildren) || Xerror)
{
&returnroot, &returnparent,
&children, &numchildren) || Xerror)
{
"Reparenting child at offset %d and position %d, %d.\n",
parentOffset, parentOffset+xwa.x, parentOffset+xwa.y);
XReparentWindow( wxGlobalDisplay(),
"Reparenting child at offset %d and position %d, %d.\n",
parentOffset, parentOffset+xwa.x, parentOffset+xwa.y);
XReparentWindow( wxGlobalDisplay(),
- children[each], (Window) newParent->GetMainWindow(),
+ children[each], (Window) newParent->X11GetMainWindow(),
{
if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)
{
{
if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)
{
- if (GetParent() && GetParent()->GetMainWindow())
+ if (GetParent() && GetParent()->X11GetMainWindow())
- Window xparentwindow = (Window) GetParent()->GetMainWindow();
+ Window xparentwindow = (Window) GetParent()->X11GetMainWindow();
XSetTransientForHint( xdisplay, xwindow, xparentwindow );
}
}
XSetTransientForHint( xdisplay, xwindow, xparentwindow );
}
}
if (GetParent())
{
wm_hints.flags |= WindowGroupHint;
if (GetParent())
{
wm_hints.flags |= WindowGroupHint;
- wm_hints.window_group = (Window) GetParent()->GetMainWindow();
+ wm_hints.window_group = (Window) GetParent()->X11GetMainWindow();
}
wm_hints.input = True;
wm_hints.initial_state = NormalState;
}
wm_hints.input = True;
wm_hints.initial_state = NormalState;
- if (!m_iconized && GetMainWindow())
+ if (!m_iconized && X11GetMainWindow())
{
if (XIconifyWindow(wxGlobalDisplay(),
{
if (XIconifyWindow(wxGlobalDisplay(),
- (Window) GetMainWindow(), DefaultScreen(wxGlobalDisplay())) != 0)
+ (Window) X11GetMainWindow(), DefaultScreen(wxGlobalDisplay())) != 0)
void wxTopLevelWindowX11::Restore()
{
// This is the way to deiconify the window, according to the X FAQ
void wxTopLevelWindowX11::Restore()
{
// This is the way to deiconify the window, according to the X FAQ
- if (m_iconized && GetMainWindow())
+ if (m_iconized && X11GetMainWindow())
- XMapWindow(wxGlobalDisplay(), (Window) GetMainWindow());
+ XMapWindow(wxGlobalDisplay(), (Window) X11GetMainWindow());
void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
{
void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
{
- if (icon.Ok() && GetMainWindow())
+ if (icon.Ok() && X11GetMainWindow())
{
#if !wxUSE_NANOX
XWMHints *wmHints = XAllocWMHints();
{
#if !wxUSE_NANOX
XWMHints *wmHints = XAllocWMHints();
wmHints->icon_mask = (Pixmap) icon.GetMask()->GetBitmap();
}
wmHints->icon_mask = (Pixmap) icon.GetMask()->GetBitmap();
}
- XSetWMHints(wxGlobalDisplay(), (Window) GetMainWindow(), wmHints);
+ XSetWMHints(wxGlobalDisplay(), (Window) X11GetMainWindow(), wmHints);
wxTopLevelWindowBase::SetIcons( icons );
DoSetIcon( icons.GetIcon( -1 ) );
wxTopLevelWindowBase::SetIcons( icons );
DoSetIcon( icons.GetIcon( -1 ) );
- wxSetIconsX11( wxGlobalDisplay(), GetMainWindow(), icons );
+ wxSetIconsX11( wxGlobalDisplay(), X11GetMainWindow(), icons );
}
bool wxTopLevelWindowX11::SetShape(const wxRegion& region)
{
return wxDoSetShape( wxGlobalDisplay(),
}
bool wxTopLevelWindowX11::SetShape(const wxRegion& region)
{
return wxDoSetShape( wxGlobalDisplay(),
- (Window)GetMainWindow(),
+ (Window)X11GetMainWindow(),
+ if (X11GetMainWindow())
{
#if wxUSE_UNICODE
// I wonder of e.g. Metacity takes UTF-8 here
{
#if wxUSE_UNICODE
// I wonder of e.g. Metacity takes UTF-8 here
- XStoreName(wxGlobalDisplay(), (Window) GetMainWindow(),
+ XStoreName(wxGlobalDisplay(), (Window) X11GetMainWindow(),
(const char*) title.ToAscii() );
(const char*) title.ToAscii() );
- XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(),
+ XSetIconName(wxGlobalDisplay(), (Window) X11GetMainWindow(),
(const char*) title.ToAscii() );
#else
(const char*) title.ToAscii() );
#else
- XStoreName(wxGlobalDisplay(), (Window) GetMainWindow(),
+ XStoreName(wxGlobalDisplay(), (Window) X11GetMainWindow(),
- XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(),
+ XSetIconName(wxGlobalDisplay(), (Window) X11GetMainWindow(),
(const char*) title);
#endif
}
(const char*) title);
#endif
}
size_hints.flags = PSize;
size_hints.width = width;
size_hints.height = height;
size_hints.flags = PSize;
size_hints.width = width;
size_hints.height = height;
- XSetWMNormalHints( wxGlobalDisplay(), (Window) GetMainWindow(), &size_hints );
+ XSetWMNormalHints( wxGlobalDisplay(), (Window) X11GetMainWindow(), &size_hints );
#endif
wxWindowX11::DoSetClientSize(width, height);
#endif
wxWindowX11::DoSetClientSize(width, height);
size_hints.y = m_y;
size_hints.width = m_width;
size_hints.height = m_height;
size_hints.y = m_y;
size_hints.width = m_width;
size_hints.height = m_height;
- XSetWMNormalHints( wxGlobalDisplay(), (Window) GetMainWindow(), &size_hints);
+ XSetWMNormalHints( wxGlobalDisplay(), (Window) X11GetMainWindow(), &size_hints);
#endif
wxWindowX11::DoSetSize(x, y, width, height, sizeFlags);
#endif
wxWindowX11::DoSetSize(x, y, width, height, sizeFlags);
if (parent->GetInsertIntoMain())
{
// wxLogDebug( "Inserted into main: %s", GetName().c_str() );
if (parent->GetInsertIntoMain())
{
// wxLogDebug( "Inserted into main: %s", GetName().c_str() );
- xparent = (Window) parent->GetMainWindow();
+ xparent = (Window) parent->X11GetMainWindow();
}
// Size (not including the border) must be nonzero (or a Value error results)!
}
// Size (not including the border) must be nonzero (or a Value error results)!
x = sb->GetPosition().x;
Display *xdisplay = wxGlobalDisplay();
x = sb->GetPosition().x;
Display *xdisplay = wxGlobalDisplay();
- Window xwindow = (Window) GetMainWindow();
+ Window xwindow = (Window) X11GetMainWindow();
Colormap cm = (Colormap) wxTheApp->GetMainColormap( wxGetDisplay() );
wxColour colour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
colour.CalcPixel( (WXColormap) cm );
Colormap cm = (Colormap) wxTheApp->GetMainColormap( wxGetDisplay() );
wxColour colour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
colour.CalcPixel( (WXColormap) cm );
// X11-specific accessors
// ----------------------------------------------------------------------------
// X11-specific accessors
// ----------------------------------------------------------------------------
-WXWindow wxWindowX11::GetMainWindow() const
+WXWindow wxWindowX11::X11GetMainWindow() const