From 679918f93d18cff9fc833be3e4d34b4e57513aac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Mar 2010 13:03:05 +0000 Subject: [PATCH] Rename wxWindow::GetMainWindow() to X11GetMainWindow() in wxX11. 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 --- include/wx/x11/reparent.h | 2 +- include/wx/x11/window.h | 4 ++-- src/x11/app.cpp | 2 +- src/x11/dcclient.cpp | 4 ++-- src/x11/reparent.cpp | 8 ++++---- src/x11/toplevel.cpp | 36 ++++++++++++++++++------------------ src/x11/window.cpp | 6 +++--- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/wx/x11/reparent.h b/include/wx/x11/reparent.h index e1121be4eb..500e2eaf49 100644 --- a/include/wx/x11/reparent.h +++ b/include/wx/x11/reparent.h @@ -60,7 +60,7 @@ class WXDLLIMPEXP_CORE wxAdoptedWindow: public wxWindow virtual ~wxAdoptedWindow(); void SetHandle(WXWindow window) { m_mainWindow = window; m_clientWindow = window; } - WXWindow GetHandle() const { return GetMainWindow(); } + WXWindow GetHandle() const { return X11GetMainWindow(); } }; #endif diff --git a/include/wx/x11/window.h b/include/wx/x11/window.h index 999280c703..ef8e0eb58f 100644 --- a/include/wx/x11/window.h +++ b/include/wx/x11/window.h @@ -82,7 +82,7 @@ public: 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 // -------------------------- @@ -91,7 +91,7 @@ public: // --------- // Get main X11 window - virtual WXWindow GetMainWindow() const; + virtual WXWindow X11GetMainWindow() const; // Get X11 window representing the client area virtual WXWindow GetClientAreaWindow() const; diff --git a/src/x11/app.cpp b/src/x11/app.cpp index e9c7b2bb17..acd1c49aef 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -338,7 +338,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) // 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. diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 3e1db0c360..316dd68cf1 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -183,7 +183,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC* owner, wxWindow *window ) m_font = window->GetFont(); - m_x11window = (WXWindow*) window->GetMainWindow(); + m_x11window = (WXWindow*) window->X11GetMainWindow(); // not realized ? if (!m_x11window) @@ -2356,7 +2356,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) 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); diff --git a/src/x11/reparent.cpp b/src/x11/reparent.cpp index 24baa7b662..ff976cd946 100644 --- a/src/x11/reparent.cpp +++ b/src/x11/reparent.cpp @@ -89,12 +89,12 @@ bool wxReparenter::Reparent(wxWindow* newParent, wxAdoptedWindow* toReparent) old = XSetErrorHandler(ErrorHandler); XReparentWindow( wxGlobalDisplay(), - (Window) toReparent->GetMainWindow(), - (Window) newParent->GetMainWindow(), + (Window) toReparent->X11GetMainWindow(), + (Window) newParent->X11GetMainWindow(), 0, 0); if (!XQueryTree( wxGlobalDisplay(), - (Window) toReparent->GetMainWindow(), + (Window) toReparent->X11GetMainWindow(), &returnroot, &returnparent, &children, &numchildren) || Xerror) { @@ -123,7 +123,7 @@ bool wxReparenter::Reparent(wxWindow* newParent, wxAdoptedWindow* toReparent) "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(), xwa.x, xwa.y); } } diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index 9d16c98353..14525801b3 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -198,9 +198,9 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent, { 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 ); } } @@ -220,7 +220,7 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent, 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; @@ -318,10 +318,10 @@ void wxTopLevelWindowX11::Iconize(bool iconize) return; } - if (!m_iconized && GetMainWindow()) + if (!m_iconized && X11GetMainWindow()) { if (XIconifyWindow(wxGlobalDisplay(), - (Window) GetMainWindow(), DefaultScreen(wxGlobalDisplay())) != 0) + (Window) X11GetMainWindow(), DefaultScreen(wxGlobalDisplay())) != 0) m_iconized = true; } } @@ -334,9 +334,9 @@ bool wxTopLevelWindowX11::IsIconized() const 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()); m_iconized = false; } } @@ -377,7 +377,7 @@ bool wxTopLevelWindowX11::ShowFullScreen(bool show, long style) void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon) { - if (icon.Ok() && GetMainWindow()) + if (icon.Ok() && X11GetMainWindow()) { #if !wxUSE_NANOX XWMHints *wmHints = XAllocWMHints(); @@ -391,7 +391,7 @@ void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon) wmHints->icon_mask = (Pixmap) icon.GetMask()->GetBitmap(); } - XSetWMHints(wxGlobalDisplay(), (Window) GetMainWindow(), wmHints); + XSetWMHints(wxGlobalDisplay(), (Window) X11GetMainWindow(), wmHints); XFree(wmHints); #endif } @@ -403,13 +403,13 @@ void wxTopLevelWindowX11::SetIcons(const wxIconBundle& icons ) wxTopLevelWindowBase::SetIcons( icons ); DoSetIcon( icons.GetIcon( -1 ) ); - wxSetIconsX11( wxGlobalDisplay(), GetMainWindow(), icons ); + wxSetIconsX11( wxGlobalDisplay(), X11GetMainWindow(), icons ); } bool wxTopLevelWindowX11::SetShape(const wxRegion& region) { return wxDoSetShape( wxGlobalDisplay(), - (Window)GetMainWindow(), + (Window)X11GetMainWindow(), region ); } @@ -417,18 +417,18 @@ void wxTopLevelWindowX11::SetTitle(const wxString& title) { m_title = title; - if (GetMainWindow()) + if (X11GetMainWindow()) { #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() ); - XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(), + XSetIconName(wxGlobalDisplay(), (Window) X11GetMainWindow(), (const char*) title.ToAscii() ); #else - XStoreName(wxGlobalDisplay(), (Window) GetMainWindow(), + XStoreName(wxGlobalDisplay(), (Window) X11GetMainWindow(), (const char*) title); - XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(), + XSetIconName(wxGlobalDisplay(), (Window) X11GetMainWindow(), (const char*) title); #endif } @@ -484,7 +484,7 @@ void wxTopLevelWindowX11::DoSetClientSize(int width, int 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); @@ -523,7 +523,7 @@ void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int siz 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); diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 61db6dee8d..57e55a536f 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -148,7 +148,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id, 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)! @@ -1267,7 +1267,7 @@ void wxWindowX11::SendNcPaintEvents() 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 ); @@ -1408,7 +1408,7 @@ void wxDeleteClientWindowFromTable(Window w) // X11-specific accessors // ---------------------------------------------------------------------------- -WXWindow wxWindowX11::GetMainWindow() const +WXWindow wxWindowX11::X11GetMainWindow() const { return m_mainWindow; } -- 2.47.2