diff --git a/src/mac/carbon/utilscocoa.mm b/src/mac/carbon/utilscocoa.mm index b802837611..e2ac95f9e6 100644 --- a/src/mac/carbon/utilscocoa.mm +++ b/src/mac/carbon/utilscocoa.mm @@ -13,7 +13,11 @@ #include +#ifdef __WXMAC__ #include "wx/mac/private.h" +#endif + +#ifdef __WXMAC__ bool wxMacInitCocoa() { @@ -32,6 +36,19 @@ wxMacAutoreleasePool::~wxMacAutoreleasePool() [(NSAutoreleasePool*)m_pool release]; } +#endif + +#ifdef __WXCOCOCA__ + +CGContextRef wxMacGetContextFromCurrentNSContext() +{ + CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] + graphicsPort]; + return context; +} + +#endif + // ---------------------------------------------------------------------------- // NSObject Utils // ----------------------------------------------------------------------------