Flutter Linux Embedder
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fl_view.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 #include <atk/atk.h>
8 #include <gtk/gtk-a11y.h>
9 
10 #include <cstring>
11 
12 #include "flutter/common/constants.h"
26 
27 struct _FlView {
29 
30  // The widget rendering the Flutter view.
31  GtkGLArea* gl_area;
32 
33  // Engine this view is showing.
34  FlEngine* engine;
35 
36  // Signal subscription for engine restart signal.
38 
39  // Signal subscription for updating semantics signal.
41 
42  // ID for this view.
43  FlutterViewId view_id;
44 
45  // Object that performs the view rendering.
46  FlRendererGdk* renderer;
47 
48  // Background color.
49  GdkRGBA* background_color;
50 
51  // TRUE if have got the first frame to render.
52  gboolean have_first_frame;
53 
54  // Monitor to track window state.
55  FlWindowStateMonitor* window_state_monitor;
56 
57  // Manages scrolling events.
58  FlScrollingManager* scrolling_manager;
59 
60  // Manages pointer events.
61  FlPointerManager* pointer_manager;
62 
63  // Manages touch events.
64  FlTouchManager* touch_manager;
65 
66  // Accessible tree from Flutter, exposed as an AtkPlug.
67  FlViewAccessible* view_accessible;
68 
69  // Signal subscripton for cursor changes.
71 
72  GCancellable* cancellable;
73 };
74 
76 
78 
79 static void fl_renderable_iface_init(FlRenderableInterface* iface);
80 
82  FlPluginRegistryInterface* iface);
83 
85  FlView,
86  fl_view,
87  GTK_TYPE_BOX,
88  G_IMPLEMENT_INTERFACE(fl_renderable_get_type(), fl_renderable_iface_init)
89  G_IMPLEMENT_INTERFACE(fl_plugin_registry_get_type(),
91 
92 // Emit the first frame signal in the main thread.
93 static gboolean first_frame_idle_cb(gpointer user_data) {
94  FlView* self = FL_VIEW(user_data);
95 
97 
98  return FALSE;
99 }
100 
101 // Signal handler for GtkWidget::delete-event
102 static gboolean window_delete_event_cb(FlView* self) {
103  fl_engine_request_app_exit(self->engine);
104  // Stop the event from propagating.
105  return TRUE;
106 }
107 
108 static void init_scrolling(FlView* self) {
109  g_clear_object(&self->scrolling_manager);
110  self->scrolling_manager =
111  fl_scrolling_manager_new(self->engine, self->view_id);
112 }
113 
114 static void init_touch(FlView* self) {
115  g_clear_object(&self->touch_manager);
116  self->touch_manager = fl_touch_manager_new(self->engine, self->view_id);
117 }
118 
119 static FlutterPointerDeviceKind get_device_kind(GdkEvent* event) {
120  GdkDevice* device = gdk_event_get_source_device(event);
121  GdkInputSource source = gdk_device_get_source(device);
122  switch (source) {
123  case GDK_SOURCE_PEN:
124  case GDK_SOURCE_ERASER:
125  case GDK_SOURCE_CURSOR:
126  case GDK_SOURCE_TABLET_PAD:
127  return kFlutterPointerDeviceKindStylus;
128  case GDK_SOURCE_TOUCHSCREEN:
129  return kFlutterPointerDeviceKindTouch;
130  case GDK_SOURCE_TOUCHPAD: // trackpad device type is reserved for gestures
131  case GDK_SOURCE_TRACKPOINT:
132  case GDK_SOURCE_KEYBOARD:
133  case GDK_SOURCE_MOUSE:
134  return kFlutterPointerDeviceKindMouse;
135  }
136 }
137 
138 // Called when the mouse cursor changes.
139 static void cursor_changed_cb(FlView* self) {
140  FlMouseCursorHandler* handler =
142  const gchar* cursor_name = fl_mouse_cursor_handler_get_cursor_name(handler);
143  GdkWindow* window =
144  gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(self)));
145  g_autoptr(GdkCursor) cursor =
146  gdk_cursor_new_from_name(gdk_window_get_display(window), cursor_name);
147  gdk_window_set_cursor(window, cursor);
148 }
149 
150 // Set the mouse cursor.
151 static void setup_cursor(FlView* self) {
152  FlMouseCursorHandler* handler =
154 
155  self->cursor_changed_cb_id = g_signal_connect_swapped(
156  handler, "cursor-changed", G_CALLBACK(cursor_changed_cb), self);
157  cursor_changed_cb(self);
158 }
159 
160 // Updates the engine with the current window metrics.
161 static void handle_geometry_changed(FlView* self) {
162  GtkAllocation allocation;
163  gtk_widget_get_allocation(GTK_WIDGET(self), &allocation);
164  gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
165 
166  // Note we can't detect if a window is moved between monitors - this
167  // information is provided by Wayland but GTK only notifies us if the scale
168  // has changed, so moving between two monitors of the same scale doesn't
169  // provide any information.
170 
171  GdkWindow* window =
172  gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(self)));
173  // NOTE(robert-ancell) If we haven't got a window we default to display 0.
174  // This is probably indicating a problem with this code in that we
175  // shouldn't be generating anything until the window is created.
176  // Another event with the correct display ID is generated soon after.
177  // I haven't changed this code in case there are side-effects but we
178  // probably shouldn't call handle_geometry_changed after the view is
179  // added but only when the window is realized.
180  FlutterEngineDisplayId display_id = 0;
181  if (window != nullptr) {
182  GdkMonitor* monitor = gdk_display_get_monitor_at_window(
183  gtk_widget_get_display(GTK_WIDGET(self)), window);
185  fl_engine_get_display_monitor(self->engine), monitor);
186  }
188  self->engine, display_id, self->view_id, allocation.width * scale_factor,
189  allocation.height * scale_factor, scale_factor);
190 
191  // Make sure the view has been realized and its size has been allocated before
192  // waiting for a frame. `fl_view_realize()` and `fl_view_size_allocate()` may
193  // be called in either order depending on the order in which the window is
194  // shown and the view is added to a container in the app runner.
195  //
196  // Note: `gtk_widget_init()` initializes the size allocation to 1x1.
197  if (allocation.width > 1 && allocation.height > 1 &&
198  gtk_widget_get_realized(GTK_WIDGET(self))) {
199  fl_renderer_wait_for_frame(FL_RENDERER(self->renderer),
200  allocation.width * scale_factor,
201  allocation.height * scale_factor);
202  }
203 }
204 
205 static void view_added_cb(GObject* object,
206  GAsyncResult* result,
207  gpointer user_data) {
208  FlView* self = FL_VIEW(user_data);
209 
210  g_autoptr(GError) error = nullptr;
211  if (!fl_engine_add_view_finish(FL_ENGINE(object), result, &error)) {
212  if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
213  return;
214  }
215 
216  g_warning("Failed to add view: %s", error->message);
217  // FIXME: Show on the GLArea
218  return;
219  }
220 
222 }
223 
224 // Called when the engine updates accessibility.
225 static void update_semantics_cb(FlView* self,
226  const FlutterSemanticsUpdate2* update) {
227  fl_view_accessible_handle_update_semantics(self->view_accessible, update);
228 }
229 
230 // Invoked by the engine right before the engine is restarted.
231 //
232 // This method should reset states to be as if the engine had just been started,
233 // which usually indicates the user has requested a hot restart (Shift-R in the
234 // Flutter CLI.)
235 static void on_pre_engine_restart_cb(FlView* self) {
236  init_scrolling(self);
237  init_touch(self);
238 }
239 
240 // Implements FlRenderable::redraw
241 static void fl_view_redraw(FlRenderable* renderable) {
242  FlView* self = FL_VIEW(renderable);
243 
244  gtk_widget_queue_draw(GTK_WIDGET(self->gl_area));
245 
246  if (!self->have_first_frame) {
247  self->have_first_frame = TRUE;
248  // This is not the main thread, so the signal needs to be done via an idle
249  // callback.
250  g_idle_add(first_frame_idle_cb, self);
251  }
252 }
253 
254 // Implements FlRenderable::make_current
255 static void fl_view_make_current(FlRenderable* renderable) {
256  FlView* self = FL_VIEW(renderable);
257  gtk_gl_area_make_current(self->gl_area);
258 }
259 
260 // Implements FlPluginRegistry::get_registrar_for_plugin.
261 static FlPluginRegistrar* fl_view_get_registrar_for_plugin(
262  FlPluginRegistry* registry,
263  const gchar* name) {
264  FlView* self = FL_VIEW(registry);
265 
266  return fl_plugin_registrar_new(self,
267  fl_engine_get_binary_messenger(self->engine),
268  fl_engine_get_texture_registrar(self->engine));
269 }
270 
271 static void fl_renderable_iface_init(FlRenderableInterface* iface) {
272  iface->redraw = fl_view_redraw;
273  iface->make_current = fl_view_make_current;
274 }
275 
277  FlPluginRegistryInterface* iface) {
278  iface->get_registrar_for_plugin = fl_view_get_registrar_for_plugin;
279 }
280 
281 static void sync_modifier_if_needed(FlView* self, GdkEvent* event) {
282  guint event_time = gdk_event_get_time(event);
283  GdkModifierType event_state = static_cast<GdkModifierType>(0);
284  gdk_event_get_state(event, &event_state);
286  fl_engine_get_keyboard_manager(self->engine), event_state, event_time);
287 }
288 
289 static void set_scrolling_position(FlView* self, gdouble x, gdouble y) {
290  gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
292  self->scrolling_manager, x * scale_factor, y * scale_factor);
293 }
294 
295 // Signal handler for GtkWidget::button-press-event
296 static gboolean button_press_event_cb(FlView* self,
297  GdkEventButton* button_event) {
298  GdkEvent* event = reinterpret_cast<GdkEvent*>(button_event);
299 
300  // Flutter doesn't handle double and triple click events.
301  GdkEventType event_type = gdk_event_get_event_type(event);
302  if (event_type == GDK_DOUBLE_BUTTON_PRESS ||
303  event_type == GDK_TRIPLE_BUTTON_PRESS) {
304  return FALSE;
305  }
306 
307  guint button = 0;
308  gdk_event_get_button(event, &button);
309 
310  gdouble x = 0.0, y = 0.0;
311  gdk_event_get_coords(event, &x, &y);
312 
313  set_scrolling_position(self, x, y);
314  sync_modifier_if_needed(self, event);
315 
316  gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
318  self->pointer_manager, gdk_event_get_time(event), get_device_kind(event),
319  x * scale_factor, y * scale_factor, button);
320 }
321 
322 // Signal handler for GtkWidget::button-release-event
323 static gboolean button_release_event_cb(FlView* self,
324  GdkEventButton* button_event) {
325  GdkEvent* event = reinterpret_cast<GdkEvent*>(button_event);
326 
327  guint button = 0;
328  gdk_event_get_button(event, &button);
329 
330  gdouble x = 0.0, y = 0.0;
331  gdk_event_get_coords(event, &x, &y);
332 
333  set_scrolling_position(self, x, y);
334  sync_modifier_if_needed(self, event);
335 
336  gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
338  self->pointer_manager, gdk_event_get_time(event), get_device_kind(event),
339  x * scale_factor, y * scale_factor, button);
340 }
341 
342 // Signal handler for GtkWidget::scroll-event
343 static gboolean scroll_event_cb(FlView* self, GdkEventScroll* event) {
344  // TODO(robert-ancell): Update to use GtkEventControllerScroll when we can
345  // depend on GTK 3.24.
346 
348  self->scrolling_manager, event,
349  gtk_widget_get_scale_factor(GTK_WIDGET(self)));
350  return TRUE;
351 }
352 
353 static gboolean touch_event_cb(FlView* self, GdkEventTouch* event) {
355  self->touch_manager, event,
356  gtk_widget_get_scale_factor(GTK_WIDGET(self)));
357  return TRUE;
358 }
359 
360 // Signal handler for GtkWidget::motion-notify-event
361 static gboolean motion_notify_event_cb(FlView* self,
362  GdkEventMotion* motion_event) {
363  GdkEvent* event = reinterpret_cast<GdkEvent*>(motion_event);
364  sync_modifier_if_needed(self, event);
365 
366  // return if touch event
367  auto event_type = gdk_event_get_event_type(event);
368  if (event_type == GDK_TOUCH_BEGIN || event_type == GDK_TOUCH_UPDATE ||
369  event_type == GDK_TOUCH_END || event_type == GDK_TOUCH_CANCEL) {
370  return FALSE;
371  }
372 
373  gdouble x = 0.0, y = 0.0;
374  gdk_event_get_coords(event, &x, &y);
375  gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
377  self->pointer_manager, gdk_event_get_time(event), get_device_kind(event),
378  x * scale_factor, y * scale_factor);
379 }
380 
381 // Signal handler for GtkWidget::enter-notify-event
382 static gboolean enter_notify_event_cb(FlView* self,
383  GdkEventCrossing* crossing_event) {
384  GdkEvent* event = reinterpret_cast<GdkEvent*>(crossing_event);
385  gdouble x = 0.0, y = 0.0;
386  gdk_event_get_coords(event, &x, &y);
387  gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
389  self->pointer_manager, gdk_event_get_time(event), get_device_kind(event),
390  x * scale_factor, y * scale_factor);
391 }
392 
393 // Signal handler for GtkWidget::leave-notify-event
394 static gboolean leave_notify_event_cb(FlView* self,
395  GdkEventCrossing* crossing_event) {
396  if (crossing_event->mode != GDK_CROSSING_NORMAL) {
397  return FALSE;
398  }
399 
400  GdkEvent* event = reinterpret_cast<GdkEvent*>(crossing_event);
401  gdouble x = 0.0, y = 0.0;
402  gdk_event_get_coords(event, &x, &y);
403  gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
405  self->pointer_manager, gdk_event_get_time(event), get_device_kind(event),
406  x * scale_factor, y * scale_factor);
407 }
408 
409 static void gesture_rotation_begin_cb(FlView* self) {
410  fl_scrolling_manager_handle_rotation_begin(self->scrolling_manager);
411 }
412 
413 static void gesture_rotation_update_cb(FlView* self,
414  gdouble rotation,
415  gdouble delta) {
416  fl_scrolling_manager_handle_rotation_update(self->scrolling_manager,
417  rotation);
418 }
419 
420 static void gesture_rotation_end_cb(FlView* self) {
421  fl_scrolling_manager_handle_rotation_end(self->scrolling_manager);
422 }
423 
424 static void gesture_zoom_begin_cb(FlView* self) {
425  fl_scrolling_manager_handle_zoom_begin(self->scrolling_manager);
426 }
427 
428 static void gesture_zoom_update_cb(FlView* self, gdouble scale) {
429  fl_scrolling_manager_handle_zoom_update(self->scrolling_manager, scale);
430 }
431 
432 static void gesture_zoom_end_cb(FlView* self) {
433  fl_scrolling_manager_handle_zoom_end(self->scrolling_manager);
434 }
435 
436 static GdkGLContext* create_context_cb(FlView* self) {
437  fl_renderer_gdk_set_window(self->renderer,
438  gtk_widget_get_parent_window(GTK_WIDGET(self)));
439 
440  init_scrolling(self);
441  init_touch(self);
442 
443  g_autoptr(GError) error = nullptr;
444  if (!fl_renderer_gdk_create_contexts(self->renderer, &error)) {
445  gtk_gl_area_set_error(self->gl_area, error);
446  return nullptr;
447  }
448 
449  return GDK_GL_CONTEXT(
450  g_object_ref(fl_renderer_gdk_get_context(self->renderer)));
451 }
452 
453 static void realize_cb(FlView* self) {
454  g_autoptr(GError) error = nullptr;
455 
456  fl_renderer_make_current(FL_RENDERER(self->renderer));
457 
458  GError* gl_error = gtk_gl_area_get_error(self->gl_area);
459  if (gl_error != NULL) {
460  g_warning("Failed to initialize GLArea: %s", gl_error->message);
461  return;
462  }
463 
464  fl_renderer_setup(FL_RENDERER(self->renderer));
465 
466  GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
467 
468  self->window_state_monitor =
470  GTK_WINDOW(toplevel_window));
471 
472  // Handle requests by the user to close the application.
473  g_signal_connect_swapped(toplevel_window, "delete-event",
474  G_CALLBACK(window_delete_event_cb), self);
475 
476  fl_renderer_add_renderable(FL_RENDERER(self->renderer), self->view_id,
477  FL_RENDERABLE(self));
478 
479  if (!fl_engine_start(self->engine, &error)) {
480  g_warning("Failed to start Flutter engine: %s", error->message);
481  return;
482  }
483 
484  setup_cursor(self);
485 
487 
488  self->view_accessible = fl_view_accessible_new(self->engine);
490  FL_SOCKET_ACCESSIBLE(gtk_widget_get_accessible(GTK_WIDGET(self))),
491  atk_plug_get_id(ATK_PLUG(self->view_accessible)));
492 }
493 
494 static void secondary_realize_cb(FlView* self) {
495  setup_cursor(self);
496 }
497 
498 static gboolean render_cb(FlView* self, GdkGLContext* context) {
499  if (gtk_gl_area_get_error(self->gl_area) != NULL) {
500  return FALSE;
501  }
502 
503  int width = gtk_widget_get_allocated_width(GTK_WIDGET(self->gl_area));
504  int height = gtk_widget_get_allocated_height(GTK_WIDGET(self->gl_area));
505  gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self->gl_area));
506  fl_renderer_render(FL_RENDERER(self->renderer), self->view_id,
507  width * scale_factor, height * scale_factor,
508  self->background_color);
509 
510  return TRUE;
511 }
512 
513 static void unrealize_cb(FlView* self) {
514  g_autoptr(GError) error = nullptr;
515 
516  fl_renderer_make_current(FL_RENDERER(self->renderer));
517 
518  GError* gl_error = gtk_gl_area_get_error(self->gl_area);
519  if (gl_error != NULL) {
520  g_warning("Failed to uninitialize GLArea: %s", gl_error->message);
521  return;
522  }
523 
524  fl_renderer_cleanup(FL_RENDERER(self->renderer));
525 }
526 
527 static void size_allocate_cb(FlView* self) {
529 }
530 
531 static void fl_view_notify(GObject* object, GParamSpec* pspec) {
532  FlView* self = FL_VIEW(object);
533 
534  if (strcmp(pspec->name, "scale-factor") == 0) {
536  }
537 
538  if (G_OBJECT_CLASS(fl_view_parent_class)->notify != nullptr) {
539  G_OBJECT_CLASS(fl_view_parent_class)->notify(object, pspec);
540  }
541 }
542 
543 static void fl_view_dispose(GObject* object) {
544  FlView* self = FL_VIEW(object);
545 
546  g_cancellable_cancel(self->cancellable);
547 
548  if (self->engine != nullptr) {
549  FlMouseCursorHandler* handler =
551  if (self->cursor_changed_cb_id != 0) {
552  g_signal_handler_disconnect(handler, self->cursor_changed_cb_id);
553  self->cursor_changed_cb_id = 0;
554  }
555 
556  // Stop rendering.
557  fl_renderer_remove_view(FL_RENDERER(self->renderer), self->view_id);
558 
559  // Release the view ID from the engine.
560  fl_engine_remove_view(self->engine, self->view_id, nullptr, nullptr,
561  nullptr);
562  }
563 
564  if (self->on_pre_engine_restart_cb_id != 0) {
565  g_signal_handler_disconnect(self->engine,
566  self->on_pre_engine_restart_cb_id);
567  self->on_pre_engine_restart_cb_id = 0;
568  }
569 
570  if (self->update_semantics_cb_id != 0) {
571  g_signal_handler_disconnect(self->engine, self->update_semantics_cb_id);
572  self->update_semantics_cb_id = 0;
573  }
574 
575  g_clear_object(&self->engine);
576  g_clear_object(&self->renderer);
577  g_clear_pointer(&self->background_color, gdk_rgba_free);
578  g_clear_object(&self->window_state_monitor);
579  g_clear_object(&self->scrolling_manager);
580  g_clear_object(&self->pointer_manager);
581  g_clear_object(&self->touch_manager);
582  g_clear_object(&self->view_accessible);
583  g_clear_object(&self->cancellable);
584 
585  G_OBJECT_CLASS(fl_view_parent_class)->dispose(object);
586 }
587 
588 // Implements GtkWidget::realize.
589 static void fl_view_realize(GtkWidget* widget) {
590  FlView* self = FL_VIEW(widget);
591 
592  GTK_WIDGET_CLASS(fl_view_parent_class)->realize(widget);
593 
594  // Realize the child widgets.
595  gtk_widget_realize(GTK_WIDGET(self->gl_area));
596 }
597 
598 static gboolean handle_key_event(FlView* self, GdkEventKey* key_event) {
599  g_autoptr(FlKeyEvent) event = fl_key_event_new_from_gdk_event(
600  gdk_event_copy(reinterpret_cast<GdkEvent*>(key_event)));
601 
603  fl_engine_get_keyboard_manager(self->engine), event, self->cancellable,
604  [](GObject* object, GAsyncResult* result, gpointer user_data) {
605  FlView* self = FL_VIEW(user_data);
606 
607  g_autoptr(FlKeyEvent) redispatch_event = nullptr;
608  g_autoptr(GError) error = nullptr;
609  if (!fl_keyboard_manager_handle_event_finish(
610  FL_KEYBOARD_MANAGER(object), result, &redispatch_event,
611  &error)) {
612  if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
613  return;
614  }
615 
616  g_warning("Failed to handle key event: %s", error->message);
617  }
618 
619  if (redispatch_event != nullptr) {
621  fl_engine_get_text_input_handler(self->engine),
622  redispatch_event)) {
623  fl_keyboard_manager_add_redispatched_event(
624  fl_engine_get_keyboard_manager(self->engine), redispatch_event);
625  gdk_event_put(fl_key_event_get_origin(redispatch_event));
626  }
627  }
628  },
629  self);
630 
631  return TRUE;
632 }
633 
634 // Implements GtkWidget::key_press_event.
635 static gboolean fl_view_focus_in_event(GtkWidget* widget,
636  GdkEventFocus* event) {
637  FlView* self = FL_VIEW(widget);
639  fl_engine_get_text_input_handler(self->engine), widget);
640  return FALSE;
641 }
642 
643 // Implements GtkWidget::key_press_event.
644 static gboolean fl_view_key_press_event(GtkWidget* widget,
645  GdkEventKey* key_event) {
646  FlView* self = FL_VIEW(widget);
647  return handle_key_event(self, key_event);
648 }
649 
650 // Implements GtkWidget::key_release_event.
651 static gboolean fl_view_key_release_event(GtkWidget* widget,
652  GdkEventKey* key_event) {
653  FlView* self = FL_VIEW(widget);
654  return handle_key_event(self, key_event);
655 }
656 
657 static void fl_view_class_init(FlViewClass* klass) {
658  GObjectClass* object_class = G_OBJECT_CLASS(klass);
659  object_class->notify = fl_view_notify;
660  object_class->dispose = fl_view_dispose;
661 
662  GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
663  widget_class->realize = fl_view_realize;
664  widget_class->focus_in_event = fl_view_focus_in_event;
665  widget_class->key_press_event = fl_view_key_press_event;
666  widget_class->key_release_event = fl_view_key_release_event;
667 
669  g_signal_new("first-frame", fl_view_get_type(), G_SIGNAL_RUN_LAST, 0,
670  NULL, NULL, NULL, G_TYPE_NONE, 0);
671 
672  gtk_widget_class_set_accessible_type(GTK_WIDGET_CLASS(klass),
673  fl_socket_accessible_get_type());
674 }
675 
676 static void fl_view_init(FlView* self) {
677  self->cancellable = g_cancellable_new();
678 
679  gtk_widget_set_can_focus(GTK_WIDGET(self), TRUE);
680 
681  self->view_id = -1;
682 
683  GdkRGBA default_background = {
684  .red = 0.0, .green = 0.0, .blue = 0.0, .alpha = 1.0};
685  self->background_color = gdk_rgba_copy(&default_background);
686 
687  GtkWidget* event_box = gtk_event_box_new();
688  gtk_widget_set_hexpand(event_box, TRUE);
689  gtk_widget_set_vexpand(event_box, TRUE);
690  gtk_container_add(GTK_CONTAINER(self), event_box);
691  gtk_widget_show(event_box);
692  gtk_widget_add_events(event_box,
693  GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
694  GDK_BUTTON_RELEASE_MASK | GDK_SCROLL_MASK |
695  GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK);
696 
697  g_signal_connect_swapped(event_box, "button-press-event",
698  G_CALLBACK(button_press_event_cb), self);
699  g_signal_connect_swapped(event_box, "button-release-event",
700  G_CALLBACK(button_release_event_cb), self);
701  g_signal_connect_swapped(event_box, "scroll-event",
702  G_CALLBACK(scroll_event_cb), self);
703  g_signal_connect_swapped(event_box, "motion-notify-event",
704  G_CALLBACK(motion_notify_event_cb), self);
705  g_signal_connect_swapped(event_box, "enter-notify-event",
706  G_CALLBACK(enter_notify_event_cb), self);
707  g_signal_connect_swapped(event_box, "leave-notify-event",
708  G_CALLBACK(leave_notify_event_cb), self);
709  GtkGesture* zoom = gtk_gesture_zoom_new(event_box);
710  g_signal_connect_swapped(zoom, "begin", G_CALLBACK(gesture_zoom_begin_cb),
711  self);
712  g_signal_connect_swapped(zoom, "scale-changed",
713  G_CALLBACK(gesture_zoom_update_cb), self);
714  g_signal_connect_swapped(zoom, "end", G_CALLBACK(gesture_zoom_end_cb), self);
715  GtkGesture* rotate = gtk_gesture_rotate_new(event_box);
716  g_signal_connect_swapped(rotate, "begin",
717  G_CALLBACK(gesture_rotation_begin_cb), self);
718  g_signal_connect_swapped(rotate, "angle-changed",
719  G_CALLBACK(gesture_rotation_update_cb), self);
720  g_signal_connect_swapped(rotate, "end", G_CALLBACK(gesture_rotation_end_cb),
721  self);
722  g_signal_connect_swapped(event_box, "touch-event", G_CALLBACK(touch_event_cb),
723  self);
724 
725  self->gl_area = GTK_GL_AREA(gtk_gl_area_new());
726  gtk_gl_area_set_has_alpha(self->gl_area, TRUE);
727  gtk_widget_show(GTK_WIDGET(self->gl_area));
728  gtk_container_add(GTK_CONTAINER(event_box), GTK_WIDGET(self->gl_area));
729  g_signal_connect_swapped(self->gl_area, "render", G_CALLBACK(render_cb),
730  self);
731 
732  g_signal_connect_swapped(self, "size-allocate", G_CALLBACK(size_allocate_cb),
733  self);
734 }
735 
736 G_MODULE_EXPORT FlView* fl_view_new(FlDartProject* project) {
737  g_autoptr(FlEngine) engine = fl_engine_new(project);
738  FlView* self = FL_VIEW(g_object_new(fl_view_get_type(), nullptr));
739 
740  self->view_id = flutter::kFlutterImplicitViewId;
741  self->engine = FL_ENGINE(g_object_ref(engine));
742  FlRenderer* renderer = fl_engine_get_renderer(engine);
743  g_assert(FL_IS_RENDERER_GDK(renderer));
744  self->renderer = FL_RENDERER_GDK(g_object_ref(renderer));
745 
746  self->pointer_manager = fl_pointer_manager_new(self->view_id, engine);
747 
748  self->on_pre_engine_restart_cb_id =
749  g_signal_connect_swapped(self->engine, "on-pre-engine-restart",
750  G_CALLBACK(on_pre_engine_restart_cb), self);
751  self->update_semantics_cb_id = g_signal_connect_swapped(
752  engine, "update-semantics", G_CALLBACK(update_semantics_cb), self);
753 
754  g_signal_connect_swapped(self->gl_area, "create-context",
755  G_CALLBACK(create_context_cb), self);
756  g_signal_connect_swapped(self->gl_area, "realize", G_CALLBACK(realize_cb),
757  self);
758  g_signal_connect_swapped(self->gl_area, "unrealize", G_CALLBACK(unrealize_cb),
759  self);
760 
761  return self;
762 }
763 
764 G_MODULE_EXPORT FlView* fl_view_new_for_engine(FlEngine* engine) {
765  FlView* self = FL_VIEW(g_object_new(fl_view_get_type(), nullptr));
766 
767  self->engine = FL_ENGINE(g_object_ref(engine));
768  FlRenderer* renderer = fl_engine_get_renderer(engine);
769  g_assert(FL_IS_RENDERER_GDK(renderer));
770  self->renderer = FL_RENDERER_GDK(g_object_ref(renderer));
771 
772  self->on_pre_engine_restart_cb_id =
773  g_signal_connect_swapped(engine, "on-pre-engine-restart",
774  G_CALLBACK(on_pre_engine_restart_cb), self);
775 
776  self->view_id = fl_engine_add_view(engine, 1, 1, 1.0, self->cancellable,
777  view_added_cb, self);
778  fl_renderer_add_renderable(FL_RENDERER(self->renderer), self->view_id,
779  FL_RENDERABLE(self));
780 
781  self->pointer_manager = fl_pointer_manager_new(self->view_id, engine);
782 
783  g_signal_connect_swapped(self->gl_area, "realize",
784  G_CALLBACK(secondary_realize_cb), self);
785 
786  return self;
787 }
788 
789 G_MODULE_EXPORT FlEngine* fl_view_get_engine(FlView* self) {
790  g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
791  return self->engine;
792 }
793 
794 G_MODULE_EXPORT
795 int64_t fl_view_get_id(FlView* self) {
796  g_return_val_if_fail(FL_IS_VIEW(self), -1);
797  return self->view_id;
798 }
799 
800 G_MODULE_EXPORT void fl_view_set_background_color(FlView* self,
801  const GdkRGBA* color) {
802  g_return_if_fail(FL_IS_VIEW(self));
803  gdk_rgba_free(self->background_color);
804  self->background_color = gdk_rgba_copy(color);
805 }
fl_view_realize
static void fl_view_realize(GtkWidget *widget)
Definition: fl_view.cc:589
window_delete_event_cb
static gboolean window_delete_event_cb(FlView *self)
Definition: fl_view.cc:102
fl_renderer_remove_view
void fl_renderer_remove_view(FlRenderer *self, FlutterViewId view_id)
Definition: fl_renderer.cc:354
gesture_rotation_update_cb
static void gesture_rotation_update_cb(FlView *self, gdouble rotation, gdouble delta)
Definition: fl_view.cc:413
fl_renderer_wait_for_frame
void fl_renderer_wait_for_frame(FlRenderer *self, int target_width, int target_height)
Definition: fl_renderer.cc:433
_FlView::cursor_changed_cb_id
guint cursor_changed_cb_id
Definition: fl_view.cc:70
fl_renderer_gdk_set_window
void fl_renderer_gdk_set_window(FlRendererGdk *self, GdkWindow *window)
Definition: fl_renderer_gdk.cc:69
if
if(end==-1)
Definition: fl_accessible_text_field.cc:42
set_scrolling_position
static void set_scrolling_position(FlView *self, gdouble x, gdouble y)
Definition: fl_view.cc:289
SIGNAL_FIRST_FRAME
@ SIGNAL_FIRST_FRAME
Definition: fl_view.cc:75
enter_notify_event_cb
static gboolean enter_notify_event_cb(FlView *self, GdkEventCrossing *crossing_event)
Definition: fl_view.cc:382
fl_view_redraw
static void fl_view_redraw(FlRenderable *renderable)
Definition: fl_view.cc:241
fl_view_accessible.h
leave_notify_event_cb
static gboolean leave_notify_event_cb(FlView *self, GdkEventCrossing *crossing_event)
Definition: fl_view.cc:394
fl_scrolling_manager_handle_zoom_end
void fl_scrolling_manager_handle_zoom_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:235
_FlView::window_state_monitor
FlWindowStateMonitor * window_state_monitor
Definition: fl_view.cc:55
fl_key_event_new_from_gdk_event
FlKeyEvent * fl_key_event_new_from_gdk_event(GdkEvent *event)
Definition: fl_key_event.cc:53
fl_view_set_background_color
G_MODULE_EXPORT void fl_view_set_background_color(FlView *self, const GdkRGBA *color)
Definition: fl_view.cc:800
fl_scrolling_manager_handle_scroll_event
void fl_scrolling_manager_handle_scroll_event(FlScrollingManager *self, GdkEventScroll *scroll_event, gint scale_factor)
Definition: fl_scrolling_manager.cc:71
fl_view_make_current
static void fl_view_make_current(FlRenderable *renderable)
Definition: fl_view.cc:255
_FlView::background_color
GdkRGBA * background_color
Definition: fl_view.cc:49
fl_view_accessible_handle_update_semantics
void fl_view_accessible_handle_update_semantics(FlViewAccessible *self, const FlutterSemanticsUpdate2 *update)
Definition: fl_view_accessible.cc:139
fl_pointer_manager_handle_button_press
gboolean fl_pointer_manager_handle_button_press(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y, guint gdk_button)
Definition: fl_pointer_manager.cc:105
_FlView::touch_manager
FlTouchManager * touch_manager
Definition: fl_view.cc:64
fl_view_class_init
static void fl_view_class_init(FlViewClass *klass)
Definition: fl_view.cc:657
_FlView::pointer_manager
FlPointerManager * pointer_manager
Definition: fl_view.cc:61
fl_plugin_registrar_private.h
fl_view_get_id
G_MODULE_EXPORT int64_t fl_view_get_id(FlView *self)
Definition: fl_view.cc:795
_FlView::parent_instance
GtkBox parent_instance
Definition: fl_view.cc:28
fl_touch_manager.h
_FlView::have_first_frame
gboolean have_first_frame
Definition: fl_view.cc:52
_FlView::cancellable
GCancellable * cancellable
Definition: fl_view.cc:72
init_scrolling
static void init_scrolling(FlView *self)
Definition: fl_view.cc:108
fl_renderer_gdk_get_context
GdkGLContext * fl_renderer_gdk_get_context(FlRendererGdk *self)
Definition: fl_renderer_gdk.cc:106
create_context_cb
static GdkGLContext * create_context_cb(FlView *self)
Definition: fl_view.cc:436
fl_engine_get_keyboard_manager
FlKeyboardManager * fl_engine_get_keyboard_manager(FlEngine *self)
Definition: fl_engine.cc:1289
get_device_kind
static FlutterPointerDeviceKind get_device_kind(GdkEvent *event)
Definition: fl_view.cc:119
fl_view_get_registrar_for_plugin
static FlPluginRegistrar * fl_view_get_registrar_for_plugin(FlPluginRegistry *registry, const gchar *name)
Definition: fl_view.cc:261
window
return window
Definition: fl_application.cc:41
on_pre_engine_restart_cb
static void on_pre_engine_restart_cb(FlView *self)
Definition: fl_view.cc:235
fl_engine_get_renderer
FlRenderer * fl_engine_get_renderer(FlEngine *self)
Definition: fl_engine.cc:597
fl_view_new_for_engine
G_MODULE_EXPORT FlView * fl_view_new_for_engine(FlEngine *engine)
Definition: fl_view.cc:764
size_allocate_cb
static void size_allocate_cb(FlView *self)
Definition: fl_view.cc:527
unrealize_cb
static void unrealize_cb(FlView *self)
Definition: fl_view.cc:513
fl_display_monitor_get_display_id
FlutterEngineDisplayId fl_display_monitor_get_display_id(FlDisplayMonitor *self, GdkMonitor *monitor)
Definition: fl_display_monitor.cc:115
init_touch
static void init_touch(FlView *self)
Definition: fl_view.cc:114
fl_engine_remove_view
void fl_engine_remove_view(FlEngine *self, FlutterViewId view_id, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition: fl_engine.cc:788
fl_pointer_manager.h
_FlView
Definition: fl_view.cc:27
pspec
guint const GValue GParamSpec * pspec
Definition: fl_standard_method_codec.cc:33
secondary_realize_cb
static void secondary_realize_cb(FlView *self)
Definition: fl_view.cc:494
_FlView::on_pre_engine_restart_cb_id
guint on_pre_engine_restart_cb_id
Definition: fl_view.cc:37
realize_cb
static void realize_cb(FlView *self)
Definition: fl_view.cc:453
scroll_event_cb
static gboolean scroll_event_cb(FlView *self, GdkEventScroll *event)
Definition: fl_view.cc:343
fl_engine_get_binary_messenger
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
Definition: fl_engine.cc:1246
touch_event_cb
static gboolean touch_event_cb(FlView *self, GdkEventTouch *event)
Definition: fl_view.cc:353
view_added_cb
static void view_added_cb(GObject *object, GAsyncResult *result, gpointer user_data)
Definition: fl_view.cc:205
_FlView::scrolling_manager
FlScrollingManager * scrolling_manager
Definition: fl_view.cc:58
fl_view_new
G_MODULE_EXPORT FlView * fl_view_new(FlDartProject *project)
Definition: fl_view.cc:736
render_cb
static gboolean render_cb(FlView *self, GdkGLContext *context)
Definition: fl_view.cc:498
user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
Definition: fl_event_channel.h:90
fl_touch_manager_handle_touch_event
void fl_touch_manager_handle_touch_event(FlTouchManager *self, GdkEventTouch *touch_event, gint scale_factor)
Definition: fl_touch_manager.cc:131
gesture_zoom_end_cb
static void gesture_zoom_end_cb(FlView *self)
Definition: fl_view.cc:432
button_release_event_cb
static gboolean button_release_event_cb(FlView *self, GdkEventButton *button_event)
Definition: fl_view.cc:323
fl_socket_accessible.h
_FlView::view_id
FlutterViewId view_id
Definition: fl_view.cc:43
handle_key_event
static gboolean handle_key_event(FlView *self, GdkEventKey *key_event)
Definition: fl_view.cc:598
fl_engine_add_view_finish
gboolean fl_engine_add_view_finish(FlEngine *self, GAsyncResult *result, GError **error)
Definition: fl_engine.cc:781
_FlView::engine
FlEngine * engine
Definition: fl_view.cc:34
LAST_SIGNAL
@ LAST_SIGNAL
Definition: fl_view.cc:75
fl_text_input_handler_set_widget
void fl_text_input_handler_set_widget(FlTextInputHandler *self, GtkWidget *widget)
Definition: fl_text_input_handler.cc:464
fl_pointer_manager_handle_button_release
gboolean fl_pointer_manager_handle_button_release(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y, guint gdk_button)
Definition: fl_pointer_manager.cc:143
fl_text_input_handler_filter_keypress
gboolean fl_text_input_handler_filter_keypress(FlTextInputHandler *self, FlKeyEvent *event)
Definition: fl_text_input_handler.cc:477
fl_view_plugin_registry_iface_init
static void fl_view_plugin_registry_iface_init(FlPluginRegistryInterface *iface)
Definition: fl_view.cc:276
fl_scrolling_manager_set_last_mouse_position
void fl_scrolling_manager_set_last_mouse_position(FlScrollingManager *self, gdouble x, gdouble y)
Definition: fl_scrolling_manager.cc:63
fl_view_signals
static guint fl_view_signals[LAST_SIGNAL]
Definition: fl_view.cc:77
fl_view_dispose
static void fl_view_dispose(GObject *object)
Definition: fl_view.cc:543
fl_engine_private.h
fl_engine_request_app_exit
void fl_engine_request_app_exit(FlEngine *self)
Definition: fl_engine.cc:1279
fl_scrolling_manager.h
fl_renderer_gdk_create_contexts
gboolean fl_renderer_gdk_create_contexts(FlRendererGdk *self, GError **error)
Definition: fl_renderer_gdk.cc:76
TRUE
return TRUE
Definition: fl_pixel_buffer_texture_test.cc:53
fl_scrolling_manager_handle_zoom_update
void fl_scrolling_manager_handle_zoom_update(FlScrollingManager *self, gdouble scale)
Definition: fl_scrolling_manager.cc:220
fl_view_get_engine
G_MODULE_EXPORT FlEngine * fl_view_get_engine(FlView *self)
Definition: fl_view.cc:789
fl_engine_get_text_input_handler
FlTextInputHandler * fl_engine_get_text_input_handler(FlEngine *self)
Definition: fl_engine.cc:1294
fl_renderable_iface_init
static void fl_renderable_iface_init(FlRenderableInterface *iface)
Definition: fl_view.cc:271
fl_window_state_monitor_new
FlWindowStateMonitor * fl_window_state_monitor_new(FlBinaryMessenger *messenger, GtkWindow *window)
Definition: fl_window_state_monitor.cc:104
fl_scrolling_manager_handle_rotation_update
void fl_scrolling_manager_handle_rotation_update(FlScrollingManager *self, gdouble rotation)
Definition: fl_scrolling_manager.cc:171
gesture_rotation_begin_cb
static void gesture_rotation_begin_cb(FlView *self)
Definition: fl_view.cc:409
fl_accessible_node.h
fl_engine_add_view
FlutterViewId fl_engine_add_view(FlEngine *self, size_t width, size_t height, double pixel_ratio, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition: fl_engine.cc:738
fl_socket_accessible_embed
void fl_socket_accessible_embed(FlSocketAccessible *self, gchar *id)
Definition: fl_socket_accessible.cc:55
fl_engine_get_mouse_cursor_handler
FlMouseCursorHandler * fl_engine_get_mouse_cursor_handler(FlEngine *self)
Definition: fl_engine.cc:1299
fl_engine_get_display_monitor
FlDisplayMonitor * fl_engine_get_display_monitor(FlEngine *self)
Definition: fl_engine.cc:602
setup_cursor
static void setup_cursor(FlView *self)
Definition: fl_view.cc:151
fl_view.h
cursor_changed_cb
static void cursor_changed_cb(FlView *self)
Definition: fl_view.cc:139
fl_keyboard_manager_sync_modifier_if_needed
void fl_keyboard_manager_sync_modifier_if_needed(FlKeyboardManager *self, guint state, double event_time)
Definition: fl_keyboard_manager.cc:427
fl_renderer_gdk.h
height
const uint8_t uint32_t uint32_t * height
Definition: fl_pixel_buffer_texture_test.cc:39
_FlView::update_semantics_cb_id
guint update_semantics_cb_id
Definition: fl_view.cc:40
fl_keyboard_manager_handle_event
void fl_keyboard_manager_handle_event(FlKeyboardManager *self, FlKeyEvent *event, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition: fl_keyboard_manager.cc:374
fl_touch_manager_new
FlTouchManager * fl_touch_manager_new(FlEngine *engine, FlutterViewId view_id)
Definition: fl_touch_manager.cc:48
handle_geometry_changed
static void handle_geometry_changed(FlView *self)
Definition: fl_view.cc:161
_FlView::renderer
FlRendererGdk * renderer
Definition: fl_view.cc:46
fl_renderer_cleanup
void fl_renderer_cleanup(FlRenderer *self)
Definition: fl_renderer.cc:608
fl_view_key_press_event
static gboolean fl_view_key_press_event(GtkWidget *widget, GdkEventKey *key_event)
Definition: fl_view.cc:644
sync_modifier_if_needed
static void sync_modifier_if_needed(FlView *self, GdkEvent *event)
Definition: fl_view.cc:281
gesture_rotation_end_cb
static void gesture_rotation_end_cb(FlView *self)
Definition: fl_view.cc:420
_FlView::gl_area
GtkGLArea * gl_area
Definition: fl_view.cc:31
fl_pointer_manager_handle_motion
gboolean fl_pointer_manager_handle_motion(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y)
Definition: fl_pointer_manager.cc:179
gesture_zoom_update_cb
static void gesture_zoom_update_cb(FlView *self, gdouble scale)
Definition: fl_view.cc:428
fl_pointer_manager_handle_leave
gboolean fl_pointer_manager_handle_leave(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y)
Definition: fl_pointer_manager.cc:218
fl_engine_new
G_MODULE_EXPORT FlEngine * fl_engine_new(FlDartProject *project)
Definition: fl_engine.cc:580
fl_key_event.h
gesture_zoom_begin_cb
static void gesture_zoom_begin_cb(FlView *self)
Definition: fl_view.cc:424
_FlView::view_accessible
FlViewAccessible * view_accessible
Definition: fl_view.cc:67
fl_engine.h
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
fl_renderer_make_current
void fl_renderer_make_current(FlRenderer *self)
Definition: fl_renderer.cc:369
fl_pointer_manager_handle_enter
gboolean fl_pointer_manager_handle_enter(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y)
Definition: fl_pointer_manager.cc:201
fl_view_init
static void fl_view_init(FlView *self)
Definition: fl_view.cc:676
fl_mouse_cursor_handler_get_cursor_name
const gchar * fl_mouse_cursor_handler_get_cursor_name(FlMouseCursorHandler *self)
Definition: fl_mouse_cursor_handler.cc:147
fl_view_notify
static void fl_view_notify(GObject *object, GParamSpec *pspec)
Definition: fl_view.cc:531
fl_renderer_render
void fl_renderer_render(FlRenderer *self, FlutterViewId view_id, int width, int height, const GdkRGBA *background_color)
Definition: fl_renderer.cc:585
fl_scrolling_manager_handle_rotation_end
void fl_scrolling_manager_handle_rotation_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:186
fl_window_state_monitor.h
fl_view_key_release_event
static gboolean fl_view_key_release_event(GtkWidget *widget, GdkEventKey *key_event)
Definition: fl_view.cc:651
fl_engine_start
gboolean fl_engine_start(FlEngine *self, GError **error)
Definition: fl_engine.cc:607
fl_scrolling_manager_handle_rotation_begin
void fl_scrolling_manager_handle_rotation_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:153
fl_scrolling_manager_new
FlScrollingManager * fl_scrolling_manager_new(FlEngine *engine, FlutterViewId view_id)
Definition: fl_scrolling_manager.cc:47
fl_renderer_add_renderable
void fl_renderer_add_renderable(FlRenderer *self, FlutterViewId view_id, FlRenderable *renderable)
Definition: fl_renderer.cc:341
G_DEFINE_TYPE_WITH_CODE
G_DEFINE_TYPE_WITH_CODE(FlView, fl_view, GTK_TYPE_BOX, G_IMPLEMENT_INTERFACE(fl_plugin_registry_get_type(), fl_view_plugin_registry_iface_init)) static gboolean first_frame_idle_cb(gpointer user_data)
Definition: fl_view.cc:84
fl_plugin_registrar_new
FlPluginRegistrar * fl_plugin_registrar_new(FlView *view, FlBinaryMessenger *messenger, FlTextureRegistrar *texture_registrar)
Definition: fl_plugin_registrar.cc:84
fl_plugin_registry.h
motion_notify_event_cb
static gboolean motion_notify_event_cb(FlView *self, GdkEventMotion *motion_event)
Definition: fl_view.cc:361
fl_engine_send_window_metrics_event
void fl_engine_send_window_metrics_event(FlEngine *self, FlutterEngineDisplayId display_id, FlutterViewId view_id, size_t width, size_t height, double pixel_ratio)
Definition: fl_engine.cc:939
width
const uint8_t uint32_t * width
Definition: fl_pixel_buffer_texture_test.cc:38
fl_view_focus_in_event
static gboolean fl_view_focus_in_event(GtkWidget *widget, GdkEventFocus *event)
Definition: fl_view.cc:635
fl_scrolling_manager_handle_zoom_begin
void fl_scrolling_manager_handle_zoom_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:202
update_semantics_cb
static void update_semantics_cb(FlView *self, const FlutterSemanticsUpdate2 *update)
Definition: fl_view.cc:225
fl_view_accessible_new
FlViewAccessible * fl_view_accessible_new(FlEngine *engine)
Definition: fl_view_accessible.cc:132
fl_engine_get_texture_registrar
G_MODULE_EXPORT FlTextureRegistrar * fl_engine_get_texture_registrar(FlEngine *self)
Definition: fl_engine.cc:1262
button_press_event_cb
static gboolean button_press_event_cb(FlView *self, GdkEventButton *button_event)
Definition: fl_view.cc:296
fl_pointer_manager_new
FlPointerManager * fl_pointer_manager_new(FlutterViewId view_id, FlEngine *engine)
Definition: fl_pointer_manager.cc:94
g_signal_emit
g_signal_emit(self, fl_application_signals[SIGNAL_CREATE_WINDOW], 0, view, &window)
fl_renderer_setup
void fl_renderer_setup(FlRenderer *self)
Definition: fl_renderer.cc:567