Skip to content

Commit ed94cd6

Browse files
authored
Add ORBLayerDelegate (#20)
1 parent 4f26793 commit ed94cd6

File tree

7 files changed

+93
-6
lines changed

7 files changed

+93
-6
lines changed

Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorMode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ORB_ASSUME_NONNULL_BEGIN
1212
ORB_EXTERN_C_BEGIN
1313

1414
// TODO: Review those names later
15-
typedef ORB_ENUM(uint32_t, ORBColorMode) {
15+
typedef ORB_ENUM(int32_t, ORBColorMode) {
1616
ORBColorMode0 = 0,
1717
ORBColorMode1 = 1,
1818
ORBColorMode2 = 2,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// ORBDisplayList.h
3+
// OpenRenderBox
4+
5+
#pragma once
6+
7+
#include <OpenRenderBox/ORBBase.h>
8+
9+
#if ORB_OBJC_FOUNDATION
10+
11+
#include <Foundation/Foundation.h>
12+
13+
ORB_ASSUME_NONNULL_BEGIN
14+
15+
// TODO
16+
@interface ORBDisplayList : NSObject
17+
18+
@end
19+
20+
ORB_ASSUME_NONNULL_END
21+
22+
#endif

Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBLayer.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88

99
#if ORB_OBJC_FOUNDATION
1010

11+
#include <OpenRenderBox/ORBColor.h>
1112
#include <OpenRenderBoxObjC/Device/ORBDevice.h>
1213
#include <OpenRenderBoxObjC/Render/ORBDrawableStatistics.h>
13-
#include <OpenRenderBox/ORBColor.h>
14+
#include <OpenRenderBoxObjC/Render/_ORBDrawableDelegate.h>
15+
#include <OpenRenderBoxObjC/Render/ORBDisplayList.h>
1416

1517
//#include "RBImageQueueLayer.h"
1618
//#include "RBSurfaceContentsLayer.h"
17-
//#include "_RBDrawableDelegate-Protocol.h"
1819
//#include "_RBSharedSurfaceOwner-Protocol.h"
1920

2021
#include <QuartzCore/QuartzCore.h>
@@ -24,7 +25,7 @@
2425

2526
ORB_ASSUME_NONNULL_BEGIN
2627

27-
@interface ORBLayer: CALayer </*_RBDrawableDelegate, _RBSharedSurfaceOwner,*/ ORBDrawableStatistics>
28+
@interface ORBLayer: CALayer <_ORBDrawableDelegate, /*_RBSharedSurfaceOwner,*/ ORBDrawableStatistics>
2829

2930
@property (retain, nonatomic, nullable) ORBDevice *device;
3031
@property (nonatomic) BOOL rendersAsynchronously;
@@ -68,7 +69,7 @@ ORB_ASSUME_NONNULL_BEGIN
6869
- (BOOL)_willMoveSubsurface:(unsigned int)subsurface;
6970
- (void)copyImageInRect:(CGRect)rect options:(nullable id)options completionQueue:(nullable id)queue handler:(nullable id /* block */)handler;
7071
- (BOOL)displayWithBounds:(CGRect)bounds callback:(nullable id /* block */)callback;
71-
- (void)drawInDisplayList:(nullable id)list;
72+
- (void)drawInDisplayList:(nullable ORBDisplayList *)list;
7273
- (void)resetStatistics:(NSUInteger)statistics alpha:(double)alpha;
7374
- (void)waitUntilAsyncRenderingCompleted;
7475

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// ORBLayerDelegate.h
3+
// OpenRenderBox
4+
5+
#pragma once
6+
7+
#include <OpenRenderBox/ORBBase.h>
8+
9+
#if ORB_OBJC_FOUNDATION
10+
11+
#include <OpenRenderBoxObjC/Render/ORBDisplayList.h>
12+
13+
#include <Foundation/Foundation.h>
14+
#include <QuartzCore/QuartzCore.h>
15+
16+
ORB_ASSUME_NONNULL_BEGIN
17+
18+
@class ORBLayer;
19+
20+
@protocol ORBLayerDelegate <CALayerDelegate>
21+
22+
@required
23+
24+
@optional
25+
26+
- (void)RBLayer:(ORBLayer *)layer draw:(ORBDisplayList *)inDisplayList;
27+
- (nullable id)RBLayerDefaultDevice:(ORBLayer *)layer;
28+
29+
@end
30+
31+
ORB_ASSUME_NONNULL_END
32+
33+
#endif /* ORB_OBJC_FOUNDATION */
34+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// _ORBDrawableDelegate.h
3+
// OpenRenderBox
4+
5+
#pragma once
6+
7+
#include <OpenRenderBox/ORBBase.h>
8+
9+
#if ORB_OBJC_FOUNDATION
10+
11+
#include <Foundation/Foundation.h>
12+
13+
ORB_ASSUME_NONNULL_BEGIN
14+
15+
@protocol _ORBDrawableDelegate <NSObject>
16+
17+
@required
18+
19+
- (void)_RBDrawableStatisticsDidChange;
20+
21+
@optional
22+
23+
@end
24+
25+
ORB_ASSUME_NONNULL_END
26+
27+
#endif /* ORB_OBJC_FOUNDATION */
28+

Sources/OpenRenderBoxShims/Export.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
public typealias ORBColor = RBColor
88
public typealias ORBDevice = RBDevice
99
public typealias ORBLayer = RBLayer
10+
public typealias ORBLayerDelegate = RBLayerDelegate
11+
public typealias ORBDisplayList = RBDisplayList
1012
public typealias ORBPath = RBPath
1113
public typealias ORBUUID = RBUUID
1214
public let renderBoxEnabled = true

0 commit comments

Comments
 (0)