| 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, GdkEventButton *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 *event, FlView *self)
static gboolean | button_release_event_cb (GtkWidget *widget, GdkEventButton *event, FlView *self)
static gboolean | scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, FlView *self)
static gboolean | motion_notify_event_cb (GtkWidget *widget, GdkEventMotion *event, FlView *self)
static gboolean | enter_notify_event_cb (GtkWidget *widget, GdkEventCrossing *event, FlView *self)
static gboolean | leave_notify_event_cb (GtkWidget *widget, GdkEventCrossing *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 * | event,
|  | FlView * | self
| ) |  |
| static

Definition at line 354 of file fl_view.cc.

356 {
357 // Flutter doesn't handle double and triple click events.
358 if (event->type == GDK_DOUBLE_BUTTON_PRESS ||
359 event->type == GDK_TRIPLE_BUTTON_PRESS) {
360 return FALSE;
361 }
362
363 check_pointer_inside(self, reinterpret_cast<GdkEvent*>(event));
364
365 return send_pointer_button_event(self, event);
366 }

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 * | event,
|  | FlView * | self
| ) |  |
| static

Definition at line 369 of file fl_view.cc.

371 {
372 return send_pointer_button_event(self, event);
373 }

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 182 of file fl_view.cc.

182 {
183 if (!self->pointer_inside) {
184 self->pointer_inside = TRUE;
185
186 gdouble x, y;
187 if (gdk_event_get_coords(event, &x, &y)) {
188 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
189
190 fl_engine_send_mouse_pointer_event(
191 self->engine, kAdd,
192 gdk_event_get_time(event) * kMicrosecondsPerMillisecond,
193 x * scale_factor, y * scale_factor, 0, 0, self->button_state);
194 }
195 }
196 }

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 550 of file fl_view.cc.

550 {
551 FlView* self = FL_VIEW(widget);
552 handle_geometry_changed(self);
553 }

References handle_geometry_changed().

Referenced by fl_view_constructed().

## ◆ enter_notify_event_cb()

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

Definition at line 411 of file fl_view.cc.

413 {
414 if (self->engine == nullptr) {
415 return FALSE;
416 }
417
418 check_pointer_inside(self, reinterpret_cast<GdkEvent*>(event));
419
420 return TRUE;
421 }

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 709 of file fl_view.cc.

709 {
710 GObjectClass* object_class = G_OBJECT_CLASS(klass);
711 object_class->constructed = fl_view_constructed;
712 object_class->set_property = fl_view_set_property;
713 object_class->get_property = fl_view_get_property;
714 object_class->notify = fl_view_notify;
715 object_class->dispose = fl_view_dispose;
716
717 GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
718 widget_class->key_press_event = fl_view_key_press_event;
719 widget_class->key_release_event = fl_view_key_release_event;
720
721 g_object_class_install_property(
722 G_OBJECT_CLASS(klass), kPropFlutterProject,
723 g_param_spec_object(
724 "flutter-project", "flutter-project", "Flutter project in use",
725 fl_dart_project_get_type(),
726 static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
727 G_PARAM_STATIC_STRINGS)));
728
729 gtk_widget_class_set_accessible_type(GTK_WIDGET_CLASS(klass),
730 fl_view_accessible_get_type());
731 }

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 555 of file fl_view.cc.

555 {
556 FlView* self = FL_VIEW(object);
557
558 self->renderer = FL_RENDERER(fl_renderer_gl_new());
559 self->engine = fl_engine_new(self->project, self->renderer);
560 fl_engine_set_update_semantics_node_handler(
561 self->engine, update_semantics_node_cb, self, nullptr);
562 fl_engine_set_on_pre_engine_restart_handler(
563 self->engine, on_pre_engine_restart_cb, self, nullptr);
564
565 // Must initialize the keymap before the keyboard.
566 self->keymap = gdk_keymap_get_for_display(gdk_display_get_default());
567
568 // Create system channel handlers.
569 FlBinaryMessenger* messenger = fl_engine_get_binary_messenger(self->engine);
570 self->accessibility_plugin = fl_accessibility_plugin_new(self);
571 init_scrolling(self);
572 self->mouse_cursor_plugin = fl_mouse_cursor_plugin_new(messenger, self);
573 self->platform_plugin = fl_platform_plugin_new(messenger);
574
575 self->event_box = gtk_event_box_new();
576 gtk_widget_set_hexpand(self->event_box, TRUE);
577 gtk_widget_set_vexpand(self->event_box, TRUE);
578 gtk_container_add(GTK_CONTAINER(self), self->event_box);
579 gtk_widget_show(self->event_box);
580 gtk_widget_add_events(self->event_box,
581 GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
582 GDK_BUTTON_RELEASE_MASK | GDK_SCROLL_MASK |
583 GDK_SMOOTH_SCROLL_MASK);
584
585 g_signal_connect(self->event_box, "button-press-event",
586 G_CALLBACK(button_press_event_cb), self);
587 g_signal_connect(self->event_box, "button-release-event",
588 G_CALLBACK(button_release_event_cb), self);
589 g_signal_connect(self->event_box, "scroll-event", G_CALLBACK(scroll_event_cb),
590 self);
591 g_signal_connect(self->event_box, "motion-notify-event",
592 G_CALLBACK(motion_notify_event_cb), self);
593 g_signal_connect(self->event_box, "enter-notify-event",
594 G_CALLBACK(enter_notify_event_cb), self);
595 g_signal_connect(self->event_box, "leave-notify-event",
596 G_CALLBACK(leave_notify_event_cb), self);
597 self->keymap_keys_changed_cb_id = g_signal_connect(
598 self->keymap, "keys-changed", G_CALLBACK(keymap_keys_changed_cb), self);
599 GtkGesture* zoom = gtk_gesture_zoom_new(self->event_box);
600 g_signal_connect(zoom, "begin", G_CALLBACK(gesture_zoom_begin_cb), self);
601 g_signal_connect(zoom, "scale-changed", G_CALLBACK(gesture_zoom_update_cb),
602 self);
603 g_signal_connect(zoom, "end", G_CALLBACK(gesture_zoom_end_cb), self);
604 GtkGesture* rotate = gtk_gesture_rotate_new(self->event_box);
605 g_signal_connect(rotate, "begin", G_CALLBACK(gesture_rotation_begin_cb),
606 self);
607 g_signal_connect(rotate, "angle-changed",
608 G_CALLBACK(gesture_rotation_update_cb), self);
609 g_signal_connect(rotate, "end", G_CALLBACK(gesture_rotation_end_cb), self);
610
611 g_signal_connect(self, "realize", G_CALLBACK(realize_cb), self);
612 g_signal_connect(self, "size-allocate", G_CALLBACK(configure_cb), self);
613 }

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 660 of file fl_view.cc.

660 {
661 FlView* self = FL_VIEW(object);
662
663 if (self->engine != nullptr) {
664 fl_engine_set_update_semantics_node_handler(self->engine, nullptr, nullptr,
665 nullptr);
666 fl_engine_set_on_pre_engine_restart_handler(self->engine, nullptr, nullptr,
667 nullptr);
668 }
669
670 if (self->window_state_cb_id != 0) {
671 GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
672 g_signal_handler_disconnect(toplevel_window, self->window_state_cb_id);
673 self->window_state_cb_id = 0;
674 }
675
676 g_clear_object(&self->project);
677 g_clear_object(&self->renderer);
678 g_clear_object(&self->engine);
679 g_clear_object(&self->accessibility_plugin);
680 g_clear_object(&self->keyboard_manager);
681 if (self->keymap_keys_changed_cb_id != 0) {
682 g_signal_handler_disconnect(self->keymap, self->keymap_keys_changed_cb_id);
683 self->keymap_keys_changed_cb_id = 0;
684 }
685 g_clear_object(&self->mouse_cursor_plugin);
686 g_clear_object(&self->platform_plugin);
687
688 G_OBJECT_CLASS(fl_view_parent_class)->dispose(object);
689 }

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 744 of file fl_view.cc.

744 {
745 g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
746 return self->engine;
747 }

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 764 of file fl_view.cc.

764 {
765 g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
766
767 return fl_keyboard_manager_get_pressed_state(self->keyboard_manager);
768 }

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 632 of file fl_view.cc.

635 {
636 FlView* self = FL_VIEW(object);
637
638 switch (prop_id) {
639 case kPropFlutterProject:
640 g_value_set_object(value, self->project);
641 break;
642 default:
643 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
644 break;
645 }
646 }

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 248 of file fl_view.cc.

250 {
251 FlView* self = FL_VIEW(registry);
252
253 return fl_plugin_registrar_new(self,
254 fl_engine_get_binary_messenger(self->engine),
255 fl_engine_get_texture_registrar(self->engine));
256 }

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 733 of file fl_view.cc.

733 {
734 gtk_widget_set_can_focus(GTK_WIDGET(self), TRUE);
735 self->window_state = gdk_window_get_state(
736 gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(self))));
737 }

References TRUE.

## ◆ fl_view_key_press_event()

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

Definition at line 692 of file fl_view.cc.

692 {
693 FlView* self = FL_VIEW(widget);
694
695 return fl_keyboard_manager_handle_event(
696 self->keyboard_manager, fl_key_event_new_from_gdk_event(gdk_event_copy(
697 reinterpret_cast<GdkEvent*>(event))));
698 }

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 701 of file fl_view.cc.

702 {
703 FlView* self = FL_VIEW(widget);
704 return fl_keyboard_manager_handle_event(
705 self->keyboard_manager, fl_key_event_new_from_gdk_event(gdk_event_copy(
706 reinterpret_cast<GdkEvent*>(event))));
707 }

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 263 of file fl_view.cc.

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

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 739 of file fl_view.cc.

739 {
740 return static_cast<FlView*>(
741 g_object_new(fl_view_get_type(), "flutter-project", project, nullptr));
742 }

## ◆ fl_view_notify()

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

Definition at line 648 of file fl_view.cc.

648 {
649 FlView* self = FL_VIEW(object);
650
651 if (strcmp(pspec->name, "scale-factor") == 0) {
652 handle_geometry_changed(self);
653 }
654
655 if (G_OBJECT_CLASS(fl_view_parent_class)->notify != nullptr) {
656 G_OBJECT_CLASS(fl_view_parent_class)->notify(object, pspec);
657 }
658 }

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 258 of file fl_view.cc.

259 {
260 iface->get_registrar_for_plugin = fl_view_get_registrar_for_plugin;
261 }

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 315 of file fl_view.cc.

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

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 615 of file fl_view.cc.

618 {
619 FlView* self = FL_VIEW(object);
620
621 switch (prop_id) {
622 case kPropFlutterProject:
623 g_set_object(&self->project,
624 static_cast<FlDartProject*>(g_value_get_object(value)));
625 break;
626 default:
627 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
628 break;
629 }
630 }

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 749 of file fl_view.cc.

751 {
752 g_return_if_fail(FL_IS_VIEW(self));
753
754 if (self->gl_area == nullptr) {
755 self->gl_area = FL_GL_AREA(fl_gl_area_new(context));
756 gtk_widget_show(GTK_WIDGET(self->gl_area));
757 gtk_container_add(GTK_CONTAINER(self->event_box),
758 GTK_WIDGET(self->gl_area));
759 }
760
761 fl_gl_area_queue_render(self->gl_area, textures);
762 }

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 341 of file fl_view.cc.

342 {
343 iface->translate_coordinates = [](FlTextInputViewDelegate* delegate,
344 gint view_x, gint view_y, gint* window_x,
345 gint* window_y) {
346 FlView* self = FL_VIEW(delegate);
347 gtk_widget_translate_coordinates(GTK_WIDGET(self),
348 gtk_widget_get_toplevel(GTK_WIDGET(self)),
349 view_x, view_y, window_x, window_y);
350 };
351 }

## ◆ 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 458 of file fl_view.cc.

460 {
461 fl_scrolling_manager_handle_rotation_begin(self->scrolling_manager);
462 }

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 472 of file fl_view.cc.

474 {
475 fl_scrolling_manager_handle_rotation_end(self->scrolling_manager);
476 }

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 464 of file fl_view.cc.

467 {
468 fl_scrolling_manager_handle_rotation_update(self->scrolling_manager,
469 rotation);
470 }

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 478 of file fl_view.cc.

480 {
481 fl_scrolling_manager_handle_zoom_begin(self->scrolling_manager);
482 }

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 490 of file fl_view.cc.

492 {
493 fl_scrolling_manager_handle_zoom_end(self->scrolling_manager);
494 }

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 484 of file fl_view.cc.

486 {
487 fl_scrolling_manager_handle_zoom_update(self->scrolling_manager, scale);
488 }

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 199 of file fl_view.cc.

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

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 450 of file fl_view.cc.

450 {
451 if (self->keyboard_layout_notifier == nullptr) {
452 return;
453 }
454
455 self->keyboard_layout_notifier();
456 }

References self.

Referenced by fl_view_constructed().

## ◆ leave_notify_event_cb()

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

Definition at line 424 of file fl_view.cc.

426 {
427 if (event->mode != GDK_CROSSING_NORMAL) {
428 return FALSE;
429 }
430
431 if (self->engine == nullptr) {
432 return FALSE;
433 }
434
435 // Don't remove pointer while button is down; In case of dragging outside of
436 // window with mouse grab active Gtk will send another leave notify on
437 // release.
438 if (self->pointer_inside && self->button_state == 0) {
439 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
440 fl_engine_send_mouse_pointer_event(
441 self->engine, kRemove, event->time * kMicrosecondsPerMillisecond,
442 event->x * scale_factor, event->y * scale_factor, 0, 0,
443 self->button_state);
444 self->pointer_inside = FALSE;
445 }
446
447 return TRUE;
448 }

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 * | event,
|  | FlView * | self
| ) |  |
| static

Definition at line 389 of file fl_view.cc.

391 {
392 if (self->engine == nullptr) {
393 return FALSE;
394 }
395
396 check_pointer_inside(self, reinterpret_cast<GdkEvent*>(event));
397
398 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
399
400 fl_keyboard_manager_sync_modifier_if_needed(self->keyboard_manager,
401 event->state, event->time);
402 fl_engine_send_mouse_pointer_event(
403 self->engine, self->button_state != 0 ? kMove : kHover,
404 event->time * kMicrosecondsPerMillisecond, event->x * scale_factor,
405 event->y * scale_factor, 0, 0, self->button_state);
406
407 return TRUE;
408 }

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 235 of file fl_view.cc.

235 {
236 FlView* self = FL_VIEW(user_data);
237
238 g_clear_object(&self->keyboard_manager);
239 g_clear_object(&self->text_input_plugin);
240 g_clear_object(&self->scrolling_manager);
241 init_keyboard(self);
242 init_scrolling(self);
243 self->window_state =
244 gdk_window_get_state(gtk_widget_get_window(GTK_WIDGET(self)));
245 }

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 520 of file fl_view.cc.

520 {
521 FlView* self = FL_VIEW(widget);
522 g_autoptr(GError) error = nullptr;
523
524 // Handle requests by the user to close the application.
525 GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
526
527 // Listen to window state changes.
528 self->window_state_cb_id =
529 g_signal_connect(toplevel_window, "window-state-event",
530 G_CALLBACK(window_state_event_cb), self);
531
532 g_signal_connect(toplevel_window, "delete-event",
533 G_CALLBACK(window_delete_event_cb), self);
534
535 init_keyboard(self);
536
537 if (!fl_renderer_start(self->renderer, self, &error)) {
538 g_warning("Failed to start Flutter renderer: %s", error->message);
539 return;
540 }
541
542 if (!fl_engine_start(self->engine, &error)) {
543 g_warning("Failed to start Flutter engine: %s", error->message);
544 return;
545 }
546
547 handle_geometry_changed(self);
548 }

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 376 of file fl_view.cc.

378 {
379 // TODO(robert-ancell): Update to use GtkEventControllerScroll when we can
380 // depend on GTK 3.24.
381
382 fl_scrolling_manager_handle_scroll_event(
383 self->scrolling_manager, event,
384 gtk_widget_get_scale_factor(GTK_WIDGET(self)));
385 return TRUE;
386 }

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,
|  | GdkEventButton * | event
| ) |  |
| static

Definition at line 128 of file fl_view.cc.

128 {
129 int64_t button;
130 switch (event->button) {
131 case 1:
132 button = kFlutterPointerButtonMousePrimary;
133 break;
134 case 2:
135 button = kFlutterPointerButtonMouseMiddle;
136 break;
137 case 3:
138 button = kFlutterPointerButtonMouseSecondary;
139 break;
140 default:
141 return FALSE;
142 }
143 int old_button_state = self->button_state;
144 FlutterPointerPhase phase = kMove;
145 if (event->type == GDK_BUTTON_PRESS) {
146 // Drop the event if Flutter already thinks the button is down.
147 if ((self->button_state & button) != 0) {
148 return FALSE;
149 }
150 self->button_state ^= button;
151
152 phase = old_button_state == 0 ? kDown : kMove;
153 } else if (event->type == GDK_BUTTON_RELEASE) {
154 // Drop the event if Flutter already thinks the button is up.
155 if ((self->button_state & button) == 0) {
156 return FALSE;
157 }
158 self->button_state ^= button;
159
160 phase = self->button_state == 0 ? kUp : kMove;
161 }
162
163 if (self->engine == nullptr) {
164 return FALSE;
165 }
166
167 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
168 fl_scrolling_manager_set_last_mouse_position(self->scrolling_manager,
169 event->x * scale_factor,
170 event->y * scale_factor);
171 fl_keyboard_manager_sync_modifier_if_needed(self->keyboard_manager,
172 event->state, event->time);
173 fl_engine_send_mouse_pointer_event(
174 self->engine, phase, event->time * kMicrosecondsPerMillisecond,
175 event->x * scale_factor, event->y * scale_factor, 0, 0,
176 self->button_state);
177
178 return TRUE;
179 }

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 221 of file fl_view.cc.

223 {
224 FlView* self = FL_VIEW(user_data);
225
226 fl_accessibility_plugin_handle_update_semantics_node(
227 self->accessibility_plugin, node);
228 }

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 496 of file fl_view.cc.

498 {
499 g_return_val_if_fail(FL_IS_VIEW(user_data), FALSE);
500 g_return_val_if_fail(FL_IS_ENGINE(FL_VIEW(user_data)->engine), FALSE);
501 FlView* self = FL_VIEW(user_data);
502 GdkWindowState state = event->window_state.new_window_state;
503 GdkWindowState previous_state = self->window_state;
504 self->window_state = state;
505 bool was_visible = !((previous_state & GDK_WINDOW_STATE_WITHDRAWN) ||
506 (previous_state & GDK_WINDOW_STATE_ICONIFIED));
507 bool is_visible = !((state & GDK_WINDOW_STATE_WITHDRAWN) ||
508 (state & GDK_WINDOW_STATE_ICONIFIED));
509 bool was_focused = (previous_state & GDK_WINDOW_STATE_FOCUSED);
510 bool is_focused = (state & GDK_WINDOW_STATE_FOCUSED);
511 if (was_visible != is_visible || was_focused != is_focused) {
512 if (self->engine != nullptr) {
513 fl_engine_send_window_state_event(FL_ENGINE(self->engine), is_visible,
514 is_focused);
515 }
516 }
517 return FALSE;
518 }

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:520
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:632
gesture_rotation_begin_cb
static void gesture_rotation_begin_cb(GtkGestureRotate *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:458
fl_scrolling_manager_handle_zoom_end
void fl_scrolling_manager_handle_zoom_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:174
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:838
kMicrosecondsPerMillisecond
static constexpr int kMicrosecondsPerMillisecond
Definition: fl_view.cc:28
motion_notify_event_cb
static gboolean motion_notify_event_cb(GtkWidget *widget, GdkEventMotion *event, FlView *self)
Definition: fl_view.cc:389
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:490
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:777
send_pointer_button_event
static gboolean send_pointer_button_event(FlView *self, GdkEventButton *event)
Definition: fl_view.cc:128
fl_view_get_registrar_for_plugin
static FlPluginRegistrar * fl_view_get_registrar_for_plugin(FlPluginRegistry *registry, const gchar *name)
Definition: fl_view.cc:248
configure_cb
static void configure_cb(GtkWidget *widget, GdkEventConfigure event)
Definition: fl_view.cc:550
leave_notify_event_cb
static gboolean leave_notify_event_cb(GtkWidget *widget, GdkEventCrossing *event, FlView *self)
Definition: fl_view.cc:424
gesture_rotation_end_cb
static void gesture_rotation_end_cb(GtkGestureRotate *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:472
fl_platform_plugin_request_app_exit
void fl_platform_plugin_request_app_exit(FlPlatformPlugin *self)
Definition: fl_platform_plugin.cc:407
fl_platform_plugin_new
FlPlatformPlugin * fl_platform_plugin_new(FlBinaryMessenger *messenger)
Definition: fl_platform_plugin.cc:391
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:759
fl_view_set_property
static void fl_view_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
Definition: fl_view.cc:615
fl_key_event_new_from_gdk_event
FlKeyEvent * fl_key_event_new_from_gdk_event(GdkEvent *raw_event)
Definition: fl_key_event.cc:12
keymap_keys_changed_cb
static void keymap_keys_changed_cb(GdkKeymap *keymapf, FlView *self)
Definition: fl_view.cc:450
fl_engine_get_binary_messenger
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
Definition: fl_engine.cc:893
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:484
_FlValue::type
FlValueType type
Definition: fl_value.cc:12
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:612
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:496
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:808
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:692
enter_notify_event_cb
static gboolean enter_notify_event_cb(GtkWidget *widget, GdkEventCrossing *event, FlView *self)
Definition: fl_view.cc:411
fl_engine_new
FlEngine * fl_engine_new(FlDartProject *project, FlRenderer *renderer)
Definition: fl_engine.cc:466
fl_view_key_release_event
static gboolean fl_view_key_release_event(GtkWidget *widget, GdkEventKey *event)
Definition: fl_view.cc:701
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:660
fl_scrolling_manager_handle_zoom_update
void fl_scrolling_manager_handle_zoom_update(FlScrollingManager *self, gdouble scale)
Definition: fl_scrolling_manager.cc:167
check_pointer_inside
static void check_pointer_inside(FlView *self, GdkEvent *event)
Definition: fl_view.cc:182
button_press_event_cb
static gboolean button_press_event_cb(GtkWidget *widget, GdkEventButton *event, FlView *self)
Definition: fl_view.cc:354
fl_view_get_keyboard_state
GHashTable * fl_view_get_keyboard_state(FlView *self)
Definition: fl_view.cc:764
fl_scrolling_manager_handle_rotation_update
void fl_scrolling_manager_handle_rotation_update(FlScrollingManager *self, gdouble rotation)
Definition: fl_scrolling_manager.cc:141
gesture_rotation_update_cb
static void gesture_rotation_update_cb(GtkGestureRotate *widget, gdouble rotation, gdouble delta, FlView *self)
Definition: fl_view.cc:464
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:33
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
button_release_event_cb
static gboolean button_release_event_cb(GtkWidget *widget, GdkEventButton *event, FlView *self)
Definition: fl_view.cc:369
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:235
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:221
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:199
fl_view_constructed
static void fl_view_constructed(GObject *object)
Definition: fl_view.cc:555
fl_renderer_gl_new
FlRendererGL * fl_renderer_gl_new()
Definition: fl_renderer_gl.cc:134
fl_scrolling_manager_handle_scroll_event
void fl_scrolling_manager_handle_scroll_event(FlScrollingManager *self, GdkEventScroll *event, gint scale_factor)
Definition: fl_scrolling_manager.cc:67
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:648
fl_scrolling_manager_handle_rotation_end
void fl_scrolling_manager_handle_rotation_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:148
fl_engine_start
gboolean fl_engine_start(FlEngine *self, GError **error)
Definition: fl_engine.cc:482
fl_scrolling_manager_handle_rotation_begin
void fl_scrolling_manager_handle_rotation_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:130
fl_engine_send_window_state_event
void fl_engine_send_window_state_event(FlEngine *self, gboolean visible, gboolean focused)
Definition: fl_engine.cc:747
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:157
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:909
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:629
scroll_event_cb
static gboolean scroll_event_cb(GtkWidget *widget, GdkEventScroll *event, FlView *self)
Definition: fl_view.cc:376
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:478