Flutter Engine
fl_key_event_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_KEY_EVENT_PLUGIN_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_EVENT_PLUGIN_H_
7 
8 #include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
9 
10 #include <gdk/gdk.h>
11 
12 G_BEGIN_DECLS
13 
14 G_DECLARE_FINAL_TYPE(FlKeyEventPlugin,
15  fl_key_event_plugin,
16  FL,
17  KEY_EVENT_PLUGIN,
18  GObject);
19 
20 /**
21  * FlKeyEventPlugin:
22  *
23  * #FlKeyEventPlugin is a plugin that implements the shell side
24  * of SystemChannels.keyEvent from the Flutter services library.
25  */
26 
27 /**
28  * fl_key_event_plugin_new:
29  * @messenger: an #FlBinaryMessenger.
30  * @response_callback: the callback to call when a response is received. If not
31  * given (nullptr), then the default response callback is
32  * used.
33  * @channel_name: the name of the channel to send key events on. If not given
34  * (nullptr), then the standard key event channel name is used.
35  * Typically used for tests to send on a test channel.
36  *
37  * Creates a new plugin that implements SystemChannels.keyEvent from the
38  * Flutter services library.
39  *
40  * Returns: a new #FlKeyEventPlugin.
41  */
42 FlKeyEventPlugin* fl_key_event_plugin_new(
43  FlBinaryMessenger* messenger,
44  GAsyncReadyCallback response_callback = nullptr,
45  const char* channel_name = nullptr);
46 
47 /**
48  * fl_key_event_plugin_send_key_event:
49  * @plugin: an #FlKeyEventPlugin.
50  * @event: a #GdkEventKey.
51  * @user_data: a pointer to user data to send to the response callback via the
52  * messenger.
53  *
54  * Sends a key event to Flutter.
55  */
56 void fl_key_event_plugin_send_key_event(FlKeyEventPlugin* plugin,
57  GdkEventKey* event,
58  gpointer user_data = nullptr);
59 
60 G_END_DECLS
61 
62 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_EVENT_PLUGIN_H_
void fl_key_event_plugin_send_key_event(FlKeyEventPlugin *plugin, GdkEventKey *event, gpointer user_data=nullptr)
FlKeyEventPlugin * fl_key_event_plugin_new(FlBinaryMessenger *messenger, GAsyncReadyCallback response_callback=nullptr, const char *channel_name=nullptr)
G_BEGIN_DECLS FlMethodCall gpointer user_data
GdkEventButton * event
Definition: fl_view.cc:62
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlKeyEventPlugin, fl_key_event_plugin, FL, KEY_EVENT_PLUGIN, GObject)
G_BEGIN_DECLS FL