File tree Expand file tree Collapse file tree 3 files changed +42
-14
lines changed
shell/platform/darwin/macos/framework Expand file tree Collapse file tree 3 files changed +42
-14
lines changed Original file line number Diff line number Diff line change 16
16
#import " FlutterMacros.h"
17
17
#endif
18
18
19
+ // TODO: Merge this file and FLEPlugin.h with FlutterPlugin.h, sharing all but
20
+ // the platform-specific methods.
21
+
19
22
/* *
20
23
* The protocol for an object managing registration for a plugin. It provides access to application
21
24
* context, as as allowing registering for callbacks for handling various conditions.
@@ -46,3 +49,30 @@ FLUTTER_EXPORT
46
49
channel : (nonnull FlutterMethodChannel*)channel ;
47
50
48
51
@end
52
+
53
+ /* *
54
+ * A registry of Flutter macOS plugins.
55
+ *
56
+ * Plugins are identified by unique string keys, typically the name of the
57
+ * plugin's main class.
58
+ *
59
+ * Plugins typically need contextual information and the ability to register
60
+ * callbacks for various application events. To keep the API of the registry
61
+ * focused, these facilities are not provided directly by the registry, but by
62
+ * a `FlutterPluginRegistrar`, created by the registry in exchange for the unique
63
+ * key of the plugin.
64
+ *
65
+ * There is no implied connection between the registry and the registrar.
66
+ * Specifically, callbacks registered by the plugin via the registrar may be
67
+ * relayed directly to the underlying iOS application objects.
68
+ */
69
+ @protocol FLEPluginRegistry <NSObject >
70
+
71
+ /* *
72
+ * Returns a registrar for registering a plugin.
73
+ *
74
+ * @param pluginKey The unique key identifying the plugin.
75
+ */
76
+ - (nonnull id <FLEPluginRegistrar>)registrarForPlugin : (nonnull NSString *)pluginKey ;
77
+
78
+ @end
Original file line number Diff line number Diff line change @@ -35,8 +35,10 @@ typedef NS_ENUM(NSInteger, FlutterMouseTrackingMode) {
35
35
* Flutter engine in non-interactive mode, or with a drawable Flutter canvas.
36
36
*/
37
37
FLUTTER_EXPORT
38
- @interface FLEViewController
39
- : NSViewController <FlutterBinaryMessenger, FLEPluginRegistrar, FLEReshapeListener>
38
+ @interface FLEViewController : NSViewController <FlutterBinaryMessenger,
39
+ FLEPluginRegistrar,
40
+ FLEPluginRegistry,
41
+ FLEReshapeListener>
40
42
41
43
/* *
42
44
* The view this controller manages when launched in interactive mode (headless set to false). Must
@@ -73,9 +75,4 @@ FLUTTER_EXPORT
73
75
- (BOOL )launchHeadlessEngineWithAssetsPath : (nonnull NSURL *)assets
74
76
commandLineArguments : (nullable NSArray <NSString*>*)arguments ;
75
77
76
- /* *
77
- * Returns the FLEPluginRegistrar that should be used to register the plugin with the given name.
78
- */
79
- - (nonnull id <FLEPluginRegistrar>)registrarForPlugin : (nonnull NSString *)pluginName ;
80
-
81
78
@end
Original file line number Diff line number Diff line change @@ -251,13 +251,6 @@ - (BOOL)launchHeadlessEngineWithAssetsPath:(NSURL*)assets
251
251
commandLineArguments: arguments];
252
252
}
253
253
254
- - (id <FLEPluginRegistrar>)registrarForPlugin : (NSString *)pluginName {
255
- // Currently, the view controller acts as the registrar for all plugins, so the
256
- // name is ignored. It is part of the API to reduce churn in the future when
257
- // aligning more closely with the Flutter registrar system.
258
- return self;
259
- }
260
-
261
254
#pragma mark - Framework-internal methods
262
255
263
256
- (void )addKeyResponder : (NSResponder *)responder {
@@ -529,6 +522,14 @@ - (void)addMethodCallDelegate:(nonnull id<FLEPlugin>)delegate
529
522
}];
530
523
}
531
524
525
+ #pragma mark - FLEPluginRegistry
526
+
527
+ - (id <FLEPluginRegistrar>)registrarForPlugin : (NSString *)pluginName {
528
+ // Currently, the view controller acts as the registrar for all plugins, so the
529
+ // name is ignored.
530
+ return self;
531
+ }
532
+
532
533
#pragma mark - NSResponder
533
534
534
535
- (BOOL )acceptsFirstResponder {
You can’t perform that action at this time.
0 commit comments