Flutter Engine
FlutterEngine_Internal.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterEngine.h"
6 
7 #import <Cocoa/Cocoa.h>
8 
9 #include <memory>
10 
11 #include "flutter/shell/platform/common/accessibility_bridge.h"
12 #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h"
13 #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderer.h"
14 
15 @interface FlutterEngine ()
16 
17 /**
18  * True if the engine is currently running.
19  */
20 @property(nonatomic, readonly) BOOL running;
21 
22 /**
23  * Provides the renderer config needed to initialize the engine and also handles external
24  * texture management.
25  */
26 @property(nonatomic, readonly, nullable) id<FlutterRenderer> renderer;
27 
28 /**
29  * Function pointers for interacting with the embedder.h API.
30  */
31 @property(nonatomic) FlutterEngineProcTable& embedderAPI;
32 
33 @property(nonatomic, readonly) std::weak_ptr<flutter::AccessibilityBridge> accessibilityBridge;
34 
35 /**
36  * True if the semantics is enabled. The Flutter framework starts sending
37  * semantics update through the embedder as soon as it is set to YES.
38  */
39 @property(nonatomic) BOOL semanticsEnabled;
40 
41 /**
42  * Informs the engine that the associated view controller's view size has changed.
43  */
44 - (void)updateWindowMetrics;
45 
46 /**
47  * Dispatches the given pointer event data to engine.
48  */
49 - (void)sendPointerEvent:(const FlutterPointerEvent&)event;
50 
51 /**
52  * Dispatches the given pointer event data to engine.
53  */
54 - (void)sendKeyEvent:(const FlutterKeyEvent&)event
55  callback:(nullable FlutterKeyEventCallback)callback
56  userData:(nullable void*)userData;
57 
58 /**
59  * Registers an external texture with the given id. Returns YES on success.
60  */
61 - (BOOL)registerTextureWithID:(int64_t)textureId;
62 
63 /**
64  * Marks texture with the given id as available. Returns YES on success.
65  */
66 - (BOOL)markTextureFrameAvailable:(int64_t)textureID;
67 
68 /**
69  * Unregisters an external texture with the given id. Returns YES on success.
70  */
71 - (BOOL)unregisterTextureWithID:(int64_t)textureID;
72 
73 // Accessibility API.
74 
75 /**
76  * Dispatches semantics action back to the framework. The semantics must be enabled by calling
77  * the updateSemanticsEnabled before dispatching semantics actions.
78  */
79 - (void)dispatchSemanticsAction:(FlutterSemanticsAction)action
80  toTarget:(uint16_t)target
81  withData:(fml::MallocMapping)data;
82 
83 @end
Function-pointer-based versions of the APIs above.
Definition: embedder.h:2372
Definition: ascii_trie.cc:9
FlutterSemanticsAction
Definition: embedder.h:101
int BOOL
Definition: windows_types.h:37
void(* FlutterKeyEventCallback)(bool, void *)
Definition: embedder.h:748