| Flutter Linux Embedder |

Classes | Functions
fl_text_input_plugin.h File Reference
`#include <gtk/gtk.h>`
`#include "flutter/shell/platform/linux/fl_key_event.h"`
`#include "flutter/shell/platform/linux/fl_text_input_view_delegate.h"`
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"`

Go to the source code of this file.

## Classes
struct | _FlTextInputPluginClass

## Functions
G_BEGIN_DECLS | G_DECLARE_DERIVABLE_TYPE (FlTextInputPlugin, fl_text_input_plugin, FL, TEXT_INPUT_PLUGIN, GObject)
FlTextInputPlugin * | fl_text_input_plugin_new (FlBinaryMessenger *messenger, GtkIMContext *im_context, FlTextInputViewDelegate *view_delegate)
gboolean | fl_text_input_plugin_filter_keypress (FlTextInputPlugin *plugin, FlKeyEvent *event)

## Function Documentation

## ◆ fl_text_input_plugin_filter_keypress()

gboolean fl_text_input_plugin_filter_keypress | ( | FlTextInputPlugin * | plugin,
|  | FlKeyEvent * | event
| ) |  |

fl_text_input_plugin_filter_keypress @plugin: an #FlTextInputPlugin. @event: a FlKeyEvent

Process a Gdk key event.

Returns: TRUE if the event was used.

Definition at line 776 of file fl_text_input_plugin.cc.

777 {
778 g_return_val_if_fail(FL_IS_TEXT_INPUT_PLUGIN(self), FALSE);
779 if (FL_TEXT_INPUT_PLUGIN_GET_CLASS(self)->filter_keypress) {
780 return FL_TEXT_INPUT_PLUGIN_GET_CLASS(self)->filter_keypress(self, event);
781 }
782 return FALSE;
783 }

References event.

Referenced by fl_view_keyboard_delegate_iface_init(), and send_key_event().

## ◆ fl_text_input_plugin_new()

FlTextInputPlugin* fl_text_input_plugin_new | ( | FlBinaryMessenger * | messenger,
|  | GtkIMContext * | im_context,
|  | FlTextInputViewDelegate * | view_delegate
| ) |  |

fl_text_input_plugin_new: @messenger: an #FlBinaryMessenger. @im_context: (allow-none): a #GtkIMContext. @view_delegate: an #FlTextInputViewDelegate.

Creates a new plugin that implements SystemChannels.textInput from the Flutter services library.

Returns: a new #FlTextInputPlugin.

Definition at line 745 of file fl_text_input_plugin.cc.

748 {
749 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger), nullptr);
750 g_return_val_if_fail(GTK_IS_IM_CONTEXT(im_context), nullptr);
751 g_return_val_if_fail(FL_IS_TEXT_INPUT_VIEW_DELEGATE(view_delegate), nullptr);
752
753 FlTextInputPlugin* self = FL_TEXT_INPUT_PLUGIN(
754 g_object_new(fl_text_input_plugin_get_type(), nullptr));
755
756 g_autoptr(FlJsonMethodCodec) codec = fl_json_method_codec_new();
757 FlTextInputPluginPrivate* priv = static_cast<FlTextInputPluginPrivate*>(
758 fl_text_input_plugin_get_instance_private(self));
759 priv->channel =
760 fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
761 fl_method_channel_set_method_call_handler(priv->channel, method_call_cb, self,
762 nullptr);
763
764 init_im_context(self, im_context);
765
766 priv->view_delegate = view_delegate;
767 g_object_add_weak_pointer(
768 G_OBJECT(view_delegate),
769 reinterpret_cast<gpointer*>(&(priv->view_delegate)));
770
771 return self;
772 }

References fl_json_method_codec_new(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), g_object_add_weak_pointer(), init_im_context(), kChannelName, method_call_cb(), and priv.

Referenced by init_keyboard(), and TEST().

## ◆ G_DECLARE_DERIVABLE_TYPE()

G_BEGIN_DECLS G_DECLARE_DERIVABLE_TYPE | ( | FlTextInputPlugin | ,
|  | fl_text_input_plugin | ,
|  | FL | ,
|  | TEXT_INPUT_PLUGIN | ,
|  | GObject |
| ) |  |

fl_json_method_codec_new
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
Definition: fl_json_method_codec.cc:205
event
FlKeyEvent * event
Definition: fl_key_channel_responder.cc:118
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
priv
FlPixelBufferTexturePrivate * priv
Definition: fl_pixel_buffer_texture.cc:30
kChannelName
static constexpr char kChannelName[]
Definition: fl_text_input_plugin.cc:14
method_call_cb
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
Definition: fl_text_input_plugin.cc:560
g_object_add_weak_pointer
g_object_add_weak_pointer(G_OBJECT(self), reinterpret_cast< gpointer * >(&self->engine))
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
init_im_context
static void init_im_context(FlTextInputPlugin *self, GtkIMContext *im_context)
Definition: fl_text_input_plugin.cc:716
FlTextInputPluginPrivate
Definition: fl_text_input_plugin.cc:62