X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/73302af6dddd667af4ebec69c800bc9de106f28e..d24b23b76eca69c0faecf6146f52f6d8f93d4b78:/include/wx/fontmap.h diff --git a/include/wx/fontmap.h b/include/wx/fontmap.h index 2dee4a244b..d7555d3b57 100644 --- a/include/wx/fontmap.h +++ b/include/wx/fontmap.h @@ -49,6 +49,8 @@ class WXDLLIMPEXP_CORE wxFontMapper; class WXDLLIMPEXP_BASE wxFontMapperBase { + // For IsWxFontMapper() + friend class WXDLLIMPEXP_CORE wxFontMapper; public: // constructtor and such // --------------------- @@ -60,14 +62,10 @@ public: virtual ~wxFontMapperBase(); // return instance of the wxFontMapper singleton -#if wxUSE_GUI - // GUI code needs to know it's a wxFontMapper because there - // are additional methods in the subclass. - static wxFontMapper *Get(); -#else // wxBase code only cares that it's a wxFontMapperBase + // In wxBase, wxFontMapper is only forward declared + // so one cannot implicitly cast from it to wxFontMapperBase. static wxFontMapperBase *Get(); -#endif // set the singleton to 'mapper' instance and return previous one static wxFontMapper *Set(wxFontMapper *mapper); @@ -162,6 +160,9 @@ protected: int NonInteractiveCharsetToEncoding(const wxString& charset); private: + // pseudo-RTTI since we aren't a wxObject. + virtual bool IsWxFontMapper(); + // the global fontmapper object or NULL static wxFontMapper *sm_instance; @@ -235,6 +236,9 @@ public: // the title for the dialogs (note that default is quite reasonable) void SetDialogTitle(const wxString& title) { m_titleDialog = title; } + // GUI code needs to know it's a wxFontMapper because there + // are additional methods in the subclass. + static wxFontMapper *Get(); protected: // GetAltForEncoding() helper: tests for the existence of the given @@ -255,6 +259,9 @@ protected: wxWindow *m_windowParent; private: + // pseudo-RTTI since we aren't a wxObject. + virtual bool IsWxFontMapper(); + DECLARE_NO_COPY_CLASS(wxFontMapper) };