+#if wxOSX_USE_COCOA_OR_IPHONE
+extern CGContextRef wxOSXGetContextFromCurrentContext() ;
+#if wxOSX_USE_COCOA
+extern bool wxOSXLockFocus( WXWidget view) ;
+extern void wxOSXUnlockFocus( WXWidget view) ;
+#endif
+#endif
+
+#if 1 // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+
+// TODO test whether this private API also works under 10.3
+
+// copying values from NSCompositingModes (see also webkit and cairo sources)
+
+typedef enum CGCompositeOperation {
+ kCGCompositeOperationClear = 0,
+ kCGCompositeOperationCopy = 1,
+ kCGCompositeOperationSourceOver = 2,
+ kCGCompositeOperationSourceIn = 3,
+ kCGCompositeOperationSourceOut = 4,
+ kCGCompositeOperationSourceAtop = 5,
+ kCGCompositeOperationDestinationOver = 6,
+ kCGCompositeOperationDestinationIn = 7,
+ kCGCompositeOperationDestinationOut = 8,
+ kCGCompositeOperationDestinationAtop = 9,
+ kCGCompositeOperationXOR = 10,
+ kCGCompositeOperationPlusDarker = 11,
+// NS only, unsupported by CG : Highlight
+ kCGCompositeOperationPlusLighter = 12
+} CGCompositeOperation ;
+
+extern "C"
+{
+ CG_EXTERN void CGContextSetCompositeOperation (CGContextRef context, int operation);
+} ;
+
+#endif
+