X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..be7a101366995b7b7bb76e3d5b1e7dd8fc9a1af8:/include/wx/fontmap.h?ds=sidebyside diff --git a/include/wx/fontmap.h b/include/wx/fontmap.h index 43285146c0..af3e7b5603 100644 --- a/include/wx/fontmap.h +++ b/include/wx/fontmap.h @@ -6,13 +6,13 @@ // Created: 04.11.99 // RCS-ID: $Id$ // Copyright: (c) Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FONTMAPPER_H_ #define _WX_FONTMAPPER_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "fontmap.h" #endif @@ -20,7 +20,10 @@ // headers // ---------------------------------------------------------------------------- +#if wxUSE_FONTMAP + #include "wx/fontenc.h" // for wxFontEncoding + #if wxUSE_GUI #include "wx/fontutil.h" // for wxNativeEncodingInfo #endif // wxUSE_GUI @@ -56,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 @@ -163,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; @@ -176,6 +185,11 @@ protected: #endif // wxUSE_GUI friend class wxFontMapperPathChanger; + +private: + static wxFontMapper *sm_instance; + + DECLARE_NO_COPY_CLASS(wxFontMapper) }; // ---------------------------------------------------------------------------- @@ -183,6 +197,16 @@ 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()) + +#else // !wxUSE_FONTMAP + +#if wxUSE_GUI + // wxEncodingToCodepage (utils.cpp) needs wxGetNativeFontEncoding + #include "wx/fontutil.h" +#endif + +#endif // wxUSE_FONTMAP/!wxUSE_FONTMAP #endif // _WX_FONTMAPPER_H_