From 8fa1a6866852176cbdf4d7968326be0793dd0f95 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 3 Oct 2014 01:52:31 +0000 Subject: [PATCH] Add stubs for wxDisplayImplX11 functions appearing in the ABI. Add the stubs after the real functions were moved into wxDisplayImplGTK in r76365. This is necessary because wxDisplayImplX11 is wrongly exported from the DLL and so its virtual methods are part of the ABI. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77952 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/displayx11.cpp | 53 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index c8a9605538..fdb3ae6399 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -159,7 +159,58 @@ wxDisplayImpl *wxDisplayFactoryX11::CreateDisplay(unsigned n) return n < screens.GetCount() ? new wxDisplayImplX11(n, screens[n]) : NULL; } -#endif // !__WXGTK20__ +#else // __WXGTK20__ + +// Provide stubs for the functions which were (wrongly!) part of ABI in 3.0.0. +// They should never be actually used by anybody, but still keep them present, +// just to be certain we don't prevent some programs referencing, but not +// using, them from running with later 3.0.x versions. +class WXDLLEXPORT wxDisplayImplX11 : public wxDisplayImpl +{ +public: + wxDisplayImplX11(unsigned n) : wxDisplayImpl(n) { } + + // These are inline because they were inline in 3.0.0 too. + virtual wxRect GetGeometry() const { return wxRect(); } + virtual wxRect GetClientArea() const { return wxRect(); } + virtual wxString GetName() const { return wxString(); } + + // And those were not. + virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const; + virtual wxVideoMode GetCurrentMode() const; + virtual bool ChangeMode(const wxVideoMode& mode); + +private: + // We must also have the same data fields as in 3.0.0, even if they are + // unused, to avoid ABI checker warnings. + wxRect m_rect; + int m_depth; +}; + +wxArrayVideoModes +wxDisplayImplX11::GetModes(const wxVideoMode& WXUNUSED(mode)) const +{ + return wxArrayVideoModes(); +} + +wxVideoMode wxDisplayImplX11::GetCurrentMode() const +{ + return wxVideoMode(); +} + +bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode)) +{ + return false; +} + +// We need to reference this class, otherwise our stubs will be simply +// discarded. Notice that this function just needs to exist, not be called. +extern wxDisplayImpl* wxDisplayImplX11Use(unsigned n) +{ + return new wxDisplayImplX11(n); +} + +#endif // !__WXGTK20__/__WXGTK20__ // ============================================================================ // wxDisplayImplX11 implementation