#include "flutter/shell/platform/linux/public/flutter_linux/fl_view.h"
#include "flutter/shell/platform/linux/fl_view_private.h"
#include <atk/atk.h>
#include <gtk/gtk-a11y.h>
#include <cstring>
#include "flutter/shell/platform/linux/fl_accessible_node.h"
#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_socket_accessible.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 FlutterPointerDeviceKind | get_device_kind (GdkEvent *event) |
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_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_redraw (FlView *self) |
GHashTable * | fl_view_get_keyboard_state (FlView *self) |
Variables | |
static constexpr int | kMicrosecondsPerMillisecond = 1000 |
anonymous enum |
|
static |
Definition at line 386 of file fl_view.cc.
References check_pointer_inside(), event, and send_pointer_button_event().
Referenced by fl_view_init().
|
static |
Definition at line 403 of file fl_view.cc.
References event, and send_pointer_button_event().
Referenced by fl_view_init().
|
static |
Definition at line 217 of file fl_view.cc.
References event, fl_engine_send_mouse_pointer_event(), get_device_kind(), kMicrosecondsPerMillisecond, and TRUE.
Referenced by button_press_event_cb(), enter_notify_event_cb(), and motion_notify_event_cb().
|
static |
Definition at line 552 of file fl_view.cc.
References error, fl_engine_get_binary_messenger(), fl_mouse_cursor_plugin_new(), fl_platform_plugin_new(), fl_renderer_gdk_create_contexts(), fl_renderer_gdk_get_context(), fl_renderer_gdk_set_window(), init_scrolling(), and keymap_keys_changed_cb().
Referenced by fl_view_init().
|
static |
Definition at line 451 of file fl_view.cc.
References check_pointer_inside(), event, and TRUE.
Referenced by fl_view_init().
|
static |
Definition at line 757 of file fl_view.cc.
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.
|
static |
Definition at line 652 of file fl_view.cc.
References fl_engine_new(), fl_engine_set_on_pre_engine_restart_handler(), fl_engine_set_update_semantics_handler(), fl_renderer_gdk_new(), on_pre_engine_restart_cb(), and update_semantics_cb().
Referenced by fl_view_class_init().
|
static |
Definition at line 708 of file fl_view.cc.
References fl_engine_set_on_pre_engine_restart_handler(), and fl_engine_set_update_semantics_handler().
Referenced by fl_view_class_init().
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 842 of file fl_view.cc.
Referenced by fl_renderer_unblock_main_thread(), fl_renderer_wait_for_frame(), and TEST().
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 852 of file fl_view.cc.
References fl_keyboard_manager_get_pressed_state().
Referenced by fl_view_keyboard_delegate_iface_init().
|
static |
Definition at line 680 of file fl_view.cc.
References kPropFlutterProject, prop_id, pspec, and value.
Referenced by fl_view_class_init().
|
static |
Definition at line 279 of file fl_view.cc.
References fl_engine_get_binary_messenger(), fl_engine_get_texture_registrar(), and fl_plugin_registrar_new().
Referenced by fl_view_plugin_registry_iface_init().
|
static |
Definition at line 781 of file fl_view.cc.
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().
|
static |
Definition at line 740 of file fl_view.cc.
References event, fl_key_event_new_from_gdk_event(), and fl_keyboard_manager_handle_event().
Referenced by fl_view_class_init().
|
static |
Definition at line 749 of file fl_view.cc.
References event, fl_key_event_new_from_gdk_event(), and fl_keyboard_manager_handle_event().
Referenced by fl_view_class_init().
|
static |
Definition at line 294 of file fl_view.cc.
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.
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 837 of file fl_view.cc.
Referenced by TEST().
|
static |
Definition at line 696 of file fl_view.cc.
References handle_geometry_changed(), and pspec.
Referenced by fl_view_class_init().
|
static |
Definition at line 289 of file fl_view.cc.
References fl_view_get_registrar_for_plugin().
void fl_view_redraw | ( | FlView * | view | ) |
fl_view_redraw: @view: an #FlView.
Indicate the view needs to redraw.
Definition at line 847 of file fl_view.cc.
Referenced by fl_renderer_present_layers().
|
static |
Definition at line 346 of file fl_view.cc.
References fl_engine_send_mouse_pointer_event(), and fl_engine_send_pointer_pan_zoom_event().
|
static |
Definition at line 663 of file fl_view.cc.
References kPropFlutterProject, prop_id, pspec, and value.
Referenced by fl_view_class_init().
|
static |
Definition at line 373 of file fl_view.cc.
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 91 of file fl_view.cc.
References fl_platform_plugin_request_app_exit(), and TRUE.
|
static |
Definition at line 504 of file fl_view.cc.
References fl_scrolling_manager_handle_rotation_begin().
Referenced by fl_view_init().
|
static |
Definition at line 515 of file fl_view.cc.
References fl_scrolling_manager_handle_rotation_end().
Referenced by fl_view_init().
|
static |
Definition at line 508 of file fl_view.cc.
References fl_scrolling_manager_handle_rotation_update().
Referenced by fl_view_init().
|
static |
Definition at line 519 of file fl_view.cc.
References fl_scrolling_manager_handle_zoom_begin().
Referenced by fl_view_init().
|
static |
Definition at line 527 of file fl_view.cc.
References fl_scrolling_manager_handle_zoom_end().
Referenced by fl_view_init().
|
static |
Definition at line 523 of file fl_view.cc.
References fl_scrolling_manager_handle_zoom_update().
Referenced by fl_view_init().
|
static |
Definition at line 135 of file fl_view.cc.
References event.
Referenced by check_pointer_inside(), leave_notify_event_cb(), motion_notify_event_cb(), and send_pointer_button_event().
|
static |
Definition at line 235 of file fl_view.cc.
References fl_engine_send_window_metrics_event(), and fl_renderer_wait_for_frame().
Referenced by fl_view_notify(), realize_cb(), and size_allocate_cb().
|
static |
Definition at line 112 of file fl_view.cc.
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().
|
static |
Definition at line 129 of file fl_view.cc.
References fl_scrolling_manager_new().
Referenced by create_context_cb(), and on_pre_engine_restart_cb().
|
static |
|
static |
Definition at line 465 of file fl_view.cc.
References event, fl_engine_send_mouse_pointer_event(), get_device_kind(), kMicrosecondsPerMillisecond, and TRUE.
Referenced by fl_view_init().
|
static |
Definition at line 421 of file fl_view.cc.
References check_pointer_inside(), event, fl_engine_send_mouse_pointer_event(), fl_keyboard_manager_sync_modifier_if_needed(), get_device_kind(), kMicrosecondsPerMillisecond, and TRUE.
Referenced by fl_view_init().
|
static |
Definition at line 271 of file fl_view.cc.
References init_keyboard(), init_scrolling(), and user_data.
Referenced by fl_view_constructed().
|
static |
Definition at line 577 of file fl_view.cc.
References error, fl_engine_start(), fl_renderer_make_current(), fl_renderer_setup(), fl_renderer_start(), fl_socket_accessible_embed(), fl_view_accessible_new(), handle_geometry_changed(), init_keyboard(), and window_state_event_cb().
Referenced by fl_view_init().
|
static |
Definition at line 620 of file fl_view.cc.
References fl_renderer_render(), height, TRUE, and width.
Referenced by fl_view_init().
|
static |
Definition at line 410 of file fl_view.cc.
References event, fl_scrolling_manager_handle_scroll_event(), and TRUE.
Referenced by fl_view_init().
|
static |
Definition at line 155 of file fl_view.cc.
References event, fl_engine_send_mouse_pointer_event(), fl_keyboard_manager_sync_modifier_if_needed(), fl_scrolling_manager_set_last_mouse_position(), get_device_kind(), kMicrosecondsPerMillisecond, and TRUE.
Referenced by button_press_event_cb(), and button_release_event_cb().
|
static |
Definition at line 648 of file fl_view.cc.
References handle_geometry_changed().
Referenced by fl_view_init().
|
static |
Definition at line 634 of file fl_view.cc.
References error, fl_renderer_cleanup(), and fl_renderer_make_current().
Referenced by fl_view_init().
|
static |
Definition at line 258 of file fl_view.cc.
References fl_view_accessible_handle_update_semantics(), and user_data.
Referenced by fl_view_constructed().
|
static |
Definition at line 531 of file fl_view.cc.
References fl_engine_send_window_state_event(), and state.
Referenced by realize_cb().
|
staticconstexpr |
Definition at line 33 of file fl_view.cc.
Referenced by check_pointer_inside(), leave_notify_event_cb(), motion_notify_event_cb(), and send_pointer_button_event().