5#include "flutter/shell/platform/glfw/public/flutter_glfw.h"
17#include "flutter/common/constants.h"
18#include "flutter/shell/platform/common/client_wrapper/include/flutter/plugin_registrar.h"
19#include "flutter/shell/platform/common/incoming_message_dispatcher.h"
20#include "flutter/shell/platform/common/path_utils.h"
21#include "flutter/shell/platform/embedder/embedder.h"
22#include "flutter/shell/platform/glfw/glfw_event_loop.h"
23#include "flutter/shell/platform/glfw/headless_event_loop.h"
24#include "flutter/shell/platform/glfw/key_event_handler.h"
25#include "flutter/shell/platform/glfw/keyboard_hook_handler.h"
26#include "flutter/shell/platform/glfw/platform_handler.h"
27#include "flutter/shell/platform/glfw/system_utils.h"
28#include "flutter/shell/platform/glfw/text_input_plugin.h"
57 std::unique_ptr<FlutterDesktopEngineState>
engine;
63 std::vector<std::unique_ptr<flutter::KeyboardHookHandler>>
164 void AddRef() { ref_count_.fetch_add(1); }
171 int32_t old_count = ref_count_.fetch_sub(1);
172 if (old_count <= 1) {
183 std::scoped_lock lock(mutex_);
200 std::atomic<int32_t> ref_count_ = 0;
215 return messenger->
GetEngine() !=
nullptr;
232 glfwGetWindowUserPointer(
window));
240#if defined(__linux__)
241 glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
242 glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
243 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
245 GLFWwindow* share_window = glfwCreateWindow(1, 1,
"", NULL,
window);
246 glfwDefaultWindowHints();
266 auto* primary_monitor = glfwGetPrimaryMonitor();
267 if (primary_monitor ==
nullptr) {
270 auto* primary_monitor_mode = glfwGetVideoMode(primary_monitor);
271 int primary_monitor_width_mm;
272 glfwGetMonitorPhysicalSize(primary_monitor, &primary_monitor_width_mm,
274 if (primary_monitor_width_mm == 0) {
277 return primary_monitor_mode->width / (primary_monitor_width_mm / 25.4);
285 double dpi = controller->
window_wrapper->pixels_per_screen_coordinate *
296 event.pixel_ratio = std::max(dpi /
kDpPerInch, 1.0);
298 event.pixel_ratio = controller->
window_wrapper->pixel_ratio_override;
316 ->event_loop->RunsTasksOnCurrentThread();
321 task, target_time_nanos);
333 controller->window_wrapper->pixels_per_screen_coordinate =
337 controller->window_wrapper->skip_next_window_refresh =
true;
343 if (controller->window_wrapper->skip_next_window_refresh) {
344 controller->window_wrapper->skip_next_window_refresh =
false;
349 int width_px, height_px;
350 glfwGetFramebufferSize(
window, &width_px, &height_px);
351 if (width_px > 0 && height_px > 0) {
365 if (!controller->pointer_currently_added &&
369 event.x = event_data.
x;
370 event.y = event_data.
y;
375 if (controller->pointer_currently_added &&
384 std::chrono::duration_cast<std::chrono::microseconds>(
385 std::chrono::high_resolution_clock::now().time_since_epoch())
392 double pixels_per_coordinate =
393 controller->window_wrapper->pixels_per_screen_coordinate;
394 event.x *= pixels_per_coordinate;
395 event.y *= pixels_per_coordinate;
396 event.scroll_delta_x *= pixels_per_coordinate;
397 event.scroll_delta_y *= pixels_per_coordinate;
405 controller->pointer_currently_added =
true;
407 controller->pointer_currently_added =
false;
409 controller->pointer_currently_down =
true;
411 controller->pointer_currently_down =
false;
419 glfwGetCursorPos(
window, &event_data->
x, &event_data->
y);
463 if (
key == GLFW_MOUSE_BUTTON_LEFT) {
465 }
else if (
key == GLFW_MOUSE_BUTTON_RIGHT) {
472 controller->buttons = (
action == GLFW_PRESS) ? controller->buttons | button
473 : controller->buttons & ~button;
484 if (!hover_enabled) {
485 glfwSetCursorPosCallback(
window, (controller->buttons != 0)
493 glfwSetCursorEnterCallback(
509 const int kScrollOffsetMultiplier = 20;
510 event.scroll_delta_x = delta_x * kScrollOffsetMultiplier;
511 event.scroll_delta_y = -delta_y * kScrollOffsetMultiplier;
517 for (
const auto& handler :
519 handler->CharHook(
window, code_point);
529 for (
const auto& handler :
537 glfwSetCursorEnterCallback(
window,
539 glfwSetCursorPosCallback(
window,
557 glfwSetKeyCallback(
window,
nullptr);
558 glfwSetCharCallback(
window,
nullptr);
559 glfwSetMouseButtonCallback(
window,
nullptr);
560 glfwSetScrollCallback(
window,
nullptr);
570 std::cerr <<
"Invalid message size received. Expected: "
602 if (!window_controller) {
605 glfwMakeContextCurrent(window_controller->
window.get());
614 if (!window_controller) {
626 if (!window_controller) {
629 glfwMakeContextCurrent(
nullptr);
638 if (!window_controller) {
641 glfwSwapBuffers(window_controller->
window.get());
652 return reinterpret_cast<void*
>(glfwGetProcAddress(
name));
664 glfwMakeContextCurrent(
window);
666 glClearColor(236.0f / 255.0f, 239.0f / 255.0f, 241.0f / 255.0f, 0.0f);
667 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
670 glfwMakeContextCurrent(
nullptr);
674 std::cerr <<
"GLFW error " << error_code <<
": " << description << std::endl;
680 if (aot_data_path.empty()) {
682 <<
"Attempted to load AOT data, but no aot_data_path was provided."
686 std::string path_string = aot_data_path.string();
687 if (!std::filesystem::exists(aot_data_path)) {
688 std::cerr <<
"Can't load AOT data from " << path_string <<
"; no such file."
694 source.elf_path = path_string.c_str();
698 std::cerr <<
"Failed to load AOT data from: " << path_string << std::endl;
714 std::unique_ptr<flutter::EventLoop> event_loop) {
718 std::vector<const char*>
argv = {
"placeholder"};
724 std::filesystem::path assets_path =
725 std::filesystem::u8path(engine_properties.
assets_path);
726 std::filesystem::path icu_path =
728 std::filesystem::path aot_library_path =
730 if (assets_path.is_relative() || icu_path.is_relative() ||
731 (!aot_library_path.empty() && aot_library_path.is_relative())) {
733 std::filesystem::path executable_location =
735 if (executable_location.empty()) {
736 std::cerr <<
"Unable to find executable location to resolve paths."
740 assets_path = std::filesystem::path(executable_location) / assets_path;
741 icu_path = std::filesystem::path(executable_location) / icu_path;
742 if (!aot_library_path.empty()) {
744 std::filesystem::path(executable_location) / aot_library_path;
748 engine_state->
event_loop = std::move(event_loop);
768 const std::string assets_path_string = assets_path.string();
769 const std::string icu_path_string = icu_path.string();
772 args.assets_path = assets_path_string.c_str();
773 args.icu_data_path = icu_path_string.c_str();
774 args.command_line_argc =
static_cast<int>(
argv.size());
777 args.custom_task_runners = &task_runners;
782 std::cerr <<
"Unable to start engine without AOT data." << std::endl;
792 std::cerr <<
"Failed to start Flutter engine: error " <<
result
796 engine_state->flutter_engine =
engine;
802 std::vector<flutter::LanguageInfo> languages =
804 std::vector<FlutterLocale> flutter_locales =
807 std::vector<const FlutterLocale*> flutter_locale_list;
808 flutter_locale_list.reserve(flutter_locales.size());
809 std::transform(flutter_locales.begin(), flutter_locales.end(),
810 std::back_inserter(flutter_locale_list),
811 [](
const auto& arg) ->
const auto* { return &arg; });
813 state->flutter_engine, flutter_locale_list.data(),
814 flutter_locale_list.size());
816 std::cerr <<
"Failed to set up Flutter locales." << std::endl;
832 state->message_dispatcher =
833 std::make_unique<flutter::IncomingMessageDispatcher>(
834 state->messenger.get());
837 state->plugin_registrar = std::make_unique<FlutterDesktopPluginRegistrar>();
839 state->internal_plugin_registrar =
840 std::make_unique<flutter::PluginRegistrar>(
state->plugin_registrar.get());
843 state->platform_handler = std::make_unique<flutter::PlatformHandler>(
844 state->internal_plugin_registrar->messenger(),
window);
862 auto state = std::make_unique<FlutterDesktopWindowControllerState>();
868#if defined(__linux__)
869 glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
872 glfwCreateWindow(window_properties.
width, window_properties.
height,
873 window_properties.
title, NULL, NULL),
875 glfwDefaultWindowHints();
887 state->engine = std::make_unique<FlutterDesktopEngineState>();
888 state->engine->window_controller =
state.get();
891 auto event_loop = std::make_unique<flutter::GLFWEventLoop>(
892 std::this_thread::get_id(),
893 [engine_state =
state->engine.get()](
const auto* task) {
894 if (FlutterEngineRunTask(engine_state->flutter_engine, task) !=
896 std::cerr <<
"Could not post an engine task." << std::endl;
902 std::move(event_loop))) {
907 state->window_wrapper = std::make_unique<FlutterDesktopWindow>();
911 auto internal_plugin_messenger =
912 state->engine->internal_plugin_registrar->messenger();
913 state->keyboard_hook_handlers.push_back(
914 std::make_unique<flutter::KeyEventHandler>(internal_plugin_messenger));
915 state->keyboard_hook_handlers.push_back(
916 std::make_unique<flutter::TextInputPlugin>(internal_plugin_messenger));
920 int width_px, height_px;
921 glfwGetFramebufferSize(
window, &width_px, &height_px);
929 return state.release();
933 controller->
engine->messenger->SetEngine(
nullptr);
935 controller->
engine->plugin_registrar.get();
952 glfwSetWindowTitle(
window, title);
960 glfwSetWindowIcon(flutter_window->
window, pixel_data ? 1 : 0, &
image);
968 glfwGetWindowPos(flutter_window->
window,
x,
y);
972 int frame_left, frame_top, frame_right, frame_bottom;
973 glfwGetWindowFrameSize(flutter_window->
window, &frame_left, &frame_top,
974 &frame_right, &frame_bottom);
982 *
width += frame_left + frame_right;
985 *
height += frame_top + frame_bottom;
996 int frame_left, frame_top, frame_right, frame_bottom;
997 glfwGetWindowFrameSize(flutter_window->
window, &frame_left, &frame_top,
998 &frame_right, &frame_bottom);
999 glfwSetWindowPos(flutter_window->
window,
x + frame_left,
y + frame_top);
1000 glfwSetWindowSize(flutter_window->
window,
width - frame_left - frame_right,
1001 height - frame_top - frame_bottom);
1011 double pixel_ratio) {
1014 int width_px, height_px;
1015 glfwGetFramebufferSize(flutter_window->
window, &width_px, &height_px);
1016 if (width_px > 0 && height_px > 0) {
1025 glfwSetWindowSizeLimits(flutter_window->
window, minimum_size.
width,
1032 uint32_t timeout_milliseconds) {
1034 timeout_milliseconds);
1035 return !glfwWindowShouldClose(controller->
window.get());
1048 return controller->
engine.get();
1053 const char* plugin_name) {
1057 return engine->plugin_registrar.get();
1062 auto engine_state = std::make_unique<FlutterDesktopEngineState>();
1064 auto event_loop = std::make_unique<flutter::HeadlessEventLoop>(
1065 std::this_thread::get_id(),
1066 [
state = engine_state.get()](
const auto* task) {
1067 if (FlutterEngineRunTask(state->flutter_engine, task) != kSuccess) {
1068 std::cerr <<
"Could not post an engine task." << std::endl;
1073 std::move(event_loop))) {
1078 return engine_state.release();
1083 uint32_t timeout_milliseconds) {
1084 std::chrono::nanoseconds wait_duration =
1085 timeout_milliseconds == 0
1086 ? std::chrono::nanoseconds::max()
1087 : std::chrono::milliseconds(timeout_milliseconds);
1088 engine->event_loop->WaitForEvents(wait_duration);
1099 const char* channel) {
1125 const char* channel,
1127 const size_t message_size,
1131 if (reply !=
nullptr &&
user_data !=
nullptr) {
1136 std::cout <<
"Failed to create response handle\n";
1150 messenger->
GetEngine()->flutter_engine, &platform_message);
1152 if (response_handle !=
nullptr) {
1154 messenger->
GetEngine()->flutter_engine, response_handle);
1161 const char* channel,
1163 const size_t message_size) {
1165 message_size,
nullptr,
nullptr);
1171 const uint8_t* data,
1172 size_t data_length) {
1174 messenger->
GetEngine()->flutter_engine, handle, data, data_length);
1178 const char* channel,
1187 std::cerr <<
"GLFW Texture support is not implemented yet." << std::endl;
1194 std::cerr <<
"GLFW Texture support is not implemented yet." << std::endl;
1203 std::cerr <<
"GLFW Texture support is not implemented yet." << std::endl;
1209 std::cerr <<
"GLFW Texture support is not implemented yet." << std::endl;
FlutterEngineResult FlutterEngineRun(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Initialize and run a Flutter engine instance and return a handle to it. This is a convenience method ...
FlutterEngineResult FlutterEngineUpdateLocales(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)
Notify a running engine instance that the locale has been updated. The preferred locale must be the f...
FlutterEngineResult FlutterEngineSendWindowMetricsEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *flutter_metrics)
FlutterEngineResult FlutterEngineShutdown(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Shuts down a Flutter engine instance. The engine handle is no longer valid for any calls in the embed...
FlutterEngineResult FlutterPlatformMessageCreateResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)
Creates a platform message response handle that allows the embedder to set a native callback for a re...
FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data)
Collects the AOT data.
FlutterEngineResult FlutterEngineSendPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *flutter_message)
bool FlutterEngineRunsAOTCompiledDartCode(void)
Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading re...
FlutterEngineResult FlutterEngineSendPointerEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *pointers, size_t events_count)
FlutterEngineResult FlutterEngineSendPlatformMessageResponse(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Send a response from the native side to a platform message from the Dart Flutter application.
FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
Collects the handle created using FlutterPlatformMessageCreateResponseHandle.
FlutterEngineResult FlutterEngineCreateAOTData(const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)
Creates the necessary data structures to launch a Flutter Dart application in AOT mode....
#define FLUTTER_API_SYMBOL(symbol)
@ kFlutterEngineAOTDataSourceTypeElfPath
@ kHover
The pointer moved while up.
@ kFlutterPointerButtonMousePrimary
@ kFlutterPointerButtonMouseSecondary
@ kFlutterPointerSignalKindScroll
#define FLUTTER_ENGINE_VERSION
@ kFlutterPointerDeviceKindMouse
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
std::unique_ptr< GLFWwindow, void(*)(GLFWwindow *)> UniqueGLFWwindowPtr
static void SetUpLocales(FlutterDesktopEngineState *state)
static FlutterDesktopMessage ConvertToDesktopMessage(const FlutterPlatformMessage &engine_message)
FlutterDesktopWindowControllerRef FlutterDesktopCreateWindow(const FlutterDesktopWindowProperties &window_properties, const FlutterDesktopEngineProperties &engine_properties)
void GLFWWindowRefreshCallback(GLFWwindow *window)
void FlutterDesktopMessengerSetCallback(FlutterDesktopMessengerRef messenger, const char *channel, FlutterDesktopMessageCallback callback, void *user_data)
static UniqueGLFWwindowPtr CreateShareWindowForWindow(GLFWwindow *window)
void FlutterDesktopDestroyWindow(FlutterDesktopWindowControllerRef controller)
const int kFlutterDesktopDontCare
FlutterDesktopWindowRef FlutterDesktopPluginRegistrarGetWindow(FlutterDesktopPluginRegistrarRef registrar)
bool FlutterDesktopInit()
static void GLFWErrorCallback(int error_code, const char *description)
std::unique_ptr< FlutterDesktopMessenger, decltype(&FlutterDesktopMessengerRelease)> FlutterDesktopMessengerReferenceOwner
Maintains one ref on the FlutterDesktopMessenger's internal reference count.
static void GLFWCursorPositionCallback(GLFWwindow *window, double x, double y)
void FlutterDesktopMessengerSendResponse(FlutterDesktopMessengerRef messenger, const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
double FlutterDesktopWindowGetScaleFactor(FlutterDesktopWindowRef flutter_window)
bool FlutterDesktopMessengerSendWithReply(FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
void FlutterDesktopPluginRegistrarSetDestructionHandler(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopOnPluginRegistrarDestroyed callback)
void FlutterDesktopWindowSetPixelRatioOverride(FlutterDesktopWindowRef flutter_window, double pixel_ratio)
UniqueAotDataPtr LoadAotData(const std::filesystem::path &aot_data_path)
int64_t FlutterDesktopTextureRegistrarRegisterExternalTexture(FlutterDesktopTextureRegistrarRef texture_registrar, const FlutterDesktopTextureInfo *texture_info)
static void SetHoverCallbacksEnabled(GLFWwindow *window, bool enabled)
bool FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable(FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id)
static bool RunFlutterEngine(FlutterDesktopEngineState *engine_state, const FlutterDesktopEngineProperties &engine_properties, std::unique_ptr< flutter::EventLoop > event_loop)
static FlutterDesktopWindowControllerState * GetWindowController(GLFWwindow *window)
FlutterDesktopMessengerRef FlutterDesktopMessengerLock(FlutterDesktopMessengerRef messenger)
void FlutterDesktopTextureRegistrarUnregisterExternalTexture(FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id, void(*callback)(void *user_data), void *user_data)
static bool EngineClearContext(void *user_data)
static void GLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
void FlutterDesktopWindowSetSizeLimits(FlutterDesktopWindowRef flutter_window, FlutterDesktopSize minimum_size, FlutterDesktopSize maximum_size)
FlutterDesktopWindowRef FlutterDesktopGetWindow(FlutterDesktopWindowControllerRef controller)
static void SendPointerEventWithData(GLFWwindow *window, const FlutterPointerEvent &event_data)
static void GLFWCharCallback(GLFWwindow *window, unsigned int code_point)
void FlutterDesktopWindowGetFrame(FlutterDesktopWindowRef flutter_window, int *x, int *y, int *width, int *height)
void FlutterDesktopPluginRegistrarEnableInputBlocking(FlutterDesktopPluginRegistrarRef registrar, const char *channel)
void FlutterDesktopRunEngineEventLoopWithTimeout(FlutterDesktopEngineRef engine, uint32_t timeout_milliseconds)
static void GLFWFramebufferSizeCallback(GLFWwindow *window, int width_px, int height_px)
bool FlutterDesktopMessengerIsAvailable(FlutterDesktopMessengerRef messenger)
bool FlutterDesktopMessengerSend(FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size)
bool FlutterDesktopRunWindowEventLoopWithTimeout(FlutterDesktopWindowControllerRef controller, uint32_t timeout_milliseconds)
void FlutterDesktopWindowSetHoverEnabled(FlutterDesktopWindowRef flutter_window, bool enabled)
static void EngineOnFlutterPlatformMessage(const FlutterPlatformMessage *engine_message, void *user_data)
static void GLFWMouseButtonCallback(GLFWwindow *window, int key, int action, int mods)
static bool EngineMakeResourceContextCurrent(void *user_data)
void FlutterDesktopWindowSetFrame(FlutterDesktopWindowRef flutter_window, int x, int y, int width, int height)
void FlutterDesktopMessengerUnlock(FlutterDesktopMessengerRef messenger)
FlutterDesktopEngineRef FlutterDesktopRunEngine(const FlutterDesktopEngineProperties &properties)
static void SetEventPhaseFromCursorButtonState(GLFWwindow *window, FlutterPointerEvent *event_data, int64_t buttons)
static void SetUpCommonEngineState(FlutterDesktopEngineState *state, GLFWwindow *window)
static void GLFWScrollCallback(GLFWwindow *window, double delta_x, double delta_y)
static void ConfigurePlatformTaskRunner(FlutterTaskRunnerDescription *task_runner, FlutterDesktopEngineState *engine_state)
static double GetScreenCoordinatesPerInch()
FlutterDesktopEngineRef FlutterDesktopGetEngine(FlutterDesktopWindowControllerRef controller)
static bool EngineMakeContextCurrent(void *user_data)
static void SendWindowMetrics(FlutterDesktopWindowControllerState *controller, int width, int height)
static void GLFWAssignEventCallbacks(GLFWwindow *window)
static void GLFWCursorEnterCallback(GLFWwindow *window, int entered)
bool FlutterDesktopShutDownEngine(FlutterDesktopEngineRef engine)
static uint32_t EngineGetActiveFbo(void *user_data)
static bool EnginePresent(void *user_data)
FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar(FlutterDesktopPluginRegistrarRef registrar)
std::unique_ptr< _FlutterEngineAOTData, AOTDataDeleter > UniqueAotDataPtr
FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger(FlutterDesktopPluginRegistrarRef registrar)
static void SetEventLocationFromCursorPosition(GLFWwindow *window, FlutterPointerEvent *event_data)
void FlutterDesktopMessengerRelease(FlutterDesktopMessengerRef messenger)
void FlutterDesktopWindowSetTitle(FlutterDesktopWindowRef flutter_window, const char *title)
static void * EngineProcResolver(void *user_data, const char *name)
void FlutterDesktopTerminate()
FlutterDesktopMessengerRef FlutterDesktopMessengerAddRef(FlutterDesktopMessengerRef messenger)
void FlutterDesktopWindowSetIcon(FlutterDesktopWindowRef flutter_window, uint8_t *pixel_data, int width, int height)
static void GLFWClearCanvas(GLFWwindow *window)
FlutterDesktopPluginRegistrarRef FlutterDesktopGetPluginRegistrar(FlutterDesktopEngineRef engine, const char *plugin_name)
static constexpr double kDpPerInch
static void GLFWClearEventCallbacks(GLFWwindow *window)
void(* FlutterDesktopBinaryReply)(const uint8_t *data, size_t data_size, void *user_data)
void(* FlutterDesktopMessageCallback)(FlutterDesktopMessengerRef, const FlutterDesktopMessage *, void *)
void(* FlutterDesktopOnPluginRegistrarDestroyed)(FlutterDesktopPluginRegistrarRef)
struct FlutterDesktopTextureRegistrar * FlutterDesktopTextureRegistrarRef
G_BEGIN_DECLS FlTextureRegistrar * texture_registrar
constexpr int64_t kFlutterImplicitViewId
std::vector< FlutterLocale > ConvertToFlutterLocale(const std::vector< LanguageInfo > &languages)
std::vector< LanguageInfo > GetPreferredLanguageInfo()
std::filesystem::path GetExecutableDirectory()
void operator()(FlutterEngineAOTData aot_data)
const FlutterTaskRunnerDescription * platform_task_runner
size_t struct_size
The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
const char * aot_library_path
const char * icu_data_path
std::unique_ptr< FlutterDesktopPluginRegistrar > plugin_registrar
FLUTTER_API_SYMBOL(FlutterEngine) flutter_engine
UniqueAotDataPtr aot_data
std::unique_ptr< flutter::PluginRegistrar > internal_plugin_registrar
std::unique_ptr< flutter::PlatformHandler > platform_handler
std::unique_ptr< flutter::EventLoop > event_loop
FlutterDesktopMessengerReferenceOwner messenger
std::unique_ptr< flutter::IncomingMessageDispatcher > message_dispatcher
FlutterDesktopWindowControllerState * window_controller
FlutterDesktopMessenger()=default
FlutterDesktopMessenger(const FlutterDesktopMessenger &value)=delete
FlutterDesktopMessenger & operator=(const FlutterDesktopMessenger &value)=delete
void SetEngine(FlutterDesktopEngineState *engine)
FlutterDesktopEngineState * GetEngine() const
Getter for the engine field.
FlutterDesktopEngineState * engine
FlutterDesktopOnPluginRegistrarDestroyed destruction_handler
bool pointer_currently_down
std::unique_ptr< FlutterDesktopWindow > window_wrapper
std::vector< std::unique_ptr< flutter::KeyboardHookHandler > > keyboard_hook_handlers
UniqueGLFWwindowPtr resource_window
double monitor_screen_coordinates_per_inch
UniqueGLFWwindowPtr window
std::unique_ptr< FlutterDesktopEngineState > engine
bool pointer_currently_added
double pixel_ratio_override
bool hover_tracking_enabled
bool skip_next_window_refresh
double pixels_per_screen_coordinate
ProcResolver gl_proc_resolver
BoolCallback make_current
UIntCallback fbo_callback
size_t struct_size
The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).
BoolCallback make_resource_current
BoolCallback clear_current
size_t struct_size
The size of this struct. Must be sizeof(FlutterPointerEvent).
double y
The y coordinate of the pointer event in physical pixels.
double x
The x coordinate of the pointer event in physical pixels.
FlutterPointerPhase phase
size_t struct_size
The size of this struct. Must be sizeof(FlutterProjectArgs).
FlutterOpenGLRendererConfig open_gl
size_t struct_size
The size of this struct. Must be sizeof(FlutterTaskRunnerDescription).
BoolCallback runs_task_on_current_thread_callback
FlutterTaskRunnerPostTaskCallback post_task_callback
size_t struct_size
The size of this struct. Must be sizeof(FlutterWindowMetricsEvent).