X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e40298d54ecd5b109222a7c60aa2ef084a304d69..85855db1c4812817e4e493f41550b3be06cde8ea:/src/mac/carbon/gdiobj.cpp diff --git a/src/mac/carbon/gdiobj.cpp b/src/mac/carbon/gdiobj.cpp index 528c5a7efe..f6c046cc61 100644 --- a/src/mac/carbon/gdiobj.cpp +++ b/src/mac/carbon/gdiobj.cpp @@ -9,14 +9,53 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "gdiobj.h" -#endif +#include "wx/wxprec.h" #include "wx/gdiobj.h" +#include "wx/gdicmn.h" +#include "wx/mac/private.h" -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) -#endif -// TODO: Nothing to do, unless you want to. +class wxStockGDIMac: public wxStockGDI +{ +public: + wxStockGDIMac(); + + virtual const wxFont* GetFont(Item item); + +private: + typedef wxStockGDI super; +}; + +static wxStockGDIMac gs_wxStockGDIMac_instance; + +wxStockGDIMac::wxStockGDIMac() +{ + // Override default instance + ms_instance = this; +} + +const wxFont* wxStockGDIMac::GetFont(Item item) +{ + wxFont* font = static_cast(ms_stockObject[item]); + if (font == NULL) + { + switch (item) + { + case FONT_NORMAL: + font = new wxFont; + font->MacCreateThemeFont(kThemeSystemFont); + break; + case FONT_SMALL: + font = new wxFont; + font->MacCreateThemeFont(kThemeSmallSystemFont); + break; + default: + font = const_cast(super::GetFont(item)); + break; + } + ms_stockObject[item] = font; + } + return font; +}