Flutter Engine
The Flutter Engine
fl_text_input_plugin.h
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#ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_TEXT_INPUT_PLUGIN_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_TEXT_INPUT_PLUGIN_H_
7
8#include <gtk/gtk.h>
9
10#include "flutter/shell/platform/linux/fl_key_event.h"
11#include "flutter/shell/platform/linux/fl_text_input_view_delegate.h"
12#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
13
14G_BEGIN_DECLS
15
16G_DECLARE_DERIVABLE_TYPE(FlTextInputPlugin,
17 fl_text_input_plugin,
18 FL,
19 TEXT_INPUT_PLUGIN,
20 GObject);
21
22/**
23 * FlTextInputPlugin:
24 *
25 * #FlTextInputPlugin is a plugin that implements the shell side
26 * of SystemChannels.textInput from the Flutter services library.
27 */
28
30 GObjectClass parent_class;
31
32 /**
33 * Virtual method called to filter a keypress.
34 */
35 gboolean (*filter_keypress)(FlTextInputPlugin* self, FlKeyEvent* event);
36};
37
38/**
39 * fl_text_input_plugin_new:
40 * @messenger: an #FlBinaryMessenger.
41 * @im_context: (allow-none): a #GtkIMContext.
42 * @view_delegate: an #FlTextInputViewDelegate.
43 *
44 * Creates a new plugin that implements SystemChannels.textInput from the
45 * Flutter services library.
46 *
47 * Returns: a new #FlTextInputPlugin.
48 */
49FlTextInputPlugin* fl_text_input_plugin_new(
50 FlBinaryMessenger* messenger,
51 GtkIMContext* im_context,
52 FlTextInputViewDelegate* view_delegate);
53
54/**
55 * fl_text_input_plugin_filter_keypress
56 * @plugin: an #FlTextInputPlugin.
57 * @event: a #FlKeyEvent
58 *
59 * Process a Gdk key event.
60 *
61 * Returns: %TRUE if the event was used.
62 */
63gboolean fl_text_input_plugin_filter_keypress(FlTextInputPlugin* plugin,
65
66G_END_DECLS
67
68#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_TEXT_INPUT_PLUGIN_H_
FlKeyEvent * event
gboolean fl_text_input_plugin_filter_keypress(FlTextInputPlugin *plugin, FlKeyEvent *event)
FlTextInputPlugin * fl_text_input_plugin_new(FlBinaryMessenger *messenger, GtkIMContext *im_context, FlTextInputViewDelegate *view_delegate)
G_BEGIN_DECLS G_DECLARE_DERIVABLE_TYPE(FlTextInputPlugin, fl_text_input_plugin, FL, TEXT_INPUT_PLUGIN, GObject)
gboolean(* filter_keypress)(FlTextInputPlugin *self, FlKeyEvent *event)