| Flutter Linux Embedder |

fl_view.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "flutter/shell/platform/linux/public/flutter_linux/fl_view.h"
6
7 #include "flutter/shell/platform/linux/fl_view_private.h"
8
9 #include <cstring>
10
11 #include "flutter/shell/platform/linux/fl_accessibility_plugin.h"
12 #include "flutter/shell/platform/linux/fl_engine_private.h"
13 #include "flutter/shell/platform/linux/fl_key_event.h"
14 #include "flutter/shell/platform/linux/fl_keyboard_manager.h"
15 #include "flutter/shell/platform/linux/fl_keyboard_view_delegate.h"
16 #include "flutter/shell/platform/linux/fl_mouse_cursor_plugin.h"
17 #include "flutter/shell/platform/linux/fl_platform_plugin.h"
18 #include "flutter/shell/platform/linux/fl_plugin_registrar_private.h"
19 #include "flutter/shell/platform/linux/fl_renderer_gl.h"
20 #include "flutter/shell/platform/linux/fl_scrolling_manager.h"
21 #include "flutter/shell/platform/linux/fl_scrolling_view_delegate.h"
22 #include "flutter/shell/platform/linux/fl_text_input_plugin.h"
23 #include "flutter/shell/platform/linux/fl_text_input_view_delegate.h"
24 #include "flutter/shell/platform/linux/fl_view_accessible.h"
25 #include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"
26 #include "flutter/shell/platform/linux/public/flutter_linux/fl_plugin_registry.h"
27
28 static constexpr int kMicrosecondsPerMillisecond = 1000;
29
30 struct _FlView {
31 GtkBox parent_instance;
32
33 // Project being run.
34 FlDartProject* project;
35
36 // Rendering output.
37 FlRenderer* renderer;
38
39 // Engine running @project.
40 FlEngine* engine;
41
42 // Pointer button state recorded for sending status updates.
43 int64_t button_state;
44
45 // Current state information for the window associated with this view.
46 GdkWindowState window_state;
47
48 // Flutter system channel handlers.
49 FlAccessibilityPlugin* accessibility_plugin;
50 FlKeyboardManager* keyboard_manager;
51 FlScrollingManager* scrolling_manager;
52 FlTextInputPlugin* text_input_plugin;
53 FlMouseCursorPlugin* mouse_cursor_plugin;
54 FlPlatformPlugin* platform_plugin;
55
56 GtkWidget* event_box;
57 FlGLArea* gl_area;
58
59 // Tracks whether mouse pointer is inside the view.
60 gboolean pointer_inside;
61
62 /* FlKeyboardViewDelegate related properties */
63 KeyboardLayoutNotifier keyboard_layout_notifier;
64 GdkKeymap* keymap;
65 gulong keymap_keys_changed_cb_id; // Signal connection ID for
66 // keymap-keys-changed
67 gulong window_state_cb_id; // Signal connection ID for window-state-changed
68 };
69
70 enum { kPropFlutterProject = 1, kPropLast };
71
72 static void fl_view_plugin_registry_iface_init(
73 FlPluginRegistryInterface* iface);
74
75 static void fl_view_keyboard_delegate_iface_init(
76 FlKeyboardViewDelegateInterface* iface);
77
78 static void fl_view_scrolling_delegate_iface_init(
79 FlScrollingViewDelegateInterface* iface);
80
81 static void fl_view_text_input_delegate_iface_init(
82 FlTextInputViewDelegateInterface* iface);
83
84 G_DEFINE_TYPE_WITH_CODE(
85 FlView,
86 fl_view,
87 GTK_TYPE_BOX,
88 G_IMPLEMENT_INTERFACE(fl_plugin_registry_get_type(),
89 fl_view_plugin_registry_iface_init)
90 G_IMPLEMENT_INTERFACE(fl_keyboard_view_delegate_get_type(),
91 fl_view_keyboard_delegate_iface_init)
92 G_IMPLEMENT_INTERFACE(fl_scrolling_view_delegate_get_type(),
93 fl_view_scrolling_delegate_iface_init)
94 G_IMPLEMENT_INTERFACE(fl_text_input_view_delegate_get_type(),
95 fl_view_text_input_delegate_iface_init))
96
97 // Signal handler for GtkWidget::delete-event
98 static gboolean window_delete_event_cb(GtkWidget* widget,
99 GdkEvent* event,
100 FlView* self) {
101 fl_platform_plugin_request_app_exit(self->platform_plugin);
102 // Stop the event from propagating.
103 return TRUE;
104 }
105
106 // Initialize keyboard manager.
107 static void init_keyboard(FlView* self) {
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 }
121
122 static void init_scrolling(FlView* self) {
123 self->scrolling_manager =
124 fl_scrolling_manager_new(FL_SCROLLING_VIEW_DELEGATE(self));
125 }
126
127 // Converts a GDK button event into a Flutter event and sends it to the engine.
128 static gboolean send_pointer_button_event(FlView* self, GdkEvent* event) {
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 }
187
188 // Generates a mouse pointer event if the pointer appears inside the window.
189 static void check_pointer_inside(FlView* self, GdkEvent* event) {
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 }
204
205 // Updates the engine with the current window metrics.
206 static void handle_geometry_changed(FlView* self) {
207 GtkAllocation allocation;
208 gtk_widget_get_allocation(GTK_WIDGET(self), &allocation);
209 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
210 fl_engine_send_window_metrics_event(
211 self->engine, allocation.width * scale_factor,
212 allocation.height * scale_factor, scale_factor);
213
214 // Make sure the view has been realized and its size has been allocated before
215 // waiting for a frame. `fl_view_realize()` and `fl_view_size_allocate()` may
216 // be called in either order depending on the order in which the window is
217 // shown and the view is added to a container in the app runner.
218 //
219 // Note: `gtk_widget_init()` initializes the size allocation to 1x1.
220 if (allocation.width > 1 && allocation.height > 1 &&
221 gtk_widget_get_realized(GTK_WIDGET(self))) {
222 fl_renderer_wait_for_frame(self->renderer, allocation.width * scale_factor,
223 allocation.height * scale_factor);
224 }
225 }
226
227 // Called when the engine updates accessibility nodes.
228 static void update_semantics_node_cb(FlEngine* engine,
229 const FlutterSemanticsNode* node,
230 gpointer user_data) {
231 FlView* self = FL_VIEW(user_data);
232
233 fl_accessibility_plugin_handle_update_semantics_node(
234 self->accessibility_plugin, node);
235 }
236
237 // Invoked by the engine right before the engine is restarted.
238 //
239 // This method should reset states to be as if the engine had just been started,
240 // which usually indicates the user has requested a hot restart (Shift-R in the
241 // Flutter CLI.)
242 static void on_pre_engine_restart_cb(FlEngine* engine, gpointer user_data) {
243 FlView* self = FL_VIEW(user_data);
244
245 g_clear_object(&self->keyboard_manager);
246 g_clear_object(&self->text_input_plugin);
247 g_clear_object(&self->scrolling_manager);
248 init_keyboard(self);
249 init_scrolling(self);
250 }
251
252 // Implements FlPluginRegistry::get_registrar_for_plugin.
253 static FlPluginRegistrar* fl_view_get_registrar_for_plugin(
254 FlPluginRegistry* registry,
255 const gchar* name) {
256 FlView* self = FL_VIEW(registry);
257
258 return fl_plugin_registrar_new(self,
259 fl_engine_get_binary_messenger(self->engine),
260 fl_engine_get_texture_registrar(self->engine));
261 }
262
263 static void fl_view_plugin_registry_iface_init(
264 FlPluginRegistryInterface* iface) {
265 iface->get_registrar_for_plugin = fl_view_get_registrar_for_plugin;
266 }
267
268 static void fl_view_keyboard_delegate_iface_init(
269 FlKeyboardViewDelegateInterface* iface) {
270 iface->send_key_event =
271 [](FlKeyboardViewDelegate* view_delegate, const FlutterKeyEvent* event,
272 FlutterKeyEventCallback callback, void* user_data) {
273 FlView* self = FL_VIEW(view_delegate);
274 if (self->engine != nullptr) {
275 fl_engine_send_key_event(self->engine, event, callback, user_data);
276 };
277 };
278
279 iface->text_filter_key_press = [](FlKeyboardViewDelegate* view_delegate,
280 FlKeyEvent* event) {
281 FlView* self = FL_VIEW(view_delegate);
282 return fl_text_input_plugin_filter_keypress(self->text_input_plugin, event);
283 };
284
285 iface->get_messenger = [](FlKeyboardViewDelegate* view_delegate) {
286 FlView* self = FL_VIEW(view_delegate);
287 return fl_engine_get_binary_messenger(self->engine);
288 };
289
290 iface->redispatch_event = [](FlKeyboardViewDelegate* view_delegate,
291 std::unique_ptr<FlKeyEvent> in_event) {
292 FlKeyEvent* event = in_event.release();
293 GdkEvent* gdk_event = reinterpret_cast<GdkEvent*>(event->origin);
294 GdkEventType event_type = gdk_event_get_event_type(gdk_event);
295 g_return_if_fail(event_type == GDK_KEY_PRESS ||
296 event_type == GDK_KEY_RELEASE);
297 gdk_event_put(gdk_event);
298 fl_key_event_dispose(event);
299 };
300
301 iface->subscribe_to_layout_change = [](FlKeyboardViewDelegate* view_delegate,
302 KeyboardLayoutNotifier notifier) {
303 FlView* self = FL_VIEW(view_delegate);
304 self->keyboard_layout_notifier = std::move(notifier);
305 };
306
307 iface->lookup_key = [](FlKeyboardViewDelegate* view_delegate,
308 const GdkKeymapKey* key) -> guint {
309 FlView* self = FL_VIEW(view_delegate);
310 g_return_val_if_fail(self->keymap != nullptr, 0);
311 return gdk_keymap_lookup_key(self->keymap, key);
312 };
313
314 iface->get_keyboard_state =
315 [](FlKeyboardViewDelegate* view_delegate) -> GHashTable* {
316 FlView* self = FL_VIEW(view_delegate);
317 return fl_view_get_keyboard_state(self);
318 };
319 }
320
321 static void fl_view_scrolling_delegate_iface_init(
322 FlScrollingViewDelegateInterface* iface) {
323 iface->send_mouse_pointer_event =
324 [](FlScrollingViewDelegate* view_delegate, FlutterPointerPhase phase,
325 size_t timestamp, double x, double y, double scroll_delta_x,
326 double scroll_delta_y, int64_t buttons) {
327 FlView* self = FL_VIEW(view_delegate);
328 if (self->engine != nullptr) {
329 fl_engine_send_mouse_pointer_event(self->engine, phase, timestamp, x,
330 y, scroll_delta_x, scroll_delta_y,
331 buttons);
332 }
333 };
334 iface->send_pointer_pan_zoom_event =
335 [](FlScrollingViewDelegate* view_delegate, size_t timestamp, double x,
336 double y, FlutterPointerPhase phase, double pan_x, double pan_y,
337 double scale, double rotation) {
338 FlView* self = FL_VIEW(view_delegate);
339 if (self->engine != nullptr) {
340 fl_engine_send_pointer_pan_zoom_event(self->engine, timestamp, x, y,
341 phase, pan_x, pan_y, scale,
342 rotation);
343 };
344 };
345 }
346
347 static void fl_view_text_input_delegate_iface_init(
348 FlTextInputViewDelegateInterface* iface) {
349 iface->translate_coordinates = [](FlTextInputViewDelegate* delegate,
350 gint view_x, gint view_y, gint* window_x,
351 gint* window_y) {
352 FlView* self = FL_VIEW(delegate);
353 gtk_widget_translate_coordinates(GTK_WIDGET(self),
354 gtk_widget_get_toplevel(GTK_WIDGET(self)),
355 view_x, view_y, window_x, window_y);
356 };
357 }
358
359 // Signal handler for GtkWidget::button-press-event
360 static gboolean button_press_event_cb(GtkWidget* widget,
361 GdkEventButton* button_event,
362 FlView* self) {
363 GdkEvent* event = reinterpret_cast<GdkEvent*>(button_event);
364
365 // Flutter doesn't handle double and triple click events.
366 GdkEventType event_type = gdk_event_get_event_type(event);
367 if (event_type == GDK_DOUBLE_BUTTON_PRESS ||
368 event_type == GDK_TRIPLE_BUTTON_PRESS) {
369 return FALSE;
370 }
371
372 check_pointer_inside(self, event);
373
374 return send_pointer_button_event(self, event);
375 }
376
377 // Signal handler for GtkWidget::button-release-event
378 static gboolean button_release_event_cb(GtkWidget* widget,
379 GdkEventButton* button_event,
380 FlView* self) {
381 GdkEvent* event = reinterpret_cast<GdkEvent*>(button_event);
382 return send_pointer_button_event(self, event);
383 }
384
385 // Signal handler for GtkWidget::scroll-event
386 static gboolean scroll_event_cb(GtkWidget* widget,
387 GdkEventScroll* event,
388 FlView* self) {
389 // TODO(robert-ancell): Update to use GtkEventControllerScroll when we can
390 // depend on GTK 3.24.
391
392 fl_scrolling_manager_handle_scroll_event(
393 self->scrolling_manager, event,
394 gtk_widget_get_scale_factor(GTK_WIDGET(self)));
395 return TRUE;
396 }
397
398 // Signal handler for GtkWidget::motion-notify-event
399 static gboolean motion_notify_event_cb(GtkWidget* widget,
400 GdkEventMotion* motion_event,
401 FlView* self) {
402 GdkEvent* event = reinterpret_cast<GdkEvent*>(motion_event);
403
404 if (self->engine == nullptr) {
405 return FALSE;
406 }
407
408 guint event_time = gdk_event_get_time(event);
409 GdkModifierType event_state = static_cast<GdkModifierType>(0);
410 gdk_event_get_state(event, &event_state);
411 gdouble event_x = 0.0, event_y = 0.0;
412 gdk_event_get_coords(event, &event_x, &event_y);
413
414 check_pointer_inside(self, event);
415
416 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
417
418 fl_keyboard_manager_sync_modifier_if_needed(self->keyboard_manager,
419 event_state, event_time);
420 fl_engine_send_mouse_pointer_event(
421 self->engine, self->button_state != 0 ? kMove : kHover,
422 event_time * kMicrosecondsPerMillisecond, event_x * scale_factor,
423 event_y * scale_factor, 0, 0, self->button_state);
424
425 return TRUE;
426 }
427
428 // Signal handler for GtkWidget::enter-notify-event
429 static gboolean enter_notify_event_cb(GtkWidget* widget,
430 GdkEventCrossing* crossing_event,
431 FlView* self) {
432 GdkEvent* event = reinterpret_cast<GdkEvent*>(crossing_event);
433
434 if (self->engine == nullptr) {
435 return FALSE;
436 }
437
438 check_pointer_inside(self, event);
439
440 return TRUE;
441 }
442
443 // Signal handler for GtkWidget::leave-notify-event
444 static gboolean leave_notify_event_cb(GtkWidget* widget,
445 GdkEventCrossing* crossing_event,
446 FlView* self) {
447 GdkEvent* event = reinterpret_cast<GdkEvent*>(crossing_event);
448
449 guint event_time = gdk_event_get_time(event);
450 gdouble event_x = 0.0, event_y = 0.0;
451 gdk_event_get_coords(event, &event_x, &event_y);
452
453 if (crossing_event->mode != GDK_CROSSING_NORMAL) {
454 return FALSE;
455 }
456
457 if (self->engine == nullptr) {
458 return FALSE;
459 }
460
461 // Don't remove pointer while button is down; In case of dragging outside of
462 // window with mouse grab active Gtk will send another leave notify on
463 // release.
464 if (self->pointer_inside && self->button_state == 0) {
465 gint scale_factor = gtk_widget_get_scale_factor(GTK_WIDGET(self));
466 fl_engine_send_mouse_pointer_event(
467 self->engine, kRemove, event_time * kMicrosecondsPerMillisecond,
468 event_x * scale_factor, event_y * scale_factor, 0, 0,
469 self->button_state);
470 self->pointer_inside = FALSE;
471 }
472
473 return TRUE;
474 }
475
476 static void keymap_keys_changed_cb(GdkKeymap* keymapf, FlView* self) {
477 if (self->keyboard_layout_notifier == nullptr) {
478 return;
479 }
480
481 self->keyboard_layout_notifier();
482 }
483
484 static void gesture_rotation_begin_cb(GtkGestureRotate* gesture,
485 GdkEventSequence* sequence,
486 FlView* self) {
487 fl_scrolling_manager_handle_rotation_begin(self->scrolling_manager);
488 }
489
490 static void gesture_rotation_update_cb(GtkGestureRotate* widget,
491 gdouble rotation,
492 gdouble delta,
493 FlView* self) {
494 fl_scrolling_manager_handle_rotation_update(self->scrolling_manager,
495 rotation);
496 }
497
498 static void gesture_rotation_end_cb(GtkGestureRotate* gesture,
499 GdkEventSequence* sequence,
500 FlView* self) {
501 fl_scrolling_manager_handle_rotation_end(self->scrolling_manager);
502 }
503
504 static void gesture_zoom_begin_cb(GtkGestureZoom* gesture,
505 GdkEventSequence* sequence,
506 FlView* self) {
507 fl_scrolling_manager_handle_zoom_begin(self->scrolling_manager);
508 }
509
510 static void gesture_zoom_update_cb(GtkGestureZoom* widget,
511 gdouble scale,
512 FlView* self) {
513 fl_scrolling_manager_handle_zoom_update(self->scrolling_manager, scale);
514 }
515
516 static void gesture_zoom_end_cb(GtkGestureZoom* gesture,
517 GdkEventSequence* sequence,
518 FlView* self) {
519 fl_scrolling_manager_handle_zoom_end(self->scrolling_manager);
520 }
521
522 static gboolean window_state_event_cb(GtkWidget* widget,
523 GdkEvent* event,
524 gpointer user_data) {
525 g_return_val_if_fail(FL_IS_VIEW(user_data), FALSE);
526 g_return_val_if_fail(FL_IS_ENGINE(FL_VIEW(user_data)->engine), FALSE);
527 FlView* self = FL_VIEW(user_data);
528 GdkWindowState state = event->window_state.new_window_state;
529 GdkWindowState previous_state = self->window_state;
530 self->window_state = state;
531 bool was_visible = !((previous_state & GDK_WINDOW_STATE_WITHDRAWN) ||
532 (previous_state & GDK_WINDOW_STATE_ICONIFIED));
533 bool is_visible = !((state & GDK_WINDOW_STATE_WITHDRAWN) ||
534 (state & GDK_WINDOW_STATE_ICONIFIED));
535 bool was_focused = (previous_state & GDK_WINDOW_STATE_FOCUSED);
536 bool is_focused = (state & GDK_WINDOW_STATE_FOCUSED);
537 if (was_visible != is_visible || was_focused != is_focused) {
538 if (self->engine != nullptr) {
539 fl_engine_send_window_state_event(FL_ENGINE(self->engine), is_visible,
540 is_focused);
541 }
542 }
543 return FALSE;
544 }
545
546 static void realize_cb(GtkWidget* widget) {
547 FlView* self = FL_VIEW(widget);
548 g_autoptr(GError) error = nullptr;
549
550 // Handle requests by the user to close the application.
551 GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
552
553 // Listen to window state changes.
554 self->window_state_cb_id =
555 g_signal_connect(toplevel_window, "window-state-event",
556 G_CALLBACK(window_state_event_cb), self);
557 self->window_state =
558 gdk_window_get_state(gtk_widget_get_window(toplevel_window));
559
560 g_signal_connect(toplevel_window, "delete-event",
561 G_CALLBACK(window_delete_event_cb), self);
562
563 init_keyboard(self);
564
565 if (!fl_renderer_start(self->renderer, self, &error)) {
566 g_warning("Failed to start Flutter renderer: %s", error->message);
567 return;
568 }
569
570 if (!fl_engine_start(self->engine, &error)) {
571 g_warning("Failed to start Flutter engine: %s", error->message);
572 return;
573 }
574
575 handle_geometry_changed(self);
576 }
577
578 static void configure_cb(GtkWidget* widget, GdkEventConfigure event) {
579 FlView* self = FL_VIEW(widget);
580 handle_geometry_changed(self);
581 }
582
583 static void fl_view_constructed(GObject* object) {
584 FlView* self = FL_VIEW(object);
585
586 self->renderer = FL_RENDERER(fl_renderer_gl_new());
587 self->engine = fl_engine_new(self->project, self->renderer);
588 fl_engine_set_update_semantics_node_handler(
589 self->engine, update_semantics_node_cb, self, nullptr);
590 fl_engine_set_on_pre_engine_restart_handler(
591 self->engine, on_pre_engine_restart_cb, self, nullptr);
592
593 // Must initialize the keymap before the keyboard.
594 self->keymap = gdk_keymap_get_for_display(gdk_display_get_default());
595
596 // Create system channel handlers.
597 FlBinaryMessenger* messenger = fl_engine_get_binary_messenger(self->engine);
598 self->accessibility_plugin = fl_accessibility_plugin_new(self);
599 init_scrolling(self);
600 self->mouse_cursor_plugin = fl_mouse_cursor_plugin_new(messenger, self);
601 self->platform_plugin = fl_platform_plugin_new(messenger);
602
603 self->event_box = gtk_event_box_new();
604 gtk_widget_set_hexpand(self->event_box, TRUE);
605 gtk_widget_set_vexpand(self->event_box, TRUE);
606 gtk_container_add(GTK_CONTAINER(self), self->event_box);
607 gtk_widget_show(self->event_box);
608 gtk_widget_add_events(self->event_box,
609 GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
610 GDK_BUTTON_RELEASE_MASK | GDK_SCROLL_MASK |
611 GDK_SMOOTH_SCROLL_MASK);
612
613 g_signal_connect(self->event_box, "button-press-event",
614 G_CALLBACK(button_press_event_cb), self);
615 g_signal_connect(self->event_box, "button-release-event",
616 G_CALLBACK(button_release_event_cb), self);
617 g_signal_connect(self->event_box, "scroll-event", G_CALLBACK(scroll_event_cb),
618 self);
619 g_signal_connect(self->event_box, "motion-notify-event",
620 G_CALLBACK(motion_notify_event_cb), self);
621 g_signal_connect(self->event_box, "enter-notify-event",
622 G_CALLBACK(enter_notify_event_cb), self);
623 g_signal_connect(self->event_box, "leave-notify-event",
624 G_CALLBACK(leave_notify_event_cb), self);
625 self->keymap_keys_changed_cb_id = g_signal_connect(
626 self->keymap, "keys-changed", G_CALLBACK(keymap_keys_changed_cb), self);
627 GtkGesture* zoom = gtk_gesture_zoom_new(self->event_box);
628 g_signal_connect(zoom, "begin", G_CALLBACK(gesture_zoom_begin_cb), self);
629 g_signal_connect(zoom, "scale-changed", G_CALLBACK(gesture_zoom_update_cb),
630 self);
631 g_signal_connect(zoom, "end", G_CALLBACK(gesture_zoom_end_cb), self);
632 GtkGesture* rotate = gtk_gesture_rotate_new(self->event_box);
633 g_signal_connect(rotate, "begin", G_CALLBACK(gesture_rotation_begin_cb),
634 self);
635 g_signal_connect(rotate, "angle-changed",
636 G_CALLBACK(gesture_rotation_update_cb), self);
637 g_signal_connect(rotate, "end", G_CALLBACK(gesture_rotation_end_cb), self);
638
639 g_signal_connect(self, "realize", G_CALLBACK(realize_cb), self);
640 g_signal_connect(self, "size-allocate", G_CALLBACK(configure_cb), self);
641 }
642
643 static void fl_view_set_property(GObject* object,
644 guint prop_id,
645 const GValue* value,
646 GParamSpec* pspec) {
647 FlView* self = FL_VIEW(object);
648
649 switch (prop_id) {
650 case kPropFlutterProject:
651 g_set_object(&self->project,
652 static_cast<FlDartProject*>(g_value_get_object(value)));
653 break;
654 default:
655 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
656 break;
657 }
658 }
659
660 static void fl_view_get_property(GObject* object,
661 guint prop_id,
662 GValue* value,
663 GParamSpec* pspec) {
664 FlView* self = FL_VIEW(object);
665
666 switch (prop_id) {
667 case kPropFlutterProject:
668 g_value_set_object(value, self->project);
669 break;
670 default:
671 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
672 break;
673 }
674 }
675
676 static void fl_view_notify(GObject* object, GParamSpec* pspec) {
677 FlView* self = FL_VIEW(object);
678
679 if (strcmp(pspec->name, "scale-factor") == 0) {
680 handle_geometry_changed(self);
681 }
682
683 if (G_OBJECT_CLASS(fl_view_parent_class)->notify != nullptr) {
684 G_OBJECT_CLASS(fl_view_parent_class)->notify(object, pspec);
685 }
686 }
687
688 static void fl_view_dispose(GObject* object) {
689 FlView* self = FL_VIEW(object);
690
691 if (self->engine != nullptr) {
692 fl_engine_set_update_semantics_node_handler(self->engine, nullptr, nullptr,
693 nullptr);
694 fl_engine_set_on_pre_engine_restart_handler(self->engine, nullptr, nullptr,
695 nullptr);
696 }
697
698 if (self->window_state_cb_id != 0) {
699 GtkWidget* toplevel_window = gtk_widget_get_toplevel(GTK_WIDGET(self));
700 g_signal_handler_disconnect(toplevel_window, self->window_state_cb_id);
701 self->window_state_cb_id = 0;
702 }
703
704 g_clear_object(&self->project);
705 g_clear_object(&self->renderer);
706 g_clear_object(&self->engine);
707 g_clear_object(&self->accessibility_plugin);
708 g_clear_object(&self->keyboard_manager);
709 if (self->keymap_keys_changed_cb_id != 0) {
710 g_signal_handler_disconnect(self->keymap, self->keymap_keys_changed_cb_id);
711 self->keymap_keys_changed_cb_id = 0;
712 }
713 g_clear_object(&self->mouse_cursor_plugin);
714 g_clear_object(&self->platform_plugin);
715
716 G_OBJECT_CLASS(fl_view_parent_class)->dispose(object);
717 }
718
719 // Implements GtkWidget::key_press_event.
720 static gboolean fl_view_key_press_event(GtkWidget* widget, GdkEventKey* event) {
721 FlView* self = FL_VIEW(widget);
722
723 return fl_keyboard_manager_handle_event(
724 self->keyboard_manager, fl_key_event_new_from_gdk_event(gdk_event_copy(
725 reinterpret_cast<GdkEvent*>(event))));
726 }
727
728 // Implements GtkWidget::key_release_event.
729 static gboolean fl_view_key_release_event(GtkWidget* widget,
730 GdkEventKey* event) {
731 FlView* self = FL_VIEW(widget);
732 return fl_keyboard_manager_handle_event(
733 self->keyboard_manager, fl_key_event_new_from_gdk_event(gdk_event_copy(
734 reinterpret_cast<GdkEvent*>(event))));
735 }
736
737 static void fl_view_class_init(FlViewClass* klass) {
738 GObjectClass* object_class = G_OBJECT_CLASS(klass);
739 object_class->constructed = fl_view_constructed;
740 object_class->set_property = fl_view_set_property;
741 object_class->get_property = fl_view_get_property;
742 object_class->notify = fl_view_notify;
743 object_class->dispose = fl_view_dispose;
744
745 GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
746 widget_class->key_press_event = fl_view_key_press_event;
747 widget_class->key_release_event = fl_view_key_release_event;
748
749 g_object_class_install_property(
750 G_OBJECT_CLASS(klass), kPropFlutterProject,
751 g_param_spec_object(
752 "flutter-project", "flutter-project", "Flutter project in use",
753 fl_dart_project_get_type(),
754 static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
755 G_PARAM_STATIC_STRINGS)));
756
757 gtk_widget_class_set_accessible_type(GTK_WIDGET_CLASS(klass),
758 fl_view_accessible_get_type());
759 }
760
761 static void fl_view_init(FlView* self) {
762 gtk_widget_set_can_focus(GTK_WIDGET(self), TRUE);
763 }
764
765 G_MODULE_EXPORT FlView* fl_view_new(FlDartProject* project) {
766 return static_cast<FlView*>(
767 g_object_new(fl_view_get_type(), "flutter-project", project, nullptr));
768 }
769
770 G_MODULE_EXPORT FlEngine* fl_view_get_engine(FlView* self) {
771 g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
772 return self->engine;
773 }
774
775 void fl_view_set_textures(FlView* self,
776 GdkGLContext* context,
777 GPtrArray* textures) {
778 g_return_if_fail(FL_IS_VIEW(self));
779
780 if (self->gl_area == nullptr) {
781 self->gl_area = FL_GL_AREA(fl_gl_area_new(context));
782 gtk_widget_show(GTK_WIDGET(self->gl_area));
783 gtk_container_add(GTK_CONTAINER(self->event_box),
784 GTK_WIDGET(self->gl_area));
785 }
786
787 fl_gl_area_queue_render(self->gl_area, textures);
788 }
789
790 GHashTable* fl_view_get_keyboard_state(FlView* self) {
791 g_return_val_if_fail(FL_IS_VIEW(self), nullptr);
792
793 return fl_keyboard_manager_get_pressed_state(self->keyboard_manager);
794 }
fl_accessibility_plugin_new
FlAccessibilityPlugin * fl_accessibility_plugin_new(FlView *view)
Definition: fl_accessibility_plugin.cc:35
_FlView::pointer_inside
gboolean pointer_inside
Definition: fl_view.cc:60
realize_cb
static void realize_cb(GtkWidget *widget)
Definition: fl_view.cc:546
fl_renderer_wait_for_frame
void fl_renderer_wait_for_frame(FlRenderer *self, int target_width, int target_height)
Definition: fl_renderer.cc:140
fl_view_text_input_delegate_iface_init
static void fl_view_text_input_delegate_iface_init(FlTextInputViewDelegateInterface *iface)
Definition: fl_view.cc:347
fl_view_get_property
static void fl_view_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
Definition: fl_view.cc:660
fl_view_accessible.h
gesture_rotation_begin_cb
static void gesture_rotation_begin_cb(GtkGestureRotate *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:484
fl_scrolling_manager_handle_zoom_end
void fl_scrolling_manager_handle_zoom_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:185
fl_engine_send_key_event
void fl_engine_send_key_event(FlEngine *self, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
Definition: fl_engine.cc:847
fl_key_event_new_from_gdk_event
FlKeyEvent * fl_key_event_new_from_gdk_event(GdkEvent *event)
Definition: fl_key_event.cc:12
kMicrosecondsPerMillisecond
static constexpr int kMicrosecondsPerMillisecond
Definition: fl_view.cc:28
fl_scrolling_manager_handle_scroll_event
void fl_scrolling_manager_handle_scroll_event(FlScrollingManager *self, GdkEventScroll *scroll_event, gint scale_factor)
Definition: fl_scrolling_manager.cc:67
fl_view_scrolling_delegate_iface_init
static void fl_view_scrolling_delegate_iface_init(FlScrollingViewDelegateInterface *iface)
Definition: fl_view.cc:321
fl_text_input_view_delegate.h
fl_text_input_plugin_filter_keypress
gboolean fl_text_input_plugin_filter_keypress(FlTextInputPlugin *self, FlKeyEvent *event)
Definition: fl_text_input_plugin.cc:776
fl_scrolling_view_delegate.h
fl_view_class_init
static void fl_view_class_init(FlViewClass *klass)
Definition: fl_view.cc:737
fl_plugin_registrar_private.h
gesture_zoom_end_cb
static void gesture_zoom_end_cb(GtkGestureZoom *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:516
_FlView::parent_instance
GtkBox parent_instance
Definition: fl_view.cc:31
fl_keyboard_manager.h
init_scrolling
static void init_scrolling(FlView *self)
Definition: fl_view.cc:122
fl_engine_send_mouse_pointer_event
void fl_engine_send_mouse_pointer_event(FlEngine *self, FlutterPointerPhase phase, size_t timestamp, double x, double y, double scroll_delta_x, double scroll_delta_y, int64_t buttons)
Definition: fl_engine.cc:778
fl_mouse_cursor_plugin.h
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)) static gboolean window_delete_event_cb(GtkWidget *widget
fl_text_input_plugin.h
fl_view_get_registrar_for_plugin
static FlPluginRegistrar * fl_view_get_registrar_for_plugin(FlPluginRegistry *registry, const gchar *name)
Definition: fl_view.cc:253
configure_cb
static void configure_cb(GtkWidget *widget, GdkEventConfigure event)
Definition: fl_view.cc:578
gesture_rotation_end_cb
static void gesture_rotation_end_cb(GtkGestureRotate *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:498
fl_platform_plugin_request_app_exit
void fl_platform_plugin_request_app_exit(FlPlatformPlugin *self)
Definition: fl_platform_plugin.cc:418
_FlView::window_state
GdkWindowState window_state
Definition: fl_view.cc:46
_FlView::keymap
GdkKeymap * keymap
Definition: fl_view.cc:64
fl_renderer_gl.h
fl_platform_plugin_new
FlPlatformPlugin * fl_platform_plugin_new(FlBinaryMessenger *messenger)
Definition: fl_platform_plugin.cc:402
leave_notify_event_cb
static gboolean leave_notify_event_cb(GtkWidget *widget, GdkEventCrossing *crossing_event, FlView *self)
Definition: fl_view.cc:444
user_data
FlKeyEvent uint64_t FlKeyResponderAsyncCallback gpointer user_data
Definition: fl_key_channel_responder.cc:121
_FlView
Definition: fl_view.cc:30
_FlView::event_box
GtkWidget * event_box
Definition: fl_view.cc:56
fl_accessibility_plugin_handle_update_semantics_node
void fl_accessibility_plugin_handle_update_semantics_node(FlAccessibilityPlugin *self, const FlutterSemanticsNode *node)
Definition: fl_accessibility_plugin.cc:46
fl_engine_send_window_metrics_event
void fl_engine_send_window_metrics_event(FlEngine *self, size_t width, size_t height, double pixel_ratio)
Definition: fl_engine.cc:760
fl_view_set_property
static void fl_view_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
Definition: fl_view.cc:643
keymap_keys_changed_cb
static void keymap_keys_changed_cb(GdkKeymap *keymapf, FlView *self)
Definition: fl_view.cc:476
fl_engine_get_binary_messenger
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
Definition: fl_engine.cc:902
_FlView::accessibility_plugin
FlAccessibilityPlugin * accessibility_plugin
Definition: fl_view.cc:49
event
GdkEvent * event
Definition: fl_view.cc:99
_FlKeyEvent
Definition: fl_key_event.h:31
state
AtkStateType state
Definition: fl_accessible_node.cc:10
gesture_zoom_update_cb
static void gesture_zoom_update_cb(GtkGestureZoom *widget, gdouble scale, FlView *self)
Definition: fl_view.cc:510
fl_view_private.h
enter_notify_event_cb
static gboolean enter_notify_event_cb(GtkWidget *widget, GdkEventCrossing *crossing_event, FlView *self)
Definition: fl_view.cc:429
_FlView::scrolling_manager
FlScrollingManager * scrolling_manager
Definition: fl_view.cc:51
_FlView::window_state_cb_id
gulong window_state_cb_id
Definition: fl_view.cc:67
fl_gl_area_new
GtkWidget * fl_gl_area_new(GdkGLContext *context)
Definition: fl_gl_area.cc:121
fl_view_new
G_MODULE_EXPORT FlView * fl_view_new(FlDartProject *project)
Definition: fl_view.cc:765
fl_keyboard_manager_handle_event
gboolean fl_keyboard_manager_handle_event(FlKeyboardManager *self, FlKeyEvent *event)
Definition: fl_keyboard_manager.cc:635
_FlView::gl_area
FlGLArea * gl_area
Definition: fl_view.cc:57
_FlView::button_state
int64_t button_state
Definition: fl_view.cc:43
fl_engine_set_update_semantics_node_handler
void fl_engine_set_update_semantics_node_handler(FlEngine *self, FlEngineUpdateSemanticsNodeHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:613
KeyboardLayoutNotifier
std::function< void()> KeyboardLayoutNotifier
Definition: fl_keyboard_view_delegate.h:17
window_state_event_cb
static gboolean window_state_event_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Definition: fl_view.cc:522
kPropLast
@ kPropLast
Definition: fl_view.cc:70
TRUE
return TRUE
Definition: fl_view.cc:103
fl_accessibility_plugin.h
fl_engine_send_pointer_pan_zoom_event
void fl_engine_send_pointer_pan_zoom_event(FlEngine *self, size_t timestamp, double x, double y, FlutterPointerPhase phase, double pan_x, double pan_y, double scale, double rotation)
Definition: fl_engine.cc:813
fl_scrolling_manager_new
FlScrollingManager * fl_scrolling_manager_new(FlScrollingViewDelegate *view_delegate)
Definition: fl_scrolling_manager.cc:41
_FlView::keyboard_layout_notifier
KeyboardLayoutNotifier keyboard_layout_notifier
Definition: fl_view.cc:63
fl_view_key_press_event
static gboolean fl_view_key_press_event(GtkWidget *widget, GdkEventKey *event)
Definition: fl_view.cc:720
_FlView::engine
FlEngine * engine
Definition: fl_view.cc:40
fl_engine_new
FlEngine * fl_engine_new(FlDartProject *project, FlRenderer *renderer)
Definition: fl_engine.cc:467
fl_view_key_release_event
static gboolean fl_view_key_release_event(GtkWidget *widget, GdkEventKey *event)
Definition: fl_view.cc:729
fl_view_plugin_registry_iface_init
static void fl_view_plugin_registry_iface_init(FlPluginRegistryInterface *iface)
Definition: fl_view.cc:263
fl_scrolling_manager_set_last_mouse_position
void fl_scrolling_manager_set_last_mouse_position(FlScrollingManager *self, gdouble x, gdouble y)
Definition: fl_scrolling_manager.cc:60
fl_view_dispose
static void fl_view_dispose(GObject *object)
Definition: fl_view.cc:688
fl_engine_private.h
fl_scrolling_manager.h
fl_scrolling_manager_handle_zoom_update
void fl_scrolling_manager_handle_zoom_update(FlScrollingManager *self, gdouble scale)
Definition: fl_scrolling_manager.cc:178
fl_view_get_engine
G_MODULE_EXPORT FlEngine * fl_view_get_engine(FlView *self)
Definition: fl_view.cc:770
check_pointer_inside
static void check_pointer_inside(FlView *self, GdkEvent *event)
Definition: fl_view.cc:189
fl_view_get_keyboard_state
GHashTable * fl_view_get_keyboard_state(FlView *self)
Definition: fl_view.cc:790
fl_scrolling_manager_handle_rotation_update
void fl_scrolling_manager_handle_rotation_update(FlScrollingManager *self, gdouble rotation)
Definition: fl_scrolling_manager.cc:152
gesture_rotation_update_cb
static void gesture_rotation_update_cb(GtkGestureRotate *widget, gdouble rotation, gdouble delta, FlView *self)
Definition: fl_view.cc:490
_FlView::keymap_keys_changed_cb_id
gulong keymap_keys_changed_cb_id
Definition: fl_view.cc:65
fl_view.h
_FlView::mouse_cursor_plugin
FlMouseCursorPlugin * mouse_cursor_plugin
Definition: fl_view.cc:53
fl_keyboard_manager_new
FlKeyboardManager * fl_keyboard_manager_new(FlBinaryMessenger *messenger, FlKeyboardViewDelegate *view_delegate)
Definition: fl_keyboard_manager.cc:585
fl_key_event_dispose
void fl_key_event_dispose(FlKeyEvent *event)
Definition: fl_key_event.cc:39
fl_keyboard_manager_sync_modifier_if_needed
void fl_keyboard_manager_sync_modifier_if_needed(FlKeyboardManager *self, guint state, double event_time)
Definition: fl_keyboard_manager.cc:672
_FlView::text_input_plugin
FlTextInputPlugin * text_input_plugin
Definition: fl_view.cc:52
self
GdkEvent FlView * self
Definition: fl_view.cc:100
on_pre_engine_restart_cb
static void on_pre_engine_restart_cb(FlEngine *engine, gpointer user_data)
Definition: fl_view.cc:242
fl_renderer_start
gboolean fl_renderer_start(FlRenderer *self, FlView *view, GError **error)
Definition: fl_renderer.cc:59
fl_keyboard_manager_get_pressed_state
GHashTable * fl_keyboard_manager_get_pressed_state(FlKeyboardManager *self)
Definition: fl_keyboard_manager.cc:685
update_semantics_node_cb
static void update_semantics_node_cb(FlEngine *engine, const FlutterSemanticsNode *node, gpointer user_data)
Definition: fl_view.cc:228
fl_gl_area_queue_render
void fl_gl_area_queue_render(FlGLArea *self, GPtrArray *textures)
Definition: fl_gl_area.cc:129
handle_geometry_changed
static void handle_geometry_changed(FlView *self)
Definition: fl_view.cc:206
button_release_event_cb
static gboolean button_release_event_cb(GtkWidget *widget, GdkEventButton *button_event, FlView *self)
Definition: fl_view.cc:378
send_pointer_button_event
static gboolean send_pointer_button_event(FlView *self, GdkEvent *event)
Definition: fl_view.cc:128
fl_view_constructed
static void fl_view_constructed(GObject *object)
Definition: fl_view.cc:583
fl_renderer_gl_new
FlRendererGL * fl_renderer_gl_new()
Definition: fl_renderer_gl.cc:134
fl_view_keyboard_delegate_iface_init
static void fl_view_keyboard_delegate_iface_init(FlKeyboardViewDelegateInterface *iface)
Definition: fl_view.cc:268
fl_key_event.h
fl_engine.h
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
_FlView::renderer
FlRenderer * renderer
Definition: fl_view.cc:37
fl_mouse_cursor_plugin_new
FlMouseCursorPlugin * fl_mouse_cursor_plugin_new(FlBinaryMessenger *messenger, FlView *view)
Definition: fl_mouse_cursor_plugin.cc:163
fl_view_init
static void fl_view_init(FlView *self)
Definition: fl_view.cc:761
fl_view_notify
static void fl_view_notify(GObject *object, GParamSpec *pspec)
Definition: fl_view.cc:676
fl_scrolling_manager_handle_rotation_end
void fl_scrolling_manager_handle_rotation_end(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:159
fl_view_set_textures
void fl_view_set_textures(FlView *self, GdkGLContext *context, GPtrArray *textures)
Definition: fl_view.cc:775
fl_engine_start
gboolean fl_engine_start(FlEngine *self, GError **error)
Definition: fl_engine.cc:483
fl_scrolling_manager_handle_rotation_begin
void fl_scrolling_manager_handle_rotation_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:141
_FlView::keyboard_manager
FlKeyboardManager * keyboard_manager
Definition: fl_view.cc:50
fl_engine_send_window_state_event
void fl_engine_send_window_state_event(FlEngine *self, gboolean visible, gboolean focused)
Definition: fl_engine.cc:748
fl_plugin_registrar_new
FlPluginRegistrar * fl_plugin_registrar_new(FlView *view, FlBinaryMessenger *messenger, FlTextureRegistrar *texture_registrar)
Definition: fl_plugin_registrar.cc:87
engine
FlEngine * engine
Definition: fl_view_accessible.cc:29
fl_keyboard_view_delegate.h
fl_platform_plugin.h
fl_plugin_registry.h
callback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition: fl_key_channel_responder.cc:120
_FlView::project
FlDartProject * project
Definition: fl_view.cc:34
fl_scrolling_manager_handle_zoom_begin
void fl_scrolling_manager_handle_zoom_begin(FlScrollingManager *self)
Definition: fl_scrolling_manager.cc:168
_FlView::platform_plugin
FlPlatformPlugin * platform_plugin
Definition: fl_view.cc:54
value
uint8_t value
Definition: fl_standard_message_codec.cc:41
init_keyboard
static void init_keyboard(FlView *self)
Definition: fl_view.cc:107
fl_engine_get_texture_registrar
G_MODULE_EXPORT FlTextureRegistrar * fl_engine_get_texture_registrar(FlEngine *self)
Definition: fl_engine.cc:918
button_press_event_cb
static gboolean button_press_event_cb(GtkWidget *widget, GdkEventButton *button_event, FlView *self)
Definition: fl_view.cc:360
node
G_BEGIN_DECLS const FlutterSemanticsNode * node
Definition: fl_view_accessible.h:40
fl_text_input_plugin_new
FlTextInputPlugin * fl_text_input_plugin_new(FlBinaryMessenger *messenger, GtkIMContext *im_context, FlTextInputViewDelegate *view_delegate)
Definition: fl_text_input_plugin.cc:745
fl_engine_set_on_pre_engine_restart_handler
void fl_engine_set_on_pre_engine_restart_handler(FlEngine *self, FlEngineOnPreEngineRestartHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:630
scroll_event_cb
static gboolean scroll_event_cb(GtkWidget *widget, GdkEventScroll *event, FlView *self)
Definition: fl_view.cc:386
motion_notify_event_cb
static gboolean motion_notify_event_cb(GtkWidget *widget, GdkEventMotion *motion_event, FlView *self)
Definition: fl_view.cc:399
kPropFlutterProject
@ kPropFlutterProject
Definition: fl_view.cc:70
gesture_zoom_begin_cb
static void gesture_zoom_begin_cb(GtkGestureZoom *gesture, GdkEventSequence *sequence, FlView *self)
Definition: fl_view.cc:504
FlKeyboardManager
typedefG_BEGIN_DECLS struct _FlKeyboardManager FlKeyboardManager
Definition: fl_key_responder.h:17