1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/carbon/gdiobj.cpp
3 // Purpose: wxGDIObject class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/gdiobj.h"
17 #include "wx/gdicmn.h"
18 #include "wx/module.h"
22 #include "wx/osx/private.h"
25 // Linker will discard entire object file without this
26 wxFORCE_LINK_THIS_MODULE(gdiobj
)
28 class wxStockGDIMac
: public wxStockGDI
, public wxModule
31 virtual const wxFont
* GetFont(Item item
);
33 virtual bool OnInit();
34 virtual void OnExit();
37 typedef wxStockGDI super
;
38 DECLARE_DYNAMIC_CLASS(wxStockGDIMac
)
41 IMPLEMENT_DYNAMIC_CLASS(wxStockGDIMac
, wxModule
)
43 bool wxStockGDIMac::OnInit()
45 // Override default instance
50 void wxStockGDIMac::OnExit()
54 extern wxFont
* CreateNormalFont();
55 extern wxFont
* CreateSmallFont();
57 const wxFont
* wxStockGDIMac::GetFont(Item item
)
59 wxFont
* font
= static_cast<wxFont
*>(ms_stockObject
[item
]);
64 #if wxOSX_USE_COCOA_OR_CARBON
68 font
->MacCreateFromThemeFont(kThemeSystemFont
);
70 font
->MacCreateFromUIFont(kCTFontSystemFontType
);
76 font
->MacCreateFromThemeFont(kThemeSmallSystemFont
);
78 font
->MacCreateFromUIFont(kCTFontSmallSystemFontType
);
83 font
= CreateNormalFont() ;
86 font
= CreateSmallFont();
90 font
= const_cast<wxFont
*>(super::GetFont(item
));
93 ms_stockObject
[item
] = font
;