Flutter Engine
 
Loading...
Searching...
No Matches
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
10
11G_BEGIN_DECLS
12
13G_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 */
36FlKeyChannelResponder* 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 */
52void 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 */
72 FlKeyChannelResponder* responder,
73 GAsyncResult* result,
74 gboolean* handled,
75 GError** error);
76
77G_END_DECLS
78
79#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_CHANNEL_RESPONDER_H_
gboolean fl_key_channel_responder_handle_event_finish(FlKeyChannelResponder *responder, GAsyncResult *result, gboolean *handled, GError **error)
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlKeyChannelResponder, fl_key_channel_responder, FL, KEY_CHANNEL_RESPONDER, GObject)
FlKeyChannelResponder * fl_key_channel_responder_new(FlBinaryMessenger *messenger)
void fl_key_channel_responder_handle_event(FlKeyChannelResponder *responder, FlKeyEvent *event, uint64_t specified_logical_key, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
const uint8_t uint32_t uint32_t GError ** error
FlutterDesktopBinaryReply callback