10#include <shared_mutex>
43static std::chrono::nanoseconds SnapToNextTick(
44 std::chrono::nanoseconds
value,
45 std::chrono::nanoseconds tick_phase,
46 std::chrono::nanoseconds tick_interval) {
47 std::chrono::nanoseconds offset = (tick_phase -
value) % tick_interval;
48 if (offset != std::chrono::nanoseconds::zero())
49 offset = offset + tick_interval;
50 return value + offset;
63 if (!
host->egl_manager()) {
66 return host->egl_manager()->render_context()->MakeCurrent();
70 if (!
host->egl_manager()) {
73 return host->egl_manager()->render_context()->ClearCurrent();
82 const char* what) ->
void* {
83 return reinterpret_cast<void*
>(eglGetProcAddress(what));
87 if (!
host->egl_manager()) {
90 return host->egl_manager()->resource_context()->MakeCurrent();
96 if (!
host->texture_registrar()) {
114 [](
void*
user_data,
const void* allocation,
size_t row_bytes,
136FlutterLocale CovertToFlutterLocale(
const LanguageInfo& info) {
140 if (!info.region.empty()) {
143 if (!info.script.empty()) {
153 std::shared_ptr<WindowsProcTable> windows_proc_table)
155 windows_proc_table_(
std::move(windows_proc_table)),
156 aot_data_(nullptr, nullptr),
158 if (windows_proc_table_ ==
nullptr) {
159 windows_proc_table_ = std::make_shared<WindowsProcTable>();
168 std::make_unique<TaskRunner>(
172 <<
"Cannot post an engine task when engine is not running.";
176 FML_LOG(ERROR) <<
"Failed to post an engine task.";
183 messenger_->SetEngine(
this);
184 plugin_registrar_ = std::make_unique<FlutterDesktopPluginRegistrar>();
185 plugin_registrar_->engine =
this;
188 std::make_unique<BinaryMessengerImpl>(messenger_->ToRef());
189 message_dispatcher_ =
190 std::make_unique<IncomingMessageDispatcher>(messenger_->ToRef());
193 std::make_unique<FlutterWindowsTextureRegistrar>(
this, gl_);
196 auto& switches = project_->GetSwitches();
197 enable_impeller_ = std::find(switches.begin(), switches.end(),
198 "--enable-impeller=true") != switches.end();
202 window_proc_delegate_manager_ = std::make_unique<WindowProcDelegateManager>();
204 display_manager_ = std::make_shared<DisplayManagerWin32>(
this);
206 window_proc_delegate_manager_->RegisterTopLevelWindowProcDelegate(
214 if (that->display_manager_->HandleWindowMessage(hwnd, msg, wpar, lpar,
221 that->lifecycle_manager_->WindowProc(hwnd, msg, wpar, lpar, result);
225 auto message_result =
226 that->window_manager_->HandleMessage(hwnd, msg, wpar, lpar);
227 if (message_result) {
228 *result = *message_result;
233 static_cast<void*
>(
this));
238 internal_plugin_registrar_ =
239 std::make_unique<PluginRegistrar>(plugin_registrar_.get());
241 accessibility_plugin_ = std::make_unique<AccessibilityPlugin>(
this);
243 accessibility_plugin_.get());
246 std::make_unique<CursorHandler>(messenger_wrapper_.get(),
this);
248 std::make_unique<PlatformHandler>(messenger_wrapper_.get(),
this);
249 window_manager_ = std::make_unique<WindowManager>(
this);
250 settings_plugin_ = std::make_unique<SettingsPlugin>(messenger_wrapper_.get(),
254FlutterWindowsEngine::~FlutterWindowsEngine() {
255 messenger_->SetEngine(
nullptr);
263void FlutterWindowsEngine::SetSwitches(
264 const std::vector<std::string>& switches) {
268bool FlutterWindowsEngine::Run() {
272bool FlutterWindowsEngine::Run(std::string_view entrypoint) {
273 if (!project_->HasValidPaths()) {
274 FML_LOG(ERROR) <<
"Missing or unresolvable paths to assets.";
277 std::string assets_path_string =
fml::PathToUtf8(project_->assets_path());
279 if (embedder_api_.RunsAOTCompiledDartCode()) {
280 aot_data_ = project_->LoadAotData(embedder_api_);
282 FML_LOG(ERROR) <<
"Unable to start engine without AOT data.";
290 std::string executable_name = GetExecutableName();
291 std::vector<const char*>
argv = {executable_name.c_str()};
292 std::vector<std::string> switches = project_->GetSwitches();
293 if (enable_impeller_) {
294 if (std::find(switches.begin(), switches.end(),
295 "--impeller-use-sdfs=true") == switches.end() &&
296 std::find(switches.begin(), switches.end(),
297 "--impeller-use-sdfs=false") == switches.end()) {
298 switches.push_back(
"--impeller-use-sdfs=true");
302 switches.begin(), switches.end(), std::back_inserter(
argv),
303 [](
const std::string& arg) ->
const char* { return arg.c_str(); });
305 const std::vector<std::string>& entrypoint_args =
306 project_->dart_entrypoint_arguments();
307 std::vector<const char*> entrypoint_argv;
309 entrypoint_args.begin(), entrypoint_args.end(),
310 std::back_inserter(entrypoint_argv),
311 [](
const std::string& arg) ->
const char* { return arg.c_str(); });
316 platform_task_runner.
user_data = task_runner_.get();
322 uint64_t target_time_nanos,
331 &WindowsPlatformThreadPrioritySetter;
333 if (project_->ui_thread_policy() !=
334 FlutterUIThreadPolicy::RunOnSeparateThread) {
337 FML_LOG(WARNING) <<
"Running with unmerged platform and UI threads. This "
338 "will be removed in future.";
343 args.shutdown_dart_vm_when_done =
true;
344 args.assets_path = assets_path_string.c_str();
345 args.icu_data_path = icu_path_string.c_str();
346 args.command_line_argc =
static_cast<int>(
argv.size());
347 args.command_line_argv =
argv.empty() ? nullptr :
argv.data();
348 args.engine_id =
reinterpret_cast<int64_t
>(
this);
356 if (!project_->dart_entrypoint().empty() && !entrypoint.empty() &&
357 project_->dart_entrypoint() != entrypoint) {
358 FML_LOG(ERROR) <<
"Conflicting entrypoints were specified in "
359 "FlutterDesktopEngineProperties.dart_entrypoint and "
360 "FlutterDesktopEngineRun(engine, entry_point). ";
363 if (!entrypoint.empty()) {
364 args.custom_dart_entrypoint = entrypoint.data();
365 }
else if (!project_->dart_entrypoint().empty()) {
366 args.custom_dart_entrypoint = project_->dart_entrypoint().c_str();
368 args.dart_entrypoint_argc =
static_cast<int>(entrypoint_argv.size());
369 args.dart_entrypoint_argv =
370 entrypoint_argv.empty() ? nullptr : entrypoint_argv.data();
371 args.platform_message_callback =
375 return host->HandlePlatformMessage(engine_message);
377 args.vsync_callback = [](
void*
user_data, intptr_t baton) ->
void {
379 host->OnVsync(baton);
383 host->OnPreEngineRestart();
394 auto accessibility_bridge =
view->accessibility_bridge().lock();
395 if (!accessibility_bridge) {
401 accessibility_bridge->AddFlutterSemanticsNodeUpdate(*node);
406 accessibility_bridge->AddFlutterSemanticsCustomActionUpdate(*
action);
409 accessibility_bridge->CommitUpdates();
413 if (
host->root_isolate_create_callback_) {
414 host->root_isolate_create_callback_();
421 std::string channel_name(update->channel);
422 host->OnChannelUpdate(std::move(channel_name),
426 args.view_focus_change_request_callback =
429 host->OnViewFocusChangeRequest(request);
432 args.custom_task_runners = &custom_task_runners;
434 if (!platform_view_plugin_) {
435 platform_view_plugin_ = std::make_unique<PlatformViewPlugin>(
436 messenger_wrapper_.get(), task_runner_.get());
439 auto resolver = [](
const char*
name) ->
void* {
440 return reinterpret_cast<void*
>(::eglGetProcAddress(
name));
446 std::make_unique<CompositorOpenGL>(
this, resolver, enable_impeller_);
448 compositor_ = std::make_unique<CompositorSoftware>();
453 compositor.user_data =
this;
454 compositor.create_backing_store_callback =
459 return host->compositor_->CreateBackingStore(*config, backing_store_out);
462 compositor.collect_backing_store_callback =
466 return host->compositor_->CollectBackingStore(backing_store);
469 compositor.present_view_callback =
473 return host->Present(info);
475 args.compositor = &compositor;
478 args.aot_data = aot_data_.get();
483 FML_DCHECK(!egl_manager_ || !egl_manager_->HasContextCurrent());
487 if (enable_impeller_) {
491 FML_LOG(ERROR) <<
"Could not create surface manager. Impeller backend "
492 "does not support software rendering.";
495 renderer_config = GetOpenGLRendererConfig();
498 egl_manager_ ? GetOpenGLRendererConfig() : GetSoftwareRendererConfig();
502 &
args,
this, &engine_);
503 if (result !=
kSuccess || engine_ ==
nullptr) {
504 FML_LOG(ERROR) <<
"Failed to start Flutter engine: error " << result;
508 display_manager_->UpdateDisplays();
512 settings_plugin_->StartWatching();
513 settings_plugin_->SendSettings();
515 InitializeKeyboard();
520bool FlutterWindowsEngine::Stop() {
522 window_manager_->OnEngineShutdown();
523 for (
const auto& [
callback, registrar] :
524 plugin_registrar_destruction_callbacks_) {
534std::unique_ptr<FlutterWindowsView> FlutterWindowsEngine::CreateView(
535 std::unique_ptr<WindowBindingHandler>
window,
536 bool is_sized_to_content,
540 auto view = std::make_unique<FlutterWindowsView>(
541 view_id,
this, std::move(
window), is_sized_to_content, box_constraints,
542 sizing_delegate, windows_proc_table_);
544 view->CreateRenderSurface();
545 view->UpdateSemanticsEnabled(semantics_enabled_);
552 std::unique_lock write_lock(views_mutex_);
557 if (!
view->IsImplicitView()) {
564 Captures captures = {};
574 Captures* captures =
reinterpret_cast<Captures*
>(result->user_data);
575 captures->added = result->added;
576 captures->latch.Signal();
582 <<
"Starting the add view operation failed. FlutterEngineAddView "
583 "returned an unexpected result: "
584 << result <<
". This indicates a bug in the Windows embedder.";
594 captures.latch.Wait();
596 if (!captures.added) {
600 FML_LOG(ERROR) <<
"FlutterEngineAddView failed to add view";
601 std::unique_lock write_lock(views_mutex_);
607 return std::move(
view);
621 Captures captures = {};
631 Captures* captures =
reinterpret_cast<Captures*
>(result->user_data);
632 captures->removed = result->removed;
633 captures->latch.Signal();
638 FML_LOG(ERROR) <<
"Starting the remove view operation failed. "
639 "FlutterEngineRemoveView "
640 "returned an unexpected result: "
642 <<
". This indicates a bug in the Windows embedder.";
652 captures.latch.Wait();
654 if (!captures.removed) {
657 FML_LOG(ERROR) <<
"FlutterEngineRemoveView failed to remove view";
665 std::unique_lock write_lock(views_mutex_);
671 if (text_input_plugin_) {
672 text_input_plugin_->OnViewRemoved(
view_id);
679void FlutterWindowsEngine::OnVsync(intptr_t baton) {
680 std::chrono::nanoseconds current_time =
681 std::chrono::nanoseconds(embedder_api_.GetCurrentTime());
682 std::chrono::nanoseconds frame_interval = FrameInterval();
683 auto next = SnapToNextTick(current_time, start_time_, frame_interval);
684 embedder_api_.OnVsync(engine_, baton, next.count(),
685 (next + frame_interval).count());
688std::chrono::nanoseconds FlutterWindowsEngine::FrameInterval() {
689 if (frame_interval_override_.has_value()) {
690 return frame_interval_override_.value();
692 uint64_t interval = 16600000;
694 DWM_TIMING_INFO timing_info = {};
695 timing_info.cbSize =
sizeof(timing_info);
696 HRESULT result = DwmGetCompositionTimingInfo(NULL, &timing_info);
697 if (result == S_OK && timing_info.rateRefresh.uiDenominator > 0 &&
698 timing_info.rateRefresh.uiNumerator > 0) {
699 interval =
static_cast<double>(timing_info.rateRefresh.uiDenominator *
701 static_cast<double>(timing_info.rateRefresh.uiNumerator);
704 return std::chrono::nanoseconds(interval);
708 std::shared_lock read_lock(views_mutex_);
710 auto iterator = views_.find(
view_id);
711 if (iterator == views_.end()) {
715 return iterator->second;
720 return plugin_registrar_.get();
723void FlutterWindowsEngine::AddPluginRegistrarDestructionCallback(
726 plugin_registrar_destruction_callbacks_[
callback] = registrar;
729void FlutterWindowsEngine::UpdateDisplay(
730 const std::vector<FlutterEngineDisplay>&
displays) {
732 embedder_api_.NotifyDisplayUpdate(engine_,
738void FlutterWindowsEngine::SendWindowMetricsEvent(
741 embedder_api_.SendWindowMetricsEvent(engine_, &event);
747 embedder_api_.SendPointerEvent(engine_, &event, 1);
759void FlutterWindowsEngine::SendViewFocusEvent(
762 embedder_api_.SendViewFocusEvent(engine_, &event);
766bool FlutterWindowsEngine::SendPlatformMessage(
769 const size_t message_size,
773 if (reply !=
nullptr &&
user_data !=
nullptr) {
775 embedder_api_.PlatformMessageCreateResponseHandle(
776 engine_, reply,
user_data, &response_handle);
778 FML_LOG(ERROR) <<
"Failed to create response handle";
792 embedder_api_.SendPlatformMessage(engine_, &platform_message);
793 if (response_handle !=
nullptr) {
794 embedder_api_.PlatformMessageReleaseResponseHandle(engine_,
800void FlutterWindowsEngine::SendPlatformMessageResponse(
803 size_t data_length) {
804 embedder_api_.SendPlatformMessageResponse(engine_, handle,
data, data_length);
807void FlutterWindowsEngine::HandlePlatformMessage(
810 FML_LOG(ERROR) <<
"Invalid message size received. Expected: "
818 message_dispatcher_->HandleMessage(
message, [
this] {}, [
this] {});
821void FlutterWindowsEngine::ReloadSystemFonts() {
822 embedder_api_.ReloadSystemFonts(engine_);
825void FlutterWindowsEngine::ScheduleFrame() {
826 embedder_api_.ScheduleFrame(engine_);
830 next_frame_callback_ = std::move(
callback);
832 embedder_api_.SetNextFrameCallback(
840 self->task_runner_->PostTask(std::move(
self->next_frame_callback_));
845HCURSOR FlutterWindowsEngine::GetCursorByName(
846 const std::string& cursor_name)
const {
847 static auto* cursors =
new std::map<std::string, const wchar_t*>{
848 {
"allScroll", IDC_SIZEALL},
849 {
"basic", IDC_ARROW},
851 {
"forbidden", IDC_NO},
853 {
"move", IDC_SIZEALL},
856 {
"precise", IDC_CROSS},
857 {
"progress", IDC_APPSTARTING},
859 {
"resizeColumn", IDC_SIZEWE},
860 {
"resizeDown", IDC_SIZENS},
861 {
"resizeDownLeft", IDC_SIZENESW},
862 {
"resizeDownRight", IDC_SIZENWSE},
863 {
"resizeLeft", IDC_SIZEWE},
864 {
"resizeLeftRight", IDC_SIZEWE},
865 {
"resizeRight", IDC_SIZEWE},
866 {
"resizeRow", IDC_SIZENS},
867 {
"resizeUp", IDC_SIZENS},
868 {
"resizeUpDown", IDC_SIZENS},
869 {
"resizeUpLeft", IDC_SIZENWSE},
870 {
"resizeUpRight", IDC_SIZENESW},
871 {
"resizeUpLeftDownRight", IDC_SIZENWSE},
872 {
"resizeUpRightDownLeft", IDC_SIZENESW},
875 const wchar_t* idc_name = IDC_ARROW;
876 auto it = cursors->find(cursor_name);
877 if (it != cursors->end()) {
878 idc_name = it->second;
880 return windows_proc_table_->LoadCursor(
nullptr, idc_name);
885 std::shared_lock read_lock(views_mutex_);
886 auto const iterator =
887 std::find_if(views_.begin(), views_.end(), [hwnd](
auto const& pair) {
888 FlutterWindowsView* const view = pair.second;
889 return GetAncestor(view->GetWindowHandle(), GA_ROOT) == hwnd;
891 if (iterator != views_.end()) {
892 return iterator->second;
897void FlutterWindowsEngine::SendSystemLocales() {
898 std::vector<LanguageInfo> languages =
900 std::vector<FlutterLocale> flutter_locales;
901 flutter_locales.reserve(languages.size());
902 for (
const auto& info : languages) {
903 flutter_locales.push_back(CovertToFlutterLocale(info));
906 std::vector<const FlutterLocale*> flutter_locale_list;
907 flutter_locale_list.reserve(flutter_locales.size());
908 std::transform(flutter_locales.begin(), flutter_locales.end(),
909 std::back_inserter(flutter_locale_list),
910 [](
const auto& arg) ->
const auto* { return &arg; });
911 embedder_api_.UpdateLocales(engine_, flutter_locale_list.data(),
912 flutter_locale_list.size());
915void FlutterWindowsEngine::InitializeKeyboard() {
916 auto internal_plugin_messenger = internal_plugin_registrar_->messenger();
917 KeyboardKeyEmbedderHandler::GetKeyStateHandler get_key_state = GetKeyState;
918 KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode map_vk_to_scan =
920 return MapVirtualKey(virtual_key,
921 extended ? MAPVK_VK_TO_VSC_EX : MAPVK_VK_TO_VSC);
923 keyboard_key_handler_ = std::move(CreateKeyboardKeyHandler(
924 internal_plugin_messenger, get_key_state, map_vk_to_scan));
926 std::move(CreateTextInputPlugin(internal_plugin_messenger));
929std::unique_ptr<KeyboardHandlerBase>
930FlutterWindowsEngine::CreateKeyboardKeyHandler(
934 auto keyboard_key_handler = std::make_unique<KeyboardKeyHandler>(messenger);
935 keyboard_key_handler->AddDelegate(
936 std::make_unique<KeyboardKeyEmbedderHandler>(
941 get_key_state, map_vk_to_scan));
942 keyboard_key_handler->AddDelegate(
943 std::make_unique<KeyboardKeyChannelHandler>(messenger));
944 keyboard_key_handler->InitKeyboardChannel();
945 return keyboard_key_handler;
948std::unique_ptr<TextInputPlugin> FlutterWindowsEngine::CreateTextInputPlugin(
950 return std::make_unique<TextInputPlugin>(messenger,
this);
953bool FlutterWindowsEngine::RegisterExternalTexture(int64_t
texture_id) {
954 return (embedder_api_.RegisterExternalTexture(engine_,
texture_id) ==
958bool FlutterWindowsEngine::UnregisterExternalTexture(int64_t
texture_id) {
959 return (embedder_api_.UnregisterExternalTexture(engine_,
texture_id) ==
963bool FlutterWindowsEngine::MarkExternalTextureFrameAvailable(
965 return (embedder_api_.MarkExternalTextureFrameAvailable(
973 auto captures =
new Captures();
974 captures->callback = std::move(
callback);
975 if (embedder_api_.PostRenderThreadTask(
978 auto captures = reinterpret_cast<Captures*>(opaque);
979 captures->callback();
989bool FlutterWindowsEngine::DispatchSemanticsAction(
1000 .data_length =
data.GetSize(),
1002 return (embedder_api_.SendSemanticsAction(engine_, &info));
1005void FlutterWindowsEngine::UpdateSemanticsEnabled(
bool enabled) {
1006 if (engine_ && semantics_enabled_ != enabled) {
1007 std::shared_lock read_lock(views_mutex_);
1009 semantics_enabled_ = enabled;
1010 embedder_api_.UpdateSemanticsEnabled(engine_, enabled);
1011 for (
auto iterator = views_.begin(); iterator != views_.end(); iterator++) {
1012 iterator->second->UpdateSemanticsEnabled(enabled);
1017void FlutterWindowsEngine::OnPreEngineRestart() {
1019 InitializeKeyboard();
1022std::string FlutterWindowsEngine::GetExecutableName()
const {
1025 const std::string& executable_path = result.second;
1026 size_t last_separator = executable_path.find_last_of(
"/\\");
1027 if (last_separator == std::string::npos ||
1028 last_separator == executable_path.size() - 1) {
1029 return executable_path;
1031 return executable_path.substr(last_separator + 1);
1036void FlutterWindowsEngine::UpdateAccessibilityFeatures() {
1037 UpdateHighContrastMode();
1040void FlutterWindowsEngine::UpdateHighContrastMode() {
1041 high_contrast_enabled_ = windows_proc_table_->GetHighContrastEnabled();
1043 SendAccessibilityFeatures();
1044 settings_plugin_->UpdateHighContrastMode(high_contrast_enabled_);
1047void FlutterWindowsEngine::SendAccessibilityFeatures() {
1050 if (high_contrast_enabled_) {
1055 embedder_api_.UpdateAccessibilityFeatures(
1059void FlutterWindowsEngine::RequestApplicationQuit(HWND hwnd,
1063 platform_handler_->RequestAppExit(hwnd, wparam, lparam, exit_type, 0);
1066void FlutterWindowsEngine::OnQuit(std::optional<HWND> hwnd,
1067 std::optional<WPARAM> wparam,
1068 std::optional<LPARAM> lparam,
1070 lifecycle_manager_->Quit(hwnd, wparam, lparam, exit_code);
1073void FlutterWindowsEngine::OnDwmCompositionChanged() {
1074 if (display_manager_) {
1075 display_manager_->UpdateDisplays();
1078 std::shared_lock read_lock(views_mutex_);
1079 for (
auto iterator = views_.begin(); iterator != views_.end(); iterator++) {
1080 iterator->second->OnDwmCompositionChanged();
1084void FlutterWindowsEngine::OnWindowStateEvent(HWND hwnd,
1086 lifecycle_manager_->OnWindowStateEvent(hwnd, event);
1089std::optional<LRESULT> FlutterWindowsEngine::ProcessExternalWindowMessage(
1094 if (lifecycle_manager_) {
1095 return lifecycle_manager_->ExternalWindowMessage(hwnd,
message, wparam,
1098 return std::nullopt;
1101void FlutterWindowsEngine::UpdateFlutterCursor(
1102 const std::string& cursor_name)
const {
1103 SetFlutterCursor(GetCursorByName(cursor_name));
1106void FlutterWindowsEngine::SetFlutterCursor(HCURSOR cursor)
const {
1107 windows_proc_table_->SetCursor(cursor);
1110void FlutterWindowsEngine::OnChannelUpdate(std::string
name,
bool listening) {
1111 if (
name ==
"flutter/platform" && listening) {
1112 lifecycle_manager_->BeginProcessingExit();
1113 }
else if (
name ==
"flutter/lifecycle" && listening) {
1114 lifecycle_manager_->BeginProcessingLifecycle();
1118void FlutterWindowsEngine::OnViewFocusChangeRequest(
1120 std::shared_lock read_lock(views_mutex_);
1122 auto iterator = views_.find(request->
view_id);
1123 if (iterator == views_.end()) {
1135 std::shared_lock read_lock(views_mutex_);
1137 auto iterator = views_.find(info->
view_id);
1138 if (iterator == views_.end()) {
1142 FlutterWindowsView*
view = iterator->second;
1147bool FlutterWindowsEngine::HandleDisplayMonitorMessage(HWND hwnd,
1152 if (!display_manager_) {
1156 return display_manager_->HandleWindowMessage(hwnd,
message, wparam, lparam,
static void SetUp(BinaryMessenger *binary_messenger, AccessibilityPlugin *plugin)
FlutterWindowsEngine(const FlutterProjectBundle &project, std::shared_ptr< WindowsProcTable > windows_proc_table=nullptr)
void SetSwitches(const std::vector< std::string > &switches)
std::function< SHORT(UINT, bool)> MapVirtualKeyToScanCode
std::function< SHORT(int)> GetKeyStateHandler
static std::unique_ptr< Manager > Create(GpuPreference gpu_preference)
static std::shared_ptr< ProcTable > Create()
A Mapping like NonOwnedMapping, but uses Free as its release proc.
FlutterEngineResult FlutterEngineGetProcAddresses(FlutterEngineProcTable *table)
Gets the table of engine function pointers.
FlutterAccessibilityFeature
@ kFlutterAccessibilityFeatureHighContrast
Request that UI be rendered with darker colors.
@ kFlutterEngineDisplaysUpdateTypeStartup
void(* FlutterKeyEventCallback)(bool, void *)
#define FLUTTER_ENGINE_VERSION
#define SAFE_ACCESS(pointer, member, default_value)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_BEGIN_DECLS FlutterViewId view_id
static FlutterDesktopMessage ConvertToDesktopMessage(const FlutterPlatformMessage &engine_message)
void(* FlutterDesktopBinaryReply)(const uint8_t *data, size_t data_size, void *user_data)
void(* FlutterDesktopOnPluginRegistrarDestroyed)(FlutterDesktopPluginRegistrarRef)
static constexpr char kAccessibilityChannelName[]
FlutterDesktopBinaryReply callback
#define FML_LOG(severity)
#define FML_UNREACHABLE()
#define FML_DCHECK(condition)
static constexpr FlutterViewId kImplicitViewId
WindowStateEvent
An event representing a change in window state that may update the.
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service host
std::vector< LanguageInfo > GetPreferredLanguageInfo()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
std::pair< bool, std::string > GetExecutablePath()
std::string PathToUtf8(const std::filesystem::path &path)
std::function< void()> closure
FlutterAddViewCallback add_view_callback
FlutterViewId view_id
The identifier for the view to add. This must be unique.
const FlutterWindowMetricsEvent * view_metrics
An update to whether a message channel has a listener set or not.
void(* thread_priority_setter)(FlutterThreadPriority)
const FlutterTaskRunnerDescription * ui_task_runner
const FlutterTaskRunnerDescription * platform_task_runner
size_t struct_size
The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
Function-pointer-based versions of the APIs above.
size_t struct_size
The size of this struct. Must be sizeof(FlutterEngineProcs).
FlutterEngineGetCurrentTimeFnPtr GetCurrentTime
FlutterEngineRunTaskFnPtr RunTask
const char * language_code
size_t struct_size
This size of this struct. Must be sizeof(FlutterLocale).
const char * country_code
ProcResolver gl_proc_resolver
BoolCallback make_current
size_t struct_size
The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).
TextureFrameCallback gl_external_texture_frame_callback
bool fbo_reset_after_present
BoolCallback make_resource_current
UIntFrameInfoCallback fbo_with_frame_info_callback
BoolCallback clear_current
size_t layers_count
The count of layers.
FlutterViewId view_id
The identifier of the target view.
const FlutterLayer ** layers
The layers that should be composited onto the view.
size_t struct_size
The size of this struct. Must be sizeof(FlutterProjectArgs).
FlutterRemoveViewCallback remove_view_callback
FlutterSoftwareRendererConfig software
FlutterOpenGLRendererConfig open_gl
A batch of updates to semantics nodes and custom actions.
size_t node_count
The number of semantics node updates.
size_t custom_action_count
The number of semantics custom action updates.
FlutterSemanticsNode2 ** nodes
FlutterSemanticsCustomAction2 ** custom_actions
size_t struct_size
The size of this struct. Must be sizeof(FlutterSoftwareRendererConfig).
SoftwareSurfacePresentCallback surface_present_callback
size_t struct_size
The size of this struct. Must be sizeof(FlutterTaskRunnerDescription).
BoolCallback runs_task_on_current_thread_callback
FlutterTaskRunnerPostTaskCallback post_task_callback
FlutterViewId view_id
The identifier of the view that received the focus event.
#define BASE_DCHECK(condition)