| 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_backing_store_provider.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_gdk.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(FlView *self)
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_cb (FlEngine *engine, const FlutterSemanticsUpdate2 *update, 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 (FlView *self, GdkEventButton *button_event)
static gboolean | button_release_event_cb (FlView *self, GdkEventButton *button_event)
static gboolean | scroll_event_cb (FlView *self, GdkEventScroll *event)
static gboolean | motion_notify_event_cb (FlView *self, GdkEventMotion *motion_event)
static gboolean | enter_notify_event_cb (FlView *self, GdkEventCrossing *crossing_event)
static gboolean | leave_notify_event_cb (FlView *self, GdkEventCrossing *crossing_event)
static void | keymap_keys_changed_cb (FlView *self)
static void | gesture_rotation_begin_cb (FlView *self)
static void | gesture_rotation_update_cb (FlView *self, gdouble rotation, gdouble delta)
static void | gesture_rotation_end_cb (FlView *self)
static void | gesture_zoom_begin_cb (FlView *self)
static void | gesture_zoom_update_cb (FlView *self, gdouble scale)
static void | gesture_zoom_end_cb (FlView *self)
static gboolean | window_state_event_cb (FlView *self, GdkEvent *event)
static GdkGLContext * | create_context_cb (FlView *self)
static void | realize_cb (FlView *self)
static gboolean | render_cb (FlView *self, GdkGLContext *context)
static void | unrealize_cb (FlView *self)
static void | size_allocate_cb (FlView *self)
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_redraw (FlView *self)
GHashTable * | fl_view_get_keyboard_state (FlView *self)

## Variables
static constexpr int | kMicrosecondsPerMillisecond = 1000

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
kPropFlutterProject |
kPropLast |

Definition at line 69 of file fl_view.cc.

69 { kPropFlutterProject = 1, kPropLast };

## Function Documentation

## ◆ button_press_event_cb()

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

Definition at line 358 of file fl_view.cc.

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

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

Referenced by fl_view_init().

## ◆ button_release_event_cb()

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

Definition at line 375 of file fl_view.cc.

376 {
377 GdkEvent* event = reinterpret_cast<GdkEvent*>(button_event);
378 return send_pointer_button_event(self, event);
379 }

References event, and send_pointer_button_event().

Referenced by fl_view_init().

## ◆ 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, and TRUE.

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

## ◆ create_context_cb()

static GdkGLContext* create_context_cb | ( | FlView * | self | ) |
| static

Definition at line 523 of file fl_view.cc.

523 {
524 self->renderer =
525 fl_renderer_gdk_new(gtk_widget_get_parent_window(GTK_WIDGET(self)));
526 self->engine = fl_engine_new(self->project, FL_RENDERER(self->renderer));
527 fl_engine_set_update_semantics_handler(self->engine, update_semantics_cb,
528 self, nullptr);
529 fl_engine_set_on_pre_engine_restart_handler(
530 self->engine, on_pre_engine_restart_cb, self, nullptr);
531
532 // Must initialize the keymap before the keyboard.
533 self->keymap = gdk_keymap_get_for_display(gdk_display_get_default());
534 self->keymap_keys_changed_cb_id = g_signal_connect_swapped(
535 self->keymap, "keys-changed", G_CALLBACK(keymap_keys_changed_cb), self);
536
537 // Create system channel handlers.
538 FlBinaryMessenger* messenger = fl_engine_get_binary_messenger(self->engine);
539 init_scrolling(self);
540 self->mouse_cursor_plugin = fl_mouse_cursor_plugin_new(messenger, self);
541 self->platform_plugin = fl_platform_plugin_new(messenger);
542
543 g_autoptr(GError) error = nullptr;
544 if (!fl_renderer_gdk_create_contexts(self->renderer, &error)) {
545 gtk_gl_area_set_error(self->gl_area, error);
546 return nullptr;
547 }
548
549 return GDK_GL_CONTEXT(
550 g_object_ref(fl_renderer_gdk_get_context(self->renderer)));
551 }

References error, fl_engine_get_binary_messenger(), fl_engine_new(), fl_engine_set_on_pre_engine_restart_handler(), fl_engine_set_update_semantics_handler(), fl_mouse_cursor_plugin_new(), fl_platform_plugin_new(), fl_renderer_gdk_create_contexts(), fl_renderer_gdk_get_context(), fl_renderer_gdk_new(), init_scrolling(), keymap_keys_changed_cb(), on_pre_engine_restart_cb(), and update_semantics_cb().

Referenced by fl_view_init().

## ◆ enter_notify_event_cb()

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

Definition at line 422 of file fl_view.cc.

423 {
424 GdkEvent* event = reinterpret_cast<GdkEvent*>(crossing_event);
425
426 if (self->engine == nullptr) {
427 return FALSE;
428 }
429
430 check_pointer_inside(self, event);
431
432 return TRUE;
433 }

References check_pointer_inside(), event, and TRUE.

Referenced by fl_view_init().

## ◆ fl_view_class_init()

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

Definition at line 716 of file fl_view.cc.

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

References 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_dispose()

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

Definition at line 668 of file fl_view.cc.

668 {
669 FlView* self = FL_VIEW(object);
670
671 if (self->engine != nullptr) {
672 fl_engine_set_update_semantics_handler(self->engine, nullptr, nullptr,
673 nullptr);
674 fl_engine_set_on_pre_engine_restart_handler(self->engine, nullptr, nullptr,
675 nullptr);
676 }
677
678 if (self->window_state_cb_id != 0) {
679 GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
680 g_signal_handler_disconnect(toplevel_window, self->window_state_cb_id);
681 self->window_state_cb_id = 0;
682 }
683
684 g_clear_object(&self->project);
685 g_clear_object(&self->renderer);
686 g_clear_object(&self->engine);
687 g_clear_object(&self->keyboard_manager);
688 if (self->keymap_keys_changed_cb_id != 0) {
689 g_signal_handler_disconnect(self->keymap, self->keymap_keys_changed_cb_id);
690 self->keymap_keys_changed_cb_id = 0;
691 }
692 g_clear_object(&self->mouse_cursor_plugin);
693 g_clear_object(&self->platform_plugin);
694
695 G_OBJECT_CLASS(fl_view_parent_class)->dispose(object);
696 }

References fl_engine_set_on_pre_engine_restart_handler(), and fl_engine_set_update_semantics_handler().

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

800 {
801 g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
802 return self->engine;
803 }

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

810 {
811 g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
812 return fl_keyboard_manager_get_pressed_state(self->keyboard_manager);
813 }

References fl_keyboard_manager_get_pressed_state().

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

643 {
644 FlView* self = FL_VIEW(object);
645
646 switch (prop_id) {
647 case kPropFlutterProject:
648 g_value_set_object(value, self->project);
649 break;
650 default:
651 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
652 break;
653 }
654 }

References kPropFlutterProject, prop_id, pspec, 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 252 of file fl_view.cc.

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

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

Referenced by fl_view_plugin_registry_iface_init().

## ◆ fl_view_init()

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

Definition at line 739 of file fl_view.cc.

739 {
740 gtk_widget_set_can_focus(GTK_WIDGET(self), TRUE);
741
742 self->event_box = gtk_event_box_new();
743 gtk_widget_set_hexpand(self->event_box, TRUE);
744 gtk_widget_set_vexpand(self->event_box, TRUE);
745 gtk_container_add(GTK_CONTAINER(self), self->event_box);
746 gtk_widget_show(self->event_box);
747 gtk_widget_add_events(self->event_box,
748 GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
749 GDK_BUTTON_RELEASE_MASK | GDK_SCROLL_MASK |
750 GDK_SMOOTH_SCROLL_MASK);
751
752 g_signal_connect_swapped(self->event_box, "button-press-event",
753 G_CALLBACK(button_press_event_cb), self);
754 g_signal_connect_swapped(self->event_box, "button-release-event",
755 G_CALLBACK(button_release_event_cb), self);
756 g_signal_connect_swapped(self->event_box, "scroll-event",
757 G_CALLBACK(scroll_event_cb), self);
758 g_signal_connect_swapped(self->event_box, "motion-notify-event",
759 G_CALLBACK(motion_notify_event_cb), self);
760 g_signal_connect_swapped(self->event_box, "enter-notify-event",
761 G_CALLBACK(enter_notify_event_cb), self);
762 g_signal_connect_swapped(self->event_box, "leave-notify-event",
763 G_CALLBACK(leave_notify_event_cb), self);
764 GtkGesture* zoom = gtk_gesture_zoom_new(self->event_box);
765 g_signal_connect_swapped(zoom, "begin", G_CALLBACK(gesture_zoom_begin_cb),
766 self);
767 g_signal_connect_swapped(zoom, "scale-changed",
768 G_CALLBACK(gesture_zoom_update_cb), self);
769 g_signal_connect_swapped(zoom, "end", G_CALLBACK(gesture_zoom_end_cb), self);
770 GtkGesture* rotate = gtk_gesture_rotate_new(self->event_box);
771 g_signal_connect_swapped(rotate, "begin",
772 G_CALLBACK(gesture_rotation_begin_cb), self);
773 g_signal_connect_swapped(rotate, "angle-changed",
774 G_CALLBACK(gesture_rotation_update_cb), self);
775 g_signal_connect_swapped(rotate, "end", G_CALLBACK(gesture_rotation_end_cb),
776 self);
777
778 self->gl_area = GTK_GL_AREA(gtk_gl_area_new());
779 gtk_widget_show(GTK_WIDGET(self->gl_area));
780 gtk_container_add(GTK_CONTAINER(self->event_box), GTK_WIDGET(self->gl_area));
781
782 g_signal_connect_swapped(self->gl_area, "create-context",
783 G_CALLBACK(create_context_cb), self);
784 g_signal_connect_swapped(self->gl_area, "realize", G_CALLBACK(realize_cb),
785 self);
786 g_signal_connect_swapped(self->gl_area, "render", G_CALLBACK(render_cb),
787 self);
788 g_signal_connect_swapped(self->gl_area, "unrealize", G_CALLBACK(unrealize_cb),
789 self);
790
791 g_signal_connect_swapped(self, "size-allocate", G_CALLBACK(size_allocate_cb),
792 self);
793 }

References button_press_event_cb(), button_release_event_cb(), create_context_cb(), enter_notify_event_cb(), gesture_rotation_begin_cb(), gesture_rotation_end_cb(), gesture_rotation_update_cb(), gesture_zoom_begin_cb(), gesture_zoom_end_cb(), gesture_zoom_update_cb(), leave_notify_event_cb(), motion_notify_event_cb(), realize_cb(), render_cb(), scroll_event_cb(), size_allocate_cb(), TRUE, and unrealize_cb().

## ◆ fl_view_key_press_event()

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

Definition at line 699 of file fl_view.cc.

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

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

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

709 {
710 FlView* self = FL_VIEW(widget);
711 return fl_keyboard_manager_handle_event(
712 self->keyboard_manager, fl_key_event_new_from_gdk_event(gdk_event_copy(
713 reinterpret_cast<GdkEvent*>(event))));
714 }

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

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

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

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(), _FlKeyEvent::origin, 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 795 of file fl_view.cc.

795 {
796 return static_cast<FlView*>(
797 g_object_new(fl_view_get_type(), "flutter-project", project, nullptr));
798 }

Referenced by TEST().

## ◆ fl_view_notify()

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

Definition at line 656 of file fl_view.cc.

656 {
657 FlView* self = FL_VIEW(object);
658
659 if (strcmp(pspec->name, "scale-factor") == 0) {
660 handle_geometry_changed(self);
661 }
662
663 if (G_OBJECT_CLASS(fl_view_parent_class)->notify != nullptr) {
664 G_OBJECT_CLASS(fl_view_parent_class)->notify(object, pspec);
665 }
666 }

References handle_geometry_changed(), and pspec.

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

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

References fl_view_get_registrar_for_plugin().

## ◆ fl_view_redraw()

void fl_view_redraw | ( | FlView * | view | ) |

fl_view_redraw: @view: an #FlView.

Indicate the view needs to redraw.

Definition at line 805 of file fl_view.cc.

805 {
806 g_return_if_fail(FL_IS_VIEW(self));
807 gtk_widget_queue_draw(GTK_WIDGET(self->gl_area));
808 }

Referenced by fl_renderer_present_layers().

## ◆ fl_view_scrolling_delegate_iface_init()

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

Definition at line 319 of file fl_view.cc.

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

References fl_engine_send_mouse_pointer_event(), and fl_engine_send_pointer_pan_zoom_event().

## ◆ fl_view_set_property()

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

Definition at line 623 of file fl_view.cc.

626 {
627 FlView* self = FL_VIEW(object);
628
629 switch (prop_id) {
630 case kPropFlutterProject:
631 g_set_object(&self->project,
632 static_cast<FlDartProject*>(g_value_get_object(value)));
633 break;
634 default:
635 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
636 break;
637 }
638 }

References kPropFlutterProject, prop_id, pspec, and value.

Referenced by fl_view_class_init().

## ◆ fl_view_text_input_delegate_iface_init()

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

Definition at line 345 of file fl_view.cc.

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

## ◆ 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) |
| ) |  |

Definition at line 83 of file fl_view.cc.

97 {
98 fl_platform_plugin_request_app_exit(self->platform_plugin);
99 // Stop the event from propagating.
100 return TRUE;
101 }

References fl_platform_plugin_request_app_exit(), and TRUE.

## ◆ gesture_rotation_begin_cb()

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

Definition at line 475 of file fl_view.cc.

475 {
476 fl_scrolling_manager_handle_rotation_begin(self->scrolling_manager);
477 }

References fl_scrolling_manager_handle_rotation_begin().

Referenced by fl_view_init().

## ◆ gesture_rotation_end_cb()

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

Definition at line 486 of file fl_view.cc.

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

References fl_scrolling_manager_handle_rotation_end().

Referenced by fl_view_init().

## ◆ gesture_rotation_update_cb()

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

Definition at line 479 of file fl_view.cc.

481 {
482 fl_scrolling_manager_handle_rotation_update(self->scrolling_manager,
483 rotation);
484 }

References fl_scrolling_manager_handle_rotation_update().

Referenced by fl_view_init().

## ◆ gesture_zoom_begin_cb()

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

Definition at line 490 of file fl_view.cc.

490 {
491 fl_scrolling_manager_handle_zoom_begin(self->scrolling_manager);
492 }

References fl_scrolling_manager_handle_zoom_begin().

Referenced by fl_view_init().

## ◆ gesture_zoom_end_cb()

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

Definition at line 498 of file fl_view.cc.

498 {
499 fl_scrolling_manager_handle_zoom_end(self->scrolling_manager);
500 }

References fl_scrolling_manager_handle_zoom_end().

Referenced by fl_view_init().

## ◆ gesture_zoom_update_cb()

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

Definition at line 494 of file fl_view.cc.

494 {
495 fl_scrolling_manager_handle_zoom_update(self->scrolling_manager, scale);
496 }

References fl_scrolling_manager_handle_zoom_update().

Referenced by fl_view_init().

## ◆ 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(FL_RENDERER(self->renderer),
223 allocation.width * scale_factor,
224 allocation.height * scale_factor);
225 }
226 }

References fl_engine_send_window_metrics_event(), and fl_renderer_wait_for_frame().

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

## ◆ init_keyboard()

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

Definition at line 104 of file fl_view.cc.

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

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

Referenced by on_pre_engine_restart_cb(), and realize_cb().

## ◆ init_scrolling()

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

Definition at line 121 of file fl_view.cc.

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

References fl_scrolling_manager_new().

Referenced by create_context_cb(), and on_pre_engine_restart_cb().

## ◆ keymap_keys_changed_cb()

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

Definition at line 467 of file fl_view.cc.

467 {
468 if (self->keyboard_layout_notifier == nullptr) {
469 return;
470 }
471
472 self->keyboard_layout_notifier();
473 }

Referenced by create_context_cb().

## ◆ leave_notify_event_cb()

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

Definition at line 436 of file fl_view.cc.

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

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

Referenced by fl_view_init().

## ◆ motion_notify_event_cb()

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

Definition at line 393 of file fl_view.cc.

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

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

Referenced by fl_view_init().

## ◆ on_pre_engine_restart_cb()

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

Definition at line 244 of file fl_view.cc.

244 {
245 FlView* self = FL_VIEW(user_data);
246
247 init_keyboard(self);
248 init_scrolling(self);
249 }

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

Referenced by create_context_cb().

## ◆ realize_cb()

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

Definition at line 553 of file fl_view.cc.

553 {
554 g_autoptr(GError) error = nullptr;
555
556 fl_renderer_make_current(FL_RENDERER(self->renderer));
557
558 GError* gl_error = gtk_gl_area_get_error(self->gl_area);
559 if (gl_error != NULL) {
560 g_warning("Failed to initialize GLArea: %s", gl_error->message);
561 return;
562 }
563
564 fl_renderer_setup(FL_RENDERER(self->renderer));
565
566 // Handle requests by the user to close the application.
567 GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
568
569 // Listen to window state changes.
570 self->window_state_cb_id =
571 g_signal_connect_swapped(toplevel_window, "window-state-event",
572 G_CALLBACK(window_state_event_cb), self);
573 self->window_state =
574 gdk_window_get_state(gtk_widget_get_window(toplevel_window));
575
576 g_signal_connect_swapped(toplevel_window, "delete-event",
577 G_CALLBACK(window_delete_event_cb), self);
578
579 init_keyboard(self);
580
581 fl_renderer_start(FL_RENDERER(FL_RENDERER(self->renderer)), self);
582
583 if (!fl_engine_start(self->engine, &error)) {
584 g_warning("Failed to start Flutter engine: %s", error->message);
585 return;
586 }
587
588 handle_geometry_changed(self);
589 }

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

Referenced by fl_view_init().

## ◆ render_cb()

static gboolean render_cb | ( | FlView * | self,
|  | GdkGLContext * | context
| ) |  |
| static

Definition at line 591 of file fl_view.cc.

591 {
592 if (gtk_gl_area_get_error(self->gl_area) != NULL) {
593 return FALSE;
594 }
595
596 int width = gtk_widget_get_allocated_width(GTK_WIDGET(self->gl_area));
597 int height = gtk_widget_get_allocated_height(GTK_WIDGET(self->gl_area));
598 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self->gl_area));
599 fl_renderer_render(FL_RENDERER(self->renderer), width * scale_factor,
600 height * scale_factor);
601
602 return TRUE;
603 }

References fl_renderer_render(), height, TRUE, and width.

Referenced by fl_view_init().

## ◆ scroll_event_cb()

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

Definition at line 382 of file fl_view.cc.

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

References event, fl_scrolling_manager_handle_scroll_event(), and TRUE.

Referenced by fl_view_init().

## ◆ 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, and TRUE.

Referenced by button_press_event_cb(), and button_release_event_cb().

## ◆ size_allocate_cb()

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

Definition at line 619 of file fl_view.cc.

619 {
620 handle_geometry_changed(self);
621 }

References handle_geometry_changed().

Referenced by fl_view_init().

## ◆ unrealize_cb()

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

Definition at line 605 of file fl_view.cc.

605 {
606 g_autoptr(GError) error = nullptr;
607
608 fl_renderer_make_current(FL_RENDERER(self->renderer));
609
610 GError* gl_error = gtk_gl_area_get_error(self->gl_area);
611 if (gl_error != NULL) {
612 g_warning("Failed to uninitialize GLArea: %s", gl_error->message);
613 return;
614 }
615
616 fl_renderer_cleanup(FL_RENDERER(self->renderer));
617 }

References error, fl_renderer_cleanup(), and fl_renderer_make_current().

Referenced by fl_view_init().

## ◆ update_semantics_cb()

static void update_semantics_cb | ( | FlEngine * | engine,
|  | const FlutterSemanticsUpdate2 * | update,
|  | gpointer | user_data
| ) |  |
| static

Definition at line 229 of file fl_view.cc.

231 {
232 FlView* self = FL_VIEW(user_data);
233
234 AtkObject* accessible = gtk_widget_get_accessible(GTK_WIDGET(self));
235 fl_view_accessible_handle_update_semantics(FL_VIEW_ACCESSIBLE(accessible),
236 update);
237 }

References fl_view_accessible_handle_update_semantics(), update, and user_data.

Referenced by create_context_cb().

## ◆ window_state_event_cb()

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

Definition at line 502 of file fl_view.cc.

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

References fl_engine_send_window_state_event(), and state.

Referenced by realize_cb().

## Variable Documentation

## ◆ 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().

prop_id
guint prop_id
Definition: fl_standard_method_codec.cc:31
gesture_rotation_update_cb
static void gesture_rotation_update_cb(FlView *self, gdouble rotation, gdouble delta)
Definition: fl_view.cc:479
fl_renderer_wait_for_frame
void fl_renderer_wait_for_frame(FlRenderer *self, int target_width, int target_height)
Definition: fl_renderer.cc:202
fl_view_get_property
static void fl_view_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
Definition: fl_view.cc:640
enter_notify_event_cb
static gboolean enter_notify_event_cb(FlView *self, GdkEventCrossing *crossing_event)
Definition: fl_view.cc:422
event
FlKeyEvent * event
Definition: fl_key_channel_responder.cc:118
leave_notify_event_cb
static gboolean leave_notify_event_cb(FlView *self, GdkEventCrossing *crossing_event)
Definition: fl_view.cc:436
fl_scrolling_manager_handle_zoom_end
void fl_scrolling_manager_handle_zoom_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:207
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:839
fl_key_event_new_from_gdk_event
FlKeyEvent * fl_key_event_new_from_gdk_event(GdkEvent *event)
Definition: fl_key_event.cc:7
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:74
fl_view_accessible_handle_update_semantics
void fl_view_accessible_handle_update_semantics(FlViewAccessible *self, const FlutterSemanticsUpdate2 *update)
Definition: fl_view_accessible.cc:158
fl_text_input_plugin_filter_keypress
gboolean fl_text_input_plugin_filter_keypress(FlTextInputPlugin *self, FlKeyEvent *event)
Definition: fl_text_input_plugin.cc:776
init_scrolling
static void init_scrolling(FlView *self)
Definition: fl_view.cc:121
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:770
fl_renderer_gdk_get_context
GdkGLContext * fl_renderer_gdk_get_context(FlRendererGdk *self)
Definition: fl_renderer_gdk.cc:98
create_context_cb
static GdkGLContext * create_context_cb(FlView *self)
Definition: fl_view.cc:523
fl_view_get_registrar_for_plugin
static FlPluginRegistrar * fl_view_get_registrar_for_plugin(FlPluginRegistry *registry, const gchar *name)
Definition: fl_view.cc:252
kPropLast
@ kPropLast
Definition: fl_view.cc:69
size_allocate_cb
static void size_allocate_cb(FlView *self)
Definition: fl_view.cc:619
unrealize_cb
static void unrealize_cb(FlView *self)
Definition: fl_view.cc:605
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
user_data
FlKeyEvent uint64_t FlKeyResponderAsyncCallback gpointer user_data
Definition: fl_key_channel_responder.cc:121
keymap_keys_changed_cb
static void keymap_keys_changed_cb(FlView *self)
Definition: fl_view.cc:467
pspec
guint const GValue GParamSpec * pspec
Definition: fl_standard_method_codec.cc:33
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:748
realize_cb
static void realize_cb(FlView *self)
Definition: fl_view.cc:553
_FlKeyEvent::origin
GdkEvent * origin
Definition: fl_key_event.h:36
fl_view_set_property
static void fl_view_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
Definition: fl_view.cc:623
height
G_BEGIN_DECLS int height
Definition: fl_backing_store_provider.h:37
scroll_event_cb
static gboolean scroll_event_cb(FlView *self, GdkEventScroll *event)
Definition: fl_view.cc:382
fl_engine_get_binary_messenger
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
Definition: fl_engine.cc:894
_FlKeyEvent
Definition: fl_key_event.h:22
state
AtkStateType state
Definition: fl_accessible_node.cc:10
update_semantics_cb
static void update_semantics_cb(FlEngine *engine, const FlutterSemanticsUpdate2 *update, gpointer user_data)
Definition: fl_view.cc:229
update
G_BEGIN_DECLS const FlutterSemanticsUpdate2 * update
Definition: fl_view_accessible.h:40
window_state_event_cb
static gboolean window_state_event_cb(FlView *self, GdkEvent *event)
Definition: fl_view.cc:502
fl_keyboard_manager_handle_event
gboolean fl_keyboard_manager_handle_event(FlKeyboardManager *self, FlKeyEvent *event)
Definition: fl_keyboard_manager.cc:638
render_cb
static gboolean render_cb(FlView *self, GdkGLContext *context)
Definition: fl_view.cc:591
fl_renderer_start
gboolean fl_renderer_start(FlRenderer *self, FlView *view)
Definition: fl_renderer.cc:125
gesture_zoom_end_cb
static void gesture_zoom_end_cb(FlView *self)
Definition: fl_view.cc:498
button_release_event_cb
static gboolean button_release_event_cb(FlView *self, GdkEventButton *button_event)
Definition: fl_view.cc:375
KeyboardLayoutNotifier
std::function< void()> KeyboardLayoutNotifier
Definition: fl_keyboard_view_delegate.h:17
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:805
fl_scrolling_manager_new
FlScrollingManager * fl_scrolling_manager_new(FlScrollingViewDelegate *view_delegate)
Definition: fl_scrolling_manager.cc:47
fl_view_key_press_event
static gboolean fl_view_key_press_event(GtkWidget *widget, GdkEventKey *event)
Definition: fl_view.cc:699
fl_engine_new
FlEngine * fl_engine_new(FlDartProject *project, FlRenderer *renderer)
Definition: fl_engine.cc:455
fl_view_key_release_event
static gboolean fl_view_key_release_event(GtkWidget *widget, GdkEventKey *event)
Definition: fl_view.cc:708
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:66
fl_view_dispose
static void fl_view_dispose(GObject *object)
Definition: fl_view.cc:668
fl_renderer_gdk_create_contexts
gboolean fl_renderer_gdk_create_contexts(FlRendererGdk *self, GError **error)
Definition: fl_renderer_gdk.cc:70
TRUE
return TRUE
Definition: fl_pixel_buffer_texture_test.cc:53
fl_scrolling_manager_handle_zoom_update
void fl_scrolling_manager_handle_zoom_update(FlScrollingManager *self, gdouble scale)
Definition: fl_scrolling_manager.cc:197
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:810
fl_scrolling_manager_handle_rotation_update
void fl_scrolling_manager_handle_rotation_update(FlScrollingManager *self, gdouble rotation)
Definition: fl_scrolling_manager.cc:163
gesture_rotation_begin_cb
static void gesture_rotation_begin_cb(FlView *self)
Definition: fl_view.cc:475
kPropFlutterProject
@ kPropFlutterProject
Definition: fl_view.cc:69
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:32
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:675
on_pre_engine_restart_cb
static void on_pre_engine_restart_cb(FlEngine *engine, gpointer user_data)
Definition: fl_view.cc:244
fl_keyboard_manager_get_pressed_state
GHashTable * fl_keyboard_manager_get_pressed_state(FlKeyboardManager *self)
Definition: fl_keyboard_manager.cc:688
handle_geometry_changed
static void handle_geometry_changed(FlView *self)
Definition: fl_view.cc:206
fl_renderer_cleanup
void fl_renderer_cleanup(FlRenderer *self)
Definition: fl_renderer.cc:369
gesture_rotation_end_cb
static void gesture_rotation_end_cb(FlView *self)
Definition: fl_view.cc:486
gesture_zoom_update_cb
static void gesture_zoom_update_cb(FlView *self, gdouble scale)
Definition: fl_view.cc:494
send_pointer_button_event
static gboolean send_pointer_button_event(FlView *self, GdkEvent *event)
Definition: fl_view.cc:128
gesture_zoom_begin_cb
static void gesture_zoom_begin_cb(FlView *self)
Definition: fl_view.cc:490
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
fl_renderer_make_current
void fl_renderer_make_current(FlRenderer *self)
Definition: fl_renderer.cc:141
fl_mouse_cursor_plugin_new
FlMouseCursorPlugin * fl_mouse_cursor_plugin_new(FlBinaryMessenger *messenger, FlView *view)
Definition: fl_mouse_cursor_plugin.cc:163
fl_engine_set_update_semantics_handler
void fl_engine_set_update_semantics_handler(FlEngine *self, FlEngineUpdateSemanticsHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:601
fl_view_notify
static void fl_view_notify(GObject *object, GParamSpec *pspec)
Definition: fl_view.cc:656
fl_scrolling_manager_handle_rotation_end
void fl_scrolling_manager_handle_rotation_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:173
fl_engine_start
gboolean fl_engine_start(FlEngine *self, GError **error)
Definition: fl_engine.cc:471
fl_renderer_render
void fl_renderer_render(FlRenderer *self, int width, int height)
Definition: fl_renderer.cc:311
fl_scrolling_manager_handle_rotation_begin
void fl_scrolling_manager_handle_rotation_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:150
fl_engine_send_window_state_event
void fl_engine_send_window_state_event(FlEngine *self, gboolean visible, gboolean focused)
Definition: fl_engine.cc:736
fl_plugin_registrar_new
FlPluginRegistrar * fl_plugin_registrar_new(FlView *view, FlBinaryMessenger *messenger, FlTextureRegistrar *texture_registrar)
Definition: fl_plugin_registrar.cc:87
callback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition: fl_key_channel_responder.cc:120
motion_notify_event_cb
static gboolean motion_notify_event_cb(FlView *self, GdkEventMotion *motion_event)
Definition: fl_view.cc:393
width
const uint8_t uint32_t * width
Definition: fl_pixel_buffer_texture_test.cc:38
fl_scrolling_manager_handle_zoom_begin
void fl_scrolling_manager_handle_zoom_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:184
value
uint8_t value
Definition: fl_standard_message_codec.cc:36
init_keyboard
static void init_keyboard(FlView *self)
Definition: fl_view.cc:104
fl_engine_get_texture_registrar
G_MODULE_EXPORT FlTextureRegistrar * fl_engine_get_texture_registrar(FlEngine *self)
Definition: fl_engine.cc:910
button_press_event_cb
static gboolean button_press_event_cb(FlView *self, GdkEventButton *button_event)
Definition: fl_view.cc:358
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:618
fl_renderer_gdk_new
FlRendererGdk * fl_renderer_gdk_new(GdkWindow *window)
Definition: fl_renderer_gdk.cc:63
fl_renderer_setup
void fl_renderer_setup(FlRenderer *self)
Definition: fl_renderer.cc:269