5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_
13 #include <string_view>
14 #include <unordered_map>
17 #include "flutter/fml/closure.h"
18 #include "flutter/fml/macros.h"
24 #include "flutter/shell/platform/embedder/embedder.h"
46 #include "third_party/rapidjson/include/rapidjson/document.h"
60 FlutterThreadPriority priority) {
64 case FlutterThreadPriority::kBackground: {
65 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
68 case FlutterThreadPriority::kDisplay: {
69 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
72 case FlutterThreadPriority::kRaster: {
73 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
76 case FlutterThreadPriority::kNormal: {
113 bool Run(std::string_view entrypoint);
116 virtual bool running()
const {
return engine_ !=
nullptr; }
124 std::unique_ptr<FlutterWindowsView>
CreateView(
125 std::unique_ptr<WindowBindingHandler> window);
141 void SetSwitches(
const std::vector<std::string>& switches);
146 return message_dispatcher_.get();
154 return texture_registrar_.get();
162 return window_proc_delegate_manager_.get();
177 return keyboard_key_handler_.get();
185 const size_t message_size,
226 FlutterSemanticsAction
action,
227 fml::MallocMapping data);
254 root_isolate_create_callback_ =
callback;
261 void OnQuit(std::optional<HWND> hwnd,
262 std::optional<WPARAM> wparam,
263 std::optional<LPARAM> lparam,
288 return lifecycle_manager_.get();
292 return windows_proc_table_;
330 void SendSystemLocales();
339 void InitializeKeyboard();
342 void SendAccessibilityFeatures();
347 FlutterEngineProcTable embedder_api_ = {};
349 std::unique_ptr<FlutterProjectBundle> project_;
355 std::unordered_map<FlutterViewId, FlutterWindowsView*> views_;
358 std::unique_ptr<TaskRunner> task_runner_;
361 fml::RefPtr<flutter::FlutterDesktopMessenger> messenger_;
364 std::unique_ptr<BinaryMessengerImpl> messenger_wrapper_;
367 std::unique_ptr<IncomingMessageDispatcher> message_dispatcher_;
370 std::unique_ptr<FlutterDesktopPluginRegistrar> plugin_registrar_;
373 std::unique_ptr<FlutterWindowsTextureRegistrar> texture_registrar_;
378 std::unique_ptr<egl::Manager> egl_manager_;
382 std::unique_ptr<Compositor> compositor_;
385 std::unique_ptr<PluginRegistrar> internal_plugin_registrar_;
388 std::unique_ptr<AccessibilityPlugin> accessibility_plugin_;
391 std::unique_ptr<CursorHandler> cursor_handler_;
394 std::unique_ptr<PlatformHandler> platform_handler_;
397 std::unique_ptr<KeyboardHandlerBase> keyboard_key_handler_;
400 std::unique_ptr<TextInputPlugin> text_input_plugin_;
403 std::unique_ptr<SettingsPlugin> settings_plugin_;
409 plugin_registrar_destruction_callbacks_;
412 std::chrono::nanoseconds FrameInterval();
415 std::chrono::nanoseconds start_time_ = std::chrono::nanoseconds::zero();
418 std::optional<std::chrono::nanoseconds> frame_interval_override_ =
421 bool semantics_enabled_ =
false;
423 bool high_contrast_enabled_ =
false;
425 bool enable_impeller_ =
false;
428 std::unique_ptr<WindowProcDelegateManager> window_proc_delegate_manager_;
431 fml::closure root_isolate_create_callback_;
434 fml::closure next_frame_callback_;
437 std::unique_ptr<WindowsLifecycleManager> lifecycle_manager_;
439 std::shared_ptr<WindowsProcTable> windows_proc_table_;
441 std::shared_ptr<egl::ProcTable> gl_;
443 std::unique_ptr<PlatformViewPlugin> platform_view_plugin_;
450 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_