| Flutter Linux Embedder |

Classes | Functions
fl_keyboard_channel.h File Reference
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"`

Go to the source code of this file.

## Classes
struct | FlKeyboardChannelVTable

## Functions
G_BEGIN_DECLS | G_DECLARE_FINAL_TYPE (FlKeyboardChannel, fl_keyboard_channel, FL, KEYBOARD_CHANNEL, GObject)
FlKeyboardChannel * | fl_keyboard_channel_new (FlBinaryMessenger *messenger, FlKeyboardChannelVTable *vtable, gpointer user_data)

## Function Documentation

## ◆ fl_keyboard_channel_new()

FlKeyboardChannel* fl_keyboard_channel_new | ( | FlBinaryMessenger * | messenger,
|  | FlKeyboardChannelVTable * | vtable,
|  | gpointer | user_data
| ) |  |

fl_keyboard_channel_new: @messenger: an #FlBinaryMessenger @vtable: callbacks for incoming method calls. @user_data: data to pass in callbacks.

Creates a new channel that implements SystemChannels.keyboard from the Flutter services library.

Returns: a new #FlKeyboardChannel

Definition at line 65 of file fl_keyboard_channel.cc.

67 {
68 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger), nullptr);
69 g_return_val_if_fail(vtable != nullptr, nullptr);
70
71 FlKeyboardChannel* self = FL_KEYBOARD_CHANNEL(
72 g_object_new(fl_keyboard_channel_get_type(), nullptr));
73
74 self->vtable = vtable;
75 self->user_data = user_data;
76
77 g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new();
78 self->channel =
79 fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
80 fl_method_channel_set_method_call_handler(self->channel, method_call_cb, self,
81 nullptr);
82
83 return self;
84 }
g_autoptr
g_autoptr(GMutexLocker) locker
user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
Definition: fl_event_channel.h:90
method_call_cb
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
Definition: fl_keyboard_channel.cc:32
kChannelName
static constexpr char kChannelName[]
Definition: fl_keyboard_channel.cc:10
fl_method_channel_new
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
Definition: fl_method_channel.cc:112
fl_method_channel_set_method_call_handler
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_method_channel.cc:134
fl_standard_method_codec_new
G_MODULE_EXPORT FlStandardMethodCodec * fl_standard_method_codec_new()
Definition: fl_standard_method_codec.cc:291

References fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), g_autoptr(), kChannelName, method_call_cb(), and user_data.

Referenced by fl_keyboard_handler_new().

## ◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE | ( | FlKeyboardChannel | ,
|  | fl_keyboard_channel | ,
|  | FL | ,
|  | KEYBOARD_CHANNEL | ,
|  | GObject |
| ) |  |