Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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}
FlKeyEvent * event
return FALSE

◆ 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();
758 fl_text_input_plugin_get_instance_private(self));
759 priv->channel =
760 fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
762 nullptr);
763
764 init_im_context(self, im_context);
765
766 priv->view_delegate = view_delegate;
768 G_OBJECT(view_delegate),
769 reinterpret_cast<gpointer*>(&(priv->view_delegate)));
770
771 return self;
772}
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
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)
FlPixelBufferTexturePrivate * priv
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
static void init_im_context(FlTextInputPlugin *self, GtkIMContext *im_context)
static constexpr char kChannelName[]
g_object_add_weak_pointer(G_OBJECT(self), reinterpret_cast< gpointer * >(&self->engine))

◆ G_DECLARE_DERIVABLE_TYPE()

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