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
This commit is contained in:
Vadim Zeitlin
2010-03-20 13:03:05 +00:00
parent 21867d9888
commit 679918f93d
7 changed files with 31 additions and 31 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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.

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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;
}