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
This commit is contained in:
Vadim Zeitlin
2014-10-03 01:52:31 +00:00
parent 36bc75c5bb
commit 8fa1a68668

View File

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