Flutter Engine
The Flutter Engine
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
7G_DEFINE_INTERFACE(FlKeyboardViewDelegate,
8 fl_keyboard_view_delegate,
9 G_TYPE_OBJECT)
10
11static void fl_keyboard_view_delegate_default_init(
12 FlKeyboardViewDelegateInterface* iface) {}
13
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(
23}
24
26 FlKeyboardViewDelegate* self,
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
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
43 FlKeyboardViewDelegate* self,
44 std::unique_ptr<FlKeyEvent> event) {
45 g_return_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self));
46 g_return_if_fail(event != nullptr);
47
48 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->redispatch_event(
49 self, std::move(event));
50}
51
53 FlKeyboardViewDelegate* self,
54 KeyboardLayoutNotifier notifier) {
55 g_return_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self));
56
57 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->subscribe_to_layout_change(
58 self, std::move(notifier));
59}
60
61guint fl_keyboard_view_delegate_lookup_key(FlKeyboardViewDelegate* self,
62 const GdkKeymapKey* key) {
63 g_return_val_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self), 0);
64
65 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->lookup_key(self, key);
66}
67
69 FlKeyboardViewDelegate* self) {
70 g_return_val_if_fail(FL_IS_KEYBOARD_VIEW_DELEGATE(self), nullptr);
71
72 return FL_KEYBOARD_VIEW_DELEGATE_GET_IFACE(self)->get_keyboard_state(self);
73}
void(* FlutterKeyEventCallback)(bool, void *)
Definition: embedder.h:1155
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
FlKeyEvent * event
GHashTable * fl_keyboard_view_delegate_get_keyboard_state(FlKeyboardViewDelegate *self)
void fl_keyboard_view_delegate_send_key_event(FlKeyboardViewDelegate *self, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
FlBinaryMessenger * fl_keyboard_view_delegate_get_messenger(FlKeyboardViewDelegate *self)
void fl_keyboard_view_delegate_subscribe_to_layout_change(FlKeyboardViewDelegate *self, KeyboardLayoutNotifier notifier)
guint fl_keyboard_view_delegate_lookup_key(FlKeyboardViewDelegate *self, const GdkKeymapKey *key)
gboolean fl_keyboard_view_delegate_text_filter_key_press(FlKeyboardViewDelegate *self, FlKeyEvent *event)
G_DEFINE_INTERFACE(FlKeyboardViewDelegate, fl_keyboard_view_delegate, G_TYPE_OBJECT) static void fl_keyboard_view_delegate_default_init(FlKeyboardViewDelegateInterface *iface)
void fl_keyboard_view_delegate_redispatch_event(FlKeyboardViewDelegate *self, std::unique_ptr< FlKeyEvent > event)
std::function< void()> KeyboardLayoutNotifier
void * user_data