| Flutter Linux Embedder |

Classes | Enumerations | Functions | Variables
fl_view.cc File Reference
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_view.h"`
`#include "flutter/shell/platform/linux/fl_view_private.h"`
`#include <cstring>`
`#include "flutter/shell/platform/linux/fl_accessibility_plugin.h"`
`#include "flutter/shell/platform/linux/fl_engine_private.h"`
`#include "flutter/shell/platform/linux/fl_key_event.h"`
`#include "flutter/shell/platform/linux/fl_keyboard_manager.h"`
`#include "flutter/shell/platform/linux/fl_keyboard_view_delegate.h"`
`#include "flutter/shell/platform/linux/fl_mouse_cursor_plugin.h"`
`#include "flutter/shell/platform/linux/fl_platform_plugin.h"`
`#include "flutter/shell/platform/linux/fl_plugin_registrar_private.h"`
`#include "flutter/shell/platform/linux/fl_renderer_gl.h"`
`#include "flutter/shell/platform/linux/fl_scrolling_manager.h"`
`#include "flutter/shell/platform/linux/fl_scrolling_view_delegate.h"`
`#include "flutter/shell/platform/linux/fl_text_input_plugin.h"`
`#include "flutter/shell/platform/linux/fl_text_input_view_delegate.h"`
`#include "flutter/shell/platform/linux/fl_view_accessible.h"`
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"`
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_plugin_registry.h"`

Go to the source code of this file.

## Classes
struct | _FlView

## Enumerations
enum | { kPropFlutterProject = 1, kPropLast }

## Functions
static void | fl_view_plugin_registry_iface_init (FlPluginRegistryInterface *iface)
static void | fl_view_keyboard_delegate_iface_init (FlKeyboardViewDelegateInterface *iface)
static void | fl_view_scrolling_delegate_iface_init (FlScrollingViewDelegateInterface *iface)
static void | fl_view_text_input_delegate_iface_init (FlTextInputViewDelegateInterface *iface)
| 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) G_IMPLEMENT_INTERFACE(fl_keyboard_view_delegate_get_type(), fl_view_keyboard_delegate_iface_init) G_IMPLEMENT_INTERFACE(fl_scrolling_view_delegate_get_type(), fl_view_scrolling_delegate_iface_init) G_IMPLEMENT_INTERFACE(fl_text_input_view_delegate_get_type(), fl_view_text_input_delegate_iface_init)) static gboolean window_delete_event_cb(GtkWidget *widget
static void | init_keyboard (FlView *self)
static void | init_scrolling (FlView *self)
static gboolean | send_pointer_button_event (FlView *self, GdkEvent *event)
static void | check_pointer_inside (FlView *self, GdkEvent *event)
static void | handle_geometry_changed (FlView *self)
static void | update_semantics_node_cb (FlEngine *engine, const FlutterSemanticsNode *node, gpointer user_data)
static void | on_pre_engine_restart_cb (FlEngine *engine, gpointer user_data)
static FlPluginRegistrar * | fl_view_get_registrar_for_plugin (FlPluginRegistry *registry, const gchar *name)
static gboolean | button_press_event_cb (GtkWidget *widget, GdkEventButton *button_event, FlView *self)
static gboolean | button_release_event_cb (GtkWidget *widget, GdkEventButton *button_event, FlView *self)
static gboolean | scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, FlView *self)
static gboolean | motion_notify_event_cb (GtkWidget *widget, GdkEventMotion *motion_event, FlView *self)
static gboolean | enter_notify_event_cb (GtkWidget *widget, GdkEventCrossing *crossing_event, FlView *self)
static gboolean | leave_notify_event_cb (GtkWidget *widget, GdkEventCrossing *crossing_event, FlView *self)
static void | keymap_keys_changed_cb (GdkKeymap *keymapf, FlView *self)
static void | gesture_rotation_begin_cb (GtkGestureRotate *gesture, GdkEventSequence *sequence, FlView *self)
static void | gesture_rotation_update_cb (GtkGestureRotate *widget, gdouble rotation, gdouble delta, FlView *self)
static void | gesture_rotation_end_cb (GtkGestureRotate *gesture, GdkEventSequence *sequence, FlView *self)
static void | gesture_zoom_begin_cb (GtkGestureZoom *gesture, GdkEventSequence *sequence, FlView *self)
static void | gesture_zoom_update_cb (GtkGestureZoom *widget, gdouble scale, FlView *self)
static void | gesture_zoom_end_cb (GtkGestureZoom *gesture, GdkEventSequence *sequence, FlView *self)
static gboolean | window_state_event_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)
static void | realize_cb (GtkWidget *widget)
static void | configure_cb (GtkWidget *widget, GdkEventConfigure event)
static void | fl_view_constructed (GObject *object)
static void | fl_view_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
static void | fl_view_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
static void | fl_view_notify (GObject *object, GParamSpec *pspec)
static void | fl_view_dispose (GObject *object)
static gboolean | fl_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
static gboolean | fl_view_key_release_event (GtkWidget *widget, GdkEventKey *event)
static void | fl_view_class_init (FlViewClass *klass)
static void | fl_view_init (FlView *self)
G_MODULE_EXPORT FlView * | fl_view_new (FlDartProject *project)
G_MODULE_EXPORT FlEngine * | fl_view_get_engine (FlView *self)
void | fl_view_set_textures (FlView *self, GdkGLContext *context, GPtrArray *textures)
GHashTable * | fl_view_get_keyboard_state (FlView *self)

## Variables
static constexpr int | kMicrosecondsPerMillisecond = 1000
GdkEvent * | event
GdkEvent FlView * | self
return | TRUE

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
kPropFlutterProject |
kPropLast |

Definition at line 70 of file fl_view.cc.

70 { kPropFlutterProject = 1, kPropLast };

## Function Documentation

## ◆ button_press_event_cb()

static gboolean button_press_event_cb | ( | GtkWidget * | widget,
|  | GdkEventButton * | button_event,
|  | FlView * | self
| ) |  |
| static

Definition at line 360 of file fl_view.cc.

362 {
363 GdkEvent* event = reinterpret_cast<GdkEvent*>(button_event);
364
365 // Flutter doesn't handle double and triple click events.
366 GdkEventType event_type = gdk_event_get_event_type(event);
367 if (event_type == GDK_DOUBLE_BUTTON_PRESS ||
368 event_type == GDK_TRIPLE_BUTTON_PRESS) {
369 return FALSE;
370 }
371
372 check_pointer_inside(self, event);
373
374 return send_pointer_button_event(self, event);
375 }

References check_pointer_inside(), event, and send_pointer_button_event().

Referenced by fl_view_constructed().

## ◆ button_release_event_cb()

static gboolean button_release_event_cb | ( | GtkWidget * | widget,
|  | GdkEventButton * | button_event,
|  | FlView * | self
| ) |  |
| static

Definition at line 378 of file fl_view.cc.

380 {
381 GdkEvent* event = reinterpret_cast<GdkEvent*>(button_event);
382 return send_pointer_button_event(self, event);
383 }

References event, and send_pointer_button_event().

Referenced by fl_view_constructed().

## ◆ check_pointer_inside()

static void check_pointer_inside | ( | FlView * | self,
|  | GdkEvent * | event
| ) |  |
| static

Definition at line 189 of file fl_view.cc.

189 {
190 if (!self->pointer_inside) {
191 self->pointer_inside = TRUE;
192
193 gdouble x, y;
194 if (gdk_event_get_coords(event, &x, &y)) {
195 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
196
197 fl_engine_send_mouse_pointer_event(
198 self->engine, kAdd,
199 gdk_event_get_time(event) * kMicrosecondsPerMillisecond,
200 x * scale_factor, y * scale_factor, 0, 0, self->button_state);
201 }
202 }
203 }

References event, fl_engine_send_mouse_pointer_event(), kMicrosecondsPerMillisecond, self, and TRUE.

Referenced by button_press_event_cb(), enter_notify_event_cb(), and motion_notify_event_cb().

## ◆ configure_cb()

static void configure_cb | ( | GtkWidget * | widget,
|  | GdkEventConfigure | event
| ) |  |
| static

Definition at line 578 of file fl_view.cc.

578 {
579 FlView* self = FL_VIEW(widget);
580 handle_geometry_changed(self);
581 }

References handle_geometry_changed().

Referenced by fl_view_constructed().

## ◆ enter_notify_event_cb()

static gboolean enter_notify_event_cb | ( | GtkWidget * | widget,
|  | GdkEventCrossing * | crossing_event,
|  | FlView * | self
| ) |  |
| static

Definition at line 429 of file fl_view.cc.

431 {
432 GdkEvent* event = reinterpret_cast<GdkEvent*>(crossing_event);
433
434 if (self->engine == nullptr) {
435 return FALSE;
436 }
437
438 check_pointer_inside(self, event);
439
440 return TRUE;
441 }

References check_pointer_inside(), event, self, and TRUE.

Referenced by fl_view_constructed().

## ◆ fl_view_class_init()

static void fl_view_class_init | ( | FlViewClass * | klass | ) |
| static

Definition at line 737 of file fl_view.cc.

737 {
738 GObjectClass* object_class = G_OBJECT_CLASS(klass);
739 object_class->constructed = fl_view_constructed;
740 object_class->set_property = fl_view_set_property;
741 object_class->get_property = fl_view_get_property;
742 object_class->notify = fl_view_notify;
743 object_class->dispose = fl_view_dispose;
744
745 GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
746 widget_class->key_press_event = fl_view_key_press_event;
747 widget_class->key_release_event = fl_view_key_release_event;
748
749 g_object_class_install_property(
750 G_OBJECT_CLASS(klass), kPropFlutterProject,
751 g_param_spec_object(
752 "flutter-project", "flutter-project", "Flutter project in use",
753 fl_dart_project_get_type(),
754 static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
755 G_PARAM_STATIC_STRINGS)));
756
757 gtk_widget_class_set_accessible_type(GTK_WIDGET_CLASS(klass),
758 fl_view_accessible_get_type());
759 }

References fl_view_constructed(), fl_view_dispose(), fl_view_get_property(), fl_view_key_press_event(), fl_view_key_release_event(), fl_view_notify(), fl_view_set_property(), and kPropFlutterProject.

## ◆ fl_view_constructed()

static void fl_view_constructed | ( | GObject * | object | ) |
| static

Definition at line 583 of file fl_view.cc.

583 {
584 FlView* self = FL_VIEW(object);
585
586 self->renderer = FL_RENDERER(fl_renderer_gl_new());
587 self->engine = fl_engine_new(self->project, self->renderer);
588 fl_engine_set_update_semantics_node_handler(
589 self->engine, update_semantics_node_cb, self, nullptr);
590 fl_engine_set_on_pre_engine_restart_handler(
591 self->engine, on_pre_engine_restart_cb, self, nullptr);
592
593 // Must initialize the keymap before the keyboard.
594 self->keymap = gdk_keymap_get_for_display(gdk_display_get_default());
595
596 // Create system channel handlers.
597 FlBinaryMessenger* messenger = fl_engine_get_binary_messenger(self->engine);
598 self->accessibility_plugin = fl_accessibility_plugin_new(self);
599 init_scrolling(self);
600 self->mouse_cursor_plugin = fl_mouse_cursor_plugin_new(messenger, self);
601 self->platform_plugin = fl_platform_plugin_new(messenger);
602
603 self->event_box = gtk_event_box_new();
604 gtk_widget_set_hexpand(self->event_box, TRUE);
605 gtk_widget_set_vexpand(self->event_box, TRUE);
606 gtk_container_add(GTK_CONTAINER(self), self->event_box);
607 gtk_widget_show(self->event_box);
608 gtk_widget_add_events(self->event_box,
609 GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
610 GDK_BUTTON_RELEASE_MASK | GDK_SCROLL_MASK |
611 GDK_SMOOTH_SCROLL_MASK);
612
613 g_signal_connect(self->event_box, "button-press-event",
614 G_CALLBACK(button_press_event_cb), self);
615 g_signal_connect(self->event_box, "button-release-event",
616 G_CALLBACK(button_release_event_cb), self);
617 g_signal_connect(self->event_box, "scroll-event", G_CALLBACK(scroll_event_cb),
618 self);
619 g_signal_connect(self->event_box, "motion-notify-event",
620 G_CALLBACK(motion_notify_event_cb), self);
621 g_signal_connect(self->event_box, "enter-notify-event",
622 G_CALLBACK(enter_notify_event_cb), self);
623 g_signal_connect(self->event_box, "leave-notify-event",
624 G_CALLBACK(leave_notify_event_cb), self);
625 self->keymap_keys_changed_cb_id = g_signal_connect(
626 self->keymap, "keys-changed", G_CALLBACK(keymap_keys_changed_cb), self);
627 GtkGesture* zoom = gtk_gesture_zoom_new(self->event_box);
628 g_signal_connect(zoom, "begin", G_CALLBACK(gesture_zoom_begin_cb), self);
629 g_signal_connect(zoom, "scale-changed", G_CALLBACK(gesture_zoom_update_cb),
630 self);
631 g_signal_connect(zoom, "end", G_CALLBACK(gesture_zoom_end_cb), self);
632 GtkGesture* rotate = gtk_gesture_rotate_new(self->event_box);
633 g_signal_connect(rotate, "begin", G_CALLBACK(gesture_rotation_begin_cb),
634 self);
635 g_signal_connect(rotate, "angle-changed",
636 G_CALLBACK(gesture_rotation_update_cb), self);
637 g_signal_connect(rotate, "end", G_CALLBACK(gesture_rotation_end_cb), self);
638
639 g_signal_connect(self, "realize", G_CALLBACK(realize_cb), self);
640 g_signal_connect(self, "size-allocate", G_CALLBACK(configure_cb), self);
641 }

References button_press_event_cb(), button_release_event_cb(), configure_cb(), enter_notify_event_cb(), fl_accessibility_plugin_new(), fl_engine_get_binary_messenger(), fl_engine_new(), fl_engine_set_on_pre_engine_restart_handler(), fl_engine_set_update_semantics_node_handler(), fl_mouse_cursor_plugin_new(), fl_platform_plugin_new(), fl_renderer_gl_new(), gesture_rotation_begin_cb(), gesture_rotation_end_cb(), gesture_rotation_update_cb(), gesture_zoom_begin_cb(), gesture_zoom_end_cb(), gesture_zoom_update_cb(), init_scrolling(), keymap_keys_changed_cb(), leave_notify_event_cb(), motion_notify_event_cb(), on_pre_engine_restart_cb(), realize_cb(), scroll_event_cb(), self, TRUE, and update_semantics_node_cb().

Referenced by fl_view_class_init().

## ◆ fl_view_dispose()

static void fl_view_dispose | ( | GObject * | object | ) |
| static

Definition at line 688 of file fl_view.cc.

688 {
689 FlView* self = FL_VIEW(object);
690
691 if (self->engine != nullptr) {
692 fl_engine_set_update_semantics_node_handler(self->engine, nullptr, nullptr,
693 nullptr);
694 fl_engine_set_on_pre_engine_restart_handler(self->engine, nullptr, nullptr,
695 nullptr);
696 }
697
698 if (self->window_state_cb_id != 0) {
699 GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
700 g_signal_handler_disconnect(toplevel_window, self->window_state_cb_id);
701 self->window_state_cb_id = 0;
702 }
703
704 g_clear_object(&self->project);
705 g_clear_object(&self->renderer);
706 g_clear_object(&self->engine);
707 g_clear_object(&self->accessibility_plugin);
708 g_clear_object(&self->keyboard_manager);
709 if (self->keymap_keys_changed_cb_id != 0) {
710 g_signal_handler_disconnect(self->keymap, self->keymap_keys_changed_cb_id);
711 self->keymap_keys_changed_cb_id = 0;
712 }
713 g_clear_object(&self->mouse_cursor_plugin);
714 g_clear_object(&self->platform_plugin);
715
716 G_OBJECT_CLASS(fl_view_parent_class)->dispose(object);
717 }

References fl_engine_set_on_pre_engine_restart_handler(), fl_engine_set_update_semantics_node_handler(), and self.

Referenced by fl_view_class_init().

## ◆ fl_view_get_engine()

G_MODULE_EXPORT FlEngine* fl_view_get_engine | ( | FlView * | view | ) |

fl_view_get_engine: @view: an #FlView.

Gets the engine being rendered in the view.

Returns: an #FlEngine.

Definition at line 770 of file fl_view.cc.

770 {
771 g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
772 return self->engine;
773 }

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

## ◆ fl_view_get_keyboard_state()

GHashTable* fl_view_get_keyboard_state | ( | FlView * | view | ) |

fl_view_get_keyboard_state: @view: an #FlView.

Returns the keyboard pressed state. The hash table contains one entry per pressed keys, mapping from the logical key to the physical key.*

Definition at line 790 of file fl_view.cc.

790 {
791 g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
792
793 return fl_keyboard_manager_get_pressed_state(self->keyboard_manager);
794 }

References fl_keyboard_manager_get_pressed_state(), and self.

Referenced by fl_view_keyboard_delegate_iface_init().

## ◆ fl_view_get_property()

static void fl_view_get_property | ( | GObject * | object,
|  | guint | prop_id,
|  | GValue * | value,
|  | GParamSpec * | pspec
| ) |  |
| static

Definition at line 660 of file fl_view.cc.

663 {
664 FlView* self = FL_VIEW(object);
665
666 switch (prop_id) {
667 case kPropFlutterProject:
668 g_value_set_object(value, self->project);
669 break;
670 default:
671 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
672 break;
673 }
674 }

References kPropFlutterProject, self, and value.

Referenced by fl_view_class_init().

## ◆ fl_view_get_registrar_for_plugin()

static FlPluginRegistrar* fl_view_get_registrar_for_plugin | ( | FlPluginRegistry * | registry,
|  | const gchar * | name
| ) |  |
| static

Definition at line 253 of file fl_view.cc.

255 {
256 FlView* self = FL_VIEW(registry);
257
258 return fl_plugin_registrar_new(self,
259 fl_engine_get_binary_messenger(self->engine),
260 fl_engine_get_texture_registrar(self->engine));
261 }

References fl_engine_get_binary_messenger(), fl_engine_get_texture_registrar(), fl_plugin_registrar_new(), and self.

Referenced by fl_view_plugin_registry_iface_init().

## ◆ fl_view_init()

static void fl_view_init | ( | FlView * | self | ) |
| static

Definition at line 761 of file fl_view.cc.

761 {
762 gtk_widget_set_can_focus(GTK_WIDGET(self), TRUE);
763 }

References TRUE.

## ◆ fl_view_key_press_event()

static gboolean fl_view_key_press_event | ( | GtkWidget * | widget,
|  | GdkEventKey * | event
| ) |  |
| static

Definition at line 720 of file fl_view.cc.

720 {
721 FlView* self = FL_VIEW(widget);
722
723 return fl_keyboard_manager_handle_event(
724 self->keyboard_manager, fl_key_event_new_from_gdk_event(gdk_event_copy(
725 reinterpret_cast<GdkEvent*>(event))));
726 }

References event, fl_key_event_new_from_gdk_event(), fl_keyboard_manager_handle_event(), and self.

Referenced by fl_view_class_init().

## ◆ fl_view_key_release_event()

static gboolean fl_view_key_release_event | ( | GtkWidget * | widget,
|  | GdkEventKey * | event
| ) |  |
| static

Definition at line 729 of file fl_view.cc.

730 {
731 FlView* self = FL_VIEW(widget);
732 return fl_keyboard_manager_handle_event(
733 self->keyboard_manager, fl_key_event_new_from_gdk_event(gdk_event_copy(
734 reinterpret_cast<GdkEvent*>(event))));
735 }

References event, fl_key_event_new_from_gdk_event(), fl_keyboard_manager_handle_event(), and self.

Referenced by fl_view_class_init().

## ◆ fl_view_keyboard_delegate_iface_init()

static void fl_view_keyboard_delegate_iface_init | ( | FlKeyboardViewDelegateInterface * | iface | ) |
| static

Definition at line 268 of file fl_view.cc.

269 {
270 iface->send_key_event =
271 [](FlKeyboardViewDelegate* view_delegate, const FlutterKeyEvent* event,
272 FlutterKeyEventCallback callback, void* user_data) {
273 FlView* self = FL_VIEW(view_delegate);
274 if (self->engine != nullptr) {
275 fl_engine_send_key_event(self->engine, event, callback, user_data);
276 };
277 };
278
279 iface->text_filter_key_press = [](FlKeyboardViewDelegate* view_delegate,
280 FlKeyEvent* event) {
281 FlView* self = FL_VIEW(view_delegate);
282 return fl_text_input_plugin_filter_keypress(self->text_input_plugin, event);
283 };
284
285 iface->get_messenger = [](FlKeyboardViewDelegate* view_delegate) {
286 FlView* self = FL_VIEW(view_delegate);
287 return fl_engine_get_binary_messenger(self->engine);
288 };
289
290 iface->redispatch_event = [](FlKeyboardViewDelegate* view_delegate,
291 std::unique_ptr<FlKeyEvent> in_event) {
292 FlKeyEvent* event = in_event.release();
293 GdkEvent* gdk_event = reinterpret_cast<GdkEvent*>(event->origin);
294 GdkEventType event_type = gdk_event_get_event_type(gdk_event);
295 g_return_if_fail(event_type == GDK_KEY_PRESS ||
296 event_type == GDK_KEY_RELEASE);
297 gdk_event_put(gdk_event);
298 fl_key_event_dispose(event);
299 };
300
301 iface->subscribe_to_layout_change = [](FlKeyboardViewDelegate* view_delegate,
302 KeyboardLayoutNotifier notifier) {
303 FlView* self = FL_VIEW(view_delegate);
304 self->keyboard_layout_notifier = std::move(notifier);
305 };
306
307 iface->lookup_key = [](FlKeyboardViewDelegate* view_delegate,
308 const GdkKeymapKey* key) -> guint {
309 FlView* self = FL_VIEW(view_delegate);
310 g_return_val_if_fail(self->keymap != nullptr, 0);
311 return gdk_keymap_lookup_key(self->keymap, key);
312 };
313
314 iface->get_keyboard_state =
315 [](FlKeyboardViewDelegate* view_delegate) -> GHashTable* {
316 FlView* self = FL_VIEW(view_delegate);
317 return fl_view_get_keyboard_state(self);
318 };
319 }

References callback, event, fl_engine_get_binary_messenger(), fl_engine_send_key_event(), fl_key_event_dispose(), fl_text_input_plugin_filter_keypress(), fl_view_get_keyboard_state(), self, and user_data.

## ◆ fl_view_new()

G_MODULE_EXPORT FlView* fl_view_new | ( | FlDartProject * | project | ) |

FlView:

#FlView is a GTK widget that is capable of displaying a Flutter application.

The following example shows how to set up a view in a GTK application: |[ FlDartProject *project = fl_dart_project_new (); FlView *view = fl_view_new (project); gtk_widget_show (GTK_WIDGET (view)); gtk_container_add (GTK_CONTAINER (parent), view);

FlBinaryMessenger *messenger = fl_engine_get_binary_messenger (fl_view_get_engine (view)); setup_channels_or_plugins (messenger); ]| fl_view_new: @project: The project to show.

Creates a widget to show Flutter application.

Returns: a new #FlView.

Definition at line 765 of file fl_view.cc.

765 {
766 return static_cast<FlView*>(
767 g_object_new(fl_view_get_type(), "flutter-project", project, nullptr));
768 }

Referenced by TEST().

## ◆ fl_view_notify()

static void fl_view_notify | ( | GObject * | object,
|  | GParamSpec * | pspec
| ) |  |
| static

Definition at line 676 of file fl_view.cc.

676 {
677 FlView* self = FL_VIEW(object);
678
679 if (strcmp(pspec->name, "scale-factor") == 0) {
680 handle_geometry_changed(self);
681 }
682
683 if (G_OBJECT_CLASS(fl_view_parent_class)->notify != nullptr) {
684 G_OBJECT_CLASS(fl_view_parent_class)->notify(object, pspec);
685 }
686 }

References handle_geometry_changed().

Referenced by fl_view_class_init().

## ◆ fl_view_plugin_registry_iface_init()

static void fl_view_plugin_registry_iface_init | ( | FlPluginRegistryInterface * | iface | ) |
| static

Definition at line 263 of file fl_view.cc.

264 {
265 iface->get_registrar_for_plugin = fl_view_get_registrar_for_plugin;
266 }

References fl_view_get_registrar_for_plugin().

## ◆ fl_view_scrolling_delegate_iface_init()

static void fl_view_scrolling_delegate_iface_init | ( | FlScrollingViewDelegateInterface * | iface | ) |
| static

Definition at line 321 of file fl_view.cc.

322 {
323 iface->send_mouse_pointer_event =
324 [](FlScrollingViewDelegate* view_delegate, FlutterPointerPhase phase,
325 size_t timestamp, double x, double y, double scroll_delta_x,
326 double scroll_delta_y, int64_t buttons) {
327 FlView* self = FL_VIEW(view_delegate);
328 if (self->engine != nullptr) {
329 fl_engine_send_mouse_pointer_event(self->engine, phase, timestamp, x,
330 y, scroll_delta_x, scroll_delta_y,
331 buttons);
332 }
333 };
334 iface->send_pointer_pan_zoom_event =
335 [](FlScrollingViewDelegate* view_delegate, size_t timestamp, double x,
336 double y, FlutterPointerPhase phase, double pan_x, double pan_y,
337 double scale, double rotation) {
338 FlView* self = FL_VIEW(view_delegate);
339 if (self->engine != nullptr) {
340 fl_engine_send_pointer_pan_zoom_event(self->engine, timestamp, x, y,
341 phase, pan_x, pan_y, scale,
342 rotation);
343 };
344 };
345 }

References fl_engine_send_mouse_pointer_event(), fl_engine_send_pointer_pan_zoom_event(), and self.

## ◆ fl_view_set_property()

static void fl_view_set_property | ( | GObject * | object,
|  | guint | prop_id,
|  | const GValue * | value,
|  | GParamSpec * | pspec
| ) |  |
| static

Definition at line 643 of file fl_view.cc.

646 {
647 FlView* self = FL_VIEW(object);
648
649 switch (prop_id) {
650 case kPropFlutterProject:
651 g_set_object(&self->project,
652 static_cast<FlDartProject*>(g_value_get_object(value)));
653 break;
654 default:
655 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
656 break;
657 }
658 }

References kPropFlutterProject, self, and value.

Referenced by fl_view_class_init().

## ◆ fl_view_set_textures()

void fl_view_set_textures | ( | FlView * | view,
|  | GdkGLContext * | context,
|  | GPtrArray * | textures
| ) |  |

fl_view_set_textures: @view: an #FlView. @context: a #GdkGLContext, for #FlGLArea to render. @textures: (transfer none) (element-type FlBackingStoreProvider): a list of #FlBackingStoreProvider.

Set the textures for this view to render.

Definition at line 775 of file fl_view.cc.

777 {
778 g_return_if_fail(FL_IS_VIEW(self));
779
780 if (self->gl_area == nullptr) {
781 self->gl_area = FL_GL_AREA(fl_gl_area_new(context));
782 gtk_widget_show(GTK_WIDGET(self->gl_area));
783 gtk_container_add(GTK_CONTAINER(self->event_box),
784 GTK_WIDGET(self->gl_area));
785 }
786
787 fl_gl_area_queue_render(self->gl_area, textures);
788 }

References fl_gl_area_new(), fl_gl_area_queue_render(), and self.

Referenced by fl_renderer_gl_present_layers().

## ◆ fl_view_text_input_delegate_iface_init()

static void fl_view_text_input_delegate_iface_init | ( | FlTextInputViewDelegateInterface * | iface | ) |
| static

Definition at line 347 of file fl_view.cc.

348 {
349 iface->translate_coordinates = [](FlTextInputViewDelegate* delegate,
350 gint view_x, gint view_y, gint* window_x,
351 gint* window_y) {
352 FlView* self = FL_VIEW(delegate);
353 gtk_widget_translate_coordinates(GTK_WIDGET(self),
354 gtk_widget_get_toplevel(GTK_WIDGET(self)),
355 view_x, view_y, window_x, window_y);
356 };
357 }

## ◆ 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) G_IMPLEMENT_INTERFACE(fl_keyboard_view_delegate_get_type(), fl_view_keyboard_delegate_iface_init) G_IMPLEMENT_INTERFACE(fl_scrolling_view_delegate_get_type(), fl_view_scrolling_delegate_iface_init) G_IMPLEMENT_INTERFACE(fl_text_input_view_delegate_get_type(), fl_view_text_input_delegate_iface_init) |
| ) |  |

## ◆ gesture_rotation_begin_cb()

static void gesture_rotation_begin_cb | ( | GtkGestureRotate * | gesture,
|  | GdkEventSequence * | sequence,
|  | FlView * | self
| ) |  |
| static

Definition at line 484 of file fl_view.cc.

486 {
487 fl_scrolling_manager_handle_rotation_begin(self->scrolling_manager);
488 }

References fl_scrolling_manager_handle_rotation_begin(), and self.

Referenced by fl_view_constructed().

## ◆ gesture_rotation_end_cb()

static void gesture_rotation_end_cb | ( | GtkGestureRotate * | gesture,
|  | GdkEventSequence * | sequence,
|  | FlView * | self
| ) |  |
| static

Definition at line 498 of file fl_view.cc.

500 {
501 fl_scrolling_manager_handle_rotation_end(self->scrolling_manager);
502 }

References fl_scrolling_manager_handle_rotation_end(), and self.

Referenced by fl_view_constructed().

## ◆ gesture_rotation_update_cb()

static void gesture_rotation_update_cb | ( | GtkGestureRotate * | widget,
|  | gdouble | rotation,
|  | gdouble | delta,
|  | FlView * | self
| ) |  |
| static

Definition at line 490 of file fl_view.cc.

493 {
494 fl_scrolling_manager_handle_rotation_update(self->scrolling_manager,
495 rotation);
496 }

References fl_scrolling_manager_handle_rotation_update(), and self.

Referenced by fl_view_constructed().

## ◆ gesture_zoom_begin_cb()

static void gesture_zoom_begin_cb | ( | GtkGestureZoom * | gesture,
|  | GdkEventSequence * | sequence,
|  | FlView * | self
| ) |  |
| static

Definition at line 504 of file fl_view.cc.

506 {
507 fl_scrolling_manager_handle_zoom_begin(self->scrolling_manager);
508 }

References fl_scrolling_manager_handle_zoom_begin(), and self.

Referenced by fl_view_constructed().

## ◆ gesture_zoom_end_cb()

static void gesture_zoom_end_cb | ( | GtkGestureZoom * | gesture,
|  | GdkEventSequence * | sequence,
|  | FlView * | self
| ) |  |
| static

Definition at line 516 of file fl_view.cc.

518 {
519 fl_scrolling_manager_handle_zoom_end(self->scrolling_manager);
520 }

References fl_scrolling_manager_handle_zoom_end(), and self.

Referenced by fl_view_constructed().

## ◆ gesture_zoom_update_cb()

static void gesture_zoom_update_cb | ( | GtkGestureZoom * | widget,
|  | gdouble | scale,
|  | FlView * | self
| ) |  |
| static

Definition at line 510 of file fl_view.cc.

512 {
513 fl_scrolling_manager_handle_zoom_update(self->scrolling_manager, scale);
514 }

References fl_scrolling_manager_handle_zoom_update(), and self.

Referenced by fl_view_constructed().

## ◆ handle_geometry_changed()

static void handle_geometry_changed | ( | FlView * | self | ) |
| static

Definition at line 206 of file fl_view.cc.

206 {
207 GtkAllocation allocation;
208 gtk_widget_get_allocation(GTK_WIDGET(self), &allocation);
209 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
210 fl_engine_send_window_metrics_event(
211 self->engine, allocation.width * scale_factor,
212 allocation.height * scale_factor, scale_factor);
213
214 // Make sure the view has been realized and its size has been allocated before
215 // waiting for a frame. `fl_view_realize()` and `fl_view_size_allocate()` may
216 // be called in either order depending on the order in which the window is
217 // shown and the view is added to a container in the app runner.
218 //
219 // Note: `gtk_widget_init()` initializes the size allocation to 1x1.
220 if (allocation.width > 1 && allocation.height > 1 &&
221 gtk_widget_get_realized(GTK_WIDGET(self))) {
222 fl_renderer_wait_for_frame(self->renderer, allocation.width * scale_factor,
223 allocation.height * scale_factor);
224 }
225 }

References fl_engine_send_window_metrics_event(), fl_renderer_wait_for_frame(), and self.

Referenced by configure_cb(), fl_view_notify(), and realize_cb().

## ◆ init_keyboard()

static void init_keyboard | ( | FlView * | self | ) |
| static

Definition at line 107 of file fl_view.cc.

107 {
108 FlBinaryMessenger* messenger = fl_engine_get_binary_messenger(self->engine);
109
110 GdkWindow* window =
111 gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(self)));
112 g_return_if_fail(GDK_IS_WINDOW(window));
113 g_autoptr(GtkIMContext) im_context = gtk_im_multicontext_new();
114 gtk_im_context_set_client_window(im_context, window);
115
116 self->text_input_plugin = fl_text_input_plugin_new(
117 messenger, im_context, FL_TEXT_INPUT_VIEW_DELEGATE(self));
118 self->keyboard_manager =
119 fl_keyboard_manager_new(messenger, FL_KEYBOARD_VIEW_DELEGATE(self));
120 }

References fl_engine_get_binary_messenger(), fl_keyboard_manager_new(), fl_text_input_plugin_new(), and self.

Referenced by on_pre_engine_restart_cb(), and realize_cb().

## ◆ init_scrolling()

static void init_scrolling | ( | FlView * | self | ) |
| static

Definition at line 122 of file fl_view.cc.

122 {
123 self->scrolling_manager =
124 fl_scrolling_manager_new(FL_SCROLLING_VIEW_DELEGATE(self));
125 }

References fl_scrolling_manager_new().

Referenced by fl_view_constructed(), and on_pre_engine_restart_cb().

## ◆ keymap_keys_changed_cb()

static void keymap_keys_changed_cb | ( | GdkKeymap * | keymapf,
|  | FlView * | self
| ) |  |
| static

Definition at line 476 of file fl_view.cc.

476 {
477 if (self->keyboard_layout_notifier == nullptr) {
478 return;
479 }
480
481 self->keyboard_layout_notifier();
482 }

References self.

Referenced by fl_view_constructed().

## ◆ leave_notify_event_cb()

static gboolean leave_notify_event_cb | ( | GtkWidget * | widget,
|  | GdkEventCrossing * | crossing_event,
|  | FlView * | self
| ) |  |
| static

Definition at line 444 of file fl_view.cc.

446 {
447 GdkEvent* event = reinterpret_cast<GdkEvent*>(crossing_event);
448
449 guint event_time = gdk_event_get_time(event);
450 gdouble event_x = 0.0, event_y = 0.0;
451 gdk_event_get_coords(event, &event_x, &event_y);
452
453 if (crossing_event->mode != GDK_CROSSING_NORMAL) {
454 return FALSE;
455 }
456
457 if (self->engine == nullptr) {
458 return FALSE;
459 }
460
461 // Don't remove pointer while button is down; In case of dragging outside of
462 // window with mouse grab active Gtk will send another leave notify on
463 // release.
464 if (self->pointer_inside && self->button_state == 0) {
465 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
466 fl_engine_send_mouse_pointer_event(
467 self->engine, kRemove, event_time * kMicrosecondsPerMillisecond,
468 event_x * scale_factor, event_y * scale_factor, 0, 0,
469 self->button_state);
470 self->pointer_inside = FALSE;
471 }
472
473 return TRUE;
474 }

References event, fl_engine_send_mouse_pointer_event(), kMicrosecondsPerMillisecond, self, and TRUE.

Referenced by fl_view_constructed().

## ◆ motion_notify_event_cb()

static gboolean motion_notify_event_cb | ( | GtkWidget * | widget,
|  | GdkEventMotion * | motion_event,
|  | FlView * | self
| ) |  |
| static

Definition at line 399 of file fl_view.cc.

401 {
402 GdkEvent* event = reinterpret_cast<GdkEvent*>(motion_event);
403
404 if (self->engine == nullptr) {
405 return FALSE;
406 }
407
408 guint event_time = gdk_event_get_time(event);
409 GdkModifierType event_state = static_cast<GdkModifierType>(0);
410 gdk_event_get_state(event, &event_state);
411 gdouble event_x = 0.0, event_y = 0.0;
412 gdk_event_get_coords(event, &event_x, &event_y);
413
414 check_pointer_inside(self, event);
415
416 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
417
418 fl_keyboard_manager_sync_modifier_if_needed(self->keyboard_manager,
419 event_state, event_time);
420 fl_engine_send_mouse_pointer_event(
421 self->engine, self->button_state != 0 ? kMove : kHover,
422 event_time * kMicrosecondsPerMillisecond, event_x * scale_factor,
423 event_y * scale_factor, 0, 0, self->button_state);
424
425 return TRUE;
426 }

References check_pointer_inside(), event, fl_engine_send_mouse_pointer_event(), fl_keyboard_manager_sync_modifier_if_needed(), kMicrosecondsPerMillisecond, self, and TRUE.

Referenced by fl_view_constructed().

## ◆ on_pre_engine_restart_cb()

static void on_pre_engine_restart_cb | ( | FlEngine * | engine,
|  | gpointer | user_data
| ) |  |
| static

Definition at line 242 of file fl_view.cc.

242 {
243 FlView* self = FL_VIEW(user_data);
244
245 g_clear_object(&self->keyboard_manager);
246 g_clear_object(&self->text_input_plugin);
247 g_clear_object(&self->scrolling_manager);
248 init_keyboard(self);
249 init_scrolling(self);
250 }

References init_keyboard(), init_scrolling(), self, and user_data.

Referenced by fl_view_constructed().

## ◆ realize_cb()

static void realize_cb | ( | GtkWidget * | widget | ) |
| static

Definition at line 546 of file fl_view.cc.

546 {
547 FlView* self = FL_VIEW(widget);
548 g_autoptr(GError) error = nullptr;
549
550 // Handle requests by the user to close the application.
551 GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
552
553 // Listen to window state changes.
554 self->window_state_cb_id =
555 g_signal_connect(toplevel_window, "window-state-event",
556 G_CALLBACK(window_state_event_cb), self);
557 self->window_state =
558 gdk_window_get_state(gtk_widget_get_window(toplevel_window));
559
560 g_signal_connect(toplevel_window, "delete-event",
561 G_CALLBACK(window_delete_event_cb), self);
562
563 init_keyboard(self);
564
565 if (!fl_renderer_start(self->renderer, self, &error)) {
566 g_warning("Failed to start Flutter renderer: %s", error->message);
567 return;
568 }
569
570 if (!fl_engine_start(self->engine, &error)) {
571 g_warning("Failed to start Flutter engine: %s", error->message);
572 return;
573 }
574
575 handle_geometry_changed(self);
576 }

References error, fl_engine_start(), fl_renderer_start(), handle_geometry_changed(), init_keyboard(), self, and window_state_event_cb().

Referenced by fl_view_constructed().

## ◆ scroll_event_cb()

static gboolean scroll_event_cb | ( | GtkWidget * | widget,
|  | GdkEventScroll * | event,
|  | FlView * | self
| ) |  |
| static

Definition at line 386 of file fl_view.cc.

388 {
389 // TODO(robert-ancell): Update to use GtkEventControllerScroll when we can
390 // depend on GTK 3.24.
391
392 fl_scrolling_manager_handle_scroll_event(
393 self->scrolling_manager, event,
394 gtk_widget_get_scale_factor(GTK_WIDGET(self)));
395 return TRUE;
396 }

References event, fl_scrolling_manager_handle_scroll_event(), self, and TRUE.

Referenced by fl_view_constructed().

## ◆ send_pointer_button_event()

static gboolean send_pointer_button_event | ( | FlView * | self,
|  | GdkEvent * | event
| ) |  |
| static

Definition at line 128 of file fl_view.cc.

128 {
129 guint event_time = gdk_event_get_time(event);
130 GdkEventType event_type = gdk_event_get_event_type(event);
131 GdkModifierType event_state = static_cast<GdkModifierType>(0);
132 gdk_event_get_state(event, &event_state);
133 guint event_button = 0;
134 gdk_event_get_button(event, &event_button);
135 gdouble event_x = 0.0, event_y = 0.0;
136 gdk_event_get_coords(event, &event_x, &event_y);
137
138 int64_t button;
139 switch (event_button) {
140 case 1:
141 button = kFlutterPointerButtonMousePrimary;
142 break;
143 case 2:
144 button = kFlutterPointerButtonMouseMiddle;
145 break;
146 case 3:
147 button = kFlutterPointerButtonMouseSecondary;
148 break;
149 default:
150 return FALSE;
151 }
152 int old_button_state = self->button_state;
153 FlutterPointerPhase phase = kMove;
154 if (event_type == GDK_BUTTON_PRESS) {
155 // Drop the event if Flutter already thinks the button is down.
156 if ((self->button_state & button) != 0) {
157 return FALSE;
158 }
159 self->button_state ^= button;
160
161 phase = old_button_state == 0 ? kDown : kMove;
162 } else if (event_type == GDK_BUTTON_RELEASE) {
163 // Drop the event if Flutter already thinks the button is up.
164 if ((self->button_state & button) == 0) {
165 return FALSE;
166 }
167 self->button_state ^= button;
168
169 phase = self->button_state == 0 ? kUp : kMove;
170 }
171
172 if (self->engine == nullptr) {
173 return FALSE;
174 }
175
176 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
177 fl_scrolling_manager_set_last_mouse_position(
178 self->scrolling_manager, event_x * scale_factor, event_y * scale_factor);
179 fl_keyboard_manager_sync_modifier_if_needed(self->keyboard_manager,
180 event_state, event_time);
181 fl_engine_send_mouse_pointer_event(
182 self->engine, phase, event_time * kMicrosecondsPerMillisecond,
183 event_x * scale_factor, event_y * scale_factor, 0, 0, self->button_state);
184
185 return TRUE;
186 }

References event, fl_engine_send_mouse_pointer_event(), fl_keyboard_manager_sync_modifier_if_needed(), fl_scrolling_manager_set_last_mouse_position(), kMicrosecondsPerMillisecond, self, and TRUE.

Referenced by button_press_event_cb(), and button_release_event_cb().

## ◆ update_semantics_node_cb()

static void update_semantics_node_cb | ( | FlEngine * | engine,
|  | const FlutterSemanticsNode * | node,
|  | gpointer | user_data
| ) |  |
| static

Definition at line 228 of file fl_view.cc.

230 {
231 FlView* self = FL_VIEW(user_data);
232
233 fl_accessibility_plugin_handle_update_semantics_node(
234 self->accessibility_plugin, node);
235 }

References fl_accessibility_plugin_handle_update_semantics_node(), node, self, and user_data.

Referenced by fl_view_constructed().

## ◆ window_state_event_cb()

static gboolean window_state_event_cb | ( | GtkWidget * | widget,
|  | GdkEvent * | event,
|  | gpointer | user_data
| ) |  |
| static

Definition at line 522 of file fl_view.cc.

524 {
525 g_return_val_if_fail(FL_IS_VIEW(user_data), FALSE);
526 g_return_val_if_fail(FL_IS_ENGINE(FL_VIEW(user_data)->engine), FALSE);
527 FlView* self = FL_VIEW(user_data);
528 GdkWindowState state = event->window_state.new_window_state;
529 GdkWindowState previous_state = self->window_state;
530 self->window_state = state;
531 bool was_visible = !((previous_state & GDK_WINDOW_STATE_WITHDRAWN) ||
532 (previous_state & GDK_WINDOW_STATE_ICONIFIED));
533 bool is_visible = !((state & GDK_WINDOW_STATE_WITHDRAWN) ||
534 (state & GDK_WINDOW_STATE_ICONIFIED));
535 bool was_focused = (previous_state & GDK_WINDOW_STATE_FOCUSED);
536 bool is_focused = (state & GDK_WINDOW_STATE_FOCUSED);
537 if (was_visible != is_visible || was_focused != is_focused) {
538 if (self->engine != nullptr) {
539 fl_engine_send_window_state_event(FL_ENGINE(self->engine), is_visible,
540 is_focused);
541 }
542 }
543 return FALSE;
544 }

References engine, fl_engine_send_window_state_event(), self, state, and user_data.

Referenced by realize_cb().

## Variable Documentation

## ◆ event

GdkEvent* event

Definition at line 99 of file fl_view.cc.

Referenced by button_press_event_cb(), button_release_event_cb(), check_pointer_inside(), enter_notify_event_cb(), fl_view_key_press_event(), fl_view_key_release_event(), fl_view_keyboard_delegate_iface_init(), leave_notify_event_cb(), motion_notify_event_cb(), scroll_event_cb(), and send_pointer_button_event().

## ◆ kMicrosecondsPerMillisecond

constexpr int kMicrosecondsPerMillisecond = 1000
| static constexpr

Definition at line 28 of file fl_view.cc.

Referenced by check_pointer_inside(), leave_notify_event_cb(), motion_notify_event_cb(), and send_pointer_button_event().

## ◆ self

GdkEvent FlView* self

Initial value:
{
fl_platform_plugin_request_app_exit(self->platform_plugin)

Definition at line 100 of file fl_view.cc.

Referenced by activate_system_cursor(), channel_closed_cb(), check_pointer_inside(), commit_updates(), create_pango_layout(), engine_weak_notify_cb(), enter_notify_event_cb(), fl_accessibility_plugin_dispose(), fl_accessibility_plugin_handle_update_semantics_node(), fl_accessibility_plugin_new(), fl_accessible_node_delete_text(), fl_accessible_text_field_add_selection(), fl_accessible_text_field_dispose(), fl_accessible_text_field_get_character_count(), fl_accessible_text_field_get_n_selections(), fl_accessible_text_field_get_selection(), fl_accessible_text_field_init(), fl_accessible_text_field_insert_text(), fl_accessible_text_field_remove_selection(), fl_accessible_text_field_set_text_selection(), fl_accessible_text_field_set_value(), fl_backing_store_provider_dispose(), fl_basic_message_channel_dispose(), fl_basic_message_channel_new(), fl_basic_message_channel_respond(), fl_basic_message_channel_send(), fl_basic_message_channel_send_finish(), fl_basic_message_channel_set_message_handler(), fl_binary_messenger_impl_dispose(), fl_binary_messenger_new(), fl_binary_messenger_platform_message_cb(), fl_binary_messenger_response_handle_impl_dispose(), fl_dart_project_dispose(), fl_dart_project_set_aot_library_path(), fl_dart_project_set_assets_path(), fl_dart_project_set_dart_entrypoint_arguments(), fl_dart_project_set_icu_data_path(), fl_engine_dispatch_semantics_action(), fl_engine_dispose(), fl_engine_execute_task(), fl_engine_get_registrar_for_plugin(), 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_proc_resolver(), fl_engine_init(), fl_engine_mark_texture_frame_available(), fl_engine_on_pre_engine_restart_cb(), fl_engine_platform_message_cb(), fl_engine_post_task(), fl_engine_register_external_texture(), fl_engine_send_key_event(), fl_engine_send_mouse_pointer_event(), fl_engine_send_platform_message(), fl_engine_send_platform_message_response(), fl_engine_send_pointer_pan_zoom_event(), fl_engine_send_window_metrics_event(), fl_engine_set_on_pre_engine_restart_handler(), fl_engine_set_platform_message_handler(), fl_engine_set_property(), fl_engine_set_update_semantics_node_handler(), fl_engine_start(), fl_engine_unregister_external_texture(), fl_engine_update_accessibility_features(), fl_engine_update_semantics_node_cb(), fl_event_channel_dispose(), fl_event_channel_new(), fl_event_channel_send(), fl_event_channel_send_end_of_stream(), fl_event_channel_send_error(), fl_gl_area_dispose(), fl_gl_area_draw(), fl_gl_area_queue_render(), fl_gl_area_unrealize(), fl_gnome_settings_dispose(), fl_gnome_settings_get_color_scheme(), fl_gnome_settings_get_text_scaling_factor(), fl_json_method_codec_decode_method_call(), fl_json_method_codec_decode_response(), fl_json_method_codec_encode_error_envelope(), fl_json_method_codec_encode_method_call(), fl_json_method_codec_encode_success_envelope(), fl_key_channel_responder_dispose(), fl_key_channel_responder_handle_event(), fl_key_channel_user_data_dispose(), fl_key_channel_user_data_new(), fl_key_embedder_call_record_dispose(), fl_key_embedder_responder_dispose(), fl_key_embedder_responder_handle_event(), fl_key_embedder_responder_handle_event_impl(), fl_key_embedder_responder_new(), fl_keyboard_manager_dispose(), fl_keyboard_manager_get_pressed_state(), fl_keyboard_manager_handle_event(), fl_keyboard_manager_new(), fl_keyboard_manager_remove_redispatched(), fl_keyboard_manager_sync_modifier_if_needed(), fl_keyboard_manager_user_data_new(), fl_keyboard_pending_event_dispose(), fl_keyboard_pending_event_new(), fl_method_call_dispose(), fl_method_call_respond(), fl_method_call_respond_error(), fl_method_call_respond_not_implemented(), fl_method_call_respond_success(), fl_method_channel_dispose(), fl_method_channel_invoke_method(), fl_method_channel_invoke_method_finish(), fl_method_channel_new(), fl_method_channel_respond(), fl_method_channel_set_method_call_handler(), fl_method_error_response_dispose(), fl_method_success_response_dispose(), fl_mouse_cursor_plugin_dispose(), fl_mouse_cursor_plugin_new(), fl_platform_plugin_dispose(), fl_platform_plugin_new(), fl_plugin_registrar_impl_dispose(), fl_plugin_registrar_new(), 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(), fl_scrolling_manager_new(), fl_settings_plugin_dispose(), fl_settings_plugin_new(), fl_settings_portal_dispose(), fl_settings_portal_start(), fl_standard_method_codec_decode_method_call(), fl_standard_method_codec_decode_response(), fl_standard_method_codec_encode_error_envelope(), fl_standard_method_codec_encode_method_call(), fl_standard_method_codec_encode_success_envelope(), fl_task_runner_block_main_thread(), fl_task_runner_dispose(), fl_task_runner_init(), fl_task_runner_on_expired_timeout(), fl_task_runner_post_task(), fl_task_runner_process_expired_tasks_locked(), fl_task_runner_release_main_thread(), fl_task_runner_tasks_did_change_locked(), fl_texture_registrar_impl_dispose(), fl_texture_registrar_impl_init(), fl_value_append(), fl_value_append_take(), fl_value_get_bool(), fl_value_get_float(), fl_value_get_float32_list(), fl_value_get_float_list(), fl_value_get_int(), fl_value_get_int32_list(), fl_value_get_int64_list(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_uint8_list(), fl_value_lookup(), fl_value_lookup_index(), fl_value_new_float32_list(), fl_value_new_float_list(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_uint8_list(), fl_value_set(), fl_value_set_string(), fl_value_set_string_take(), fl_value_set_take(), fl_value_unref(), fl_view_accessible_dispose(), fl_view_accessible_handle_update_semantics_node(), fl_view_constructed(), fl_view_dispose(), fl_view_get_keyboard_state(), fl_view_get_property(), fl_view_get_registrar_for_plugin(), fl_view_key_press_event(), fl_view_key_release_event(), fl_view_keyboard_delegate_iface_init(), fl_view_scrolling_delegate_iface_init(), fl_view_set_property(), fl_view_set_textures(), G_DEFINE_TYPE(), G_DEFINE_TYPE_WITH_CODE(), gesture_rotation_begin_cb(), gesture_rotation_end_cb(), gesture_rotation_update_cb(), gesture_zoom_begin_cb(), gesture_zoom_end_cb(), gesture_zoom_update_cb(), get_engine(), get_keyboard_state(), get_node(), get_pango_context(), guarantee_layout(), handle_geometry_changed(), handle_method_call(), handle_response(), init_keyboard(), keymap_keys_changed_cb(), leave_notify_event_cb(), lookup_node(), lookup_texture(), mark_texture_frame_available(), message_cb(), motion_notify_event_cb(), on_pre_engine_restart_cb(), platform_message_handler_free(), possibly_update_lock_bit(), realize_cb(), register_texture(), remove_handlers(), request_app_exit(), request_app_exit_response_cb(), responder_handle_event_callback(), scroll_event_cb(), send_message_cb(), send_on_channel(), send_on_channel_finish(), send_pointer_button_event(), send_ready_cb(), send_response(), set_message_handler_on_channel(), setup_locales(), synchronize_lock_states_loop_body(), synchronize_pressed_states_loop_body(), system_exit_application(), test_method_codec_decode_method_call(), test_method_codec_decode_response(), test_method_codec_dispose(), test_method_codec_encode_method_call(), unregister_texture(), update_caps_lock_state_logic_inferrence(), update_mapping_record(), update_pressing_state(), update_semantics_node_cb(), update_settings(), and window_state_event_cb().

## ◆ TRUE

return TRUE

Definition at line 103 of file fl_view.cc.

Referenced by check_pointer_inside(), enter_notify_event_cb(), fl_view_constructed(), fl_view_init(), leave_notify_event_cb(), motion_notify_event_cb(), scroll_event_cb(), and send_pointer_button_event().

fl_accessibility_plugin_new
FlAccessibilityPlugin * fl_accessibility_plugin_new(FlView *view)
Definition: fl_accessibility_plugin.cc:35
realize_cb
static void realize_cb(GtkWidget *widget)
Definition: fl_view.cc:546
fl_renderer_wait_for_frame
void fl_renderer_wait_for_frame(FlRenderer *self, int target_width, int target_height)
Definition: fl_renderer.cc:140
fl_view_get_property
static void fl_view_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
Definition: fl_view.cc:660
gesture_rotation_begin_cb
static void gesture_rotation_begin_cb(GtkGestureRotate *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:484
fl_scrolling_manager_handle_zoom_end
void fl_scrolling_manager_handle_zoom_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:185
fl_engine_send_key_event
void fl_engine_send_key_event(FlEngine *self, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
Definition: fl_engine.cc:847
fl_key_event_new_from_gdk_event
FlKeyEvent * fl_key_event_new_from_gdk_event(GdkEvent *event)
Definition: fl_key_event.cc:12
kMicrosecondsPerMillisecond
static constexpr int kMicrosecondsPerMillisecond
Definition: fl_view.cc:28
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:67
fl_text_input_plugin_filter_keypress
gboolean fl_text_input_plugin_filter_keypress(FlTextInputPlugin *self, FlKeyEvent *event)
Definition: fl_text_input_plugin.cc:776
gesture_zoom_end_cb
static void gesture_zoom_end_cb(GtkGestureZoom *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:516
init_scrolling
static void init_scrolling(FlView *self)
Definition: fl_view.cc:122
fl_engine_send_mouse_pointer_event
void fl_engine_send_mouse_pointer_event(FlEngine *self, FlutterPointerPhase phase, size_t timestamp, double x, double y, double scroll_delta_x, double scroll_delta_y, int64_t buttons)
Definition: fl_engine.cc:778
fl_view_get_registrar_for_plugin
static FlPluginRegistrar * fl_view_get_registrar_for_plugin(FlPluginRegistry *registry, const gchar *name)
Definition: fl_view.cc:253
configure_cb
static void configure_cb(GtkWidget *widget, GdkEventConfigure event)
Definition: fl_view.cc:578
gesture_rotation_end_cb
static void gesture_rotation_end_cb(GtkGestureRotate *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:498
fl_platform_plugin_request_app_exit
void fl_platform_plugin_request_app_exit(FlPlatformPlugin *self)
Definition: fl_platform_plugin.cc:418
fl_platform_plugin_new
FlPlatformPlugin * fl_platform_plugin_new(FlBinaryMessenger *messenger)
Definition: fl_platform_plugin.cc:402
leave_notify_event_cb
static gboolean leave_notify_event_cb(GtkWidget *widget, GdkEventCrossing *crossing_event, FlView *self)
Definition: fl_view.cc:444
user_data
FlKeyEvent uint64_t FlKeyResponderAsyncCallback gpointer user_data
Definition: fl_key_channel_responder.cc:121
fl_accessibility_plugin_handle_update_semantics_node
void fl_accessibility_plugin_handle_update_semantics_node(FlAccessibilityPlugin *self, const FlutterSemanticsNode *node)
Definition: fl_accessibility_plugin.cc:46
fl_engine_send_window_metrics_event
void fl_engine_send_window_metrics_event(FlEngine *self, size_t width, size_t height, double pixel_ratio)
Definition: fl_engine.cc:760
fl_view_set_property
static void fl_view_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
Definition: fl_view.cc:643
keymap_keys_changed_cb
static void keymap_keys_changed_cb(GdkKeymap *keymapf, FlView *self)
Definition: fl_view.cc:476
fl_engine_get_binary_messenger
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
Definition: fl_engine.cc:902
event
GdkEvent * event
Definition: fl_view.cc:99
_FlKeyEvent
Definition: fl_key_event.h:31
state
AtkStateType state
Definition: fl_accessible_node.cc:10
gesture_zoom_update_cb
static void gesture_zoom_update_cb(GtkGestureZoom *widget, gdouble scale, FlView *self)
Definition: fl_view.cc:510
enter_notify_event_cb
static gboolean enter_notify_event_cb(GtkWidget *widget, GdkEventCrossing *crossing_event, FlView *self)
Definition: fl_view.cc:429
fl_gl_area_new
GtkWidget * fl_gl_area_new(GdkGLContext *context)
Definition: fl_gl_area.cc:121
fl_keyboard_manager_handle_event
gboolean fl_keyboard_manager_handle_event(FlKeyboardManager *self, FlKeyEvent *event)
Definition: fl_keyboard_manager.cc:635
fl_engine_set_update_semantics_node_handler
void fl_engine_set_update_semantics_node_handler(FlEngine *self, FlEngineUpdateSemanticsNodeHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:613
KeyboardLayoutNotifier
std::function< void()> KeyboardLayoutNotifier
Definition: fl_keyboard_view_delegate.h:17
window_state_event_cb
static gboolean window_state_event_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Definition: fl_view.cc:522
kPropLast
@ kPropLast
Definition: fl_view.cc:70
TRUE
return TRUE
Definition: fl_view.cc:103
fl_engine_send_pointer_pan_zoom_event
void fl_engine_send_pointer_pan_zoom_event(FlEngine *self, size_t timestamp, double x, double y, FlutterPointerPhase phase, double pan_x, double pan_y, double scale, double rotation)
Definition: fl_engine.cc:813
fl_scrolling_manager_new
FlScrollingManager * fl_scrolling_manager_new(FlScrollingViewDelegate *view_delegate)
Definition: fl_scrolling_manager.cc:41
fl_view_key_press_event
static gboolean fl_view_key_press_event(GtkWidget *widget, GdkEventKey *event)
Definition: fl_view.cc:720
fl_engine_new
FlEngine * fl_engine_new(FlDartProject *project, FlRenderer *renderer)
Definition: fl_engine.cc:467
fl_view_key_release_event
static gboolean fl_view_key_release_event(GtkWidget *widget, GdkEventKey *event)
Definition: fl_view.cc:729
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:60
fl_view_dispose
static void fl_view_dispose(GObject *object)
Definition: fl_view.cc:688
fl_scrolling_manager_handle_zoom_update
void fl_scrolling_manager_handle_zoom_update(FlScrollingManager *self, gdouble scale)
Definition: fl_scrolling_manager.cc:178
check_pointer_inside
static void check_pointer_inside(FlView *self, GdkEvent *event)
Definition: fl_view.cc:189
fl_view_get_keyboard_state
GHashTable * fl_view_get_keyboard_state(FlView *self)
Definition: fl_view.cc:790
fl_scrolling_manager_handle_rotation_update
void fl_scrolling_manager_handle_rotation_update(FlScrollingManager *self, gdouble rotation)
Definition: fl_scrolling_manager.cc:152
gesture_rotation_update_cb
static void gesture_rotation_update_cb(GtkGestureRotate *widget, gdouble rotation, gdouble delta, FlView *self)
Definition: fl_view.cc:490
fl_keyboard_manager_new
FlKeyboardManager * fl_keyboard_manager_new(FlBinaryMessenger *messenger, FlKeyboardViewDelegate *view_delegate)
Definition: fl_keyboard_manager.cc:585
fl_key_event_dispose
void fl_key_event_dispose(FlKeyEvent *event)
Definition: fl_key_event.cc:39
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:672
self
GdkEvent FlView * self
Definition: fl_view.cc:100
on_pre_engine_restart_cb
static void on_pre_engine_restart_cb(FlEngine *engine, gpointer user_data)
Definition: fl_view.cc:242
fl_renderer_start
gboolean fl_renderer_start(FlRenderer *self, FlView *view, GError **error)
Definition: fl_renderer.cc:59
fl_keyboard_manager_get_pressed_state
GHashTable * fl_keyboard_manager_get_pressed_state(FlKeyboardManager *self)
Definition: fl_keyboard_manager.cc:685
update_semantics_node_cb
static void update_semantics_node_cb(FlEngine *engine, const FlutterSemanticsNode *node, gpointer user_data)
Definition: fl_view.cc:228
fl_gl_area_queue_render
void fl_gl_area_queue_render(FlGLArea *self, GPtrArray *textures)
Definition: fl_gl_area.cc:129
handle_geometry_changed
static void handle_geometry_changed(FlView *self)
Definition: fl_view.cc:206
button_release_event_cb
static gboolean button_release_event_cb(GtkWidget *widget, GdkEventButton *button_event, FlView *self)
Definition: fl_view.cc:378
send_pointer_button_event
static gboolean send_pointer_button_event(FlView *self, GdkEvent *event)
Definition: fl_view.cc:128
fl_view_constructed
static void fl_view_constructed(GObject *object)
Definition: fl_view.cc:583
fl_renderer_gl_new
FlRendererGL * fl_renderer_gl_new()
Definition: fl_renderer_gl.cc:134
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
fl_mouse_cursor_plugin_new
FlMouseCursorPlugin * fl_mouse_cursor_plugin_new(FlBinaryMessenger *messenger, FlView *view)
Definition: fl_mouse_cursor_plugin.cc:163
fl_view_notify
static void fl_view_notify(GObject *object, GParamSpec *pspec)
Definition: fl_view.cc:676
fl_scrolling_manager_handle_rotation_end
void fl_scrolling_manager_handle_rotation_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:159
fl_engine_start
gboolean fl_engine_start(FlEngine *self, GError **error)
Definition: fl_engine.cc:483
fl_scrolling_manager_handle_rotation_begin
void fl_scrolling_manager_handle_rotation_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:141
fl_engine_send_window_state_event
void fl_engine_send_window_state_event(FlEngine *self, gboolean visible, gboolean focused)
Definition: fl_engine.cc:748
fl_plugin_registrar_new
FlPluginRegistrar * fl_plugin_registrar_new(FlView *view, FlBinaryMessenger *messenger, FlTextureRegistrar *texture_registrar)
Definition: fl_plugin_registrar.cc:87
engine
FlEngine * engine
Definition: fl_view_accessible.cc:29
callback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition: fl_key_channel_responder.cc:120
fl_scrolling_manager_handle_zoom_begin
void fl_scrolling_manager_handle_zoom_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:168
value
uint8_t value
Definition: fl_standard_message_codec.cc:41
init_keyboard
static void init_keyboard(FlView *self)
Definition: fl_view.cc:107
fl_engine_get_texture_registrar
G_MODULE_EXPORT FlTextureRegistrar * fl_engine_get_texture_registrar(FlEngine *self)
Definition: fl_engine.cc:918
button_press_event_cb
static gboolean button_press_event_cb(GtkWidget *widget, GdkEventButton *button_event, FlView *self)
Definition: fl_view.cc:360
node
G_BEGIN_DECLS const FlutterSemanticsNode * node
Definition: fl_view_accessible.h:40
fl_text_input_plugin_new
FlTextInputPlugin * fl_text_input_plugin_new(FlBinaryMessenger *messenger, GtkIMContext *im_context, FlTextInputViewDelegate *view_delegate)
Definition: fl_text_input_plugin.cc:745
fl_engine_set_on_pre_engine_restart_handler
void fl_engine_set_on_pre_engine_restart_handler(FlEngine *self, FlEngineOnPreEngineRestartHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:630
scroll_event_cb
static gboolean scroll_event_cb(GtkWidget *widget, GdkEventScroll *event, FlView *self)
Definition: fl_view.cc:386
motion_notify_event_cb
static gboolean motion_notify_event_cb(GtkWidget *widget, GdkEventMotion *motion_event, FlView *self)
Definition: fl_view.cc:399
kPropFlutterProject
@ kPropFlutterProject
Definition: fl_view.cc:70
gesture_zoom_begin_cb
static void gesture_zoom_begin_cb(GtkGestureZoom *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:504