| // Private QuartzCore + CoreGraphics APIs for cross-process layer hosting. | |
| // CAContext/CALayerHost have been stable from macOS 10.10 through Sequoia (15.x). | |
| // No entitlements needed — works for same-user processes. | |
| // WindowServer connection ID for the current process | |
| extern "C" uint32_t CGSMainConnectionID(void); | |
| // CAContext — server side: wraps a CALayer and exposes it to other processes via contextId | |
| @interface CAContext : NSObject | |
| + (instancetype)contextWithCGSConnection:(uint32_t)cid options:(NSDictionary *)opts; | |
| @property (readonly) uint32_t contextId; | |
| @property (retain) CALayer *layer; | |
| @end | |
| // CALayerHost — client side: a CALayer subclass that renders a remote CAContext by ID | |
| @interface CALayerHost : CALayer | |
| @property uint32_t contextId; | |
| @end | |