]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/gdiobj.cpp
moved win_gtk.h header to wx/gtk/private, it's for internal use only
[wxWidgets.git] / src / mac / carbon / gdiobj.cpp
index abd6b9da069f97f191fb5e1e2aaea609d6dab56a..76156134e021d06944aa8e76b287e675ec18293e 100644 (file)
 
 #ifndef WX_PRECOMP
     #include "wx/gdicmn.h"
+    #include "wx/module.h"
 #endif
 
+#include "wx/link.h"
 #include "wx/mac/private.h"
 
-class wxStockGDIMac: public wxStockGDI
+// Linker will discard entire object file without this
+wxFORCE_LINK_THIS_MODULE(gdiobj)
+
+class wxStockGDIMac: public wxStockGDI, public wxModule
 {
 public:
-    wxStockGDIMac();
-
     virtual const wxFont* GetFont(Item item);
 
+    virtual bool OnInit();
+    virtual void OnExit();
+
 private:
     typedef wxStockGDI super;
+    DECLARE_DYNAMIC_CLASS(wxStockGDIMac)
 };
 
-static wxStockGDIMac gs_wxStockGDIMac_instance;
+IMPLEMENT_DYNAMIC_CLASS(wxStockGDIMac, wxModule)
 
-wxStockGDIMac::wxStockGDIMac()
+bool wxStockGDIMac::OnInit()
 {
     // Override default instance
     ms_instance = this;
+    return true;
+}
+
+void wxStockGDIMac::OnExit()
+{
 }
 
 const wxFont* wxStockGDIMac::GetFont(Item item)
@@ -47,11 +59,11 @@ const wxFont* wxStockGDIMac::GetFont(Item item)
         {
         case FONT_NORMAL:
             font = new wxFont;
-            font->MacCreateThemeFont(kThemeSystemFont);
+            font->MacCreateFromThemeFont(kThemeSystemFont);
             break;
         case FONT_SMALL:
             font = new wxFont;
-            font->MacCreateThemeFont(kThemeSmallSystemFont);
+            font->MacCreateFromThemeFont(kThemeSmallSystemFont);
             break;
         default:
             font = const_cast<wxFont*>(super::GetFont(item));