]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/gdiobj.cpp
PCH build fix.
[wxWidgets.git] / src / mac / carbon / gdiobj.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/mac/carbon/gdiobj.cpp
3 // Purpose: wxGDIObject class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13
14 #include "wx/gdiobj.h"
15
16 #ifndef WX_PRECOMP
17 #include "wx/gdicmn.h"
18 #endif
19
20 #include "wx/mac/private.h"
21
22 IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
23
24 class wxStockGDIMac: public wxStockGDI
25 {
26 public:
27 wxStockGDIMac();
28
29 virtual const wxFont* GetFont(Item item);
30
31 private:
32 typedef wxStockGDI super;
33 };
34
35 static wxStockGDIMac gs_wxStockGDIMac_instance;
36
37 wxStockGDIMac::wxStockGDIMac()
38 {
39 // Override default instance
40 ms_instance = this;
41 }
42
43 const wxFont* wxStockGDIMac::GetFont(Item item)
44 {
45 wxFont* font = static_cast<wxFont*>(ms_stockObject[item]);
46 if (font == NULL)
47 {
48 switch (item)
49 {
50 case FONT_NORMAL:
51 font = new wxFont;
52 font->MacCreateThemeFont(kThemeSystemFont);
53 break;
54 case FONT_SMALL:
55 font = new wxFont;
56 font->MacCreateThemeFont(kThemeSmallSystemFont);
57 break;
58 default:
59 font = const_cast<wxFont*>(super::GetFont(item));
60 break;
61 }
62 ms_stockObject[item] = font;
63 }
64 return font;
65 }