From f4a7b7a39b73061169f7e420d2b6d7d494368a92 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 5 Mar 2008 21:19:46 +0000 Subject: [PATCH] graphics context additions (work in progress for cocoa integration) and merging graphics bitmap additions from Kevin O. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52346 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/utilscocoa.mm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 // ----------------------------------------------------------------------------