]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/utilscocoa.mm
1945421 applied
[wxWidgets.git] / src / mac / carbon / utilscocoa.mm
index b802837611c435db2252af9956775f948a540333..e2ac95f9e6e4ebc9d0b3ff129742c9d1648aed8a 100644 (file)
 
 #include <Cocoa/Cocoa.h>
 
 
 #include <Cocoa/Cocoa.h>
 
+#ifdef __WXMAC__
 #include "wx/mac/private.h"
 #include "wx/mac/private.h"
+#endif
+
+#ifdef __WXMAC__
 
 bool wxMacInitCocoa()
 {
 
 bool wxMacInitCocoa()
 {
@@ -32,6 +36,19 @@ wxMacAutoreleasePool::~wxMacAutoreleasePool()
     [(NSAutoreleasePool*)m_pool release];
 }
 
     [(NSAutoreleasePool*)m_pool release];
 }
 
+#endif
+
+#ifdef __WXCOCOCA__
+
+CGContextRef wxMacGetContextFromCurrentNSContext()
+{
+    CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext]
+                                          graphicsPort];
+    return context;
+}
+
+#endif
+
 // ----------------------------------------------------------------------------
 // NSObject Utils
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // NSObject Utils
 // ----------------------------------------------------------------------------