Flutter Linux Embedder
fl_engine_private.h File Reference

Go to the source code of this file.

Typedefs

typedef gboolean(* FlEnginePlatformMessageHandler) (FlEngine *engine, const gchar *channel, GBytes *message, const FlutterPlatformMessageResponseHandle *response_handle, gpointer user_data)
 
typedef void(* FlEngineUpdateSemanticsHandler) (FlEngine *engine, const FlutterSemanticsUpdate2 *update, gpointer user_data)
 

Enumerations

enum  FlEngineError { FL_ENGINE_ERROR_FAILED }
 

Functions

GQuark fl_engine_error_quark (void) G_GNUC_CONST
 
FlEngine * fl_engine_new_with_renderer (FlDartProject *project, FlRenderer *renderer)
 
FlRenderer * fl_engine_get_renderer (FlEngine *engine)
 
FlDisplayMonitor * fl_engine_get_display_monitor (FlEngine *engine)
 
gboolean fl_engine_start (FlEngine *engine, GError **error)
 
FlutterEngineProcTable * fl_engine_get_embedder_api (FlEngine *engine)
 
void fl_engine_notify_display_update (FlEngine *engine, const FlutterEngineDisplay *displays, size_t displays_length)
 
FlutterViewId fl_engine_add_view (FlEngine *engine, size_t width, size_t height, double pixel_ratio, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
 
gboolean fl_engine_add_view_finish (FlEngine *engine, GAsyncResult *result, GError **error)
 
void fl_engine_remove_view (FlEngine *engine, FlutterViewId view_id, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
 
gboolean fl_engine_remove_view_finish (FlEngine *engine, GAsyncResult *result, GError **error)
 
void fl_engine_set_platform_message_handler (FlEngine *engine, FlEnginePlatformMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
 
void fl_engine_set_update_semantics_handler (FlEngine *engine, FlEngineUpdateSemanticsHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
 
void fl_engine_send_window_metrics_event (FlEngine *engine, FlutterEngineDisplayId display_id, FlutterViewId view_id, size_t width, size_t height, double pixel_ratio)
 
void fl_engine_send_mouse_pointer_event (FlEngine *engine, FlutterViewId view_id, FlutterPointerPhase phase, size_t timestamp, double x, double y, FlutterPointerDeviceKind device_kind, double scroll_delta_x, double scroll_delta_y, int64_t buttons)
 
void fl_engine_send_touch_up_event (FlEngine *engine, FlutterViewId view_id, size_t timestamp, double x, double y, int32_t device)
 
void fl_engine_send_touch_down_event (FlEngine *engine, FlutterViewId view_id, size_t timestamp, double x, double y, int32_t device)
 
void fl_engine_send_touch_move_event (FlEngine *engine, FlutterViewId view_id, size_t timestamp, double x, double y, int32_t device)
 
void fl_engine_send_touch_add_event (FlEngine *engine, FlutterViewId view_id, size_t timestamp, double x, double y, int32_t device)
 
void fl_engine_send_touch_remove_event (FlEngine *engine, FlutterViewId view_id, size_t timestamp, double x, double y, int32_t device)
 
void fl_engine_send_pointer_pan_zoom_event (FlEngine *engine, FlutterViewId view_id, size_t timestamp, double x, double y, FlutterPointerPhase phase, double pan_x, double pan_y, double scale, double rotation)
 
void fl_engine_send_key_event (FlEngine *engine, const FlutterKeyEvent *event, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
 
gboolean fl_engine_send_key_event_finish (FlEngine *engine, GAsyncResult *result, gboolean *handled, GError **error)
 
void fl_engine_dispatch_semantics_action (FlEngine *engine, uint64_t id, FlutterSemanticsAction action, GBytes *data)
 
gboolean fl_engine_send_platform_message_response (FlEngine *engine, const FlutterPlatformMessageResponseHandle *handle, GBytes *response, GError **error)
 
void fl_engine_send_platform_message (FlEngine *engine, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
 
GBytes * fl_engine_send_platform_message_finish (FlEngine *engine, GAsyncResult *result, GError **error)
 
FlTaskRunner * fl_engine_get_task_runner (FlEngine *engine)
 
void fl_engine_execute_task (FlEngine *engine, FlutterTask *task)
 
gboolean fl_engine_mark_texture_frame_available (FlEngine *engine, int64_t texture_id)
 
gboolean fl_engine_register_external_texture (FlEngine *engine, int64_t texture_id)
 
gboolean fl_engine_unregister_external_texture (FlEngine *engine, int64_t texture_id)
 
void fl_engine_update_accessibility_features (FlEngine *engine, int32_t flags)
 
void fl_engine_request_app_exit (FlEngine *engine)
 
FlMouseCursorHandler * fl_engine_get_mouse_cursor_handler (FlEngine *engine)
 

Typedef Documentation

◆ FlEnginePlatformMessageHandler

typedef gboolean(* FlEnginePlatformMessageHandler) (FlEngine *engine, const gchar *channel, GBytes *message, const FlutterPlatformMessageResponseHandle *response_handle, gpointer user_data)

FlEnginePlatformMessageHandler: @engine: an #FlEngine. @channel: channel message received on. @message: message content received from Dart. @response_handle: a handle to respond to the message with. @user_data: (closure): data provided when registering this handler.

Function called when platform messages are received.

Returns: TRUE if message has been accepted.

Definition at line 43 of file fl_engine_private.h.

◆ FlEngineUpdateSemanticsHandler

typedef void(* FlEngineUpdateSemanticsHandler) (FlEngine *engine, const FlutterSemanticsUpdate2 *update, gpointer user_data)

FlEngineUpdateSemanticsHandler: @engine: an #FlEngine. @node: semantic node information. @user_data: (closure): data provided when registering this handler.

Function called when semantics node updates are received.

Definition at line 58 of file fl_engine_private.h.

Enumeration Type Documentation

◆ FlEngineError

FlEngineError: Errors for #FlEngine objects to set on failures.

Enumerator
FL_ENGINE_ERROR_FAILED 

Definition at line 25 of file fl_engine_private.h.

Function Documentation

◆ fl_engine_add_view()

FlutterViewId fl_engine_add_view ( FlEngine *  engine,
size_t  width,
size_t  height,
double  pixel_ratio,
GCancellable *  cancellable,
GAsyncReadyCallback  callback,
gpointer  user_data 
)

fl_engine_add_view: @engine: an #FlEngine. @width: width of view in pixels. @height: height of view in pixels. @pixel_ratio: scale factor for view. @cancellable: (allow-none): a #GCancellable or NULL. @callback: (scope async): a #GAsyncReadyCallback to call when the view is added. @user_data: (closure): user data to pass to @callback.

Asynchronously add a new view. The returned view ID should not be used until this function completes.

Returns: the ID for the view.

Definition at line 678 of file fl_engine.cc.

684  {
685  g_return_val_if_fail(FL_IS_ENGINE(self), -1);
686 
687  g_autoptr(GTask) task = g_task_new(self, cancellable, callback, user_data);
688 
689  FlutterViewId view_id = self->next_view_id;
690  self->next_view_id++;
691 
692  // We don't know which display this view will open on, so set to zero and this
693  // will be updated in a following FlutterWindowMetricsEvent
694  FlutterEngineDisplayId display_id = 0;
695 
696  FlutterWindowMetricsEvent metrics;
697  metrics.struct_size = sizeof(FlutterWindowMetricsEvent);
698  metrics.width = width;
699  metrics.height = height;
700  metrics.pixel_ratio = pixel_ratio;
701  metrics.display_id = display_id;
702  metrics.view_id = view_id;
703  FlutterAddViewInfo info;
704  info.struct_size = sizeof(FlutterAddViewInfo);
705  info.view_id = view_id;
706  info.view_metrics = &metrics;
707  info.user_data = g_object_ref(task);
708  info.add_view_callback = view_added_cb;
709  FlutterEngineResult result = self->embedder_api.AddView(self->engine, &info);
710  if (result != kSuccess) {
711  g_task_return_new_error(task, fl_engine_error_quark(),
712  FL_ENGINE_ERROR_FAILED, "AddView returned %d",
713  result);
714  // This would have been done in the callback, but that won't occur now.
715  g_object_unref(task);
716  }
717 
718  return view_id;
719 }

References FL_ENGINE_ERROR_FAILED, fl_engine_error_quark(), height, user_data, view_added_cb(), and width.

Referenced by fl_view_new_for_engine(), and TEST().

◆ fl_engine_add_view_finish()

gboolean fl_engine_add_view_finish ( FlEngine *  engine,
GAsyncResult *  result,
GError **  error 
)

fl_engine_add_view_finish: @engine: an #FlEngine.

Returns
: a #GAsyncResult. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.

Completes request started with fl_engine_add_view().

Returns: TRUE on success.

Definition at line 721 of file fl_engine.cc.

723  {
724  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
725  return g_task_propagate_boolean(G_TASK(result), error);
726 }

References error.

Referenced by add_view_cb(), add_view_engine_error_cb(), add_view_error_cb(), and view_added_cb().

◆ fl_engine_dispatch_semantics_action()

void fl_engine_dispatch_semantics_action ( FlEngine *  engine,
uint64_t  id,
FlutterSemanticsAction  action,
GBytes *  data 
)

fl_engine_dispatch_semantics_action: @engine: an #FlEngine. @id: the semantics action identifier. @action: the action being dispatched. @data: (allow-none): data associated with the action.

Definition at line 1161 of file fl_engine.cc.

1164  {
1165  g_return_if_fail(FL_IS_ENGINE(self));
1166 
1167  if (self->engine == nullptr) {
1168  return;
1169  }
1170 
1171  const uint8_t* action_data = nullptr;
1172  size_t action_data_length = 0;
1173  if (data != nullptr) {
1174  action_data = static_cast<const uint8_t*>(
1175  g_bytes_get_data(data, &action_data_length));
1176  }
1177 
1178  self->embedder_api.DispatchSemanticsAction(self->engine, id, action,
1179  action_data, action_data_length);
1180 }

Referenced by fl_accessible_node_perform_action_impl(), and TEST().

◆ fl_engine_error_quark()

◆ fl_engine_execute_task()

void fl_engine_execute_task ( FlEngine *  engine,
FlutterTask *  task 
)

fl_engine_execute_task: @engine: an #FlEngine. @task: a #FlutterTask to execute.

Executes given Flutter task.

Definition at line 1214 of file fl_engine.cc.

1214  {
1215  g_return_if_fail(FL_IS_ENGINE(self));
1216  self->embedder_api.RunTask(self->engine, task);
1217 }

Referenced by fl_task_runner_process_expired_tasks_locked().

◆ fl_engine_get_display_monitor()

FlDisplayMonitor* fl_engine_get_display_monitor ( FlEngine *  engine)

fl_engine_get_display_monitor: @engine: an #FlEngine.

Gets the display monitor used by this engine.

Returns: an #FlDisplayMonitor.

Definition at line 539 of file fl_engine.cc.

539  {
540  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
541  return self->display_monitor;
542 }

Referenced by handle_geometry_changed().

◆ fl_engine_get_embedder_api()

FlutterEngineProcTable* fl_engine_get_embedder_api ( FlEngine *  engine)

fl_engine_get_embedder_api: @engine: an #FlEngine.

Gets the embedder API proc table, allowing modificiations for unit testing.

Returns: a mutable pointer to the embedder API proc table.

Definition at line 661 of file fl_engine.cc.

661  {
662  return &(self->embedder_api);
663 }

Referenced by TEST().

◆ fl_engine_get_mouse_cursor_handler()

FlMouseCursorHandler* fl_engine_get_mouse_cursor_handler ( FlEngine *  engine)

fl_engine_get_mouse_cursor_handler: @engine: an #FlEngine.

Gets the mouse cursor handler used by this engine.

Returns: a #FlMouseCursorHandler.

Definition at line 1241 of file fl_engine.cc.

1241  {
1242  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
1243  return self->mouse_cursor_handler;
1244 }

Referenced by cursor_changed_cb(), fl_view_dispose(), and setup_cursor().

◆ fl_engine_get_renderer()

FlRenderer* fl_engine_get_renderer ( FlEngine *  engine)

fl_engine_get_renderer: @engine: an #FlEngine.

Gets the renderer used by this engine.

Returns: an #FlRenderer.

Definition at line 534 of file fl_engine.cc.

534  {
535  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
536  return self->renderer;
537 }

Referenced by fl_view_new(), and fl_view_new_for_engine().

◆ fl_engine_get_task_runner()

FlTaskRunner* fl_engine_get_task_runner ( FlEngine *  engine)

fl_engine_get_task_runner: @engine: an #FlEngine.

Returns
: a #FlTaskRunner.

Returns: task runner responsible for scheduling Flutter tasks.

Definition at line 1209 of file fl_engine.cc.

1209  {
1210  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
1211  return self->task_runner;
1212 }

Referenced by fl_renderer_unblock_main_thread(), and fl_renderer_wait_for_frame().

◆ fl_engine_mark_texture_frame_available()

gboolean fl_engine_mark_texture_frame_available ( FlEngine *  engine,
int64_t  texture_id 
)

fl_engine_mark_texture_frame_available: @engine: an #FlEngine. @texture_id: the identifier of the texture whose frame has been updated.

Tells the Flutter engine that a new texture frame is available for the given texture.

Returns: TRUE on success.

Definition at line 1182 of file fl_engine.cc.

1183  {
1184  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
1185  return self->embedder_api.MarkExternalTextureFrameAvailable(
1186  self->engine, texture_id) == kSuccess;
1187 }

References texture_id.

Referenced by mark_texture_frame_available().

◆ fl_engine_new_with_renderer()

FlEngine* fl_engine_new_with_renderer ( FlDartProject *  project,
FlRenderer *  renderer 
)

fl_engine_new_with_renderer: @project: an #FlDartProject. @renderer: an #FlRenderer.

Creates new Flutter engine.

Returns: a new #FlEngine.

Definition at line 509 of file fl_engine.cc.

510  {
511  g_return_val_if_fail(FL_IS_DART_PROJECT(project), nullptr);
512  g_return_val_if_fail(FL_IS_RENDERER(renderer), nullptr);
513 
514  FlEngine* self = FL_ENGINE(g_object_new(fl_engine_get_type(), nullptr));
515  self->project = FL_DART_PROJECT(g_object_ref(project));
516  self->renderer = FL_RENDERER(g_object_ref(renderer));
517  self->binary_messenger = fl_binary_messenger_new(self);
518 
519  fl_renderer_set_engine(self->renderer, self);
520 
521  return self;
522 }

References fl_binary_messenger_new(), and fl_renderer_set_engine().

Referenced by fl_engine_new(), and fl_engine_new_headless().

◆ fl_engine_notify_display_update()

void fl_engine_notify_display_update ( FlEngine *  engine,
const FlutterEngineDisplay *  displays,
size_t  displays_length 
)

fl_engine_notify_display_update: @engine: an #FlEngine. @displays: displays present on the system. @displays_length: length of @displays.

Notify the current displays that are in the system.

Definition at line 665 of file fl_engine.cc.

667  {
668  g_return_if_fail(FL_IS_ENGINE(self));
669 
670  FlutterEngineResult result = self->embedder_api.NotifyDisplayUpdate(
671  self->engine, kFlutterEngineDisplaysUpdateTypeStartup, displays,
672  displays_length);
673  if (result != kSuccess) {
674  g_warning("Failed to notify display update to Flutter engine: %d", result);
675  }
676 }

Referenced by notify_display_update(), and TEST().

◆ fl_engine_register_external_texture()

gboolean fl_engine_register_external_texture ( FlEngine *  engine,
int64_t  texture_id 
)

fl_engine_register_external_texture: @engine: an #FlEngine. @texture_id: the identifier of the texture that is available.

Tells the Flutter engine that a new external texture is available.

Returns: TRUE on success.

Definition at line 1189 of file fl_engine.cc.

1190  {
1191  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
1192  return self->embedder_api.RegisterExternalTexture(self->engine, texture_id) ==
1193  kSuccess;
1194 }

References texture_id.

Referenced by register_texture().

◆ fl_engine_remove_view()

void fl_engine_remove_view ( FlEngine *  engine,
FlutterViewId  view_id,
GCancellable *  cancellable,
GAsyncReadyCallback  callback,
gpointer  user_data 
)

fl_engine_remove_view: @engine: an #FlEngine. @view_id: ID to remove. @cancellable: (allow-none): a #GCancellable or NULL. @callback: (scope async): a #GAsyncReadyCallback to call when the view is added. @user_data: (closure): user data to pass to @callback.

Removes a view previously added with fl_engine_add_view().

Definition at line 728 of file fl_engine.cc.

732  {
733  g_return_if_fail(FL_IS_ENGINE(self));
734 
735  g_autoptr(GTask) task = g_task_new(self, cancellable, callback, user_data);
736 
737  FlutterRemoveViewInfo info;
738  info.struct_size = sizeof(FlutterRemoveViewInfo);
739  info.view_id = view_id;
740  info.user_data = g_object_ref(task);
741  info.remove_view_callback = view_removed_cb;
742  FlutterEngineResult result =
743  self->embedder_api.RemoveView(self->engine, &info);
744  if (result != kSuccess) {
745  g_task_return_new_error(task, fl_engine_error_quark(),
746  FL_ENGINE_ERROR_FAILED, "RemoveView returned %d",
747  result);
748  // This would have been done in the callback, but that won't occur now.
749  g_object_unref(task);
750  }
751 }

References FL_ENGINE_ERROR_FAILED, fl_engine_error_quark(), user_data, and view_removed_cb().

Referenced by fl_view_dispose(), and TEST().

◆ fl_engine_remove_view_finish()

gboolean fl_engine_remove_view_finish ( FlEngine *  engine,
GAsyncResult *  result,
GError **  error 
)

fl_engine_remove_view_finish: @engine: an #FlEngine.

Returns
: a #GAsyncResult. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.

Completes request started with fl_engine_remove_view().

Returns: TRUE on succcess.

Definition at line 753 of file fl_engine.cc.

755  {
756  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
757  return g_task_propagate_boolean(G_TASK(result), error);
758 }

References error.

Referenced by remove_view_cb(), remove_view_engine_error_cb(), and remove_view_error_cb().

◆ fl_engine_request_app_exit()

void fl_engine_request_app_exit ( FlEngine *  engine)

fl_engine_request_app_exit: @engine: an #FlEngine.

Request the application exits.

Definition at line 1236 of file fl_engine.cc.

1236  {
1237  g_return_if_fail(FL_IS_ENGINE(self));
1238  fl_platform_handler_request_app_exit(self->platform_handler);
1239 }

References fl_platform_handler_request_app_exit().

Referenced by window_delete_event_cb().

◆ fl_engine_send_key_event()

void fl_engine_send_key_event ( FlEngine *  engine,
const FlutterKeyEvent *  event,
GCancellable *  cancellable,
GAsyncReadyCallback  callback,
gpointer  user_data 
)

fl_engine_send_key_event: @engine: an #FlEngine. @event: key event to send. @cancellable: (allow-none): a #GCancellable or NULL. @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied. @user_data: (closure): user data to pass to @callback.

Send a key event to the engine.

Definition at line 1121 of file fl_engine.cc.

1125  {
1126  g_return_if_fail(FL_IS_ENGINE(self));
1127 
1128  g_autoptr(GTask) task = g_task_new(self, cancellable, callback, user_data);
1129 
1130  if (self->engine == nullptr) {
1131  g_task_return_new_error(task, fl_engine_error_quark(),
1132  FL_ENGINE_ERROR_FAILED, "No engine");
1133  return;
1134  }
1135 
1136  if (self->embedder_api.SendKeyEvent(self->engine, event, send_key_event_cb,
1137  g_object_ref(task)) != kSuccess) {
1138  g_task_return_new_error(task, fl_engine_error_quark(),
1139  FL_ENGINE_ERROR_FAILED, "Failed to send key event");
1140  g_object_unref(task);
1141  }
1142 }

References FL_ENGINE_ERROR_FAILED, fl_engine_error_quark(), send_key_event_cb(), and user_data.

Referenced by fl_keyboard_manager_new(), and TEST().

◆ fl_engine_send_key_event_finish()

gboolean fl_engine_send_key_event_finish ( FlEngine *  engine,
GAsyncResult *  result,
gboolean *  handled,
GError **  error 
)

fl_engine_send_key_event_finish: @engine: an #FlEngine.

Returns
: a #GAsyncResult. @handled: location to write if this event was handled by the engine. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.

Completes request started with fl_engine_send_key_event().

Returns: TRUE on success.

Definition at line 1144 of file fl_engine.cc.

1147  {
1148  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
1149  g_return_val_if_fail(g_task_is_valid(result, self), FALSE);
1150 
1151  g_autofree gboolean* return_value =
1152  static_cast<gboolean*>(g_task_propagate_pointer(G_TASK(result), error));
1153  if (return_value == nullptr) {
1154  return FALSE;
1155  }
1156 
1157  *handled = *return_value;
1158  return TRUE;
1159 }

References error, and TRUE.

Referenced by TEST().

◆ fl_engine_send_mouse_pointer_event()

void fl_engine_send_mouse_pointer_event ( FlEngine *  engine,
FlutterViewId  view_id,
FlutterPointerPhase  phase,
size_t  timestamp,
double  x,
double  y,
FlutterPointerDeviceKind  device_kind,
double  scroll_delta_x,
double  scroll_delta_y,
int64_t  buttons 
)

fl_engine_send_mouse_pointer_event: @engine: an #FlEngine. @view_id: the view that the event occured on. @phase: mouse phase. @timestamp: time when event occurred in microseconds. @x: x location of mouse cursor. @y: y location of mouse cursor. @device_kind: kind of pointing device. @scroll_delta_x: x offset of scroll. @scroll_delta_y: y offset of scroll. @buttons: buttons that are pressed.

Sends a mouse pointer event to the engine.

Definition at line 918 of file fl_engine.cc.

927  {
928  g_return_if_fail(FL_IS_ENGINE(self));
929 
930  if (self->engine == nullptr) {
931  return;
932  }
933 
934  FlutterPointerEvent fl_event = {};
935  fl_event.struct_size = sizeof(fl_event);
936  fl_event.phase = phase;
937  fl_event.timestamp = timestamp;
938  fl_event.x = x;
939  fl_event.y = y;
940  if (scroll_delta_x != 0 || scroll_delta_y != 0) {
941  fl_event.signal_kind = kFlutterPointerSignalKindScroll;
942  }
943  fl_event.scroll_delta_x = scroll_delta_x;
944  fl_event.scroll_delta_y = scroll_delta_y;
945  fl_event.device_kind = device_kind;
946  fl_event.buttons = buttons;
947  fl_event.device = kMousePointerDeviceId;
948  fl_event.view_id = view_id;
949  self->embedder_api.SendPointerEvent(self->engine, &fl_event, 1);
950 }

References kMousePointerDeviceId.

Referenced by ensure_pointer_added(), fl_pointer_manager_handle_button_press(), fl_pointer_manager_handle_button_release(), fl_pointer_manager_handle_leave(), fl_pointer_manager_handle_motion(), fl_scrolling_manager_handle_scroll_event(), and TEST().

◆ fl_engine_send_platform_message()

void fl_engine_send_platform_message ( FlEngine *  engine,
const gchar *  channel,
GBytes *  message,
GCancellable *  cancellable,
GAsyncReadyCallback  callback,
gpointer  user_data 
)

fl_engine_send_platform_message: @engine: an #FlEngine. @channel: channel to send to. @message: (allow-none): message buffer to send or NULL for an empty message @cancellable: (allow-none): a #GCancellable or NULL. @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied. @user_data: (closure): user data to pass to @callback.

Asynchronously sends a platform message.

Definition at line 828 of file fl_engine.cc.

833  {
834  g_return_if_fail(FL_IS_ENGINE(self));
835 
836  GTask* task = nullptr;
837  FlutterPlatformMessageResponseHandle* response_handle = nullptr;
838  if (callback != nullptr) {
839  task = g_task_new(self, cancellable, callback, user_data);
840 
841  if (self->engine == nullptr) {
842  g_task_return_new_error(task, fl_engine_error_quark(),
843  FL_ENGINE_ERROR_FAILED, "No engine to send to");
844  return;
845  }
846 
847  FlutterEngineResult result =
848  self->embedder_api.PlatformMessageCreateResponseHandle(
849  self->engine, fl_engine_platform_message_response_cb, task,
850  &response_handle);
851  if (result != kSuccess) {
852  g_task_return_new_error(task, fl_engine_error_quark(),
854  "Failed to create response handle");
855  g_object_unref(task);
856  return;
857  }
858  } else if (self->engine == nullptr) {
859  return;
860  }
861 
862  FlutterPlatformMessage fl_message = {};
863  fl_message.struct_size = sizeof(fl_message);
864  fl_message.channel = channel;
865  fl_message.message =
866  message != nullptr
867  ? static_cast<const uint8_t*>(g_bytes_get_data(message, nullptr))
868  : nullptr;
869  fl_message.message_size = message != nullptr ? g_bytes_get_size(message) : 0;
870  fl_message.response_handle = response_handle;
871  FlutterEngineResult result =
872  self->embedder_api.SendPlatformMessage(self->engine, &fl_message);
873 
874  if (result != kSuccess && task != nullptr) {
875  g_task_return_new_error(task, fl_engine_error_quark(),
877  "Failed to send platform messages");
878  g_object_unref(task);
879  }
880 
881  if (response_handle != nullptr) {
882  self->embedder_api.PlatformMessageReleaseResponseHandle(self->engine,
883  response_handle);
884  }
885 }

References FL_ENGINE_ERROR_FAILED, fl_engine_error_quark(), fl_engine_platform_message_response_cb(), and user_data.

Referenced by send_on_channel(), and TEST().

◆ fl_engine_send_platform_message_finish()

GBytes* fl_engine_send_platform_message_finish ( FlEngine *  engine,
GAsyncResult *  result,
GError **  error 
)

fl_engine_send_platform_message_finish: @engine: an #FlEngine.

Returns
: a #GAsyncResult. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.

Completes request started with fl_engine_send_platform_message().

Returns: message response on success or NULL on error.

Definition at line 887 of file fl_engine.cc.

889  {
890  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
891  g_return_val_if_fail(g_task_is_valid(result, self), FALSE);
892 
893  return static_cast<GBytes*>(g_task_propagate_pointer(G_TASK(result), error));
894 }

References error.

Referenced by send_on_channel_finish().

◆ fl_engine_send_platform_message_response()

gboolean fl_engine_send_platform_message_response ( FlEngine *  engine,
const FlutterPlatformMessageResponseHandle *  handle,
GBytes *  response,
GError **  error 
)

fl_engine_send_platform_message_response: @engine: an #FlEngine. @handle: handle that was provided in FlEnginePlatformMessageHandler. @response: (allow-none): response to send or NULL for an empty response. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.

Responds to a platform message.

Returns: TRUE on success.

Definition at line 796 of file fl_engine.cc.

800  {
801  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
802  g_return_val_if_fail(handle != nullptr, FALSE);
803 
804  if (self->engine == nullptr) {
806  "No engine to send response to");
807  return FALSE;
808  }
809 
810  gsize data_length = 0;
811  const uint8_t* data = nullptr;
812  if (response != nullptr) {
813  data =
814  static_cast<const uint8_t*>(g_bytes_get_data(response, &data_length));
815  }
816  FlutterEngineResult result = self->embedder_api.SendPlatformMessageResponse(
817  self->engine, handle, data, data_length);
818 
819  if (result != kSuccess) {
821  "Failed to send platform message response");
822  return FALSE;
823  }
824 
825  return TRUE;
826 }

References error, FL_ENGINE_ERROR_FAILED, fl_engine_error_quark(), and TRUE.

Referenced by fl_engine_platform_message_cb(), send_response(), and TEST().

◆ fl_engine_send_pointer_pan_zoom_event()

void fl_engine_send_pointer_pan_zoom_event ( FlEngine *  engine,
FlutterViewId  view_id,
size_t  timestamp,
double  x,
double  y,
FlutterPointerPhase  phase,
double  pan_x,
double  pan_y,
double  scale,
double  rotation 
)

fl_engine_send_pointer_pan_zoom_event: @engine: an #FlEngine. @view_id: the view that the event occured on. @timestamp: time when event occurred in microseconds. @x: x location of mouse cursor. @y: y location of mouse cursor. @phase: mouse phase. @pan_x: x offset of the pan/zoom in pixels. @pan_y: y offset of the pan/zoom in pixels. @scale: scale of the pan/zoom. @rotation: rotation of the pan/zoom in radians.

Sends a pan/zoom pointer event to the engine.

Definition at line 1082 of file fl_engine.cc.

1091  {
1092  g_return_if_fail(FL_IS_ENGINE(self));
1093 
1094  if (self->engine == nullptr) {
1095  return;
1096  }
1097 
1098  FlutterPointerEvent fl_event = {};
1099  fl_event.struct_size = sizeof(fl_event);
1100  fl_event.timestamp = timestamp;
1101  fl_event.x = x;
1102  fl_event.y = y;
1103  fl_event.phase = phase;
1104  fl_event.pan_x = pan_x;
1105  fl_event.pan_y = pan_y;
1106  fl_event.scale = scale;
1107  fl_event.rotation = rotation;
1108  fl_event.device = kPointerPanZoomDeviceId;
1109  fl_event.device_kind = kFlutterPointerDeviceKindTrackpad;
1110  fl_event.view_id = view_id;
1111  self->embedder_api.SendPointerEvent(self->engine, &fl_event, 1);
1112 }

References kPointerPanZoomDeviceId.

Referenced by fl_scrolling_manager_handle_rotation_begin(), fl_scrolling_manager_handle_rotation_end(), fl_scrolling_manager_handle_rotation_update(), fl_scrolling_manager_handle_scroll_event(), fl_scrolling_manager_handle_zoom_begin(), fl_scrolling_manager_handle_zoom_end(), fl_scrolling_manager_handle_zoom_update(), and TEST().

◆ fl_engine_send_touch_add_event()

void fl_engine_send_touch_add_event ( FlEngine *  engine,
FlutterViewId  view_id,
size_t  timestamp,
double  x,
double  y,
int32_t  device 
)

fl_engine_send_touch_add_event: @engine: an #FlEngine. @view_id: the view that the event occured on. @timestamp: time when event occurred in microseconds. @x: x location of mouse cursor. @y: y location of mouse cursor. @device: device id.

Sends a touch add event to the engine.

Definition at line 1030 of file fl_engine.cc.

1035  {
1036  g_return_if_fail(FL_IS_ENGINE(self));
1037 
1038  if (self->engine == nullptr) {
1039  return;
1040  }
1041 
1042  FlutterPointerEvent event;
1043  event.timestamp = timestamp;
1044  event.x = x;
1045  event.y = y;
1046  event.device_kind = kFlutterPointerDeviceKindTouch;
1047  event.device = device;
1048  event.buttons = 0;
1049  event.view_id = view_id;
1050  event.phase = FlutterPointerPhase::kAdd;
1051  event.struct_size = sizeof(event);
1052 
1053  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1054 }

Referenced by ensure_touch_added().

◆ fl_engine_send_touch_down_event()

void fl_engine_send_touch_down_event ( FlEngine *  engine,
FlutterViewId  view_id,
size_t  timestamp,
double  x,
double  y,
int32_t  device 
)

fl_engine_send_touch_down_event: @engine: an #FlEngine. @view_id: the view that the event occured on. @timestamp: time when event occurred in microseconds. @x: x location of mouse cursor. @y: y location of mouse cursor. @device: device id.

Sends a touch down event to the engine.

Definition at line 978 of file fl_engine.cc.

983  {
984  g_return_if_fail(FL_IS_ENGINE(self));
985 
986  if (self->engine == nullptr) {
987  return;
988  }
989 
990  FlutterPointerEvent event;
991  event.timestamp = timestamp;
992  event.x = x;
993  event.y = y;
994  event.device_kind = kFlutterPointerDeviceKindTouch;
995  event.device = device;
996  event.buttons = FlutterPointerMouseButtons::kFlutterPointerButtonMousePrimary;
997  event.view_id = view_id;
998  event.phase = FlutterPointerPhase::kDown;
999  event.struct_size = sizeof(event);
1000 
1001  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1002 }

Referenced by fl_touch_manager_handle_touch_event().

◆ fl_engine_send_touch_move_event()

void fl_engine_send_touch_move_event ( FlEngine *  engine,
FlutterViewId  view_id,
size_t  timestamp,
double  x,
double  y,
int32_t  device 
)

fl_engine_send_touch_move_event: @engine: an #FlEngine. @view_id: the view that the event occured on. @timestamp: time when event occurred in microseconds. @x: x location of mouse cursor. @y: y location of mouse cursor. @device: device id.

Sends a touch move event to the engine.

Definition at line 1004 of file fl_engine.cc.

1009  {
1010  g_return_if_fail(FL_IS_ENGINE(self));
1011 
1012  if (self->engine == nullptr) {
1013  return;
1014  }
1015 
1016  FlutterPointerEvent event;
1017  event.timestamp = timestamp;
1018  event.x = x;
1019  event.y = y;
1020  event.device_kind = kFlutterPointerDeviceKindTouch;
1021  event.device = device;
1022  event.buttons = FlutterPointerMouseButtons::kFlutterPointerButtonMousePrimary;
1023  event.view_id = view_id;
1024  event.phase = FlutterPointerPhase::kMove;
1025  event.struct_size = sizeof(event);
1026 
1027  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1028 }

Referenced by fl_touch_manager_handle_touch_event().

◆ fl_engine_send_touch_remove_event()

void fl_engine_send_touch_remove_event ( FlEngine *  engine,
FlutterViewId  view_id,
size_t  timestamp,
double  x,
double  y,
int32_t  device 
)

fl_engine_send_touch_remove_event: @engine: an #FlEngine. @view_id: the view that the event occured on. @timestamp: time when event occurred in microseconds. @x: x location of mouse cursor. @y: y location of mouse cursor. @device: device id.

Sends a touch remove event to the engine.

Definition at line 1056 of file fl_engine.cc.

1061  {
1062  g_return_if_fail(FL_IS_ENGINE(self));
1063 
1064  if (self->engine == nullptr) {
1065  return;
1066  }
1067 
1068  FlutterPointerEvent event;
1069  event.timestamp = timestamp;
1070  event.x = x;
1071  event.y = y;
1072  event.device_kind = kFlutterPointerDeviceKindTouch;
1073  event.device = device;
1074  event.buttons = 0;
1075  event.view_id = view_id;
1076  event.phase = FlutterPointerPhase::kRemove;
1077  event.struct_size = sizeof(event);
1078 
1079  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1080 }

Referenced by fl_touch_manager_handle_touch_event().

◆ fl_engine_send_touch_up_event()

void fl_engine_send_touch_up_event ( FlEngine *  engine,
FlutterViewId  view_id,
size_t  timestamp,
double  x,
double  y,
int32_t  device 
)

fl_engine_send_touch_up_event: @engine: an #FlEngine. @view_id: the view that the event occured on. @timestamp: time when event occurred in microseconds. @x: x location of mouse cursor. @y: y location of mouse cursor. @device: device id.

Sends a touch up event to the engine.

Definition at line 952 of file fl_engine.cc.

957  {
958  g_return_if_fail(FL_IS_ENGINE(self));
959 
960  if (self->engine == nullptr) {
961  return;
962  }
963 
964  FlutterPointerEvent event;
965  event.timestamp = timestamp;
966  event.x = x;
967  event.y = y;
968  event.device_kind = kFlutterPointerDeviceKindTouch;
969  event.device = device;
970  event.buttons = 0;
971  event.view_id = view_id;
972  event.phase = FlutterPointerPhase::kUp;
973  event.struct_size = sizeof(event);
974 
975  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
976 }

Referenced by fl_touch_manager_handle_touch_event().

◆ fl_engine_send_window_metrics_event()

void fl_engine_send_window_metrics_event ( FlEngine *  engine,
FlutterEngineDisplayId  display_id,
FlutterViewId  view_id,
size_t  width,
size_t  height,
double  pixel_ratio 
)

fl_engine_send_window_metrics_event: @engine: an #FlEngine. @display_id: the display this view is rendering on. @view_id: the view that the event occured on. @width: width of the window in pixels. @height: height of the window in pixels. @pixel_ratio: scale factor for window.

Sends a window metrics event to the engine.

Definition at line 896 of file fl_engine.cc.

901  {
902  g_return_if_fail(FL_IS_ENGINE(self));
903 
904  if (self->engine == nullptr) {
905  return;
906  }
907 
908  FlutterWindowMetricsEvent event = {};
909  event.struct_size = sizeof(FlutterWindowMetricsEvent);
910  event.width = width;
911  event.height = height;
912  event.pixel_ratio = pixel_ratio;
913  event.display_id = display_id;
914  event.view_id = view_id;
915  self->embedder_api.SendWindowMetricsEvent(self->engine, &event);
916 }

References height, and width.

Referenced by handle_geometry_changed(), and TEST().

◆ fl_engine_set_platform_message_handler()

void fl_engine_set_platform_message_handler ( FlEngine *  engine,
FlEnginePlatformMessageHandler  handler,
gpointer  user_data,
GDestroyNotify  destroy_notify 
)

fl_engine_set_platform_message_handler: @engine: an #FlEngine. @handler: function to call when a platform message is received. @user_data: (closure): user data to pass to @handler. @destroy_notify: (allow-none): a function which gets called to free @user_data, or NULL.

Registers the function called when a platform message is received. Call fl_engine_send_platform_message_response() with the response to this message. Ownership of #FlutterPlatformMessageResponseHandle is transferred to the caller, and the message must be responded to avoid memory leaks.

Definition at line 760 of file fl_engine.cc.

764  {
765  g_return_if_fail(FL_IS_ENGINE(self));
766  g_return_if_fail(handler != nullptr);
767 
768  if (self->platform_message_handler_destroy_notify) {
769  self->platform_message_handler_destroy_notify(
770  self->platform_message_handler_data);
771  }
772 
773  self->platform_message_handler = handler;
774  self->platform_message_handler_data = user_data;
775  self->platform_message_handler_destroy_notify = destroy_notify;
776 }

References user_data.

Referenced by fl_binary_messenger_new().

◆ fl_engine_set_update_semantics_handler()

void fl_engine_set_update_semantics_handler ( FlEngine *  engine,
FlEngineUpdateSemanticsHandler  handler,
gpointer  user_data,
GDestroyNotify  destroy_notify 
)

fl_engine_set_update_semantics_handler: @engine: an #FlEngine. @handler: function to call when a semantics update is received. @user_data: (closure): user data to pass to @handler. @destroy_notify: (allow-none): a function which gets called to free @user_data, or NULL.

Registers the function called when a semantics update is received.

Definition at line 778 of file fl_engine.cc.

782  {
783  g_return_if_fail(FL_IS_ENGINE(self));
784 
785  if (self->update_semantics_handler_destroy_notify) {
786  self->update_semantics_handler_destroy_notify(
787  self->update_semantics_handler_data);
788  }
789 
790  self->update_semantics_handler = handler;
791  self->update_semantics_handler_data = user_data;
792  self->update_semantics_handler_destroy_notify = destroy_notify;
793 }

References user_data.

Referenced by fl_view_dispose(), and fl_view_new().

◆ fl_engine_start()

gboolean fl_engine_start ( FlEngine *  engine,
GError **  error 
)

fl_engine_start: @engine: an #FlEngine. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.

Starts the Flutter engine.

Returns: TRUE on success.

Definition at line 544 of file fl_engine.cc.

544  {
545  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
546 
547  self->task_runner = fl_task_runner_new(self);
548 
549  FlutterRendererConfig config = {};
550  config.type = kOpenGL;
551  config.open_gl.struct_size = sizeof(FlutterOpenGLRendererConfig);
552  config.open_gl.gl_proc_resolver = fl_engine_gl_proc_resolver;
553  config.open_gl.make_current = fl_engine_gl_make_current;
554  config.open_gl.clear_current = fl_engine_gl_clear_current;
555  config.open_gl.fbo_callback = fl_engine_gl_get_fbo;
556  config.open_gl.present = fl_engine_gl_present;
557  config.open_gl.make_resource_current = fl_engine_gl_make_resource_current;
558  config.open_gl.gl_external_texture_frame_callback =
560 
561  FlutterTaskRunnerDescription platform_task_runner = {};
562  platform_task_runner.struct_size = sizeof(FlutterTaskRunnerDescription);
563  platform_task_runner.user_data = self;
564  platform_task_runner.runs_task_on_current_thread_callback =
566  platform_task_runner.post_task_callback = fl_engine_post_task;
567  platform_task_runner.identifier = kPlatformTaskRunnerIdentifier;
568 
569  FlutterCustomTaskRunners custom_task_runners = {};
570  custom_task_runners.struct_size = sizeof(FlutterCustomTaskRunners);
571  custom_task_runners.platform_task_runner = &platform_task_runner;
572  custom_task_runners.render_task_runner = &platform_task_runner;
573 
574  g_autoptr(GPtrArray) command_line_args =
575  g_ptr_array_new_with_free_func(g_free);
576  g_ptr_array_insert(command_line_args, 0, g_strdup("flutter"));
577  for (const auto& env_switch : flutter::GetSwitchesFromEnvironment()) {
578  g_ptr_array_add(command_line_args, g_strdup(env_switch.c_str()));
579  }
580 
581  gchar** dart_entrypoint_args =
583 
584  FlutterProjectArgs args = {};
585  args.struct_size = sizeof(FlutterProjectArgs);
586  args.assets_path = fl_dart_project_get_assets_path(self->project);
587  args.icu_data_path = fl_dart_project_get_icu_data_path(self->project);
588  args.command_line_argc = command_line_args->len;
589  args.command_line_argv =
590  reinterpret_cast<const char* const*>(command_line_args->pdata);
591  args.platform_message_callback = fl_engine_platform_message_cb;
592  args.update_semantics_callback2 = fl_engine_update_semantics_cb;
593  args.custom_task_runners = &custom_task_runners;
594  args.shutdown_dart_vm_when_done = true;
595  args.on_pre_engine_restart_callback = fl_engine_on_pre_engine_restart_cb;
596  args.dart_entrypoint_argc =
597  dart_entrypoint_args != nullptr ? g_strv_length(dart_entrypoint_args) : 0;
598  args.dart_entrypoint_argv =
599  reinterpret_cast<const char* const*>(dart_entrypoint_args);
600 
601  FlutterCompositor compositor = {};
602  compositor.struct_size = sizeof(FlutterCompositor);
603  compositor.user_data = self->renderer;
604  compositor.create_backing_store_callback =
606  compositor.collect_backing_store_callback =
608  compositor.present_view_callback = compositor_present_view_callback;
609  args.compositor = &compositor;
610 
611  if (self->embedder_api.RunsAOTCompiledDartCode()) {
612  FlutterEngineAOTDataSource source = {};
613  source.type = kFlutterEngineAOTDataSourceTypeElfPath;
614  source.elf_path = fl_dart_project_get_aot_library_path(self->project);
615  if (self->embedder_api.CreateAOTData(&source, &self->aot_data) !=
616  kSuccess) {
618  "Failed to create AOT data");
619  return FALSE;
620  }
621  args.aot_data = self->aot_data;
622  }
623 
624  FlutterEngineResult result = self->embedder_api.Initialize(
625  FLUTTER_ENGINE_VERSION, &config, &args, self, &self->engine);
626  if (result != kSuccess) {
628  "Failed to initialize Flutter engine");
629  return FALSE;
630  }
631 
632  result = self->embedder_api.RunInitialized(self->engine);
633  if (result != kSuccess) {
635  "Failed to run Flutter engine");
636  return FALSE;
637  }
638 
639  setup_locales(self);
640 
641  g_autoptr(FlSettings) settings = fl_settings_new();
642  self->settings_handler = fl_settings_handler_new(self);
643  fl_settings_handler_start(self->settings_handler, settings);
644 
645  self->platform_handler = fl_platform_handler_new(self->binary_messenger);
646  self->mouse_cursor_handler =
647  fl_mouse_cursor_handler_new(self->binary_messenger);
648 
649  result = self->embedder_api.UpdateSemanticsEnabled(self->engine, TRUE);
650  if (result != kSuccess) {
651  g_warning("Failed to enable accessibility features on Flutter engine");
652  }
653 
654  self->display_monitor =
655  fl_display_monitor_new(self, gdk_display_get_default());
656  fl_display_monitor_start(self->display_monitor);
657 
658  return TRUE;
659 }

References args, compositor_collect_backing_store_callback(), compositor_create_backing_store_callback(), compositor_present_view_callback(), error, fl_dart_project_get_aot_library_path(), fl_dart_project_get_assets_path(), fl_dart_project_get_dart_entrypoint_arguments(), fl_dart_project_get_icu_data_path(), fl_display_monitor_new(), fl_display_monitor_start(), FL_ENGINE_ERROR_FAILED, fl_engine_error_quark(), fl_engine_gl_clear_current(), fl_engine_gl_external_texture_frame_callback(), fl_engine_gl_get_fbo(), fl_engine_gl_make_current(), fl_engine_gl_make_resource_current(), fl_engine_gl_present(), fl_engine_gl_proc_resolver(), fl_engine_on_pre_engine_restart_cb(), fl_engine_platform_message_cb(), fl_engine_post_task(), fl_engine_runs_task_on_current_thread(), fl_engine_update_semantics_cb(), fl_mouse_cursor_handler_new(), fl_platform_handler_new(), fl_settings_handler_new(), fl_settings_handler_start(), fl_settings_new(), fl_task_runner_new(), flutter::GetSwitchesFromEnvironment(), kPlatformTaskRunnerIdentifier, setup_locales(), and TRUE.

Referenced by realize_cb(), and TEST().

◆ fl_engine_unregister_external_texture()

gboolean fl_engine_unregister_external_texture ( FlEngine *  engine,
int64_t  texture_id 
)

fl_engine_unregister_external_texture: @engine: an #FlEngine. @texture_id: the identifier of the texture that is not available anymore.

Tells the Flutter engine that an existing external texture is not available anymore.

Returns: TRUE on success.

Definition at line 1196 of file fl_engine.cc.

1197  {
1198  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
1199  return self->embedder_api.UnregisterExternalTexture(self->engine,
1200  texture_id) == kSuccess;
1201 }

References texture_id.

Referenced by unregister_texture().

◆ fl_engine_update_accessibility_features()

void fl_engine_update_accessibility_features ( FlEngine *  engine,
int32_t  flags 
)

fl_engine_update_accessibility_features: @engine: an #FlEngine. @flags: the features to enable in the accessibility tree.

Tells the Flutter engine to update the flags on the accessibility tree.

Definition at line 1225 of file fl_engine.cc.

1225  {
1226  g_return_if_fail(FL_IS_ENGINE(self));
1227 
1228  if (self->engine == nullptr) {
1229  return;
1230  }
1231 
1232  self->embedder_api.UpdateAccessibilityFeatures(
1233  self->engine, static_cast<FlutterAccessibilityFeature>(flags));
1234 }

References flags.

Referenced by update_settings().

fl_dart_project_get_aot_library_path
const G_MODULE_EXPORT gchar * fl_dart_project_get_aot_library_path(FlDartProject *self)
Definition: fl_dart_project.cc:72
fl_settings_handler_new
FlSettingsHandler * fl_settings_handler_new(FlEngine *engine)
Definition: fl_settings_handler.cc:74
fl_engine_platform_message_response_cb
static void fl_engine_platform_message_response_cb(const uint8_t *data, size_t data_length, void *user_data)
Definition: fl_engine.cc:397
fl_engine_gl_get_fbo
static uint32_t fl_engine_gl_get_fbo(void *user_data)
Definition: fl_engine.cc:280
fl_engine_gl_make_resource_current
static bool fl_engine_gl_make_resource_current(void *user_data)
Definition: fl_engine.cc:291
FL_ENGINE_ERROR_FAILED
@ FL_ENGINE_ERROR_FAILED
Definition: fl_engine_private.h:26
kMousePointerDeviceId
static constexpr int32_t kMousePointerDeviceId
Definition: fl_engine.cc:33
fl_mouse_cursor_handler_new
FlMouseCursorHandler * fl_mouse_cursor_handler_new(FlBinaryMessenger *messenger)
Definition: fl_mouse_cursor_handler.cc:134
compositor_present_view_callback
static bool compositor_present_view_callback(const FlutterPresentViewInfo *info)
Definition: fl_engine.cc:254
fl_platform_handler_request_app_exit
void fl_platform_handler_request_app_exit(FlPlatformHandler *self)
Definition: fl_platform_handler.cc:264
fl_settings_new
FlSettings * fl_settings_new()
Definition: fl_settings.cc:55
fl_engine_gl_present
static bool fl_engine_gl_present(void *user_data)
Definition: fl_engine.cc:285
flags
FlutterSemanticsFlag flags
Definition: fl_accessible_node.cc:106
fl_platform_handler_new
FlPlatformHandler * fl_platform_handler_new(FlBinaryMessenger *messenger)
Definition: fl_platform_handler.cc:251
fl_engine_on_pre_engine_restart_cb
static void fl_engine_on_pre_engine_restart_cb(void *user_data)
Definition: fl_engine.cc:389
fl_dart_project_get_assets_path
const G_MODULE_EXPORT gchar * fl_dart_project_get_assets_path(FlDartProject *self)
Definition: fl_dart_project.cc:85
fl_binary_messenger_new
FlBinaryMessenger * fl_binary_messenger_new(FlEngine *engine)
Definition: fl_binary_messenger.cc:391
kPlatformTaskRunnerIdentifier
static constexpr size_t kPlatformTaskRunnerIdentifier
Definition: fl_engine.cc:29
fl_renderer_set_engine
void fl_renderer_set_engine(FlRenderer *self, FlEngine *engine)
Definition: fl_renderer.cc:332
view_removed_cb
static void view_removed_cb(const FlutterRemoveViewResult *result)
Definition: fl_engine.cc:166
user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
Definition: fl_event_channel.h:90
fl_display_monitor_new
FlDisplayMonitor * fl_display_monitor_new(FlEngine *engine, GdkDisplay *display)
Definition: fl_display_monitor.cc:94
fl_engine_update_semantics_cb
static void fl_engine_update_semantics_cb(const FlutterSemanticsUpdate2 *update, void *user_data)
Definition: fl_engine.cc:374
fl_engine_gl_external_texture_frame_callback
static bool fl_engine_gl_external_texture_frame_callback(void *user_data, int64_t texture_id, size_t width, size_t height, FlutterOpenGLTexture *opengl_texture)
Definition: fl_engine.cc:298
TRUE
return TRUE
Definition: fl_pixel_buffer_texture_test.cc:53
flutter::GetSwitchesFromEnvironment
std::vector< std::string > GetSwitchesFromEnvironment()
Definition: engine_switches.cc:14
fl_dart_project_get_dart_entrypoint_arguments
G_MODULE_EXPORT gchar ** fl_dart_project_get_dart_entrypoint_arguments(FlDartProject *self)
Definition: fl_dart_project.cc:104
fl_settings_handler_start
void fl_settings_handler_start(FlSettingsHandler *self, FlSettings *settings)
Definition: fl_settings_handler.cc:88
fl_engine_runs_task_on_current_thread
static bool fl_engine_runs_task_on_current_thread(void *user_data)
Definition: fl_engine.cc:339
height
const uint8_t uint32_t uint32_t * height
Definition: fl_pixel_buffer_texture_test.cc:39
view_added_cb
static void view_added_cb(const FlutterAddViewResult *result)
Definition: fl_engine.cc:155
FlEngineError
FlEngineError
Definition: fl_engine_private.h:25
args
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition: fl_event_channel.h:89
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
compositor_collect_backing_store_callback
static bool compositor_collect_backing_store_callback(const FlutterBackingStore *backing_store, void *user_data)
Definition: fl_engine.cc:245
fl_engine_gl_proc_resolver
static void * fl_engine_gl_proc_resolver(void *user_data, const char *name)
Definition: fl_engine.cc:263
setup_locales
static void setup_locales(FlEngine *self)
Definition: fl_engine.cc:184
compositor_create_backing_store_callback
static bool compositor_create_backing_store_callback(const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out, void *user_data)
Definition: fl_engine.cc:235
send_key_event_cb
static void send_key_event_cb(bool handled, void *user_data)
Definition: fl_engine.cc:1114
fl_display_monitor_start
void fl_display_monitor_start(FlDisplayMonitor *self)
Definition: fl_display_monitor.cc:103
fl_engine_error_quark
GQuark fl_engine_error_quark(void) G_GNUC_CONST
fl_dart_project_get_icu_data_path
const G_MODULE_EXPORT gchar * fl_dart_project_get_icu_data_path(FlDartProject *self)
Definition: fl_dart_project.cc:98
texture_id
int64_t texture_id
Definition: texture_registrar_unittests.cc:24
width
const uint8_t uint32_t * width
Definition: fl_pixel_buffer_texture_test.cc:38
fl_engine_gl_make_current
static bool fl_engine_gl_make_current(void *user_data)
Definition: fl_engine.cc:268
fl_engine_post_task
static void fl_engine_post_task(FlutterTask task, uint64_t target_time_nanos, void *user_data)
Definition: fl_engine.cc:345
fl_task_runner_new
FlTaskRunner * fl_task_runner_new(FlEngine *engine)
Definition: fl_task_runner.cc:154
fl_engine_platform_message_cb
static void fl_engine_platform_message_cb(const FlutterPlatformMessage *message, void *user_data)
Definition: fl_engine.cc:354
kPointerPanZoomDeviceId
static constexpr int32_t kPointerPanZoomDeviceId
Definition: fl_engine.cc:34
fl_engine_gl_clear_current
static bool fl_engine_gl_clear_current(void *user_data)
Definition: fl_engine.cc:274