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:
		@@ -60,7 +60,7 @@ class WXDLLIMPEXP_CORE wxAdoptedWindow: public wxWindow
 | 
				
			|||||||
    virtual ~wxAdoptedWindow();
 | 
					    virtual ~wxAdoptedWindow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void SetHandle(WXWindow window) { m_mainWindow = window; m_clientWindow = window; }
 | 
					    void SetHandle(WXWindow window) { m_mainWindow = window; m_clientWindow = window; }
 | 
				
			||||||
    WXWindow GetHandle() const { return GetMainWindow(); }
 | 
					    WXWindow GetHandle() const { return X11GetMainWindow(); }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -82,7 +82,7 @@ public:
 | 
				
			|||||||
    virtual void DragAcceptFiles(bool accept);
 | 
					    virtual void DragAcceptFiles(bool accept);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get the unique identifier of a window
 | 
					    // 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
 | 
				
			||||||
    // --------------------------
 | 
					    // --------------------------
 | 
				
			||||||
@@ -91,7 +91,7 @@ public:
 | 
				
			|||||||
    // ---------
 | 
					    // ---------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get main X11 window
 | 
					    // Get main X11 window
 | 
				
			||||||
    virtual WXWindow GetMainWindow() const;
 | 
					    virtual WXWindow X11GetMainWindow() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get X11 window representing the client area
 | 
					    // Get X11 window representing the client area
 | 
				
			||||||
    virtual WXWindow GetClientAreaWindow() const;
 | 
					    virtual WXWindow GetClientAreaWindow() const;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -338,7 +338,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                // If we only have one X11 window, always indicate
 | 
					                // If we only have one X11 window, always indicate
 | 
				
			||||||
                // that borders might have to be redrawn.
 | 
					                // that borders might have to be redrawn.
 | 
				
			||||||
                if (win->GetMainWindow() == win->GetClientAreaWindow())
 | 
					                if (win->X11GetMainWindow() == win->GetClientAreaWindow())
 | 
				
			||||||
                    win->NeedUpdateNcAreaInIdle();
 | 
					                    win->NeedUpdateNcAreaInIdle();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // Only erase background, paint in idle time.
 | 
					                // Only erase background, paint in idle time.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -183,7 +183,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC* owner, wxWindow *window )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    m_font = window->GetFont();
 | 
					    m_font = window->GetFont();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    m_x11window = (WXWindow*) window->GetMainWindow();
 | 
					    m_x11window = (WXWindow*) window->X11GetMainWindow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // not realized ?
 | 
					    // not realized ?
 | 
				
			||||||
    if (!m_x11window)
 | 
					    if (!m_x11window)
 | 
				
			||||||
@@ -2356,7 +2356,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window )
 | 
				
			|||||||
    m_x11window = (WXWindow*) window->GetClientAreaWindow();
 | 
					    m_x11window = (WXWindow*) window->GetClientAreaWindow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Adjust the client area when the wxWindow is not using 2 X11 windows.
 | 
					    // 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();
 | 
					        wxPoint ptOrigin = window->GetClientAreaOrigin();
 | 
				
			||||||
        SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
 | 
					        SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -89,12 +89,12 @@ bool wxReparenter::Reparent(wxWindow* newParent, wxAdoptedWindow* toReparent)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    old = XSetErrorHandler(ErrorHandler);
 | 
					    old = XSetErrorHandler(ErrorHandler);
 | 
				
			||||||
    XReparentWindow( wxGlobalDisplay(),
 | 
					    XReparentWindow( wxGlobalDisplay(),
 | 
				
			||||||
                     (Window) toReparent->GetMainWindow(),
 | 
					                     (Window) toReparent->X11GetMainWindow(),
 | 
				
			||||||
                     (Window) newParent->GetMainWindow(),
 | 
					                     (Window) newParent->X11GetMainWindow(),
 | 
				
			||||||
                     0, 0);
 | 
					                     0, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!XQueryTree( wxGlobalDisplay(),
 | 
					    if (!XQueryTree( wxGlobalDisplay(),
 | 
				
			||||||
                     (Window) toReparent->GetMainWindow(),
 | 
					                     (Window) toReparent->X11GetMainWindow(),
 | 
				
			||||||
                     &returnroot, &returnparent,
 | 
					                     &returnroot, &returnparent,
 | 
				
			||||||
                     &children, &numchildren) || Xerror)
 | 
					                     &children, &numchildren) || Xerror)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -123,7 +123,7 @@ bool wxReparenter::Reparent(wxWindow* newParent, wxAdoptedWindow* toReparent)
 | 
				
			|||||||
              "Reparenting child at offset %d and position %d, %d.\n",
 | 
					              "Reparenting child at offset %d and position %d, %d.\n",
 | 
				
			||||||
               parentOffset, parentOffset+xwa.x, parentOffset+xwa.y);
 | 
					               parentOffset, parentOffset+xwa.x, parentOffset+xwa.y);
 | 
				
			||||||
            XReparentWindow( wxGlobalDisplay(),
 | 
					            XReparentWindow( wxGlobalDisplay(),
 | 
				
			||||||
                             children[each], (Window) newParent->GetMainWindow(),
 | 
					                             children[each], (Window) newParent->X11GetMainWindow(),
 | 
				
			||||||
                             xwa.x, xwa.y);
 | 
					                             xwa.x, xwa.y);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -198,9 +198,9 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
       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 );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -220,7 +220,7 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
 | 
				
			|||||||
    if (GetParent())
 | 
					    if (GetParent())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        wm_hints.flags |= WindowGroupHint;
 | 
					        wm_hints.flags |= WindowGroupHint;
 | 
				
			||||||
        wm_hints.window_group = (Window) GetParent()->GetMainWindow();
 | 
					        wm_hints.window_group = (Window) GetParent()->X11GetMainWindow();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    wm_hints.input = True;
 | 
					    wm_hints.input = True;
 | 
				
			||||||
    wm_hints.initial_state = NormalState;
 | 
					    wm_hints.initial_state = NormalState;
 | 
				
			||||||
@@ -318,10 +318,10 @@ void wxTopLevelWindowX11::Iconize(bool iconize)
 | 
				
			|||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!m_iconized && GetMainWindow())
 | 
					    if (!m_iconized && X11GetMainWindow())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (XIconifyWindow(wxGlobalDisplay(),
 | 
					        if (XIconifyWindow(wxGlobalDisplay(),
 | 
				
			||||||
            (Window) GetMainWindow(), DefaultScreen(wxGlobalDisplay())) != 0)
 | 
					            (Window) X11GetMainWindow(), DefaultScreen(wxGlobalDisplay())) != 0)
 | 
				
			||||||
            m_iconized = true;
 | 
					            m_iconized = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -334,9 +334,9 @@ bool wxTopLevelWindowX11::IsIconized() const
 | 
				
			|||||||
void wxTopLevelWindowX11::Restore()
 | 
					void wxTopLevelWindowX11::Restore()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    // This is the way to deiconify the window, according to the X FAQ
 | 
					    // 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;
 | 
					        m_iconized = false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -377,7 +377,7 @@ bool wxTopLevelWindowX11::ShowFullScreen(bool show, long style)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
 | 
					void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (icon.Ok() && GetMainWindow())
 | 
					    if (icon.Ok() && X11GetMainWindow())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
#if !wxUSE_NANOX
 | 
					#if !wxUSE_NANOX
 | 
				
			||||||
        XWMHints *wmHints = XAllocWMHints();
 | 
					        XWMHints *wmHints = XAllocWMHints();
 | 
				
			||||||
@@ -391,7 +391,7 @@ void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
 | 
				
			|||||||
            wmHints->icon_mask = (Pixmap) icon.GetMask()->GetBitmap();
 | 
					            wmHints->icon_mask = (Pixmap) icon.GetMask()->GetBitmap();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        XSetWMHints(wxGlobalDisplay(), (Window) GetMainWindow(), wmHints);
 | 
					        XSetWMHints(wxGlobalDisplay(), (Window) X11GetMainWindow(), wmHints);
 | 
				
			||||||
        XFree(wmHints);
 | 
					        XFree(wmHints);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -403,13 +403,13 @@ void wxTopLevelWindowX11::SetIcons(const wxIconBundle& icons )
 | 
				
			|||||||
    wxTopLevelWindowBase::SetIcons( icons );
 | 
					    wxTopLevelWindowBase::SetIcons( icons );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DoSetIcon( icons.GetIcon( -1 ) );
 | 
					    DoSetIcon( icons.GetIcon( -1 ) );
 | 
				
			||||||
    wxSetIconsX11( wxGlobalDisplay(), GetMainWindow(), icons );
 | 
					    wxSetIconsX11( wxGlobalDisplay(), X11GetMainWindow(), icons );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxTopLevelWindowX11::SetShape(const wxRegion& region)
 | 
					bool wxTopLevelWindowX11::SetShape(const wxRegion& region)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return wxDoSetShape( wxGlobalDisplay(),
 | 
					    return wxDoSetShape( wxGlobalDisplay(),
 | 
				
			||||||
                         (Window)GetMainWindow(),
 | 
					                         (Window)X11GetMainWindow(),
 | 
				
			||||||
                         region );
 | 
					                         region );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -417,18 +417,18 @@ void wxTopLevelWindowX11::SetTitle(const wxString& title)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    m_title = title;
 | 
					    m_title = title;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (GetMainWindow())
 | 
					    if (X11GetMainWindow())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
#if wxUSE_UNICODE
 | 
					#if wxUSE_UNICODE
 | 
				
			||||||
        //  I wonder of e.g. Metacity takes UTF-8 here
 | 
					        //  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() );
 | 
					            (const char*) title.ToAscii() );
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
        XStoreName(wxGlobalDisplay(), (Window) GetMainWindow(),
 | 
					        XStoreName(wxGlobalDisplay(), (Window) X11GetMainWindow(),
 | 
				
			||||||
            (const char*) title);
 | 
					            (const char*) title);
 | 
				
			||||||
        XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(),
 | 
					        XSetIconName(wxGlobalDisplay(), (Window) X11GetMainWindow(),
 | 
				
			||||||
            (const char*) title);
 | 
					            (const char*) title);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -484,7 +484,7 @@ void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
 | 
				
			|||||||
    size_hints.flags = PSize;
 | 
					    size_hints.flags = PSize;
 | 
				
			||||||
    size_hints.width = width;
 | 
					    size_hints.width = width;
 | 
				
			||||||
    size_hints.height = height;
 | 
					    size_hints.height = height;
 | 
				
			||||||
    XSetWMNormalHints( wxGlobalDisplay(), (Window) GetMainWindow(), &size_hints );
 | 
					    XSetWMNormalHints( wxGlobalDisplay(), (Window) X11GetMainWindow(), &size_hints );
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxWindowX11::DoSetClientSize(width, height);
 | 
					    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.y = m_y;
 | 
				
			||||||
    size_hints.width = m_width;
 | 
					    size_hints.width = m_width;
 | 
				
			||||||
    size_hints.height = m_height;
 | 
					    size_hints.height = m_height;
 | 
				
			||||||
    XSetWMNormalHints( wxGlobalDisplay(), (Window) GetMainWindow(), &size_hints);
 | 
					    XSetWMNormalHints( wxGlobalDisplay(), (Window) X11GetMainWindow(), &size_hints);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxWindowX11::DoSetSize(x, y, width, height, sizeFlags);
 | 
					    wxWindowX11::DoSetSize(x, y, width, height, sizeFlags);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -148,7 +148,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
 | 
				
			|||||||
    if (parent->GetInsertIntoMain())
 | 
					    if (parent->GetInsertIntoMain())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // wxLogDebug( "Inserted into main: %s", GetName().c_str() );
 | 
					        // 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)!
 | 
				
			||||||
@@ -1267,7 +1267,7 @@ void wxWindowX11::SendNcPaintEvents()
 | 
				
			|||||||
            x = sb->GetPosition().x;
 | 
					            x = sb->GetPosition().x;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Display *xdisplay = wxGlobalDisplay();
 | 
					            Display *xdisplay = wxGlobalDisplay();
 | 
				
			||||||
            Window xwindow = (Window) GetMainWindow();
 | 
					            Window xwindow = (Window) X11GetMainWindow();
 | 
				
			||||||
            Colormap cm = (Colormap) wxTheApp->GetMainColormap( wxGetDisplay() );
 | 
					            Colormap cm = (Colormap) wxTheApp->GetMainColormap( wxGetDisplay() );
 | 
				
			||||||
            wxColour colour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
 | 
					            wxColour colour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
 | 
				
			||||||
            colour.CalcPixel( (WXColormap) cm );
 | 
					            colour.CalcPixel( (WXColormap) cm );
 | 
				
			||||||
@@ -1408,7 +1408,7 @@ void wxDeleteClientWindowFromTable(Window w)
 | 
				
			|||||||
// X11-specific accessors
 | 
					// X11-specific accessors
 | 
				
			||||||
// ----------------------------------------------------------------------------
 | 
					// ----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WXWindow wxWindowX11::GetMainWindow() const
 | 
					WXWindow wxWindowX11::X11GetMainWindow() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return m_mainWindow;
 | 
					    return m_mainWindow;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user