]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/gdiobj.cpp
Include wx/pen.h according to precompiled headers of wx/wx.h (with other minor cleaning).
[wxWidgets.git] / src / mac / classic / gdiobj.cpp
index 5a1fff8a0298bbf4ecbd2dd75ad81907b4c2fbd0..9b74779924c31da498b57262c8a3a4942210dac1 100644 (file)
@@ -6,17 +6,57 @@
 // Created:     1998-01-01
 // RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Created:     1998-01-01
 // RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
-// Licence:       wxWidgets licence
+// Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "gdiobj.h"
-#endif
-
 #include "wx/gdiobj.h"
 #include "wx/gdiobj.h"
+#include "wx/gdicmn.h"
+#include "wx/mac/private.h"
 
 
-#if !USE_SHARED_LIBRARIES
 IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
 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 = wx_static_cast(wxFont*, ms_stockObject[item]);
+    if (font == NULL)
+    {
+        Str255 fontName;
+        SInt16 fontSize;
+        Style fontStyle;
+        switch (item)
+        {
+        case FONT_NORMAL:
+            GetThemeFont(kThemeSystemFont, GetApplicationScript(), fontName, &fontSize, &fontStyle);
+            font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxNORMAL, false, wxMacMakeStringFromPascal(fontName));
+            break;
+        case FONT_SMALL:
+            GetThemeFont(kThemeSmallSystemFont, GetApplicationScript(), fontName, &fontSize, &fontStyle);
+            font = new wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL, false, wxMacMakeStringFromPascal(fontName));
+            break;
+        default:
+            font = wx_const_cast(wxFont*, super::GetFont(item));
+            break;
+        }
+        ms_stockObject[item] = font;
+    }
+    return font;
+}