File size: 856 Bytes
0548359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
// 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.

#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>

// 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