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();
294 switches.begin(), switches.end(), std::back_inserter(
argv),
295 [](
const std::string& arg) ->
const char* { return arg.c_str(); });
297 const std::vector<std::string>& entrypoint_args =
298 project_->dart_entrypoint_arguments();
299 std::vector<const char*> entrypoint_argv;
301 entrypoint_args.begin(), entrypoint_args.end(),
302 std::back_inserter(entrypoint_argv),
303 [](
const std::string& arg) ->
const char* { return arg.c_str(); });
308 platform_task_runner.
user_data = task_runner_.get();
314 uint64_t target_time_nanos,
323 &WindowsPlatformThreadPrioritySetter;
325 if (project_->ui_thread_policy() !=
326 FlutterUIThreadPolicy::RunOnSeparateThread) {
329 FML_LOG(WARNING) <<
"Running with unmerged platform and UI threads. This "
330 "will be removed in future.";
335 args.shutdown_dart_vm_when_done =
true;
336 args.assets_path = assets_path_string.c_str();
337 args.icu_data_path = icu_path_string.c_str();
338 args.command_line_argc =
static_cast<int>(
argv.size());
339 args.command_line_argv =
argv.empty() ? nullptr :
argv.data();
340 args.engine_id =
reinterpret_cast<int64_t
>(
this);
348 if (!project_->dart_entrypoint().empty() && !entrypoint.empty() &&
349 project_->dart_entrypoint() != entrypoint) {
350 FML_LOG(ERROR) <<
"Conflicting entrypoints were specified in "
351 "FlutterDesktopEngineProperties.dart_entrypoint and "
352 "FlutterDesktopEngineRun(engine, entry_point). ";
355 if (!entrypoint.empty()) {
356 args.custom_dart_entrypoint = entrypoint.data();
357 }
else if (!project_->dart_entrypoint().empty()) {
358 args.custom_dart_entrypoint = project_->dart_entrypoint().c_str();
360 args.dart_entrypoint_argc =
static_cast<int>(entrypoint_argv.size());
361 args.dart_entrypoint_argv =
362 entrypoint_argv.empty() ? nullptr : entrypoint_argv.data();
363 args.platform_message_callback =
367 return host->HandlePlatformMessage(engine_message);
369 args.vsync_callback = [](
void*
user_data, intptr_t baton) ->
void {
371 host->OnVsync(baton);
375 host->OnPreEngineRestart();
386 auto accessibility_bridge =
view->accessibility_bridge().lock();
387 if (!accessibility_bridge) {
393 accessibility_bridge->AddFlutterSemanticsNodeUpdate(*node);
398 accessibility_bridge->AddFlutterSemanticsCustomActionUpdate(*
action);
401 accessibility_bridge->CommitUpdates();
405 if (
host->root_isolate_create_callback_) {
406 host->root_isolate_create_callback_();
413 std::string channel_name(update->channel);
414 host->OnChannelUpdate(std::move(channel_name),
418 args.view_focus_change_request_callback =
421 host->OnViewFocusChangeRequest(request);
424 args.custom_task_runners = &custom_task_runners;
426 if (!platform_view_plugin_) {
427 platform_view_plugin_ = std::make_unique<PlatformViewPlugin>(
428 messenger_wrapper_.get(), task_runner_.get());
431 auto resolver = [](
const char*
name) ->
void* {
432 return reinterpret_cast<void*
>(::eglGetProcAddress(
name));
438 std::make_unique<CompositorOpenGL>(
this, resolver, enable_impeller_);
440 compositor_ = std::make_unique<CompositorSoftware>();
445 compositor.user_data =
this;
446 compositor.create_backing_store_callback =
451 return host->compositor_->CreateBackingStore(*config, backing_store_out);
454 compositor.collect_backing_store_callback =
458 return host->compositor_->CollectBackingStore(backing_store);
461 compositor.present_view_callback =
465 return host->Present(info);
467 args.compositor = &compositor;
470 args.aot_data = aot_data_.get();
475 FML_DCHECK(!egl_manager_ || !egl_manager_->HasContextCurrent());
479 if (enable_impeller_) {
483 FML_LOG(ERROR) <<
"Could not create surface manager. Impeller backend "
484 "does not support software rendering.";
487 renderer_config = GetOpenGLRendererConfig();
490 egl_manager_ ? GetOpenGLRendererConfig() : GetSoftwareRendererConfig();
494 &
args,
this, &engine_);
495 if (result !=
kSuccess || engine_ ==
nullptr) {
496 FML_LOG(ERROR) <<
"Failed to start Flutter engine: error " << result;
500 display_manager_->UpdateDisplays();
504 settings_plugin_->StartWatching();
505 settings_plugin_->SendSettings();
507 InitializeKeyboard();
512bool FlutterWindowsEngine::Stop() {
514 window_manager_->OnEngineShutdown();
515 for (
const auto& [
callback, registrar] :
516 plugin_registrar_destruction_callbacks_) {
526std::unique_ptr<FlutterWindowsView> FlutterWindowsEngine::CreateView(
527 std::unique_ptr<WindowBindingHandler>
window,
528 bool is_sized_to_content,
532 auto view = std::make_unique<FlutterWindowsView>(
533 view_id,
this, std::move(
window), is_sized_to_content, box_constraints,
534 sizing_delegate, windows_proc_table_);
536 view->CreateRenderSurface();
537 view->UpdateSemanticsEnabled(semantics_enabled_);
544 std::unique_lock write_lock(views_mutex_);
549 if (!
view->IsImplicitView()) {
556 Captures captures = {};
566 Captures* captures =
reinterpret_cast<Captures*
>(result->user_data);
567 captures->added = result->added;
568 captures->latch.Signal();
574 <<
"Starting the add view operation failed. FlutterEngineAddView "
575 "returned an unexpected result: "
576 << result <<
". This indicates a bug in the Windows embedder.";
586 captures.latch.Wait();
588 if (!captures.added) {
592 FML_LOG(ERROR) <<
"FlutterEngineAddView failed to add view";
593 std::unique_lock write_lock(views_mutex_);
599 return std::move(
view);
613 Captures captures = {};
623 Captures* captures =
reinterpret_cast<Captures*
>(result->user_data);
624 captures->removed = result->removed;
625 captures->latch.Signal();
630 FML_LOG(ERROR) <<
"Starting the remove view operation failed. "
631 "FlutterEngineRemoveView "
632 "returned an unexpected result: "
634 <<
". This indicates a bug in the Windows embedder.";
644 captures.latch.Wait();
646 if (!captures.removed) {
649 FML_LOG(ERROR) <<
"FlutterEngineRemoveView failed to remove view";
657 std::unique_lock write_lock(views_mutex_);
664void FlutterWindowsEngine::OnVsync(intptr_t baton) {
665 std::chrono::nanoseconds current_time =
666 std::chrono::nanoseconds(embedder_api_.GetCurrentTime());
667 std::chrono::nanoseconds frame_interval = FrameInterval();
668 auto next = SnapToNextTick(current_time, start_time_, frame_interval);
669 embedder_api_.OnVsync(engine_, baton, next.count(),
670 (next + frame_interval).count());
673std::chrono::nanoseconds FlutterWindowsEngine::FrameInterval() {
674 if (frame_interval_override_.has_value()) {
675 return frame_interval_override_.value();
677 uint64_t interval = 16600000;
679 DWM_TIMING_INFO timing_info = {};
680 timing_info.cbSize =
sizeof(timing_info);
681 HRESULT result = DwmGetCompositionTimingInfo(NULL, &timing_info);
682 if (result == S_OK && timing_info.rateRefresh.uiDenominator > 0 &&
683 timing_info.rateRefresh.uiNumerator > 0) {
684 interval =
static_cast<double>(timing_info.rateRefresh.uiDenominator *
686 static_cast<double>(timing_info.rateRefresh.uiNumerator);
689 return std::chrono::nanoseconds(interval);
693 std::shared_lock read_lock(views_mutex_);
695 auto iterator = views_.find(
view_id);
696 if (iterator == views_.end()) {
700 return iterator->second;
705 return plugin_registrar_.get();
708void FlutterWindowsEngine::AddPluginRegistrarDestructionCallback(
711 plugin_registrar_destruction_callbacks_[
callback] = registrar;
714void FlutterWindowsEngine::UpdateDisplay(
715 const std::vector<FlutterEngineDisplay>&
displays) {
717 embedder_api_.NotifyDisplayUpdate(engine_,
723void FlutterWindowsEngine::SendWindowMetricsEvent(
726 embedder_api_.SendWindowMetricsEvent(engine_, &event);
732 embedder_api_.SendPointerEvent(engine_, &event, 1);
744void FlutterWindowsEngine::SendViewFocusEvent(
747 embedder_api_.SendViewFocusEvent(engine_, &event);
751bool FlutterWindowsEngine::SendPlatformMessage(
754 const size_t message_size,
758 if (reply !=
nullptr &&
user_data !=
nullptr) {
760 embedder_api_.PlatformMessageCreateResponseHandle(
761 engine_, reply,
user_data, &response_handle);
763 FML_LOG(ERROR) <<
"Failed to create response handle";
777 embedder_api_.SendPlatformMessage(engine_, &platform_message);
778 if (response_handle !=
nullptr) {
779 embedder_api_.PlatformMessageReleaseResponseHandle(engine_,
785void FlutterWindowsEngine::SendPlatformMessageResponse(
788 size_t data_length) {
789 embedder_api_.SendPlatformMessageResponse(engine_, handle,
data, data_length);
792void FlutterWindowsEngine::HandlePlatformMessage(
795 FML_LOG(ERROR) <<
"Invalid message size received. Expected: "
803 message_dispatcher_->HandleMessage(
message, [
this] {}, [
this] {});
806void FlutterWindowsEngine::ReloadSystemFonts() {
807 embedder_api_.ReloadSystemFonts(engine_);
810void FlutterWindowsEngine::ScheduleFrame() {
811 embedder_api_.ScheduleFrame(engine_);
815 next_frame_callback_ = std::move(
callback);
817 embedder_api_.SetNextFrameCallback(
825 self->task_runner_->PostTask(std::move(
self->next_frame_callback_));
830HCURSOR FlutterWindowsEngine::GetCursorByName(
831 const std::string& cursor_name)
const {
832 static auto* cursors =
new std::map<std::string, const wchar_t*>{
833 {
"allScroll", IDC_SIZEALL},
834 {
"basic", IDC_ARROW},
836 {
"forbidden", IDC_NO},
838 {
"move", IDC_SIZEALL},
841 {
"precise", IDC_CROSS},
842 {
"progress", IDC_APPSTARTING},
844 {
"resizeColumn", IDC_SIZEWE},
845 {
"resizeDown", IDC_SIZENS},
846 {
"resizeDownLeft", IDC_SIZENESW},
847 {
"resizeDownRight", IDC_SIZENWSE},
848 {
"resizeLeft", IDC_SIZEWE},
849 {
"resizeLeftRight", IDC_SIZEWE},
850 {
"resizeRight", IDC_SIZEWE},
851 {
"resizeRow", IDC_SIZENS},
852 {
"resizeUp", IDC_SIZENS},
853 {
"resizeUpDown", IDC_SIZENS},
854 {
"resizeUpLeft", IDC_SIZENWSE},
855 {
"resizeUpRight", IDC_SIZENESW},
856 {
"resizeUpLeftDownRight", IDC_SIZENWSE},
857 {
"resizeUpRightDownLeft", IDC_SIZENESW},
860 const wchar_t* idc_name = IDC_ARROW;
861 auto it = cursors->find(cursor_name);
862 if (it != cursors->end()) {
863 idc_name = it->second;
865 return windows_proc_table_->LoadCursor(
nullptr, idc_name);
870 std::shared_lock read_lock(views_mutex_);
871 auto const iterator =
872 std::find_if(views_.begin(), views_.end(), [hwnd](
auto const& pair) {
873 FlutterWindowsView* const view = pair.second;
874 return GetAncestor(view->GetWindowHandle(), GA_ROOT) == hwnd;
876 if (iterator != views_.end()) {
877 return iterator->second;
882void FlutterWindowsEngine::SendSystemLocales() {
883 std::vector<LanguageInfo> languages =
885 std::vector<FlutterLocale> flutter_locales;
886 flutter_locales.reserve(languages.size());
887 for (
const auto& info : languages) {
888 flutter_locales.push_back(CovertToFlutterLocale(info));
891 std::vector<const FlutterLocale*> flutter_locale_list;
892 flutter_locale_list.reserve(flutter_locales.size());
893 std::transform(flutter_locales.begin(), flutter_locales.end(),
894 std::back_inserter(flutter_locale_list),
895 [](
const auto& arg) ->
const auto* { return &arg; });
896 embedder_api_.UpdateLocales(engine_, flutter_locale_list.data(),
897 flutter_locale_list.size());
900void FlutterWindowsEngine::InitializeKeyboard() {
901 auto internal_plugin_messenger = internal_plugin_registrar_->messenger();
902 KeyboardKeyEmbedderHandler::GetKeyStateHandler get_key_state = GetKeyState;
903 KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode map_vk_to_scan =
905 return MapVirtualKey(virtual_key,
906 extended ? MAPVK_VK_TO_VSC_EX : MAPVK_VK_TO_VSC);
908 keyboard_key_handler_ = std::move(CreateKeyboardKeyHandler(
909 internal_plugin_messenger, get_key_state, map_vk_to_scan));
911 std::move(CreateTextInputPlugin(internal_plugin_messenger));
914std::unique_ptr<KeyboardHandlerBase>
915FlutterWindowsEngine::CreateKeyboardKeyHandler(
919 auto keyboard_key_handler = std::make_unique<KeyboardKeyHandler>(messenger);
920 keyboard_key_handler->AddDelegate(
921 std::make_unique<KeyboardKeyEmbedderHandler>(
926 get_key_state, map_vk_to_scan));
927 keyboard_key_handler->AddDelegate(
928 std::make_unique<KeyboardKeyChannelHandler>(messenger));
929 keyboard_key_handler->InitKeyboardChannel();
930 return keyboard_key_handler;
933std::unique_ptr<TextInputPlugin> FlutterWindowsEngine::CreateTextInputPlugin(
935 return std::make_unique<TextInputPlugin>(messenger,
this);
938bool FlutterWindowsEngine::RegisterExternalTexture(int64_t
texture_id) {
939 return (embedder_api_.RegisterExternalTexture(engine_,
texture_id) ==
943bool FlutterWindowsEngine::UnregisterExternalTexture(int64_t
texture_id) {
944 return (embedder_api_.UnregisterExternalTexture(engine_,
texture_id) ==
948bool FlutterWindowsEngine::MarkExternalTextureFrameAvailable(
950 return (embedder_api_.MarkExternalTextureFrameAvailable(
958 auto captures =
new Captures();
959 captures->callback = std::move(
callback);
960 if (embedder_api_.PostRenderThreadTask(
963 auto captures = reinterpret_cast<Captures*>(opaque);
964 captures->callback();
974bool FlutterWindowsEngine::DispatchSemanticsAction(
985 .data_length =
data.GetSize(),
987 return (embedder_api_.SendSemanticsAction(engine_, &info));
990void FlutterWindowsEngine::UpdateSemanticsEnabled(
bool enabled) {
991 if (engine_ && semantics_enabled_ != enabled) {
992 std::shared_lock read_lock(views_mutex_);
994 semantics_enabled_ = enabled;
995 embedder_api_.UpdateSemanticsEnabled(engine_, enabled);
996 for (
auto iterator = views_.begin(); iterator != views_.end(); iterator++) {
997 iterator->second->UpdateSemanticsEnabled(enabled);
1002void FlutterWindowsEngine::OnPreEngineRestart() {
1004 InitializeKeyboard();
1007std::string FlutterWindowsEngine::GetExecutableName()
const {
1010 const std::string& executable_path = result.second;
1011 size_t last_separator = executable_path.find_last_of(
"/\\");
1012 if (last_separator == std::string::npos ||
1013 last_separator == executable_path.size() - 1) {
1014 return executable_path;
1016 return executable_path.substr(last_separator + 1);
1021void FlutterWindowsEngine::UpdateAccessibilityFeatures() {
1022 UpdateHighContrastMode();
1025void FlutterWindowsEngine::UpdateHighContrastMode() {
1026 high_contrast_enabled_ = windows_proc_table_->GetHighContrastEnabled();
1028 SendAccessibilityFeatures();
1029 settings_plugin_->UpdateHighContrastMode(high_contrast_enabled_);
1032void FlutterWindowsEngine::SendAccessibilityFeatures() {
1035 if (high_contrast_enabled_) {
1040 embedder_api_.UpdateAccessibilityFeatures(
1044void FlutterWindowsEngine::RequestApplicationQuit(HWND hwnd,
1048 platform_handler_->RequestAppExit(hwnd, wparam, lparam, exit_type, 0);
1051void FlutterWindowsEngine::OnQuit(std::optional<HWND> hwnd,
1052 std::optional<WPARAM> wparam,
1053 std::optional<LPARAM> lparam,
1055 lifecycle_manager_->Quit(hwnd, wparam, lparam, exit_code);
1058void FlutterWindowsEngine::OnDwmCompositionChanged() {
1059 if (display_manager_) {
1060 display_manager_->UpdateDisplays();
1063 std::shared_lock read_lock(views_mutex_);
1064 for (
auto iterator = views_.begin(); iterator != views_.end(); iterator++) {
1065 iterator->second->OnDwmCompositionChanged();
1069void FlutterWindowsEngine::OnWindowStateEvent(HWND hwnd,
1071 lifecycle_manager_->OnWindowStateEvent(hwnd, event);
1074std::optional<LRESULT> FlutterWindowsEngine::ProcessExternalWindowMessage(
1079 if (lifecycle_manager_) {
1080 return lifecycle_manager_->ExternalWindowMessage(hwnd,
message, wparam,
1083 return std::nullopt;
1086void FlutterWindowsEngine::UpdateFlutterCursor(
1087 const std::string& cursor_name)
const {
1088 SetFlutterCursor(GetCursorByName(cursor_name));
1091void FlutterWindowsEngine::SetFlutterCursor(HCURSOR cursor)
const {
1092 windows_proc_table_->SetCursor(cursor);
1095void FlutterWindowsEngine::OnChannelUpdate(std::string
name,
bool listening) {
1096 if (
name ==
"flutter/platform" && listening) {
1097 lifecycle_manager_->BeginProcessingExit();
1098 }
else if (
name ==
"flutter/lifecycle" && listening) {
1099 lifecycle_manager_->BeginProcessingLifecycle();
1103void FlutterWindowsEngine::OnViewFocusChangeRequest(
1105 std::shared_lock read_lock(views_mutex_);
1107 auto iterator = views_.find(request->
view_id);
1108 if (iterator == views_.end()) {
1120 std::shared_lock read_lock(views_mutex_);
1122 auto iterator = views_.find(info->
view_id);
1123 if (iterator == views_.end()) {
1127 FlutterWindowsView*
view = iterator->second;
1132bool FlutterWindowsEngine::HandleDisplayMonitorMessage(HWND hwnd,
1137 if (!display_manager_) {
1141 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()
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.
std::shared_ptr< const fml::Mapping > data
#define BASE_DCHECK(condition)