@nativescript/canvas 1.0.0 → 1.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Canvas/common.d.ts +1 -0
- package/Canvas/common.js +69 -32
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.js +1 -12
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.ios.js +23 -14
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.d.ts +1 -0
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.js +3 -0
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/common.d.ts +3 -1
- package/Canvas2D/CanvasRenderingContext2D/common.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.android.d.ts +3 -1
- package/Canvas2D/CanvasRenderingContext2D/index.android.js +48 -37
- package/Canvas2D/CanvasRenderingContext2D/index.android.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +6 -0
- package/Canvas2D/CanvasRenderingContext2D/index.ios.d.ts +4 -1
- package/Canvas2D/CanvasRenderingContext2D/index.ios.js +119 -113
- package/Canvas2D/CanvasRenderingContext2D/index.ios.js.map +1 -1
- package/Canvas2D/DOMMatrix/common.d.ts +1 -0
- package/Canvas2D/DOMMatrix/common.js +3 -0
- package/Canvas2D/DOMMatrix/common.js.map +1 -1
- package/Canvas2D/ImageData/common.d.ts +1 -0
- package/Canvas2D/ImageData/common.js +3 -0
- package/Canvas2D/ImageData/common.js.map +1 -1
- package/Canvas2D/Path2D/Path2D.android.d.ts +2 -0
- package/Canvas2D/Path2D/Path2D.android.js +8 -0
- package/Canvas2D/Path2D/Path2D.android.js.map +1 -1
- package/Canvas2D/Path2D/Path2D.d.ts +4 -0
- package/Canvas2D/Path2D/Path2D.ios.d.ts +2 -0
- package/Canvas2D/Path2D/Path2D.ios.js +8 -0
- package/Canvas2D/Path2D/Path2D.ios.js.map +1 -1
- package/Canvas2D/Path2D/common.d.ts +4 -1
- package/Canvas2D/Path2D/common.js +3 -0
- package/Canvas2D/Path2D/common.js.map +1 -1
- package/Canvas2D/TextMetrics/common.d.ts +1 -0
- package/Canvas2D/TextMetrics/common.js +3 -0
- package/Canvas2D/TextMetrics/common.js.map +1 -1
- package/ImageAsset/ImageAsset.android.js +4 -4
- package/ImageAsset/ImageAsset.android.js.map +1 -1
- package/ImageAsset/ImageAsset.ios.js +3 -3
- package/ImageAsset/ImageAsset.ios.js.map +1 -1
- package/ImageAsset/common.d.ts +1 -0
- package/ImageAsset/common.js +3 -0
- package/ImageAsset/common.js.map +1 -1
- package/ImageBitmap/common.d.ts +1 -0
- package/ImageBitmap/common.js +3 -0
- package/ImageBitmap/common.js.map +1 -1
- package/ImageBitmap/index.android.js +47 -21
- package/ImageBitmap/index.android.js.map +1 -1
- package/ImageBitmap/index.ios.d.ts +2 -1
- package/ImageBitmap/index.ios.js +21 -32
- package/ImageBitmap/index.ios.js.map +1 -1
- package/SVG/SVG.js.map +1 -1
- package/TextDecoder/common.d.ts +1 -0
- package/TextDecoder/common.js +3 -0
- package/TextDecoder/common.js.map +1 -1
- package/TextEncoder/common.d.ts +1 -0
- package/TextEncoder/common.js +3 -0
- package/TextEncoder/common.js.map +1 -1
- package/WebGL/WebGLActiveInfo.d.ts +7 -3
- package/WebGL/WebGLActiveInfo.js +26 -3
- package/WebGL/WebGLActiveInfo.js.map +1 -1
- package/WebGL/WebGLProgram.d.ts +0 -1
- package/WebGL/WebGLProgram.js +0 -3
- package/WebGL/WebGLProgram.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.android.js +3 -2
- package/WebGL/WebGLRenderingContext/index.android.js.map +1 -1
- package/angular/esm2020/index.mjs +17 -0
- package/angular/esm2020/nativescript-canvas-angular.mjs +5 -0
- package/angular/fesm2015/nativescript-canvas-angular.mjs +24 -0
- package/angular/fesm2015/nativescript-canvas-angular.mjs.map +1 -0
- package/angular/fesm2020/nativescript-canvas-angular.mjs +24 -0
- package/angular/fesm2020/nativescript-canvas-angular.mjs.map +1 -0
- package/angular/index.d.ts +4 -0
- package/angular/package.json +20 -8
- package/package.json +2 -2
- package/platforms/android/include.gradle +1 -1
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +85 -6
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +68 -32
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +75519 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{arm64.swiftinterface → arm64-apple-ios.private.swiftinterface} +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/module.modulemap +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +160 -12
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +68 -32
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +75519 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{arm64.swiftinterface → arm64-apple-ios-simulator.private.swiftinterface} +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +75519 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{x86_64.swiftinterface → x86_64-apple-ios-simulator.private.swiftinterface} +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/module.modulemap +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +41 -85
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/typings/objc!CanvasNative.d.ts +2036 -0
- package/typings/objc!CanvasNative.js +1 -0
- package/typings/objc!CanvasNative.js.map +1 -0
- package/utils.d.ts +3 -1
- package/utils.js +7 -20
- package/utils.js.map +1 -1
- package/angular/bundles/nativescript-canvas-angular.umd.js +0 -29
- package/angular/bundles/nativescript-canvas-angular.umd.js.map +0 -1
- package/angular/esm2015/index.js +0 -12
- package/angular/esm2015/nativescript-canvas-angular.js +0 -5
- package/angular/fesm2015/nativescript-canvas-angular.js +0 -19
- package/angular/fesm2015/nativescript-canvas-angular.js.map +0 -1
- package/angular/nativescript-canvas-angular.d.ts +0 -4
- package/angular/nativescript-canvas-angular.metadata.json +0 -1
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64.swiftdoc +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
#if 0
|
|
2
|
+
#elif defined(__arm64__) && __arm64__
|
|
3
|
+
// Generated by Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)
|
|
2
4
|
#ifndef CANVASNATIVE_SWIFT_H
|
|
3
5
|
#define CANVASNATIVE_SWIFT_H
|
|
4
6
|
#pragma clang diagnostic push
|
|
@@ -21,11 +23,20 @@
|
|
|
21
23
|
# include <swift/objc-prologue.h>
|
|
22
24
|
#endif
|
|
23
25
|
|
|
26
|
+
#pragma clang diagnostic ignored "-Wduplicate-method-match"
|
|
24
27
|
#pragma clang diagnostic ignored "-Wauto-import"
|
|
28
|
+
#if defined(__OBJC__)
|
|
25
29
|
#include <Foundation/Foundation.h>
|
|
30
|
+
#endif
|
|
31
|
+
#if defined(__cplusplus)
|
|
32
|
+
#include <cstdint>
|
|
33
|
+
#include <cstddef>
|
|
34
|
+
#include <cstdbool>
|
|
35
|
+
#else
|
|
26
36
|
#include <stdint.h>
|
|
27
37
|
#include <stddef.h>
|
|
28
38
|
#include <stdbool.h>
|
|
39
|
+
#endif
|
|
29
40
|
|
|
30
41
|
#if !defined(SWIFT_TYPEDEFS)
|
|
31
42
|
# define SWIFT_TYPEDEFS 1
|
|
@@ -181,15 +192,45 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
181
192
|
#else
|
|
182
193
|
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
|
183
194
|
#endif
|
|
195
|
+
#if defined(__OBJC__)
|
|
184
196
|
#if !defined(IBSegueAction)
|
|
185
197
|
# define IBSegueAction
|
|
186
198
|
#endif
|
|
199
|
+
#endif
|
|
200
|
+
#if !defined(SWIFT_EXTERN)
|
|
201
|
+
# if defined(__cplusplus)
|
|
202
|
+
# define SWIFT_EXTERN extern "C"
|
|
203
|
+
# else
|
|
204
|
+
# define SWIFT_EXTERN extern
|
|
205
|
+
# endif
|
|
206
|
+
#endif
|
|
207
|
+
#if !defined(SWIFT_CALL)
|
|
208
|
+
# define SWIFT_CALL __attribute__((swiftcall))
|
|
209
|
+
#endif
|
|
210
|
+
#if defined(__cplusplus)
|
|
211
|
+
#if !defined(SWIFT_NOEXCEPT)
|
|
212
|
+
# define SWIFT_NOEXCEPT noexcept
|
|
213
|
+
#endif
|
|
214
|
+
#else
|
|
215
|
+
#if !defined(SWIFT_NOEXCEPT)
|
|
216
|
+
# define SWIFT_NOEXCEPT
|
|
217
|
+
#endif
|
|
218
|
+
#endif
|
|
219
|
+
#if defined(__cplusplus)
|
|
220
|
+
#if !defined(SWIFT_CXX_INT_DEFINED)
|
|
221
|
+
#define SWIFT_CXX_INT_DEFINED
|
|
222
|
+
namespace swift {
|
|
223
|
+
using Int = ptrdiff_t;
|
|
224
|
+
using UInt = size_t;
|
|
225
|
+
}
|
|
226
|
+
#endif
|
|
227
|
+
#endif
|
|
228
|
+
#if defined(__OBJC__)
|
|
187
229
|
#if __has_feature(modules)
|
|
188
230
|
#if __has_warning("-Watimport-in-framework-header")
|
|
189
231
|
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
190
232
|
#endif
|
|
191
233
|
@import CoreFoundation;
|
|
192
|
-
@import CoreGraphics;
|
|
193
234
|
@import CoreVideo;
|
|
194
235
|
@import Dispatch;
|
|
195
236
|
@import Foundation;
|
|
@@ -199,6 +240,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
199
240
|
@import UIKit;
|
|
200
241
|
#endif
|
|
201
242
|
|
|
243
|
+
#endif
|
|
202
244
|
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
|
203
245
|
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
|
204
246
|
#if __has_warning("-Wpragma-clang-attribute")
|
|
@@ -206,6 +248,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
206
248
|
#endif
|
|
207
249
|
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
|
208
250
|
#pragma clang diagnostic ignored "-Wnullability"
|
|
251
|
+
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
|
|
209
252
|
|
|
210
253
|
#if __has_attribute(external_source_symbol)
|
|
211
254
|
# pragma push_macro("any")
|
|
@@ -214,7 +257,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
214
257
|
# pragma pop_macro("any")
|
|
215
258
|
#endif
|
|
216
259
|
|
|
217
|
-
|
|
260
|
+
#if defined(__OBJC__)
|
|
218
261
|
@class NSCoder;
|
|
219
262
|
|
|
220
263
|
SWIFT_CLASS_NAMED("CanvasCPUView")
|
|
@@ -270,7 +313,7 @@ SWIFT_CLASS_NAMED("TNSAnimationFrame")
|
|
|
270
313
|
@class TNSDOMMatrix;
|
|
271
314
|
@protocol TNSCanvasListener;
|
|
272
315
|
@class TNSCanvasRenderingContext;
|
|
273
|
-
@class
|
|
316
|
+
@class TNSContextAttributes;
|
|
274
317
|
|
|
275
318
|
SWIFT_CLASS_NAMED("TNSCanvas")
|
|
276
319
|
@interface TNSCanvas : UIView
|
|
@@ -287,6 +330,7 @@ SWIFT_CLASS_NAMED("TNSCanvas")
|
|
|
287
330
|
- (void)toDataURLAsync:(NSString * _Nonnull)type :(void (^ _Nonnull)(NSString * _Nonnull))callback;
|
|
288
331
|
- (void)toDataURLAsync:(NSString * _Nonnull)type :(float)format :(void (^ _Nonnull)(NSString * _Nonnull))callback;
|
|
289
332
|
- (NSArray<NSNumber *> * _Nonnull)snapshot SWIFT_WARN_UNUSED_RESULT;
|
|
333
|
+
- (NSArray<NSNumber *> * _Nonnull)snapshotEncoded SWIFT_WARN_UNUSED_RESULT;
|
|
290
334
|
@property (nonatomic, readonly) BOOL isGL;
|
|
291
335
|
- (GLint)getId SWIFT_WARN_UNUSED_RESULT;
|
|
292
336
|
@property (nonatomic, readonly) float width;
|
|
@@ -299,6 +343,7 @@ SWIFT_CLASS_NAMED("TNSCanvas")
|
|
|
299
343
|
- (nonnull instancetype)initWithFrame:(CGRect)frame useCpu:(BOOL)useCpu OBJC_DESIGNATED_INITIALIZER;
|
|
300
344
|
- (void)setListener:(id <TNSCanvasListener> _Nullable)listener;
|
|
301
345
|
@property (nonatomic, readonly) float fps;
|
|
346
|
+
+ (void)layoutView:(UIView * _Nonnull)view :(CGFloat)width :(CGFloat)height;
|
|
302
347
|
- (void)layoutSubviews;
|
|
303
348
|
- (void)resume;
|
|
304
349
|
- (void)pause;
|
|
@@ -307,7 +352,9 @@ SWIFT_CLASS_NAMED("TNSCanvas")
|
|
|
307
352
|
- (void)handleMoveOffMain;
|
|
308
353
|
- (void)handleMoveToMain;
|
|
309
354
|
- (TNSCanvasRenderingContext * _Nullable)getContext:(NSString * _Nonnull)type SWIFT_WARN_UNUSED_RESULT;
|
|
310
|
-
- (TNSCanvasRenderingContext * _Nullable)
|
|
355
|
+
- (TNSCanvasRenderingContext * _Nullable)getContextWithType:(NSString * _Nonnull)type attributes:(NSString * _Nonnull)attributes SWIFT_WARN_UNUSED_RESULT;
|
|
356
|
+
- (TNSCanvasRenderingContext * _Nullable)getContext:(NSString * _Nonnull)type contextAttributes:(NSDictionary<NSString *, id> * _Nonnull)contextAttributes SWIFT_WARN_UNUSED_RESULT;
|
|
357
|
+
- (TNSCanvasRenderingContext * _Nullable)getContextWithType:(NSString * _Nonnull)type contextAttributes:(TNSContextAttributes * _Nonnull)contextAttributes SWIFT_WARN_UNUSED_RESULT;
|
|
311
358
|
- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
|
|
312
359
|
@end
|
|
313
360
|
|
|
@@ -333,6 +380,7 @@ enum TNSTextBaseLine : NSInteger;
|
|
|
333
380
|
enum TNSFillRule : NSInteger;
|
|
334
381
|
@class TNSLinearGradient;
|
|
335
382
|
@class TNSRadialGradient;
|
|
383
|
+
@class TNSConicGradient;
|
|
336
384
|
enum TNSPatternRepetition : NSInteger;
|
|
337
385
|
@class TNSImageData;
|
|
338
386
|
@class TNSTextMetrics;
|
|
@@ -357,7 +405,9 @@ SWIFT_CLASS_NAMED("TNSCanvasRenderingContext2D")
|
|
|
357
405
|
@property (nonatomic) float shadowOffsetY;
|
|
358
406
|
@property (nonatomic) enum TNSTextAlignment textAlign;
|
|
359
407
|
@property (nonatomic) enum TNSTextBaseLine textBaseline;
|
|
408
|
+
- (void)setFillStyleWithString:(NSString * _Nonnull)color;
|
|
360
409
|
@property (nonatomic, strong) id <ICanvasColorStyle> _Nonnull fillStyle;
|
|
410
|
+
- (void)setStrokeStyleWithString:(NSString * _Nonnull)color;
|
|
361
411
|
@property (nonatomic, strong) id <ICanvasColorStyle> _Nonnull strokeStyle;
|
|
362
412
|
- (void)fillRect:(float)x :(float)y :(float)width :(float)height;
|
|
363
413
|
- (void)strokeRect:(float)x :(float)y :(float)width :(float)height;
|
|
@@ -366,6 +416,9 @@ SWIFT_CLASS_NAMED("TNSCanvasRenderingContext2D")
|
|
|
366
416
|
- (void)strokeText:(NSString * _Nonnull)text :(float)x :(float)y;
|
|
367
417
|
- (void)strokeText:(NSString * _Nonnull)text :(float)x :(float)y :(float)width;
|
|
368
418
|
- (void)rect:(float)x :(float)y :(float)width :(float)height;
|
|
419
|
+
- (void)roundRectWithX:(float)x y:(float)y width:(float)width height:(float)height topLeft:(float)topLeft topRight:(float)topRight bottomRight:(float)bottomRight bottomLeft:(float)bottomLeft;
|
|
420
|
+
- (void)roundRectWithX:(float)x y:(float)y width:(float)width height:(float)height radii:(float)radii;
|
|
421
|
+
- (void)roundRect:(float)x :(float)y :(float)width :(float)height :(NSArray<NSNumber *> * _Nonnull)radii;
|
|
369
422
|
- (void)fill;
|
|
370
423
|
- (void)fillWithValue:(id _Nonnull)value;
|
|
371
424
|
- (void)fill:(TNSPath2D * _Nonnull)path :(enum TNSFillRule)rule;
|
|
@@ -389,6 +442,7 @@ SWIFT_CLASS_NAMED("TNSCanvasRenderingContext2D")
|
|
|
389
442
|
- (TNSCanvas * _Nonnull)getCanvas SWIFT_WARN_UNUSED_RESULT;
|
|
390
443
|
- (TNSLinearGradient * _Nonnull)createLinearGradient:(float)x0 :(float)y0 :(float)x1 :(float)y1 SWIFT_WARN_UNUSED_RESULT;
|
|
391
444
|
- (TNSRadialGradient * _Nonnull)createRadialGradient:(float)x0 :(float)y0 :(float)r0 :(float)x1 :(float)y1 :(float)r1 SWIFT_WARN_UNUSED_RESULT;
|
|
445
|
+
- (TNSConicGradient * _Nonnull)createConicGradient:(float)startAngle :(float)x :(float)y SWIFT_WARN_UNUSED_RESULT;
|
|
392
446
|
- (id _Nullable)createPattern:(id _Nonnull)value :(enum TNSPatternRepetition)repetition SWIFT_WARN_UNUSED_RESULT;
|
|
393
447
|
- (void)setTransform:(float)a :(float)b :(float)c :(float)d :(float)e :(float)f;
|
|
394
448
|
- (void)scale:(float)x :(float)y;
|
|
@@ -454,6 +508,11 @@ SWIFT_CLASS_NAMED("TNSRadialGradient")
|
|
|
454
508
|
@end
|
|
455
509
|
|
|
456
510
|
|
|
511
|
+
SWIFT_CLASS_NAMED("TNSConicGradient")
|
|
512
|
+
@interface TNSConicGradient : TNSGradient
|
|
513
|
+
@end
|
|
514
|
+
|
|
515
|
+
|
|
457
516
|
SWIFT_CLASS_NAMED("TNSPattern")
|
|
458
517
|
@interface TNSPattern : NSObject <ICanvasColorStyle>
|
|
459
518
|
- (void)setTransformWithMatrix:(TNSDOMMatrix * _Nonnull)matrix;
|
|
@@ -492,6 +551,12 @@ typedef SWIFT_ENUM_NAMED(NSInteger, TNSCompositeOperationType, "TNSCompositeOper
|
|
|
492
551
|
};
|
|
493
552
|
|
|
494
553
|
|
|
554
|
+
SWIFT_CLASS_NAMED("TNSContextAttributes")
|
|
555
|
+
@interface TNSContextAttributes : NSObject
|
|
556
|
+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
557
|
+
@end
|
|
558
|
+
|
|
559
|
+
|
|
495
560
|
SWIFT_CLASS_NAMED("TNSDOMMatrix")
|
|
496
561
|
@interface TNSDOMMatrix : NSObject
|
|
497
562
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
@@ -534,6 +599,7 @@ SWIFT_CLASS_NAMED("TNSFramebufferAttachmentParameter")
|
|
|
534
599
|
- (nonnull instancetype)initWithIsTexture:(BOOL)isTexture isRenderbuffer:(BOOL)isRenderbuffer value:(int32_t)value OBJC_DESIGNATED_INITIALIZER;
|
|
535
600
|
@end
|
|
536
601
|
|
|
602
|
+
@class NSData;
|
|
537
603
|
@class UIImage;
|
|
538
604
|
enum TNSImageAssetFormat : NSInteger;
|
|
539
605
|
|
|
@@ -547,6 +613,8 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, strong) dispatch_queue_t _Null
|
|
|
547
613
|
- (BOOL)loadImageFromUrlWithUrl:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT;
|
|
548
614
|
- (void)loadImageFromUrlAsyncWithUrl:(NSString * _Nonnull)url callback:(void (^ _Nonnull)(NSString * _Nullable))callback;
|
|
549
615
|
- (void)loadImageFromPathAsyncWithPath:(NSString * _Nonnull)path callback:(void (^ _Nonnull)(NSString * _Nullable))callback;
|
|
616
|
+
- (BOOL)loadImageFromBuffer:(NSData * _Nonnull)buffer SWIFT_WARN_UNUSED_RESULT;
|
|
617
|
+
- (void)loadImageFromBufferAsync:(NSData * _Nonnull)buffer callback:(void (^ _Nonnull)(NSString * _Nullable))callback;
|
|
550
618
|
- (BOOL)loadImageFromBytesWithArray:(NSArray<NSNumber *> * _Nonnull)array SWIFT_WARN_UNUSED_RESULT;
|
|
551
619
|
- (void)loadImageFromBytesAsyncWithArray:(NSArray<NSNumber *> * _Nonnull)array callback:(void (^ _Nonnull)(NSString * _Nullable))callback;
|
|
552
620
|
- (BOOL)loadImageFromImageWithImage:(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
|
|
@@ -571,7 +639,6 @@ typedef SWIFT_ENUM_NAMED(NSInteger, TNSImageAssetFormat, "TNSImageAssetFormat",
|
|
|
571
639
|
};
|
|
572
640
|
|
|
573
641
|
@class TNSImageBitmapOptions;
|
|
574
|
-
@class NSData;
|
|
575
642
|
|
|
576
643
|
SWIFT_CLASS_NAMED("TNSImageBitmap")
|
|
577
644
|
@interface TNSImageBitmap : NSObject
|
|
@@ -689,6 +756,9 @@ SWIFT_CLASS_NAMED("TNSPath2D")
|
|
|
689
756
|
- (void)ellipse:(float)x :(float)y :(float)radiusX :(float)radiusY :(float)rotation :(float)startAngle :(float)endAngle;
|
|
690
757
|
- (void)ellipse:(float)x :(float)y :(float)radiusX :(float)radiusY :(float)rotation :(float)startAngle :(float)endAngle :(BOOL)anticlockwise;
|
|
691
758
|
- (void)rect:(float)x :(float)y :(float)width :(float)height;
|
|
759
|
+
- (void)roundRect:(float)x :(float)y :(float)width :(float)height :(float)topLeft :(float)topRight :(float)bottomRight :(float)bottomLeft;
|
|
760
|
+
- (void)roundRectWithRadii:(float)x :(float)y :(float)width :(float)height :(float)radii;
|
|
761
|
+
- (void)roundRectWithX:(float)x y:(float)y width:(float)width height:(float)height radii:(NSArray<NSNumber *> * _Nonnull)radii;
|
|
692
762
|
@end
|
|
693
763
|
|
|
694
764
|
typedef SWIFT_ENUM(NSInteger, TNSPatternRepetition, open) {
|
|
@@ -715,6 +785,8 @@ SWIFT_CLASS_NAMED("TNSSVG")
|
|
|
715
785
|
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
|
|
716
786
|
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
|
|
717
787
|
- (void)drawRect:(CGRect)rect;
|
|
788
|
+
- (UIImage * _Nullable)toImage SWIFT_WARN_UNUSED_RESULT;
|
|
789
|
+
- (NSData * _Nullable)toData SWIFT_WARN_UNUSED_RESULT;
|
|
718
790
|
@end
|
|
719
791
|
|
|
720
792
|
typedef SWIFT_ENUM_NAMED(NSInteger, TNSTextAlignment, "TNSTextAlignment", open) {
|
|
@@ -1989,8 +2061,15 @@ SWIFT_CLASS_NAMED("Utils")
|
|
|
1989
2061
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
1990
2062
|
@end
|
|
1991
2063
|
|
|
2064
|
+
#endif
|
|
2065
|
+
#if defined(__cplusplus)
|
|
2066
|
+
#endif
|
|
1992
2067
|
#if __has_attribute(external_source_symbol)
|
|
1993
2068
|
# pragma clang attribute pop
|
|
1994
2069
|
#endif
|
|
1995
2070
|
#pragma clang diagnostic pop
|
|
1996
2071
|
#endif
|
|
2072
|
+
|
|
2073
|
+
#else
|
|
2074
|
+
#error unsupported Swift architecture
|
|
2075
|
+
#endif
|
|
@@ -137,6 +137,12 @@ typedef struct U8Array {
|
|
|
137
137
|
uintptr_t data_len;
|
|
138
138
|
} U8Array;
|
|
139
139
|
|
|
140
|
+
#if defined(TARGET_OS_ANDROID)
|
|
141
|
+
typedef struct ASurfaceTexture {
|
|
142
|
+
uint8_t _unused[0];
|
|
143
|
+
} ASurfaceTexture;
|
|
144
|
+
#endif
|
|
145
|
+
|
|
140
146
|
typedef struct PaintStyleValue {
|
|
141
147
|
long long value;
|
|
142
148
|
enum PaintStyleValueType value_type;
|
|
@@ -237,6 +243,36 @@ void destroy_u32_array(struct U32Array *array);
|
|
|
237
243
|
|
|
238
244
|
void destroy_u8_array(struct U8Array *array);
|
|
239
245
|
|
|
246
|
+
#if defined(TARGET_OS_ANDROID)
|
|
247
|
+
/**
|
|
248
|
+
* Returns the API level of the device we're actually running on, or -1 on failure.
|
|
249
|
+
* The returned values correspond to the named constants in `<android/api-level.h>`,
|
|
250
|
+
* and is equivalent to the Java `Build.VERSION.SDK_INT` API.
|
|
251
|
+
*
|
|
252
|
+
* See also android_get_application_target_sdk_version().
|
|
253
|
+
*/
|
|
254
|
+
extern int android_get_device_api_level(void);
|
|
255
|
+
#endif
|
|
256
|
+
|
|
257
|
+
#if defined(TARGET_OS_ANDROID)
|
|
258
|
+
/**
|
|
259
|
+
* Get a reference to the native ASurfaceTexture from the corresponding java object.
|
|
260
|
+
*
|
|
261
|
+
* The caller must keep a reference to the Java SurfaceTexture during the lifetime of the returned
|
|
262
|
+
* ASurfaceTexture. Failing to do so could result in the ASurfaceTexture to stop functioning
|
|
263
|
+
* properly once the Java object gets finalized.
|
|
264
|
+
* However, this will not result in program termination.
|
|
265
|
+
*
|
|
266
|
+
* \param env JNI environment
|
|
267
|
+
* \param surfacetexture Instance of Java SurfaceTexture object
|
|
268
|
+
* \return native ASurfaceTexture reference or nullptr if the java object is not a SurfaceTexture.
|
|
269
|
+
* The returned reference MUST BE released when it's no longer needed using
|
|
270
|
+
* ASurfaceTexture_release().
|
|
271
|
+
*/
|
|
272
|
+
extern struct ASurfaceTexture *ASurfaceTexture_fromSurfaceTexture(JNIEnv *env,
|
|
273
|
+
jobject surfacetexture);
|
|
274
|
+
#endif
|
|
275
|
+
|
|
240
276
|
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
241
277
|
void destroy_string(const char *string);
|
|
242
278
|
#endif
|
|
@@ -303,6 +339,10 @@ const char *context_data_url(long long context, const char *format, float qualit
|
|
|
303
339
|
struct U8Array *context_snapshot_canvas(long long context);
|
|
304
340
|
#endif
|
|
305
341
|
|
|
342
|
+
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
343
|
+
struct U8Array *context_snapshot_canvas_encoded(long long context);
|
|
344
|
+
#endif
|
|
345
|
+
|
|
306
346
|
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
307
347
|
void context_flush(long long context);
|
|
308
348
|
#endif
|
|
@@ -564,6 +604,10 @@ long long context_create_radial_gradient(long long context,
|
|
|
564
604
|
float r1);
|
|
565
605
|
#endif
|
|
566
606
|
|
|
607
|
+
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
608
|
+
long long context_create_conic_gradient(long long context, float start_angle, float x, float y);
|
|
609
|
+
#endif
|
|
610
|
+
|
|
567
611
|
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
568
612
|
void context_draw_image_dx_dy(long long context,
|
|
569
613
|
const uint8_t *image_data,
|
|
@@ -739,6 +783,18 @@ void context_quadratic_curve_to(long long context, float cpx, float cpy, float x
|
|
|
739
783
|
void context_rect(long long context, float x, float y, float width, float height);
|
|
740
784
|
#endif
|
|
741
785
|
|
|
786
|
+
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
787
|
+
void context_round_rect(long long context,
|
|
788
|
+
float x,
|
|
789
|
+
float y,
|
|
790
|
+
float width,
|
|
791
|
+
float height,
|
|
792
|
+
float top_left,
|
|
793
|
+
float top_right,
|
|
794
|
+
float bottom_right,
|
|
795
|
+
float bottom_left);
|
|
796
|
+
#endif
|
|
797
|
+
|
|
742
798
|
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
743
799
|
void context_reset_transform(long long context);
|
|
744
800
|
#endif
|
|
@@ -875,14 +931,6 @@ bool image_asset_load_from_raw(long long asset, const uint8_t *array, uintptr_t
|
|
|
875
931
|
struct U8Array *image_asset_get_bytes(long long asset);
|
|
876
932
|
#endif
|
|
877
933
|
|
|
878
|
-
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
879
|
-
struct U8Array *image_asset_get_rgba_bytes(long long asset);
|
|
880
|
-
#endif
|
|
881
|
-
|
|
882
|
-
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
883
|
-
struct U8Array *image_asset_get_rgb_bytes(long long asset);
|
|
884
|
-
#endif
|
|
885
|
-
|
|
886
934
|
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
887
935
|
unsigned int image_asset_width(long long asset);
|
|
888
936
|
#endif
|
|
@@ -903,30 +951,6 @@ bool image_asset_has_error(long long asset);
|
|
|
903
951
|
bool image_asset_scale(long long asset, unsigned int x, unsigned int y);
|
|
904
952
|
#endif
|
|
905
953
|
|
|
906
|
-
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
907
|
-
bool image_asset_flip_x(long long asset);
|
|
908
|
-
#endif
|
|
909
|
-
|
|
910
|
-
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
911
|
-
bool image_asset_flip_x_in_place(long long asset);
|
|
912
|
-
#endif
|
|
913
|
-
|
|
914
|
-
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
915
|
-
bool image_asset_flip_y(long long asset);
|
|
916
|
-
#endif
|
|
917
|
-
|
|
918
|
-
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
919
|
-
void image_asset_flip_y_in_place_owned(uint8_t *buf, uintptr_t length);
|
|
920
|
-
#endif
|
|
921
|
-
|
|
922
|
-
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
923
|
-
void image_asset_flip_x_in_place_owned(uint8_t *buf, uintptr_t length);
|
|
924
|
-
#endif
|
|
925
|
-
|
|
926
|
-
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
927
|
-
bool image_asset_flip_y_in_place(long long asset);
|
|
928
|
-
#endif
|
|
929
|
-
|
|
930
954
|
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
931
955
|
bool image_asset_save_path(long long asset, const char *path, unsigned int format);
|
|
932
956
|
#endif
|
|
@@ -1339,6 +1363,18 @@ void path_ellipse(long long path,
|
|
|
1339
1363
|
void path_rect(long long path, float x, float y, float width, float height);
|
|
1340
1364
|
#endif
|
|
1341
1365
|
|
|
1366
|
+
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
1367
|
+
void path_round_rect(long long path,
|
|
1368
|
+
float x,
|
|
1369
|
+
float y,
|
|
1370
|
+
float width,
|
|
1371
|
+
float height,
|
|
1372
|
+
float top_left,
|
|
1373
|
+
float top_right,
|
|
1374
|
+
float bottom_right,
|
|
1375
|
+
float bottom_left);
|
|
1376
|
+
#endif
|
|
1377
|
+
|
|
1342
1378
|
#if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
|
|
1343
1379
|
void destroy_path(long long path);
|
|
1344
1380
|
#endif
|
|
Binary file
|