From 89d4022362bdb0a82de9bdddea8a9bb2e924e781 Mon Sep 17 00:00:00 2001 From: Andrew Hyatt Date: Wed, 18 Mar 2020 20:12:09 -0400 Subject: [PATCH] Allow ApplicationServices to be included in C code Remove all Objective-C syntax usages --- src/ImageIO/include/ImageIO/CGImageDestination.h | 9 ++++++--- src/ImageIO/include/ImageIO/CGImageSource.h | 3 +-- src/ImageIO/include/ImageIO/ImageIOBase.h | 2 ++ src/external/cocotron | 2 +- .../PrintCore/include/PrintCore/PrintCore.h | 5 ++--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ImageIO/include/ImageIO/CGImageDestination.h b/src/ImageIO/include/ImageIO/CGImageDestination.h index 962586035..af4a42f55 100644 --- a/src/ImageIO/include/ImageIO/CGImageDestination.h +++ b/src/ImageIO/include/ImageIO/CGImageDestination.h @@ -1,13 +1,14 @@ -@class O2ImageDestination; -typedef O2ImageDestination *CGImageDestinationRef; - #include +typedef struct CF_BRIDGED_TYPE(id) O2ImageDestination *CGImageDestinationRef; + #import #import #import #import +CF_IMPLICIT_BRIDGING_ENABLED + IMAGEIO_EXTERN const CFStringRef kCGImageDestinationLossyCompressionQuality; IMAGEIO_EXTERN const CFStringRef kCGImageDestinationBackgroundColor; IMAGEIO_EXTERN const CFStringRef kCGImageDestinationDPI; @@ -26,3 +27,5 @@ IMAGEIO_EXTERN void CGImageDestinationAddImage(CGImageDestinationRef self, CGIma IMAGEIO_EXTERN void CGImageDestinationAddImageFromSource(CGImageDestinationRef self, CGImageSourceRef imageSource, size_t index, CFDictionaryRef properties); IMAGEIO_EXTERN bool CGImageDestinationFinalize(CGImageDestinationRef self); + +CF_IMPLICIT_BRIDGING_DISABLED diff --git a/src/ImageIO/include/ImageIO/CGImageSource.h b/src/ImageIO/include/ImageIO/CGImageSource.h index c8f5edf99..8cfa59716 100644 --- a/src/ImageIO/include/ImageIO/CGImageSource.h +++ b/src/ImageIO/include/ImageIO/CGImageSource.h @@ -10,8 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #import #import -@class O2ImageSource; -typedef O2ImageSource *CGImageSourceRef; +typedef struct CF_BRIDGED_TYPE(id) O2ImageSource *CGImageSourceRef; #import diff --git a/src/ImageIO/include/ImageIO/ImageIOBase.h b/src/ImageIO/include/ImageIO/ImageIOBase.h index d428d21fa..e7933bfe1 100644 --- a/src/ImageIO/include/ImageIO/ImageIOBase.h +++ b/src/ImageIO/include/ImageIO/ImageIOBase.h @@ -23,4 +23,6 @@ #define IMAGEIO_EXTERN extern +#include + #endif diff --git a/src/external/cocotron b/src/external/cocotron index d5496c73f..44989417c 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit d5496c73f313a1604492c09f40d745dab898f7d4 +Subproject commit 44989417c3d35f87fd9503d8eb9c2cb73adcf2d7 diff --git a/src/frameworks/ApplicationServices/PrintCore/include/PrintCore/PrintCore.h b/src/frameworks/ApplicationServices/PrintCore/include/PrintCore/PrintCore.h index 33c0076c5..a1286572a 100644 --- a/src/frameworks/ApplicationServices/PrintCore/include/PrintCore/PrintCore.h +++ b/src/frameworks/ApplicationServices/PrintCore/include/PrintCore/PrintCore.h @@ -21,9 +21,8 @@ #ifndef _PrintCore_H_ #define _PrintCore_H_ -#import - -#import +/* Private */ +/* #import */ void* CPLAutoSelectCancel(void); void* CPLAutoSelectCopyLocation(void); -- 2.51.2