| Flutter Linux Embedder |

fl_keyboard_view_delegate.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/fl_keyboard_view_delegate.h"
6
7 G_DEFINE_INTERFACE(FlKeyboardViewDelegate,
8 fl_keyboard_view_delegate,
9 G_TYPE_OBJECT)
10
11 static void fl_keyboard_view_delegate_default_init(
12 FlKeyboardViewDelegateInterface* iface) {}
13
14 void fl_keyboard_view_delegate_send_key_event(FlKeyboardViewDelegate* self,
15 const FlutterKeyEvent* event,
16 FlutterKeyEventCallback callback,
17 void* user_data) {
18 g_return_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self));
19 g_return_if_fail(event != nullptr);
20
21 FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->send_key_event(
22 self, event, callback, user_data);
23 }
24
25 gboolean fl_keyboard_view_delegate_text_filter_key_press(
26 FlKeyboardViewDelegate* self,
27 FlKeyEvent* event) {
28 g_return_val_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self), false);
29 g_return_val_if_fail(event != nullptr, false);
30
31 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->text_filter_key_press(
32 self, event);
33 }
34
35 FlBinaryMessenger* fl_keyboard_view_delegate_get_messenger(
36 FlKeyboardViewDelegate* self) {
37 g_return_val_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self), nullptr);
38
39 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->get_messenger(self);
40 }
41
42 void fl_keyboard_view_delegate_redispatch_event(FlKeyboardViewDelegate* self,
43 FlKeyEvent* event) {
44 g_return_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self));
45 g_return_if_fail(event != nullptr);
46
47 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->redispatch_event(self,
48 event);
49 }
50
51 void fl_keyboard_view_delegate_subscribe_to_layout_change(
52 FlKeyboardViewDelegate* self,
53 KeyboardLayoutNotifier notifier) {
54 g_return_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self));
55
56 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->subscribe_to_layout_change(
57 self, std::move(notifier));
58 }
59
60 guint fl_keyboard_view_delegate_lookup_key(FlKeyboardViewDelegate* self,
61 const GdkKeymapKey* key) {
62 g_return_val_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self), 0);
63
64 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->lookup_key(self, key);
65 }
66
67 GHashTable* fl_keyboard_view_delegate_get_keyboard_state(
68 FlKeyboardViewDelegate* self) {
69 g_return_val_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self), nullptr);
70
71 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->get_keyboard_state(self);
72 }
fl_keyboard_view_delegate_redispatch_event
void fl_keyboard_view_delegate_redispatch_event(FlKeyboardViewDelegate *self, FlKeyEvent *event)
Definition: fl_keyboard_view_delegate.cc:42
event
FlKeyEvent * event
Definition: fl_key_channel_responder.cc:118
fl_keyboard_view_delegate_subscribe_to_layout_change
void fl_keyboard_view_delegate_subscribe_to_layout_change(FlKeyboardViewDelegate *self, KeyboardLayoutNotifier notifier)
Definition: fl_keyboard_view_delegate.cc:51
user_data
FlKeyEvent uint64_t FlKeyResponderAsyncCallback gpointer user_data
Definition: fl_key_channel_responder.cc:121
G_DEFINE_INTERFACE
G_DEFINE_INTERFACE(FlKeyboardViewDelegate, fl_keyboard_view_delegate, G_TYPE_OBJECT) static void fl_keyboard_view_delegate_default_init(FlKeyboardViewDelegateInterface *iface)
Definition: fl_keyboard_view_delegate.cc:7
fl_keyboard_view_delegate_lookup_key
guint fl_keyboard_view_delegate_lookup_key(FlKeyboardViewDelegate *self, const GdkKeymapKey *key)
Definition: fl_keyboard_view_delegate.cc:60
KeyboardLayoutNotifier
std::function< void()> KeyboardLayoutNotifier
Definition: fl_keyboard_view_delegate.h:17
fl_keyboard_view_delegate_text_filter_key_press
gboolean fl_keyboard_view_delegate_text_filter_key_press(FlKeyboardViewDelegate *self, FlKeyEvent *event)
Definition: fl_keyboard_view_delegate.cc:25
fl_keyboard_view_delegate_get_messenger
FlBinaryMessenger * fl_keyboard_view_delegate_get_messenger(FlKeyboardViewDelegate *self)
Definition: fl_keyboard_view_delegate.cc:35
fl_keyboard_view_delegate.h
callback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition: fl_key_channel_responder.cc:120
fl_keyboard_view_delegate_send_key_event
void fl_keyboard_view_delegate_send_key_event(FlKeyboardViewDelegate *self, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
Definition: fl_keyboard_view_delegate.cc:14
fl_keyboard_view_delegate_get_keyboard_state
GHashTable * fl_keyboard_view_delegate_get_keyboard_state(FlKeyboardViewDelegate *self)
Definition: fl_keyboard_view_delegate.cc:67