X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc9361e3ec5b81a7e8c32d93a03aea0b2cd3e045..0685aa9eb65aae0c930ef2a001002ac217cf5ce1:/include/wx/font.h diff --git a/include/wx/font.h b/include/wx/font.h index 9b87cafd11..3ef53d3580 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -19,6 +19,7 @@ #include "wx/defs.h" // for wxDEFAULT &c #include "wx/fontenc.h" // the font encoding constants #include "wx/gdiobj.h" // the base class +#include "wx/gdicmn.h" // for wxGDIObjListBase // ---------------------------------------------------------------------------- // forward declarations @@ -155,13 +156,9 @@ public: // from the string representation of wxNativeFontInfo static wxFont *New(const wxString& strNativeFontDesc); - // was the font successfully created? - bool Ok() const { return IsOk(); } - bool IsOk() const { return m_refData != NULL; } - // comparison - bool operator == (const wxFont& font) const; - bool operator != (const wxFont& font) const; + bool operator==(const wxFont& font) const; + bool operator!=(const wxFont& font) const { return !(*this == font); } // accessors: get the font characteristics virtual int GetPointSize() const = 0; @@ -253,5 +250,33 @@ WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font); #include "wx/os2/font.h" #endif +class WXDLLIMPEXP_CORE wxFontList: public wxGDIObjListBase +{ +public: + wxFont *FindOrCreateFont(int pointSize, + wxFontFamily family, + wxFontStyle style, + wxFontWeight weight, + bool underline = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT); + +#if FUTURE_WXWIN_COMPATIBILITY_3_0 + wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight, + bool underline = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { return FindOrCreateFont(pointSize, (wxFontFamily)family, (wxFontStyle)style, + (wxFontWeight)weight, underline, face, encoding); } +#endif + +#if WXWIN_COMPATIBILITY_2_6 + wxDEPRECATED( void AddFont(wxFont*) ); + wxDEPRECATED( void RemoveFont(wxFont*) ); +#endif +}; + +extern WXDLLEXPORT_DATA(wxFontList*) wxTheFontList; + #endif // _WX_FONT_H_BASE_