Quartz: Expose methods for bridge with Opal

Expose methods for bridging Opal types and GUI classes. The new
relations are the following:

a) NSImage -> CGImage
b) NSColor -> CGColor
c) NSImageRep -> CGImage

The actual implementation for this bridge is implemented in the Backend
library.

This significantly improves compatibility with AppKit.
This commit is contained in:
Daniel Ferreira 2017-07-13 06:55:22 +10:00 committed by Ivan Vučica
parent 1cb15c2735
commit dc9ff85436
3 changed files with 23 additions and 0 deletions

View file

@ -286,5 +286,12 @@ APPKIT_EXPORT NSString *NSSystemColorsDidChangeNotification;
@end
#endif
typedef struct CGColor *CGColorRef;
@interface NSColor (GSQuartz)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (CGColorRef)CGColor;
#endif
@end
#endif // _GNUstep_H_NSColor

View file

@ -485,6 +485,13 @@ APPKIT_EXTERN NSString *const NSImageNameFolder;
@end
@interface NSImage (GSQuartz)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
- (CGImageRef)CGImageForProposedRect: (NSRect *)proposedDestRect
context: (NSGraphicsContext *)referenceContext
hints: (NSDictionary *)hints;
#endif
@end
@interface NSBundle (NSImageAdditions)

View file

@ -177,6 +177,15 @@ enum {
@end
typedef struct CGImage *CGImageRef;
@interface NSImageRep (GSQuartz)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
- (CGImageRef)CGImageForProposedRect: (NSRect *)proposedDestRect
context: (NSGraphicsContext *)referenceContext
hints: (NSDictionary *)hints;
#endif
@end
APPKIT_EXPORT NSString *NSImageRepRegistryChangedNotification;
#endif // _GNUstep_H_NSImageRep