5#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterEngineGroup.h"
6#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h"
11 [_entrypoint release];
12 [_libraryURI release];
13 [_initialRoute release];
14 [_entrypointArgs release];
22@property(nonatomic, retain) NSMutableArray<NSValue*>*
engines;
27 int _enginesCreatedCount;
30- (instancetype)initWithName:(NSString*)name project:(nullable
FlutterDartProject*)project {
34 _engines = [[NSMutableArray<NSValue*> alloc] init];
47- (
FlutterEngine*)makeEngineWithEntrypoint:(nullable NSString*)entrypoint
48 libraryURI:(nullable NSString*)libraryURI {
49 return [
self makeEngineWithEntrypoint:entrypoint libraryURI:libraryURI initialRoute:nil];
52- (
FlutterEngine*)makeEngineWithEntrypoint:(nullable NSString*)entrypoint
53 libraryURI:(nullable NSString*)libraryURI
54 initialRoute:(nullable NSString*)initialRoute {
56 options.entrypoint = entrypoint;
57 options.libraryURI = libraryURI;
58 options.initialRoute = initialRoute;
59 return [
self makeEngineWithOptions:options];
63 NSString* entrypoint =
options.entrypoint;
64 NSString* libraryURI =
options.libraryURI;
65 NSString* initialRoute =
options.initialRoute;
66 NSArray<NSString*>* entrypointArgs =
options.entrypointArgs;
69 if (
self.engines.count <= 0) {
70 engine = [
self makeEngine];
77 engine = [spawner spawnWithEntrypoint:entrypoint
79 initialRoute:initialRoute
80 entrypointArgs:entrypointArgs];
82 [_engines addObject:[NSValue valueWithPointer:engine]];
84 NSNotificationCenter*
center = [NSNotificationCenter defaultCenter];
85 [center addObserver:self
86 selector:@selector(onEngineWillBeDealloced:)
87 name:kFlutterEngineWillDealloc
94 NSString* engineName = [NSString stringWithFormat:@"%@.%d", self.name, ++_enginesCreatedCount];
96 return [result autorelease];
99- (void)onEngineWillBeDealloced:(NSNotification*)notification {
100 [_engines removeObject:[NSValue valueWithPointer:notification.object]];
static void copy(void *dst, const uint8_t *src, int width, int bpp, int deltaSrc, int offset, const SkPMColor ctable[])
static SkScalar center(float pos0, float pos1)
NSMutableArray< NSValue * > * engines
FlutterDartProject * project
BOOL runWithEntrypoint:libraryURI:initialRoute:entrypointArgs:(nullable NSString *entrypoint,[libraryURI] nullable NSString *libraryURI,[initialRoute] nullable NSString *initialRoute,[entrypointArgs] nullable NSArray< NSString * > *entrypointArgs)
FlutterDartProject * _project
DEF_SWITCHES_START aot vmservice shared library name