X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5fe8354960174a56ee21c456ac3ba521a7b9bae5..69429a166f8b168228bbb89eb8c52903670f4fd2:/include/wx/fontmap.h diff --git a/include/wx/fontmap.h b/include/wx/fontmap.h index 70691e8afb..eb4c48ea7d 100644 --- a/include/wx/fontmap.h +++ b/include/wx/fontmap.h @@ -12,7 +12,7 @@ #ifndef _WX_FONTMAPPER_H_ #define _WX_FONTMAPPER_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "fontmap.h" #endif @@ -59,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 @@ -180,6 +185,9 @@ protected: #endif // wxUSE_GUI friend class wxFontMapperPathChanger; + +private: + static wxFontMapper *sm_instance; }; // ---------------------------------------------------------------------------- @@ -187,7 +195,8 @@ 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