X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7826e2dd838d59c6a8061b4fdd9f7326a6e06de3..2adfb497e666354303ea6bb0e468f1e53811ad55:/include/wx/fontmap.h diff --git a/include/wx/fontmap.h b/include/wx/fontmap.h index 920733ed35..53edf7f17c 100644 --- a/include/wx/fontmap.h +++ b/include/wx/fontmap.h @@ -20,8 +20,14 @@ // headers // ---------------------------------------------------------------------------- +#if wxUSE_FONTMAP + #include "wx/fontenc.h" // for wxFontEncoding +#if wxUSE_GUI + #include "wx/fontutil.h" // for wxNativeEncodingInfo +#endif // wxUSE_GUI + #if wxUSE_CONFIG class WXDLLEXPORT wxConfigBase; #endif // wxUSE_CONFIG @@ -53,6 +59,11 @@ public: // virtual dtor for a base class virtual ~wxFontMapper(); + // return instance of the wxFontMapper singleton + static wxFontMapper *Get(); + // set the sigleton to 'mapper' instance and return previous one + static wxFontMapper *Set(wxFontMapper *mapper); + #if wxUSE_GUI // find an alternative for the given encoding (which is supposed to not be // available on this system). If successful, return TRUE and fill info @@ -160,6 +171,7 @@ protected: #if wxUSE_CONFIG // config object and path (in it) to use wxConfigBase *m_config; + bool m_configIsDummy; #endif wxString m_configRootPath; @@ -173,6 +185,9 @@ protected: #endif // wxUSE_GUI friend class wxFontMapperPathChanger; + +private: + static wxFontMapper *sm_instance; }; // ---------------------------------------------------------------------------- @@ -180,6 +195,9 @@ protected: // ---------------------------------------------------------------------------- // the default font mapper for wxWindows programs -WXDLLEXPORT_DATA(extern wxFontMapper *) wxTheFontMapper; +// do NOT use! This is for backward compatibility, use wxFontMapper::Get() instead +#define wxTheFontMapper (wxFontMapper::Get()) + +#endif // wxUSE_FONTMAP #endif // _WX_FONTMAPPER_H_