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)
 

Enumerations

enum  FlEngineError { FL_ENGINE_ERROR_FAILED }
 

Functions

GQuark fl_engine_error_quark (void) G_GNUC_CONST
 
FlEngine * fl_engine_new_with_binary_messenger (FlBinaryMessenger *binary_messenger)
 
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_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)
 
FlWindowingHandler * fl_engine_get_windowing_handler (FlEngine *engine)
 
FlKeyboardManager * fl_engine_get_keyboard_manager (FlEngine *engine)
 
FlTextInputHandler * fl_engine_get_text_input_handler (FlEngine *engine)
 
FlMouseCursorHandler * fl_engine_get_mouse_cursor_handler (FlEngine *engine)
 
FlEngine * fl_engine_for_id (int64_t handle)
 

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 46 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 28 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 738 of file fl_engine.cc.

744  {
745  g_return_val_if_fail(FL_IS_ENGINE(self), -1);
746 
747  g_autoptr(GTask) task = g_task_new(self, cancellable, callback, user_data);
748 
749  FlutterViewId view_id = self->next_view_id;
750  self->next_view_id++;
751 
752  // We don't know which display this view will open on, so set to zero and this
753  // will be updated in a following FlutterWindowMetricsEvent
754  FlutterEngineDisplayId display_id = 0;
755 
756  FlutterWindowMetricsEvent metrics;
757  metrics.struct_size = sizeof(FlutterWindowMetricsEvent);
758  metrics.width = width;
759  metrics.height = height;
760  metrics.pixel_ratio = pixel_ratio;
761  metrics.display_id = display_id;
762  metrics.view_id = view_id;
763  FlutterAddViewInfo info;
764  info.struct_size = sizeof(FlutterAddViewInfo);
765  info.view_id = view_id;
766  info.view_metrics = &metrics;
767  info.user_data = g_object_ref(task);
768  info.add_view_callback = view_added_cb;
769  FlutterEngineResult result = self->embedder_api.AddView(self->engine, &info);
770  if (result != kSuccess) {
771  g_task_return_new_error(task, fl_engine_error_quark(),
772  FL_ENGINE_ERROR_FAILED, "AddView returned %d",
773  result);
774  // This would have been done in the callback, but that won't occur now.
775  g_object_unref(task);
776  }
777 
778  return view_id;
779 }

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 781 of file fl_engine.cc.

783  {
784  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
785  return g_task_propagate_boolean(G_TASK(result), error);
786 }

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 1204 of file fl_engine.cc.

1207  {
1208  g_return_if_fail(FL_IS_ENGINE(self));
1209 
1210  if (self->engine == nullptr) {
1211  return;
1212  }
1213 
1214  const uint8_t* action_data = nullptr;
1215  size_t action_data_length = 0;
1216  if (data != nullptr) {
1217  action_data = static_cast<const uint8_t*>(
1218  g_bytes_get_data(data, &action_data_length));
1219  }
1220 
1221  self->embedder_api.DispatchSemanticsAction(self->engine, id, action,
1222  action_data, action_data_length);
1223 }

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 1257 of file fl_engine.cc.

1257  {
1258  g_return_if_fail(FL_IS_ENGINE(self));
1259  self->embedder_api.RunTask(self->engine, task);
1260 }

Referenced by fl_task_runner_process_expired_tasks_locked().

◆ fl_engine_for_id()

FlEngine* fl_engine_for_id ( int64_t  handle)

fl_engine_for_id: @handle: an engine identifier obtained through PlatformDispatcher.instance.engineId.

Returns Flutter engine associated with the identifier. The identifier must be valid and for a running engine otherwise the behavior is undefined. Must be called from the main thread.

Returns: a #FlEngine or NULL.

Definition at line 567 of file fl_engine.cc.

567  {
568  void* engine = reinterpret_cast<void*>(id);
569  g_return_val_if_fail(FL_IS_ENGINE(engine), nullptr);
570  return FL_ENGINE(engine);
571 }

References id.

Referenced by TEST().

◆ 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 602 of file fl_engine.cc.

602  {
603  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
604  return self->display_monitor;
605 }

Referenced by handle_geometry_changed(), and TEST().

◆ 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 721 of file fl_engine.cc.

721  {
722  return &(self->embedder_api);
723 }

Referenced by TEST().

◆ fl_engine_get_keyboard_manager()

FlKeyboardManager* fl_engine_get_keyboard_manager ( FlEngine *  engine)

fl_engine_get_keyboard_manager: @engine: an #FlEngine.

Gets the keyboard manager used by this engine.

Returns: an #FlKeyboardManager.

Definition at line 1289 of file fl_engine.cc.

1289  {
1290  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
1291  return self->keyboard_manager;
1292 }

Referenced by handle_key_event(), sync_modifier_if_needed(), and 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: an #FlMouseCursorHandler.

Definition at line 1299 of file fl_engine.cc.

1299  {
1300  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
1301  return self->mouse_cursor_handler;
1302 }

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

◆ 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 597 of file fl_engine.cc.

597  {
598  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
599  return self->renderer;
600 }

Referenced by fl_view_new(), fl_view_new_for_engine(), and TEST().

◆ 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 1252 of file fl_engine.cc.

1252  {
1253  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
1254  return self->task_runner;
1255 }

Referenced by fl_renderer_unblock_main_thread(), fl_renderer_wait_for_frame(), and TEST().

◆ fl_engine_get_text_input_handler()

FlTextInputHandler* fl_engine_get_text_input_handler ( FlEngine *  engine)

fl_engine_get_text_input_handler: @engine: an #FlEngine.

Gets the text input handler used by this engine.

Returns: an #FlTextInputHandler.

Definition at line 1294 of file fl_engine.cc.

1294  {
1295  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
1296  return self->text_input_handler;
1297 }

Referenced by fl_view_focus_in_event(), and handle_key_event().

◆ fl_engine_get_windowing_handler()

FlWindowingHandler* fl_engine_get_windowing_handler ( FlEngine *  engine)

fl_engine_get_windowing_handler: @engine: an #FlEngine.

Gets the windowing handler used by this engine.

Returns: an #FlWindowingHandler.

Definition at line 1284 of file fl_engine.cc.

1284  {
1285  g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
1286  return self->windowing_handler;
1287 }

Referenced by fl_application_activate(), and TEST().

◆ 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 1225 of file fl_engine.cc.

1226  {
1227  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
1228  return self->embedder_api.MarkExternalTextureFrameAvailable(
1229  self->engine, texture_id) == kSuccess;
1230 }

References texture_id.

Referenced by mark_texture_frame_available().

◆ fl_engine_new_with_binary_messenger()

FlEngine* fl_engine_new_with_binary_messenger ( FlBinaryMessenger *  binary_messenger)

fl_engine_new_with_binary_messenger: @binary_messenger: an #FlBinaryMessenger.

Creates a new engine with a custom binary messenger. Used for testing.

Returns: a new #FlEngine.

Definition at line 585 of file fl_engine.cc.

586  {
587  g_autoptr(FlDartProject) project = fl_dart_project_new();
588  g_autoptr(FlRendererGdk) renderer = fl_renderer_gdk_new();
589  return fl_engine_new_full(project, FL_RENDERER(renderer), binary_messenger);
590 }

References fl_dart_project_new(), fl_engine_new_full(), and fl_renderer_gdk_new().

Referenced by TEST().

◆ 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 573 of file fl_engine.cc.

574  {
575  g_return_val_if_fail(FL_IS_DART_PROJECT(project), nullptr);
576  g_return_val_if_fail(FL_IS_RENDERER(renderer), nullptr);
577  return fl_engine_new_full(project, renderer, nullptr);
578 }

References fl_engine_new_full().

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 725 of file fl_engine.cc.

727  {
728  g_return_if_fail(FL_IS_ENGINE(self));
729 
730  FlutterEngineResult result = self->embedder_api.NotifyDisplayUpdate(
731  self->engine, kFlutterEngineDisplaysUpdateTypeStartup, displays,
732  displays_length);
733  if (result != kSuccess) {
734  g_warning("Failed to notify display update to Flutter engine: %d", result);
735  }
736 }

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 1232 of file fl_engine.cc.

1233  {
1234  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
1235  return self->embedder_api.RegisterExternalTexture(self->engine, texture_id) ==
1236  kSuccess;
1237 }

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 788 of file fl_engine.cc.

792  {
793  g_return_if_fail(FL_IS_ENGINE(self));
794 
795  g_autoptr(GTask) task = g_task_new(self, cancellable, callback, user_data);
796 
797  FlutterRemoveViewInfo info;
798  info.struct_size = sizeof(FlutterRemoveViewInfo);
799  info.view_id = view_id;
800  info.user_data = g_object_ref(task);
801  info.remove_view_callback = view_removed_cb;
802  FlutterEngineResult result =
803  self->embedder_api.RemoveView(self->engine, &info);
804  if (result != kSuccess) {
805  g_task_return_new_error(task, fl_engine_error_quark(),
806  FL_ENGINE_ERROR_FAILED, "RemoveView returned %d",
807  result);
808  // This would have been done in the callback, but that won't occur now.
809  g_object_unref(task);
810  }
811 }

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 813 of file fl_engine.cc.

815  {
816  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
817  return g_task_propagate_boolean(G_TASK(result), error);
818 }

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 1279 of file fl_engine.cc.

1279  {
1280  g_return_if_fail(FL_IS_ENGINE(self));
1281  fl_platform_handler_request_app_exit(self->platform_handler);
1282 }

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 1164 of file fl_engine.cc.

1168  {
1169  g_return_if_fail(FL_IS_ENGINE(self));
1170 
1171  g_autoptr(GTask) task = g_task_new(self, cancellable, callback, user_data);
1172 
1173  if (self->engine == nullptr) {
1174  g_task_return_new_error(task, fl_engine_error_quark(),
1175  FL_ENGINE_ERROR_FAILED, "No engine");
1176  return;
1177  }
1178 
1179  if (self->embedder_api.SendKeyEvent(self->engine, event, send_key_event_cb,
1180  g_object_ref(task)) != kSuccess) {
1181  g_task_return_new_error(task, fl_engine_error_quark(),
1182  FL_ENGINE_ERROR_FAILED, "Failed to send key event");
1183  g_object_unref(task);
1184  }
1185 }

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

Referenced by fl_key_embedder_responder_handle_event(), fl_key_embedder_responder_handle_event_impl(), synthesize_simple_event(), 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 1187 of file fl_engine.cc.

1190  {
1191  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
1192  g_return_val_if_fail(g_task_is_valid(result, self), FALSE);
1193 
1194  g_autofree gboolean* return_value =
1195  static_cast<gboolean*>(g_task_propagate_pointer(G_TASK(result), error));
1196  if (return_value == nullptr) {
1197  return FALSE;
1198  }
1199 
1200  *handled = *return_value;
1201  return TRUE;
1202 }

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 961 of file fl_engine.cc.

970  {
971  g_return_if_fail(FL_IS_ENGINE(self));
972 
973  if (self->engine == nullptr) {
974  return;
975  }
976 
977  FlutterPointerEvent fl_event = {};
978  fl_event.struct_size = sizeof(fl_event);
979  fl_event.phase = phase;
980  fl_event.timestamp = timestamp;
981  fl_event.x = x;
982  fl_event.y = y;
983  if (scroll_delta_x != 0 || scroll_delta_y != 0) {
984  fl_event.signal_kind = kFlutterPointerSignalKindScroll;
985  }
986  fl_event.scroll_delta_x = scroll_delta_x;
987  fl_event.scroll_delta_y = scroll_delta_y;
988  fl_event.device_kind = device_kind;
989  fl_event.buttons = buttons;
990  fl_event.device = kMousePointerDeviceId;
991  fl_event.view_id = view_id;
992  self->embedder_api.SendPointerEvent(self->engine, &fl_event, 1);
993 }

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 871 of file fl_engine.cc.

876  {
877  g_return_if_fail(FL_IS_ENGINE(self));
878 
879  GTask* task = nullptr;
880  FlutterPlatformMessageResponseHandle* response_handle = nullptr;
881  if (callback != nullptr) {
882  task = g_task_new(self, cancellable, callback, user_data);
883 
884  if (self->engine == nullptr) {
885  g_task_return_new_error(task, fl_engine_error_quark(),
886  FL_ENGINE_ERROR_FAILED, "No engine to send to");
887  return;
888  }
889 
890  FlutterEngineResult result =
891  self->embedder_api.PlatformMessageCreateResponseHandle(
892  self->engine, fl_engine_platform_message_response_cb, task,
893  &response_handle);
894  if (result != kSuccess) {
895  g_task_return_new_error(task, fl_engine_error_quark(),
897  "Failed to create response handle");
898  g_object_unref(task);
899  return;
900  }
901  } else if (self->engine == nullptr) {
902  return;
903  }
904 
905  FlutterPlatformMessage fl_message = {};
906  fl_message.struct_size = sizeof(fl_message);
907  fl_message.channel = channel;
908  fl_message.message =
909  message != nullptr
910  ? static_cast<const uint8_t*>(g_bytes_get_data(message, nullptr))
911  : nullptr;
912  fl_message.message_size = message != nullptr ? g_bytes_get_size(message) : 0;
913  fl_message.response_handle = response_handle;
914  FlutterEngineResult result =
915  self->embedder_api.SendPlatformMessage(self->engine, &fl_message);
916 
917  if (result != kSuccess && task != nullptr) {
918  g_task_return_new_error(task, fl_engine_error_quark(),
920  "Failed to send platform messages");
921  g_object_unref(task);
922  }
923 
924  if (response_handle != nullptr) {
925  self->embedder_api.PlatformMessageReleaseResponseHandle(self->engine,
926  response_handle);
927  }
928 }

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 930 of file fl_engine.cc.

932  {
933  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
934  g_return_val_if_fail(g_task_is_valid(result, self), FALSE);
935 
936  return static_cast<GBytes*>(g_task_propagate_pointer(G_TASK(result), error));
937 }

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 839 of file fl_engine.cc.

843  {
844  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
845  g_return_val_if_fail(handle != nullptr, FALSE);
846 
847  if (self->engine == nullptr) {
849  "No engine to send response to");
850  return FALSE;
851  }
852 
853  gsize data_length = 0;
854  const uint8_t* data = nullptr;
855  if (response != nullptr) {
856  data =
857  static_cast<const uint8_t*>(g_bytes_get_data(response, &data_length));
858  }
859  FlutterEngineResult result = self->embedder_api.SendPlatformMessageResponse(
860  self->engine, handle, data, data_length);
861 
862  if (result != kSuccess) {
864  "Failed to send platform message response");
865  return FALSE;
866  }
867 
868  return TRUE;
869 }

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 1125 of file fl_engine.cc.

1134  {
1135  g_return_if_fail(FL_IS_ENGINE(self));
1136 
1137  if (self->engine == nullptr) {
1138  return;
1139  }
1140 
1141  FlutterPointerEvent fl_event = {};
1142  fl_event.struct_size = sizeof(fl_event);
1143  fl_event.timestamp = timestamp;
1144  fl_event.x = x;
1145  fl_event.y = y;
1146  fl_event.phase = phase;
1147  fl_event.pan_x = pan_x;
1148  fl_event.pan_y = pan_y;
1149  fl_event.scale = scale;
1150  fl_event.rotation = rotation;
1151  fl_event.device = kPointerPanZoomDeviceId;
1152  fl_event.device_kind = kFlutterPointerDeviceKindTrackpad;
1153  fl_event.view_id = view_id;
1154  self->embedder_api.SendPointerEvent(self->engine, &fl_event, 1);
1155 }

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 1073 of file fl_engine.cc.

1078  {
1079  g_return_if_fail(FL_IS_ENGINE(self));
1080 
1081  if (self->engine == nullptr) {
1082  return;
1083  }
1084 
1085  FlutterPointerEvent event;
1086  event.timestamp = timestamp;
1087  event.x = x;
1088  event.y = y;
1089  event.device_kind = kFlutterPointerDeviceKindTouch;
1090  event.device = device;
1091  event.buttons = 0;
1092  event.view_id = view_id;
1093  event.phase = FlutterPointerPhase::kAdd;
1094  event.struct_size = sizeof(event);
1095 
1096  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1097 }

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 1021 of file fl_engine.cc.

1026  {
1027  g_return_if_fail(FL_IS_ENGINE(self));
1028 
1029  if (self->engine == nullptr) {
1030  return;
1031  }
1032 
1033  FlutterPointerEvent event;
1034  event.timestamp = timestamp;
1035  event.x = x;
1036  event.y = y;
1037  event.device_kind = kFlutterPointerDeviceKindTouch;
1038  event.device = device;
1039  event.buttons = FlutterPointerMouseButtons::kFlutterPointerButtonMousePrimary;
1040  event.view_id = view_id;
1041  event.phase = FlutterPointerPhase::kDown;
1042  event.struct_size = sizeof(event);
1043 
1044  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1045 }

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 1047 of file fl_engine.cc.

1052  {
1053  g_return_if_fail(FL_IS_ENGINE(self));
1054 
1055  if (self->engine == nullptr) {
1056  return;
1057  }
1058 
1059  FlutterPointerEvent event;
1060  event.timestamp = timestamp;
1061  event.x = x;
1062  event.y = y;
1063  event.device_kind = kFlutterPointerDeviceKindTouch;
1064  event.device = device;
1065  event.buttons = FlutterPointerMouseButtons::kFlutterPointerButtonMousePrimary;
1066  event.view_id = view_id;
1067  event.phase = FlutterPointerPhase::kMove;
1068  event.struct_size = sizeof(event);
1069 
1070  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1071 }

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 1099 of file fl_engine.cc.

1104  {
1105  g_return_if_fail(FL_IS_ENGINE(self));
1106 
1107  if (self->engine == nullptr) {
1108  return;
1109  }
1110 
1111  FlutterPointerEvent event;
1112  event.timestamp = timestamp;
1113  event.x = x;
1114  event.y = y;
1115  event.device_kind = kFlutterPointerDeviceKindTouch;
1116  event.device = device;
1117  event.buttons = 0;
1118  event.view_id = view_id;
1119  event.phase = FlutterPointerPhase::kRemove;
1120  event.struct_size = sizeof(event);
1121 
1122  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1123 }

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 995 of file fl_engine.cc.

1000  {
1001  g_return_if_fail(FL_IS_ENGINE(self));
1002 
1003  if (self->engine == nullptr) {
1004  return;
1005  }
1006 
1007  FlutterPointerEvent event;
1008  event.timestamp = timestamp;
1009  event.x = x;
1010  event.y = y;
1011  event.device_kind = kFlutterPointerDeviceKindTouch;
1012  event.device = device;
1013  event.buttons = 0;
1014  event.view_id = view_id;
1015  event.phase = FlutterPointerPhase::kUp;
1016  event.struct_size = sizeof(event);
1017 
1018  self->embedder_api.SendPointerEvent(self->engine, &event, 1);
1019 }

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 939 of file fl_engine.cc.

944  {
945  g_return_if_fail(FL_IS_ENGINE(self));
946 
947  if (self->engine == nullptr) {
948  return;
949  }
950 
951  FlutterWindowMetricsEvent event = {};
952  event.struct_size = sizeof(FlutterWindowMetricsEvent);
953  event.width = width;
954  event.height = height;
955  event.pixel_ratio = pixel_ratio;
956  event.display_id = display_id;
957  event.view_id = view_id;
958  self->embedder_api.SendWindowMetricsEvent(self->engine, &event);
959 }

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 820 of file fl_engine.cc.

824  {
825  g_return_if_fail(FL_IS_ENGINE(self));
826  g_return_if_fail(handler != nullptr);
827 
828  if (self->platform_message_handler_destroy_notify) {
829  self->platform_message_handler_destroy_notify(
830  self->platform_message_handler_data);
831  }
832 
833  self->platform_message_handler = handler;
834  self->platform_message_handler_data = user_data;
835  self->platform_message_handler_destroy_notify = destroy_notify;
836 }

References user_data.

Referenced by fl_binary_messenger_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 607 of file fl_engine.cc.

607  {
608  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
609 
610  FlutterRendererConfig config = {};
611  config.type = kOpenGL;
612  config.open_gl.struct_size = sizeof(FlutterOpenGLRendererConfig);
613  config.open_gl.gl_proc_resolver = fl_engine_gl_proc_resolver;
614  config.open_gl.make_current = fl_engine_gl_make_current;
615  config.open_gl.clear_current = fl_engine_gl_clear_current;
616  config.open_gl.fbo_callback = fl_engine_gl_get_fbo;
617  config.open_gl.present = fl_engine_gl_present;
618  config.open_gl.make_resource_current = fl_engine_gl_make_resource_current;
619  config.open_gl.gl_external_texture_frame_callback =
621 
622  FlutterTaskRunnerDescription platform_task_runner = {};
623  platform_task_runner.struct_size = sizeof(FlutterTaskRunnerDescription);
624  platform_task_runner.user_data = self;
625  platform_task_runner.runs_task_on_current_thread_callback =
627  platform_task_runner.post_task_callback = fl_engine_post_task;
628  platform_task_runner.identifier = kPlatformTaskRunnerIdentifier;
629 
630  FlutterCustomTaskRunners custom_task_runners = {};
631  custom_task_runners.struct_size = sizeof(FlutterCustomTaskRunners);
632  custom_task_runners.platform_task_runner = &platform_task_runner;
633  custom_task_runners.render_task_runner = &platform_task_runner;
634 
635  g_autoptr(GPtrArray) command_line_args =
636  g_ptr_array_new_with_free_func(g_free);
637  g_ptr_array_insert(command_line_args, 0, g_strdup("flutter"));
638  for (const auto& env_switch : flutter::GetSwitchesFromEnvironment()) {
639  g_ptr_array_add(command_line_args, g_strdup(env_switch.c_str()));
640  }
641 
642  gchar** dart_entrypoint_args =
644 
645  FlutterProjectArgs args = {};
646  args.struct_size = sizeof(FlutterProjectArgs);
647  args.assets_path = fl_dart_project_get_assets_path(self->project);
648  args.icu_data_path = fl_dart_project_get_icu_data_path(self->project);
649  args.command_line_argc = command_line_args->len;
650  args.command_line_argv =
651  reinterpret_cast<const char* const*>(command_line_args->pdata);
652  args.platform_message_callback = fl_engine_platform_message_cb;
653  args.update_semantics_callback2 = fl_engine_update_semantics_cb;
654  args.custom_task_runners = &custom_task_runners;
655  args.shutdown_dart_vm_when_done = true;
656  args.on_pre_engine_restart_callback = fl_engine_on_pre_engine_restart_cb;
657  args.dart_entrypoint_argc =
658  dart_entrypoint_args != nullptr ? g_strv_length(dart_entrypoint_args) : 0;
659  args.dart_entrypoint_argv =
660  reinterpret_cast<const char* const*>(dart_entrypoint_args);
661  args.engine_id = reinterpret_cast<int64_t>(self);
662 
663  FlutterCompositor compositor = {};
664  compositor.struct_size = sizeof(FlutterCompositor);
665  compositor.user_data = self->renderer;
666  compositor.create_backing_store_callback =
668  compositor.collect_backing_store_callback =
670  compositor.present_view_callback = compositor_present_view_callback;
671  args.compositor = &compositor;
672 
673  if (self->embedder_api.RunsAOTCompiledDartCode()) {
674  FlutterEngineAOTDataSource source = {};
675  source.type = kFlutterEngineAOTDataSourceTypeElfPath;
676  source.elf_path = fl_dart_project_get_aot_library_path(self->project);
677  if (self->embedder_api.CreateAOTData(&source, &self->aot_data) !=
678  kSuccess) {
680  "Failed to create AOT data");
681  return FALSE;
682  }
683  args.aot_data = self->aot_data;
684  }
685 
686  FlutterEngineResult result = self->embedder_api.Initialize(
687  FLUTTER_ENGINE_VERSION, &config, &args, self, &self->engine);
688  if (result != kSuccess) {
690  "Failed to initialize Flutter engine");
691  return FALSE;
692  }
693 
694  result = self->embedder_api.RunInitialized(self->engine);
695  if (result != kSuccess) {
697  "Failed to run Flutter engine");
698  return FALSE;
699  }
700 
701  setup_locales(self);
702 
703  g_autoptr(FlSettings) settings = fl_settings_new();
704  self->settings_handler = fl_settings_handler_new(self);
705  fl_settings_handler_start(self->settings_handler, settings);
706 
707  self->platform_handler = fl_platform_handler_new(self->binary_messenger);
708 
709  setup_keyboard(self);
710 
711  result = self->embedder_api.UpdateSemanticsEnabled(self->engine, TRUE);
712  if (result != kSuccess) {
713  g_warning("Failed to enable accessibility features on Flutter engine");
714  }
715 
716  fl_display_monitor_start(self->display_monitor);
717 
718  return TRUE;
719 }

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_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_platform_handler_new(), fl_settings_handler_new(), fl_settings_handler_start(), fl_settings_new(), flutter::GetSwitchesFromEnvironment(), kPlatformTaskRunnerIdentifier, setup_keyboard(), 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 1239 of file fl_engine.cc.

1240  {
1241  g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
1242  return self->embedder_api.UnregisterExternalTexture(self->engine,
1243  texture_id) == kSuccess;
1244 }

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 1268 of file fl_engine.cc.

1268  {
1269  g_return_if_fail(FL_IS_ENGINE(self));
1270 
1271  if (self->engine == nullptr) {
1272  return;
1273  }
1274 
1275  self->embedder_api.UpdateAccessibilityFeatures(
1276  self->engine, static_cast<FlutterAccessibilityFeature>(flags));
1277 }

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:424
fl_engine_gl_get_fbo
static uint32_t fl_engine_gl_get_fbo(void *user_data)
Definition: fl_engine.cc:289
fl_engine_gl_make_resource_current
static bool fl_engine_gl_make_resource_current(void *user_data)
Definition: fl_engine.cc:300
FL_ENGINE_ERROR_FAILED
@ FL_ENGINE_ERROR_FAILED
Definition: fl_engine_private.h:29
kMousePointerDeviceId
static constexpr int32_t kMousePointerDeviceId
Definition: fl_engine.cc:35
fl_engine_new_full
static FlEngine * fl_engine_new_full(FlDartProject *project, FlRenderer *renderer, FlBinaryMessenger *binary_messenger)
Definition: fl_engine.cc:541
compositor_present_view_callback
static bool compositor_present_view_callback(const FlutterPresentViewInfo *info)
Definition: fl_engine.cc:263
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:294
flags
FlutterSemanticsFlag flags
Definition: fl_accessible_node.cc:106
id
int64_t id
Definition: fl_pixel_buffer_texture.cc:28
fl_platform_handler_new
FlPlatformHandler * fl_platform_handler_new(FlBinaryMessenger *messenger)
Definition: fl_platform_handler.cc:251
fl_dart_project_new
G_MODULE_EXPORT FlDartProject * fl_dart_project_new()
Definition: fl_dart_project.cc:50
fl_engine_on_pre_engine_restart_cb
static void fl_engine_on_pre_engine_restart_cb(void *user_data)
Definition: fl_engine.cc:414
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
kPlatformTaskRunnerIdentifier
static constexpr size_t kPlatformTaskRunnerIdentifier
Definition: fl_engine.cc:31
view_removed_cb
static void view_removed_cb(const FlutterRemoveViewResult *result)
Definition: fl_engine.cc:175
user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
Definition: fl_event_channel.h:90
fl_engine_update_semantics_cb
static void fl_engine_update_semantics_cb(const FlutterSemanticsUpdate2 *update, void *user_data)
Definition: fl_engine.cc:383
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:307
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:348
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:164
FlEngineError
FlEngineError
Definition: fl_engine_private.h:28
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:254
fl_engine_gl_proc_resolver
static void * fl_engine_gl_proc_resolver(void *user_data, const char *name)
Definition: fl_engine.cc:272
setup_locales
static void setup_locales(FlEngine *self)
Definition: fl_engine.cc:193
fl_renderer_gdk_new
FlRendererGdk * fl_renderer_gdk_new()
Definition: fl_renderer_gdk.cc:63
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:244
send_key_event_cb
static void send_key_event_cb(bool handled, void *user_data)
Definition: fl_engine.cc:1157
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:277
fl_engine_post_task
static void fl_engine_post_task(FlutterTask task, uint64_t target_time_nanos, void *user_data)
Definition: fl_engine.cc:354
fl_engine_platform_message_cb
static void fl_engine_platform_message_cb(const FlutterPlatformMessage *message, void *user_data)
Definition: fl_engine.cc:363
kPointerPanZoomDeviceId
static constexpr int32_t kPointerPanZoomDeviceId
Definition: fl_engine.cc:36
setup_keyboard
static void setup_keyboard(FlEngine *self)
Definition: fl_engine.cc:390
fl_engine_gl_clear_current
static bool fl_engine_gl_clear_current(void *user_data)
Definition: fl_engine.cc:283