Flutter Engine
 
Loading...
Searching...
No Matches
fl_keyboard_channel.h File Reference

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));
81 nullptr);
82
83 return self;
84}
g_autoptr(GMutexLocker) locker
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
static constexpr char kChannelName[]
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
G_MODULE_EXPORT FlStandardMethodCodec * fl_standard_method_codec_new()

References fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), g_autoptr(), kChannelName, method_call_cb(), self, 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   
)