| Flutter Windows Embedder |

flutter_windows_engine.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 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_
7
8 #include <chrono>
9 #include <map>
10 #include <memory>
11 #include <optional>
12 #include <shared_mutex>
13 #include <string>
14 #include <string_view>
15 #include <unordered_map>
16 #include <vector>
17
18 #include "flutter/fml/closure.h"
19 #include "flutter/fml/macros.h"
20 #include "flutter/shell/platform/common/accessibility_bridge.h"
21 #include "flutter/shell/platform/common/app_lifecycle_state.h"
22 #include "flutter/shell/platform/common/client_wrapper/binary_messenger_impl.h"
23 #include "flutter/shell/platform/common/client_wrapper/include/flutter/basic_message_channel.h"
24 #include "flutter/shell/platform/common/incoming_message_dispatcher.h"
25 #include "flutter/shell/platform/embedder/embedder.h"
26 #include "flutter/shell/platform/windows/accessibility_bridge_windows.h"
27 #include "flutter/shell/platform/windows/accessibility_plugin.h"
28 #include "flutter/shell/platform/windows/compositor.h"
29 #include "flutter/shell/platform/windows/cursor_handler.h"
30 #include "flutter/shell/platform/windows/egl/manager.h"
31 #include "flutter/shell/platform/windows/egl/proc_table.h"
32 #include "flutter/shell/platform/windows/flutter_desktop_messenger.h"
33 #include "flutter/shell/platform/windows/flutter_project_bundle.h"
34 #include "flutter/shell/platform/windows/flutter_windows_texture_registrar.h"
35 #include "flutter/shell/platform/windows/keyboard_handler_base.h"
36 #include "flutter/shell/platform/windows/keyboard_key_embedder_handler.h"
37 #include "flutter/shell/platform/windows/platform_handler.h"
38 #include "flutter/shell/platform/windows/platform_view_plugin.h"
39 #include "flutter/shell/platform/windows/public/flutter_windows.h"
40 #include "flutter/shell/platform/windows/settings_plugin.h"
41 #include "flutter/shell/platform/windows/task_runner.h"
42 #include "flutter/shell/platform/windows/text_input_plugin.h"
43 #include "flutter/shell/platform/windows/window_proc_delegate_manager.h"
44 #include "flutter/shell/platform/windows/window_state.h"
45 #include "flutter/shell/platform/windows/windows_lifecycle_manager.h"
46 #include "flutter/shell/platform/windows/windows_proc_table.h"
47 #include "third_party/rapidjson/include/rapidjson/document.h"
48
49 namespace flutter {
50
51 // The implicit view's ID.
52 //
53 // See:
54 // https://api.flutter.dev/flutter/dart-ui/PlatformDispatcher/implicitView.html
55 constexpr FlutterViewId kImplicitViewId = 0;
56
57 class FlutterWindowsView;
58
59 // Update the thread priority for the Windows engine.
60 static void WindowsPlatformThreadPrioritySetter(
61 FlutterThreadPriority priority) {
62 // TODO(99502): Add support for tracing to the windows embedding so we can
63 // mark thread priorities and success/failure.
64 switch (priority) {
65 case FlutterThreadPriority::kBackground: {
66 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
67 break;
68 }
69 case FlutterThreadPriority::kDisplay: {
70 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
71 break;
72 }
73 case FlutterThreadPriority::kRaster: {
74 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
75 break;
76 }
77 case FlutterThreadPriority::kNormal: {
78 // For normal or default priority we do not need to set the priority
79 // class.
80 break;
81 }
82 }
83 }
84
85 // Manages state associated with the underlying FlutterEngine that isn't
86 // related to its display.
87 //
88 // In most cases this will be associated with a FlutterView, but if not will
89 // run in headless mode.
90 class FlutterWindowsEngine {
91 public:
92 // Creates a new Flutter engine object configured to run |project|.
93 FlutterWindowsEngine(
94 const FlutterProjectBundle& project,
95 std::shared_ptr<WindowsProcTable> windows_proc_table = nullptr);
96
97 virtual ~FlutterWindowsEngine();
98
99 // Returns the engine associated with the given identifier.
100 // The engine_id must be valid and for a running engine, otherwise
101 // the behavior is undefined.
102 // Must be called on the platform thread.
103 static FlutterWindowsEngine* GetEngineForId(int64_t engine_id);
104
105 // Starts running the entrypoint function specifed in the project bundle. If
106 // unspecified, defaults to main().
107 //
108 // Returns false if the engine couldn't be started.
109 bool Run();
110
111 // Starts running the engine with the given entrypoint. If the empty string
112 // is specified, defaults to the entrypoint function specified in the project
113 // bundle, or main() if both are unspecified.
114 //
115 // Returns false if the engine couldn't be started or if conflicting,
116 // non-default values are passed here and in the project bundle..
117 //
118 // DEPRECATED: Prefer setting the entrypoint in the FlutterProjectBundle
119 // passed to the constructor and calling the no-parameter overload.
120 bool Run(std::string_view entrypoint);
121
122 // Returns true if the engine is currently running.
123 virtual bool running() const { return engine_ != nullptr; }
124
125 // Stops the engine. This invalidates the pointer returned by engine().
126 //
127 // Returns false if stopping the engine fails, or if it was not running.
128 virtual bool Stop();
129
130 // Create a view that can display this engine's content.
131 //
132 // Returns null on failure.
133 std::unique_ptr<FlutterWindowsView> CreateView(
134 std::unique_ptr<WindowBindingHandler> window);
135
136 // Remove a view. The engine will no longer render into it.
137 virtual void RemoveView(FlutterViewId view_id);
138
139 // Get a view that displays this engine's content.
140 //
141 // Returns null if the view does not exist.
142 FlutterWindowsView* view(FlutterViewId view_id) const;
143
144 // Returns the currently configured Plugin Registrar.
145 FlutterDesktopPluginRegistrarRef GetRegistrar();
146
147 // Registers |callback| to be called when the plugin registrar is destroyed.
148 void AddPluginRegistrarDestructionCallback(
149 FlutterDesktopOnPluginRegistrarDestroyed callback,
150 FlutterDesktopPluginRegistrarRef registrar);
151
152 // Sets switches member to the given switches.
153 void SetSwitches(const std::vector<std::string>& switches);
154
155 FlutterDesktopMessengerRef messenger() { return messenger_->ToRef(); }
156
157 IncomingMessageDispatcher* message_dispatcher() {
158 return message_dispatcher_.get();
159 }
160
161 TaskRunner* task_runner() { return task_runner_.get(); }
162
163 BinaryMessenger* messenger_wrapper() { return messenger_wrapper_.get(); }
164
165 FlutterWindowsTextureRegistrar* texture_registrar() {
166 return texture_registrar_.get();
167 }
168
169 // The EGL manager object. If this is nullptr, then we are
170 // rendering using software instead of OpenGL.
171 egl::Manager* egl_manager() const { return egl_manager_.get(); }
172
173 WindowProcDelegateManager* window_proc_delegate_manager() {
174 return window_proc_delegate_manager_.get();
175 }
176
177 // Informs the engine that the window metrics have changed.
178 void SendWindowMetricsEvent(const FlutterWindowMetricsEvent& event);
179
180 // Informs the engine of an incoming pointer event.
181 void SendPointerEvent(const FlutterPointerEvent& event);
182
183 // Informs the engine of an incoming key event.
184 void SendKeyEvent(const FlutterKeyEvent& event,
185 FlutterKeyEventCallback callback,
186 void* user_data);
187
188 // Informs the engine of an incoming focus event.
189 void SendViewFocusEvent(const FlutterViewFocusEvent& event);
190
191 KeyboardHandlerBase* keyboard_key_handler() {
192 return keyboard_key_handler_.get();
193 }
194 TextInputPlugin* text_input_plugin() { return text_input_plugin_.get(); }
195
196 // Sends the given message to the engine, calling |reply| with |user_data|
197 // when a response is received from the engine if they are non-null.
198 bool SendPlatformMessage(const char* channel,
199 const uint8_t* message,
200 const size_t message_size,
201 const FlutterDesktopBinaryReply reply,
202 void* user_data);
203
204 // Sends the given data as the response to an earlier platform message.
205 void SendPlatformMessageResponse(
206 const FlutterDesktopMessageResponseHandle* handle,
207 const uint8_t* data,
208 size_t data_length);
209
210 // Callback passed to Flutter engine for notifying window of platform
211 // messages.
212 void HandlePlatformMessage(const FlutterPlatformMessage*);
213
214 // Informs the engine that the system font list has changed.
215 void ReloadSystemFonts();
216
217 // Informs the engine that a new frame is needed to redraw the content.
218 void ScheduleFrame();
219
220 // Set the callback that is called when the next frame is drawn.
221 void SetNextFrameCallback(fml::closure callback);
222
223 // Attempts to register the texture with the given |texture_id|.
224 bool RegisterExternalTexture(int64_t texture_id);
225
226 // Attempts to unregister the texture with the given |texture_id|.
227 bool UnregisterExternalTexture(int64_t texture_id);
228
229 // Notifies the engine about a new frame being available for the
230 // given |texture_id|.
231 bool MarkExternalTextureFrameAvailable(int64_t texture_id);
232
233 // Posts the given callback onto the raster thread.
234 virtual bool PostRasterThreadTask(fml::closure callback) const;
235
236 // Invoke on the embedder's vsync callback to schedule a frame.
237 void OnVsync(intptr_t baton);
238
239 // Dispatches a semantics action to the specified semantics node.
240 bool DispatchSemanticsAction(FlutterViewId view_id,
241 uint64_t node_id,
242 FlutterSemanticsAction action,
243 fml::MallocMapping data);
244
245 // Informs the engine that the semantics enabled state has changed.
246 void UpdateSemanticsEnabled(bool enabled);
247
248 // Returns true if the semantics tree is enabled.
249 bool semantics_enabled() const { return semantics_enabled_; }
250
251 // Refresh accessibility features and send them to the engine.
252 void UpdateAccessibilityFeatures();
253
254 // Refresh high contrast accessibility mode and notify the engine.
255 void UpdateHighContrastMode();
256
257 // Returns true if the high contrast feature is enabled.
258 bool high_contrast_enabled() const { return high_contrast_enabled_; }
259
260 // Register a root isolate create callback.
261 //
262 // The root isolate create callback is invoked at creation of the root Dart
263 // isolate in the app. This may be used to be notified that execution of the
264 // main Dart entrypoint is about to begin, and is used by test infrastructure
265 // to register a native function resolver that can register and resolve
266 // functions marked as native in the Dart code.
267 //
268 // This must be called before calling |Run|.
269 void SetRootIsolateCreateCallback(const fml::closure& callback) {
270 root_isolate_create_callback_ = callback;
271 }
272
273 // Returns the executable name for this process or "Flutter" if unknown.
274 std::string GetExecutableName() const;
275
276 // Called when the application quits in response to a quit request.
277 void OnQuit(std::optional<HWND> hwnd,
278 std::optional<WPARAM> wparam,
279 std::optional<LPARAM> lparam,
280 UINT exit_code);
281
282 // Called when a WM_CLOSE message is received.
283 void RequestApplicationQuit(HWND hwnd,
284 WPARAM wparam,
285 LPARAM lparam,
286 AppExitType exit_type);
287
288 // Called when a WM_DWMCOMPOSITIONCHANGED message is received.
289 void OnDwmCompositionChanged();
290
291 // Called when a Window receives an event that may alter the application
292 // lifecycle state.
293 void OnWindowStateEvent(HWND hwnd, WindowStateEvent event);
294
295 // Handle a message from a non-Flutter window in the same application.
296 // Returns a result when the message is consumed and should not be processed
297 // further.
298 std::optional<LRESULT> ProcessExternalWindowMessage(HWND hwnd,
299 UINT message,
300 WPARAM wparam,
301 LPARAM lparam);
302
303 WindowsLifecycleManager* lifecycle_manager() {
304 return lifecycle_manager_.get();
305 }
306
307 std::shared_ptr<WindowsProcTable> windows_proc_table() {
308 return windows_proc_table_;
309 }
310
311 // Sets the cursor that should be used when the mouse is over the Flutter
312 // content. See mouse_cursor.dart for the values and meanings of cursor_name.
313 void UpdateFlutterCursor(const std::string& cursor_name) const;
314
315 // Sets the cursor directly from a cursor handle.
316 void SetFlutterCursor(HCURSOR cursor) const;
317
318 protected:
319 // Creates the keyboard key handler.
320 //
321 // Exposing this method allows unit tests to override in order to
322 // capture information.
323 virtual std::unique_ptr<KeyboardHandlerBase> CreateKeyboardKeyHandler(
324 BinaryMessenger* messenger,
325 KeyboardKeyEmbedderHandler::GetKeyStateHandler get_key_state,
326 KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode map_vk_to_scan);
327
328 // Creates the text input plugin.
329 //
330 // Exposing this method allows unit tests to override in order to
331 // capture information.
332 virtual std::unique_ptr<TextInputPlugin> CreateTextInputPlugin(
333 BinaryMessenger* messenger);
334
335 // Invoked by the engine right before the engine is restarted.
336 //
337 // This should reset necessary states to as if the engine has just been
338 // created. This is typically caused by a hot restart (Shift-R in CLI.)
339 void OnPreEngineRestart();
340
341 // Invoked by the engine when a listener is set or cleared on a platform
342 // channel.
343 virtual void OnChannelUpdate(std::string name, bool listening);
344
345 virtual void OnViewFocusChangeRequest(
346 const FlutterViewFocusChangeRequest* request);
347
348 private:
349 // Allows swapping out embedder_api_ calls in tests.
350 friend class EngineModifier;
351
352 // Maps a Flutter cursor name to an HCURSOR.
353 //
354 // Returns the arrow cursor for unknown constants.
355 //
356 // This map must be kept in sync with Flutter framework's
357 // services/mouse_cursor.dart.
358 HCURSOR GetCursorByName(const std::string& cursor_name) const;
359
360 // Sends system locales to the engine.
361 //
362 // Should be called just after the engine is run, and after any relevant
363 // system changes.
364 void SendSystemLocales();
365
366 // Create the keyboard & text input sub-systems.
367 //
368 // This requires that a view is attached to the engine.
369 // Calling this method again resets the keyboard state.
370 void InitializeKeyboard();
371
372 // Send the currently enabled accessibility features to the engine.
373 void SendAccessibilityFeatures();
374
375 // Present content to a view. Returns true if the content was presented.
376 //
377 // This is invoked on the raster thread.
378 bool Present(const FlutterPresentViewInfo* info);
379
380 // The handle to the embedder.h engine instance.
381 FLUTTER_API_SYMBOL(FlutterEngine) engine_ = nullptr;
382
383 FlutterEngineProcTable embedder_api_ = {};
384
385 std::unique_ptr<FlutterProjectBundle> project_;
386
387 // AOT data, if any.
388 UniqueAotDataPtr aot_data_;
389
390 // The ID that the next view will have.
391 FlutterViewId next_view_id_ = kImplicitViewId;
392
393 // The views displaying the content running in this engine, if any.
394 //
395 // This is read and mutated by the platform thread. This is read by the raster
396 // thread to present content to a view.
397 //
398 // Reads to this object on non-platform threads must be protected
399 // by acquiring a shared lock on |views_mutex_|.
400 //
401 // Writes to this object must only happen on the platform thread
402 // and must be protected by acquiring an exclusive lock on |views_mutex_|.
403 std::unordered_map<FlutterViewId, FlutterWindowsView*> views_;
404
405 // The mutex that protects the |views_| map.
406 //
407 // The raster thread acquires a shared lock to present to a view.
408 //
409 // The platform thread acquires a shared lock to access the view.
410 // The platform thread acquires an exclusive lock before adding
411 // a view to the engine or after removing a view from the engine.
412 mutable std::shared_mutex views_mutex_;
413
414 // Task runner for tasks posted from the engine.
415 std::unique_ptr<TaskRunner> task_runner_;
416
417 // The plugin messenger handle given to API clients.
418 fml::RefPtr<flutter::FlutterDesktopMessenger> messenger_;
419
420 // A wrapper around messenger_ for interacting with client_wrapper-level APIs.
421 std::unique_ptr<BinaryMessengerImpl> messenger_wrapper_;
422
423 // Message dispatch manager for messages from engine_.
424 std::unique_ptr<IncomingMessageDispatcher> message_dispatcher_;
425
426 // The plugin registrar handle given to API clients.
427 std::unique_ptr<FlutterDesktopPluginRegistrar> plugin_registrar_;
428
429 // The texture registrar.
430 std::unique_ptr<FlutterWindowsTextureRegistrar> texture_registrar_;
431
432 // An object used for intializing ANGLE and creating / destroying render
433 // surfaces. If nullptr, ANGLE failed to initialize and software rendering
434 // should be used instead.
435 std::unique_ptr<egl::Manager> egl_manager_;
436
437 // The compositor that creates backing stores for the engine to render into
438 // and then presents them onto views.
439 std::unique_ptr<Compositor> compositor_;
440
441 // The plugin registrar managing internal plugins.
442 std::unique_ptr<PluginRegistrar> internal_plugin_registrar_;
443
444 // Handler for accessibility events.
445 std::unique_ptr<AccessibilityPlugin> accessibility_plugin_;
446
447 // Handler for cursor events.
448 std::unique_ptr<CursorHandler> cursor_handler_;
449
450 // Handler for the flutter/platform channel.
451 std::unique_ptr<PlatformHandler> platform_handler_;
452
453 // Handlers for keyboard events from Windows.
454 std::unique_ptr<KeyboardHandlerBase> keyboard_key_handler_;
455
456 // Handlers for text events from Windows.
457 std::unique_ptr<TextInputPlugin> text_input_plugin_;
458
459 // The settings plugin.
460 std::unique_ptr<SettingsPlugin> settings_plugin_;
461
462 // Callbacks to be called when the engine (and thus the plugin registrar) is
463 // being destroyed.
464 std::map<FlutterDesktopOnPluginRegistrarDestroyed,
465 FlutterDesktopPluginRegistrarRef>
466 plugin_registrar_destruction_callbacks_;
467
468 // The approximate time between vblank events.
469 std::chrono::nanoseconds FrameInterval();
470
471 // The start time used to align frames.
472 std::chrono::nanoseconds start_time_ = std::chrono::nanoseconds::zero();
473
474 // An override of the frame interval used by EngineModifier for testing.
475 std::optional<std::chrono::nanoseconds> frame_interval_override_ =
476 std::nullopt;
477
478 bool semantics_enabled_ = false;
479
480 bool high_contrast_enabled_ = false;
481
482 bool enable_impeller_ = false;
483
484 // The manager for WindowProc delegate registration and callbacks.
485 std::unique_ptr<WindowProcDelegateManager> window_proc_delegate_manager_;
486
487 // The root isolate creation callback.
488 fml::closure root_isolate_create_callback_;
489
490 // The on frame drawn callback.
491 fml::closure next_frame_callback_;
492
493 // Handler for top level window messages.
494 std::unique_ptr<WindowsLifecycleManager> lifecycle_manager_;
495
496 std::shared_ptr<WindowsProcTable> windows_proc_table_;
497
498 std::shared_ptr<egl::ProcTable> gl_;
499
500 std::unique_ptr<PlatformViewPlugin> platform_view_plugin_;
501
502 FML_DISALLOW_COPY_AND_ASSIGN(FlutterWindowsEngine);
503 };
504
505 } // namespace flutter
506
507 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_
accessibility_bridge.h
accessibility_bridge_windows.h
accessibility_plugin.h
app_lifecycle_state.h
basic_message_channel.h
binary_messenger_impl.h
flutter::BinaryMessenger
Definition: binary_messenger.h:28
flutter::FlutterEngine
Definition: flutter_engine.h:28
flutter::FlutterProjectBundle
Definition: flutter_project_bundle.h:32
flutter::FlutterWindowsEngine
Definition: flutter_windows_engine.h:90
flutter::FlutterWindowsEngine::texture_registrar
FlutterWindowsTextureRegistrar * texture_registrar()
Definition: flutter_windows_engine.h:165
flutter::FlutterWindowsEngine::UpdateHighContrastMode
void UpdateHighContrastMode()
Definition: flutter_windows_engine.cc:984
flutter::FlutterWindowsEngine::windows_proc_table
std::shared_ptr< WindowsProcTable > windows_proc_table()
Definition: flutter_windows_engine.h:307
flutter::FlutterWindowsEngine::task_runner
TaskRunner * task_runner()
Definition: flutter_windows_engine.h:161
flutter::FlutterWindowsEngine::FlutterWindowsEngine
FlutterWindowsEngine(const FlutterProjectBundle &project, std::shared_ptr< WindowsProcTable > windows_proc_table=nullptr)
Definition: flutter_windows_engine.cc:149
flutter::FlutterWindowsEngine::UpdateAccessibilityFeatures
void UpdateAccessibilityFeatures()
Definition: flutter_windows_engine.cc:980
flutter::FlutterWindowsEngine::messenger
FlutterDesktopMessengerRef messenger()
Definition: flutter_windows_engine.h:155
flutter::FlutterWindowsEngine::Run
bool Run()
Definition: flutter_windows_engine.cc:245
flutter::FlutterWindowsEngine::lifecycle_manager
WindowsLifecycleManager * lifecycle_manager()
Definition: flutter_windows_engine.h:303
flutter::FlutterWindowsEngine::OnWindowStateEvent
void OnWindowStateEvent(HWND hwnd, WindowStateEvent event)
Definition: flutter_windows_engine.cc:1025
flutter::FlutterWindowsEngine::OnDwmCompositionChanged
void OnDwmCompositionChanged()
Definition: flutter_windows_engine.cc:1017
flutter::FlutterWindowsEngine::RequestApplicationQuit
void RequestApplicationQuit(HWND hwnd, WPARAM wparam, LPARAM lparam, AppExitType exit_type)
Definition: flutter_windows_engine.cc:1003
flutter::FlutterWindowsEngine::window_proc_delegate_manager
WindowProcDelegateManager * window_proc_delegate_manager()
Definition: flutter_windows_engine.h:173
flutter::FlutterWindowsEngine::view
FlutterWindowsView * view(FlutterViewId view_id) const
Definition: flutter_windows_engine.cc:674
flutter::FlutterWindowsEngine::OnPreEngineRestart
void OnPreEngineRestart()
Definition: flutter_windows_engine.cc:961
flutter::FlutterWindowsEngine::SendViewFocusEvent
void SendViewFocusEvent(const FlutterViewFocusEvent &event)
Definition: flutter_windows_engine.cc:717
flutter::FlutterWindowsEngine::SendPlatformMessage
bool SendPlatformMessage(const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
Definition: flutter_windows_engine.cc:724
flutter::FlutterWindowsEngine::OnViewFocusChangeRequest
virtual void OnViewFocusChangeRequest(const FlutterViewFocusChangeRequest *request)
Definition: flutter_windows_engine.cc:1059
flutter::FlutterWindowsEngine::ProcessExternalWindowMessage
std::optional< LRESULT > ProcessExternalWindowMessage(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
Definition: flutter_windows_engine.cc:1030
flutter::FlutterWindowsEngine::AddPluginRegistrarDestructionCallback
void AddPluginRegistrarDestructionCallback(FlutterDesktopOnPluginRegistrarDestroyed callback, FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows_engine.cc:690
flutter::FlutterWindowsEngine::RegisterExternalTexture
bool RegisterExternalTexture(int64_t texture_id)
Definition: flutter_windows_engine.cc:897
flutter::FlutterWindowsEngine::SendPlatformMessageResponse
void SendPlatformMessageResponse(const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Definition: flutter_windows_engine.cc:758
flutter::FlutterWindowsEngine::SetRootIsolateCreateCallback
void SetRootIsolateCreateCallback(const fml::closure &callback)
Definition: flutter_windows_engine.h:269
flutter::FlutterWindowsEngine::GetEngineForId
static FlutterWindowsEngine * GetEngineForId(int64_t engine_id)
Definition: flutter_windows_engine.cc:236
flutter::FlutterWindowsEngine::UpdateSemanticsEnabled
void UpdateSemanticsEnabled(bool enabled)
Definition: flutter_windows_engine.cc:949
flutter::FlutterWindowsEngine::GetExecutableName
std::string GetExecutableName() const
Definition: flutter_windows_engine.cc:966
flutter::FlutterWindowsEngine::OnChannelUpdate
virtual void OnChannelUpdate(std::string name, bool listening)
Definition: flutter_windows_engine.cc:1051
flutter::FlutterWindowsEngine::CreateKeyboardKeyHandler
virtual std::unique_ptr< KeyboardHandlerBase > CreateKeyboardKeyHandler(BinaryMessenger *messenger, KeyboardKeyEmbedderHandler::GetKeyStateHandler get_key_state, KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode map_vk_to_scan)
Definition: flutter_windows_engine.cc:874
flutter::FlutterWindowsEngine::DispatchSemanticsAction
bool DispatchSemanticsAction(FlutterViewId view_id, uint64_t node_id, FlutterSemanticsAction action, fml::MallocMapping data)
Definition: flutter_windows_engine.cc:933
flutter::FlutterWindowsEngine::MarkExternalTextureFrameAvailable
bool MarkExternalTextureFrameAvailable(int64_t texture_id)
Definition: flutter_windows_engine.cc:907
flutter::FlutterWindowsEngine::keyboard_key_handler
KeyboardHandlerBase * keyboard_key_handler()
Definition: flutter_windows_engine.h:191
flutter::FlutterWindowsEngine::high_contrast_enabled
bool high_contrast_enabled() const
Definition: flutter_windows_engine.h:258
flutter::FlutterWindowsEngine::running
virtual bool running() const
Definition: flutter_windows_engine.h:123
flutter::FlutterWindowsEngine::CreateView
std::unique_ptr< FlutterWindowsView > CreateView(std::unique_ptr< WindowBindingHandler > window)
Definition: flutter_windows_engine.cc:512
flutter::FlutterWindowsEngine::semantics_enabled
bool semantics_enabled() const
Definition: flutter_windows_engine.h:249
flutter::FlutterWindowsEngine::PostRasterThreadTask
virtual bool PostRasterThreadTask(fml::closure callback) const
Definition: flutter_windows_engine.cc:913
flutter::FlutterWindowsEngine::message_dispatcher
IncomingMessageDispatcher * message_dispatcher()
Definition: flutter_windows_engine.h:157
flutter::FlutterWindowsEngine::EngineModifier
friend class EngineModifier
Definition: flutter_windows_engine.h:350
flutter::FlutterWindowsEngine::UnregisterExternalTexture
bool UnregisterExternalTexture(int64_t texture_id)
Definition: flutter_windows_engine.cc:902
flutter::FlutterWindowsEngine::messenger_wrapper
BinaryMessenger * messenger_wrapper()
Definition: flutter_windows_engine.h:163
flutter::FlutterWindowsEngine::ScheduleFrame
void ScheduleFrame()
Definition: flutter_windows_engine.cc:783
flutter::FlutterWindowsEngine::SetNextFrameCallback
void SetNextFrameCallback(fml::closure callback)
Definition: flutter_windows_engine.cc:787
flutter::FlutterWindowsEngine::HandlePlatformMessage
void HandlePlatformMessage(const FlutterPlatformMessage *)
Definition: flutter_windows_engine.cc:765
flutter::FlutterWindowsEngine::Stop
virtual bool Stop()
Definition: flutter_windows_engine.cc:499
flutter::FlutterWindowsEngine::RemoveView
virtual void RemoveView(FlutterViewId view_id)
Definition: flutter_windows_engine.cc:584
flutter::FlutterWindowsEngine::GetRegistrar
FlutterDesktopPluginRegistrarRef GetRegistrar()
Definition: flutter_windows_engine.cc:686
flutter::FlutterWindowsEngine::ReloadSystemFonts
void ReloadSystemFonts()
Definition: flutter_windows_engine.cc:779
flutter::FlutterWindowsEngine::CreateTextInputPlugin
virtual std::unique_ptr< TextInputPlugin > CreateTextInputPlugin(BinaryMessenger *messenger)
Definition: flutter_windows_engine.cc:892
flutter::FlutterWindowsEngine::UpdateFlutterCursor
void UpdateFlutterCursor(const std::string &cursor_name) const
Definition: flutter_windows_engine.cc:1042
flutter::FlutterWindowsEngine::text_input_plugin
TextInputPlugin * text_input_plugin()
Definition: flutter_windows_engine.h:194
flutter::FlutterWindowsEngine::SetFlutterCursor
void SetFlutterCursor(HCURSOR cursor) const
Definition: flutter_windows_engine.cc:1047
flutter::FlutterWindowsEngine::OnVsync
void OnVsync(intptr_t baton)
Definition: flutter_windows_engine.cc:646
flutter::FlutterWindowsEngine::SendPointerEvent
void SendPointerEvent(const FlutterPointerEvent &event)
Definition: flutter_windows_engine.cc:703
flutter::FlutterWindowsEngine::SendWindowMetricsEvent
void SendWindowMetricsEvent(const FlutterWindowMetricsEvent &event)
Definition: flutter_windows_engine.cc:696
flutter::FlutterWindowsEngine::SetSwitches
void SetSwitches(const std::vector< std::string > &switches)
Definition: flutter_windows_engine.cc:240
flutter::FlutterWindowsEngine::SendKeyEvent
void SendKeyEvent(const FlutterKeyEvent &event, FlutterKeyEventCallback callback, void *user_data)
Definition: flutter_windows_engine.cc:709
flutter::FlutterWindowsEngine::egl_manager
egl::Manager * egl_manager() const
Definition: flutter_windows_engine.h:171
flutter::FlutterWindowsEngine::OnQuit
void OnQuit(std::optional< HWND > hwnd, std::optional< WPARAM > wparam, std::optional< LPARAM > lparam, UINT exit_code)
Definition: flutter_windows_engine.cc:1010
flutter::FlutterWindowsEngine::~FlutterWindowsEngine
virtual ~FlutterWindowsEngine()
Definition: flutter_windows_engine.cc:231
flutter::FlutterWindowsTextureRegistrar
Definition: flutter_windows_texture_registrar.h:24
flutter::FlutterWindowsView
Definition: flutter_windows_view.h:34
flutter::IncomingMessageDispatcher
Definition: incoming_message_dispatcher.h:20
flutter::KeyboardHandlerBase
Definition: keyboard_handler_base.h:18
flutter::KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode
std::function< SHORT(UINT, bool)> MapVirtualKeyToScanCode
Definition: keyboard_key_embedder_handler.h:43
flutter::KeyboardKeyEmbedderHandler::GetKeyStateHandler
std::function< SHORT(int)> GetKeyStateHandler
Definition: keyboard_key_embedder_handler.h:41
flutter::TaskRunner
Definition: task_runner.h:26
flutter::TextInputPlugin
Definition: text_input_plugin.h:29
flutter::WindowProcDelegateManager
Definition: window_proc_delegate_manager.h:20
flutter::WindowsLifecycleManager
Definition: windows_lifecycle_manager.h:37
flutter::egl::Manager
Definition: manager.h:39
compositor.h
texture_id
uint32_t texture_id
Definition: compositor_opengl.cc:20
cursor_handler.h
flutter_desktop_messenger.h
FlutterDesktopBinaryReply
void(* FlutterDesktopBinaryReply)(const uint8_t *data, size_t data_size, void *user_data)
Definition: flutter_messenger.h:26
FlutterDesktopMessengerRef
struct FlutterDesktopMessenger * FlutterDesktopMessengerRef
Definition: flutter_messenger.h:19
FlutterDesktopMessageResponseHandle
struct _FlutterPlatformMessageResponseHandle FlutterDesktopMessageResponseHandle
Definition: flutter_messenger.h:22
FlutterDesktopOnPluginRegistrarDestroyed
void(* FlutterDesktopOnPluginRegistrarDestroyed)(FlutterDesktopPluginRegistrarRef)
Definition: flutter_plugin_registrar.h:23
flutter_project_bundle.h
flutter_windows.h
flutter_windows_texture_registrar.h
user_data
void * user_data
Definition: flutter_windows_view_unittests.cc:53
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:52
incoming_message_dispatcher.h
keyboard_handler_base.h
keyboard_key_embedder_handler.h
action
int action
Definition: keyboard_key_handler_unittests.cc:116
message
Win32Message message
Definition: keyboard_unittests.cc:137
manager.h
flutter
Definition: accessibility_bridge_windows.cc:11
flutter::AppExitType
AppExitType
Definition: platform_handler.h:27
flutter::WindowStateEvent
WindowStateEvent
An event representing a change in window state that may update the.
Definition: windows_lifecycle_manager.h:24
flutter::FlutterViewId
int64_t FlutterViewId
Definition: flutter_view.h:13
flutter::WindowsPlatformThreadPrioritySetter
static void WindowsPlatformThreadPrioritySetter(FlutterThreadPriority priority)
Definition: flutter_windows_engine.h:60
flutter::kImplicitViewId
constexpr FlutterViewId kImplicitViewId
Definition: flutter_windows_engine.h:55
flutter::UniqueAotDataPtr
std::unique_ptr< _FlutterEngineAOTData, FlutterEngineCollectAOTDataFnPtr > UniqueAotDataPtr
Definition: flutter_project_bundle.h:18
platform_handler.h
platform_view_plugin.h
proc_table.h
settings_plugin.h
FlutterDesktopPluginRegistrar
Definition: window_state.h:23
task_runner.h
text_input_plugin.h
window_proc_delegate_manager.h
window_state.h
windows_lifecycle_manager.h
windows_proc_table.h