5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_
13 #include <string_view>
16 #include "flutter/fml/closure.h"
17 #include "flutter/fml/macros.h"
23 #include "flutter/shell/platform/embedder/embedder.h"
41 #include "third_party/rapidjson/include/rapidjson/document.h"
45 class FlutterWindowsView;
49 FlutterThreadPriority priority) {
53 case FlutterThreadPriority::kBackground: {
54 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
57 case FlutterThreadPriority::kDisplay: {
58 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
61 case FlutterThreadPriority::kRaster: {
62 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
65 case FlutterThreadPriority::kNormal: {
100 bool Run(std::string_view entrypoint);
126 void SetSwitches(
const std::vector<std::string>& switches);
131 return message_dispatcher_.get();
137 return texture_registrar_.get();
145 return window_proc_delegate_manager_.get();
160 return keyboard_key_handler_.get();
168 const size_t message_size,
209 FlutterSemanticsAction
action,
210 fml::MallocMapping data);
237 root_isolate_create_callback_ =
callback;
247 void OnQuit(std::optional<HWND> hwnd,
248 std::optional<WPARAM> wparam,
249 std::optional<LPARAM> lparam,
274 return lifecycle_manager_.get();
312 void SendSystemLocales();
321 void InitializeKeyboard();
329 FlutterEngineProcTable embedder_api_ = {};
331 std::unique_ptr<FlutterProjectBundle> project_;
340 std::unique_ptr<TaskRunner> task_runner_;
343 fml::RefPtr<flutter::FlutterDesktopMessenger> messenger_;
346 std::unique_ptr<BinaryMessengerImpl> messenger_wrapper_;
349 std::unique_ptr<IncomingMessageDispatcher> message_dispatcher_;
352 std::unique_ptr<FlutterDesktopPluginRegistrar> plugin_registrar_;
355 std::unique_ptr<FlutterWindowsTextureRegistrar> texture_registrar_;
363 std::unique_ptr<AngleSurfaceManager> surface_manager_;
366 std::unique_ptr<PluginRegistrar> internal_plugin_registrar_;
369 std::unique_ptr<CursorHandler> cursor_handler_;
372 std::unique_ptr<PlatformHandler> platform_handler_;
375 std::unique_ptr<KeyboardHandlerBase> keyboard_key_handler_;
378 std::unique_ptr<TextInputPlugin> text_input_plugin_;
381 std::unique_ptr<SettingsPlugin> settings_plugin_;
387 plugin_registrar_destruction_callbacks_;
390 std::chrono::nanoseconds FrameInterval();
393 std::chrono::nanoseconds start_time_ = std::chrono::nanoseconds::zero();
396 std::optional<std::chrono::nanoseconds> frame_interval_override_ =
399 bool semantics_enabled_ =
false;
401 bool high_contrast_enabled_ =
false;
403 bool enable_impeller_ =
false;
406 std::unique_ptr<WindowProcDelegateManager> window_proc_delegate_manager_;
409 fml::closure root_isolate_create_callback_;
412 fml::closure next_frame_callback_;
415 std::unique_ptr<WindowsLifecycleManager> lifecycle_manager_;
417 WindowsProcTable windows_proc_table_;
424 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_ENGINE_H_