]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/gdiobj.cpp
int warning
[wxWidgets.git] / src / mac / carbon / gdiobj.cpp
CommitLineData
e9576ca5 1/////////////////////////////////////////////////////////////////////////////
dd05139a 2// Name: src/mac/carbon/gdiobj.cpp
e9576ca5 3// Purpose: wxGDIObject class
a31a5f85 4// Author: Stefan Csomor
e9576ca5 5// Modified by:
a31a5f85 6// Created: 1998-01-01
e9576ca5 7// RCS-ID: $Id$
a31a5f85 8// Copyright: (c) Stefan Csomor
dd05139a 9// Licence: wxWindows licence
e9576ca5
SC
10/////////////////////////////////////////////////////////////////////////////
11
3d1a4878
SC
12#include "wx/wxprec.h"
13
e9576ca5 14#include "wx/gdiobj.h"
dd05139a
WS
15
16#ifndef WX_PRECOMP
17 #include "wx/gdicmn.h"
18#endif
19
f516d986 20#include "wx/mac/private.h"
e9576ca5 21
e9576ca5 22IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
e9576ca5 23
f516d986
VZ
24class wxStockGDIMac: public wxStockGDI
25{
26public:
27 wxStockGDIMac();
28
29 virtual const wxFont* GetFont(Item item);
30
31private:
32 typedef wxStockGDI super;
33};
34
35static wxStockGDIMac gs_wxStockGDIMac_instance;
36
37wxStockGDIMac::wxStockGDIMac()
38{
39 // Override default instance
40 ms_instance = this;
41}
42
43const 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}