| Flutter Linux Embedder |

fl_key_channel_responder.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_CHANNEL_RESPONDER_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_CHANNEL_RESPONDER_H_
7
8 #include "flutter/shell/platform/linux/fl_key_event.h"
9 #include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
10
11 G_BEGIN_DECLS
12
13 G_DECLARE_FINAL_TYPE(FlKeyChannelResponder,
14 fl_key_channel_responder,
15 FL,
16 KEY_CHANNEL_RESPONDER,
17 GObject);
18
19 /**
20 * FlKeyChannelResponder:
21 *
22 * A #FlKeyResponder that handles events by sending the raw event data
23 * in JSON through the message channel.
24 *
25 * This class communicates with the RawKeyboard API in the framework.
26 */
27
28 /**
29 * fl_key_channel_responder_new:
30 * @messenger: the messenger that the message channel should be built on.
31 *
32 * Creates a new #FlKeyChannelResponder.
33 *
34 * Returns: a new #FlKeyChannelResponder.
35 */
36 FlKeyChannelResponder* fl_key_channel_responder_new(
37 FlBinaryMessenger* messenger);
38
39 /**
40 * fl_key_channel_responder_handle_event:
41 * @responder: the #FlKeyChannelResponder self.
42 * @event: the event to be handled. Must not be null. The object is managed by
43 * callee and must not be assumed available after this function.
44 * @specified_logical_key:
45 * @cancellable: (allow-none): a #GCancellable or %NULL.
46 * @callback: (scope async): a #GAsyncReadyCallback to call when the event has
47 * been processed.
48 * @user_data: (closure): user data to pass to @callback.
49 *
50 * Let the responder handle an event.
51 */
52 void fl_key_channel_responder_handle_event(FlKeyChannelResponder* responder,
53 FlKeyEvent* event,
54 uint64_t specified_logical_key,
55 GCancellable* cancellable,
56 GAsyncReadyCallback callback,
57 gpointer user_data);
58
59 /**
60 * fl_key_channel_responder_handle_event_finish:
61 * @responder: an #FlKeyChannelResponder.
62 * @result: a #GAsyncResult.
63 * @handled: location to write if this event was handled by the platform.
64 * @error: (allow-none): #GError location to store the error occurring, or %NULL
65 * to ignore.
66 *
67 * Completes request started with fl_key_channel_responder_handle_event().
68 *
69 * Returns %TRUE on success.
70 */
71 gboolean fl_key_channel_responder_handle_event_finish(
72 FlKeyChannelResponder* responder,
73 GAsyncResult* result,
74 gboolean* handled,
75 GError** error);
76
77 G_END_DECLS
78
79 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_CHANNEL_RESPONDER_H_
FL
FL
Definition: fl_binary_messenger.cc:27
fl_binary_messenger.h
user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
Definition: fl_event_channel.h:90
fl_key_channel_responder_handle_event_finish
gboolean fl_key_channel_responder_handle_event_finish(FlKeyChannelResponder *responder, GAsyncResult *result, gboolean *handled, GError **error)
Definition: fl_key_channel_responder.cc:139
G_DECLARE_FINAL_TYPE
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlKeyChannelResponder, fl_key_channel_responder, FL, KEY_CHANNEL_RESPONDER, GObject)
fl_key_channel_responder_new
FlKeyChannelResponder * fl_key_channel_responder_new(FlBinaryMessenger *messenger)
Definition: fl_key_channel_responder.cc:59
fl_key_channel_responder_handle_event
void fl_key_channel_responder_handle_event(FlKeyChannelResponder *responder, FlKeyEvent *event, uint64_t specified_logical_key, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition: fl_key_channel_responder.cc:71
fl_key_event.h
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40