Flutter Engine
fl_text_input_plugin.cc File Reference
#include "flutter/shell/platform/linux/fl_text_input_plugin.h"
#include <gtk/gtk.h>
#include "flutter/shell/platform/common/text_input_model.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_method_codec.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h"

Go to the source code of this file.

Classes

struct  FlTextInputPluginPrivate
 

Enumerations

enum  FlTextInputType {
  FL_TEXT_INPUT_TYPE_TEXT,
  FL_TEXT_INPUT_TYPE_MULTILINE,
  FL_TEXT_INPUT_TYPE_NONE
}
 

Functions

 G_DEFINE_TYPE_WITH_PRIVATE (FlTextInputPlugin, fl_text_input_plugin, G_TYPE_OBJECT) static gboolean finish_method(GObject *object
 
 if (response==nullptr)
 
return fl_method_response_get_result (response, error) !
 
static void update_editing_state_response_cb (GObject *object, GAsyncResult *result, gpointer user_data)
 
static void update_editing_state (FlTextInputPlugin *self)
 
static void perform_action_response_cb (GObject *object, GAsyncResult *result, gpointer user_data)
 
static void perform_action (FlTextInputPlugin *self)
 
static void im_preedit_start_cb (FlTextInputPlugin *self)
 
static void im_preedit_changed_cb (FlTextInputPlugin *self)
 
static void im_commit_cb (FlTextInputPlugin *self, const gchar *text)
 
static void im_preedit_end_cb (FlTextInputPlugin *self)
 
static gboolean im_retrieve_surrounding_cb (FlTextInputPlugin *self)
 
static gboolean im_delete_surrounding_cb (FlTextInputPlugin *self, gint offset, gint n_chars)
 
static FlMethodResponse * set_client (FlTextInputPlugin *self, FlValue *args)
 
static FlMethodResponse * hide (FlTextInputPlugin *self)
 
static FlMethodResponse * show (FlTextInputPlugin *self)
 
static FlMethodResponse * set_editing_state (FlTextInputPlugin *self, FlValue *args)
 
static FlMethodResponse * clear_client (FlTextInputPlugin *self)
 
static void update_im_cursor_position (FlTextInputPlugin *self)
 
static FlMethodResponse * set_editable_size_and_transform (FlTextInputPlugin *self, FlValue *args)
 
static FlMethodResponse * set_marked_text_rect (FlTextInputPlugin *self, FlValue *args)
 
static void method_call_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
 
static void fl_text_input_plugin_dispose (GObject *object)
 
static gboolean fl_text_input_plugin_filter_keypress_default (FlTextInputPlugin *self, FlKeyEvent *event)
 
static void fl_text_input_plugin_class_init (FlTextInputPluginClass *klass)
 
static void fl_text_input_plugin_init (FlTextInputPlugin *self)
 
FlTextInputPlugin * fl_text_input_plugin_new (FlBinaryMessenger *messenger, FlView *view, FlTextInputPluginImFilter im_filter)
 
gboolean fl_text_input_plugin_filter_keypress (FlTextInputPlugin *self, FlKeyEvent *event)
 

Variables

static constexpr char kChannelName [] = "flutter/textinput"
 
static constexpr char kBadArgumentsError [] = "Bad Arguments"
 
static constexpr char kSetClientMethod [] = "TextInput.setClient"
 
static constexpr char kShowMethod [] = "TextInput.show"
 
static constexpr char kSetEditingStateMethod [] = "TextInput.setEditingState"
 
static constexpr char kClearClientMethod [] = "TextInput.clearClient"
 
static constexpr char kHideMethod [] = "TextInput.hide"
 
static constexpr char kUpdateEditingStateMethod []
 
static constexpr char kPerformActionMethod [] = "TextInputClient.performAction"
 
static constexpr char kSetEditableSizeAndTransform []
 
static constexpr char kSetMarkedTextRect [] = "TextInput.setMarkedTextRect"
 
static constexpr char kInputActionKey [] = "inputAction"
 
static constexpr char kTextInputTypeKey [] = "inputType"
 
static constexpr char kTextInputTypeNameKey [] = "name"
 
static constexpr char kTextKey [] = "text"
 
static constexpr char kSelectionBaseKey [] = "selectionBase"
 
static constexpr char kSelectionExtentKey [] = "selectionExtent"
 
static constexpr char kSelectionAffinityKey [] = "selectionAffinity"
 
static constexpr char kSelectionIsDirectionalKey [] = "selectionIsDirectional"
 
static constexpr char kComposingBaseKey [] = "composingBase"
 
static constexpr char kComposingExtentKey [] = "composingExtent"
 
static constexpr char kTransform [] = "transform"
 
static constexpr char kTextAffinityDownstream [] = "TextAffinity.downstream"
 
static constexpr char kMultilineInputType [] = "TextInputType.multiline"
 
static constexpr char kNoneInputType [] = "TextInputType.none"
 
static constexpr int64_t kClientIdUnset = -1
 
GAsyncResult * result
 
GAsyncResult GError ** error
 

Enumeration Type Documentation

◆ FlTextInputType

Enumerator
FL_TEXT_INPUT_TYPE_TEXT 
FL_TEXT_INPUT_TYPE_MULTILINE 
FL_TEXT_INPUT_TYPE_NONE 

Definition at line 48 of file fl_text_input_plugin.cc.

48  {
50  // Send newline when multi-line and enter is pressed.
52  // The input method is not shown at all.

Function Documentation

◆ clear_client()

static FlMethodResponse* clear_client ( FlTextInputPlugin *  self)
static

Definition at line 363 of file fl_text_input_plugin.cc.

References FlTextInputPluginPrivate::client_id, fl_method_success_response_new(), and kClientIdUnset.

Referenced by method_call_cb().

363  {
365  fl_text_input_plugin_get_instance_private(self));
366  priv->client_id = kClientIdUnset;
367 
368  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
369 }
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
static constexpr int64_t kClientIdUnset

◆ fl_method_response_get_result()

return fl_method_response_get_result ( response  ,
error   
)

Referenced by if().

◆ fl_text_input_plugin_class_init()

static void fl_text_input_plugin_class_init ( FlTextInputPluginClass *  klass)
static

Definition at line 578 of file fl_text_input_plugin.cc.

References fl_text_input_plugin_dispose(), and fl_text_input_plugin_filter_keypress_default().

578  {
579  G_OBJECT_CLASS(klass)->dispose = fl_text_input_plugin_dispose;
580  FL_TEXT_INPUT_PLUGIN_CLASS(klass)->filter_keypress =
582 }
static void fl_text_input_plugin_dispose(GObject *object)
static gboolean fl_text_input_plugin_filter_keypress_default(FlTextInputPlugin *self, FlKeyEvent *event)

◆ fl_text_input_plugin_dispose()

static void fl_text_input_plugin_dispose ( GObject *  object)
static

Definition at line 490 of file fl_text_input_plugin.cc.

References FlTextInputPluginPrivate::channel, FlTextInputPluginPrivate::im_context, FlTextInputPluginPrivate::input_action, FlTextInputPluginPrivate::text_model, and FlTextInputPluginPrivate::view.

Referenced by fl_text_input_plugin_class_init().

490  {
491  FlTextInputPlugin* self = FL_TEXT_INPUT_PLUGIN(object);
493  fl_text_input_plugin_get_instance_private(self));
494 
495  g_clear_object(&priv->channel);
496  g_clear_pointer(&priv->input_action, g_free);
497  g_clear_object(&priv->im_context);
498  if (priv->text_model != nullptr) {
499  delete priv->text_model;
500  priv->text_model = nullptr;
501  }
502  priv->view = nullptr;
503 
504  G_OBJECT_CLASS(fl_text_input_plugin_parent_class)->dispose(object);
505 }
flutter::TextInputModel * text_model

◆ fl_text_input_plugin_filter_keypress()

gboolean fl_text_input_plugin_filter_keypress ( FlTextInputPlugin *  plugin,
FlKeyEvent event 
)

fl_text_input_plugin_filter_keypress : an #FlTextInputPlugin. : a FlKeyEvent

Process a Gdk key event.

Returns: TRUE if the event was used.

Definition at line 637 of file fl_text_input_plugin.cc.

References FALSE.

Referenced by responder_handle_event_callback().

638  {
639  g_return_val_if_fail(FL_IS_TEXT_INPUT_PLUGIN(self), FALSE);
640  if (FL_TEXT_INPUT_PLUGIN_GET_CLASS(self)->filter_keypress) {
641  return FL_TEXT_INPUT_PLUGIN_GET_CLASS(self)->filter_keypress(self, event);
642  }
643  return FALSE;
644 }
return FALSE

◆ fl_text_input_plugin_filter_keypress_default()

static gboolean fl_text_input_plugin_filter_keypress_default ( FlTextInputPlugin *  self,
FlKeyEvent event 
)
static

Definition at line 508 of file fl_text_input_plugin.cc.

References flutter::TextInputModel::AddCodePoint(), FlTextInputPluginPrivate::client_id, FALSE, FL_TEXT_INPUT_TYPE_MULTILINE, FlTextInputPluginPrivate::im_context, FlTextInputPluginPrivate::im_filter, FlTextInputPluginPrivate::input_type, _FlKeyEvent::is_press, kClientIdUnset, _FlKeyEvent::keyval, flutter::TextInputModel::MoveCursorToBeginning(), flutter::TextInputModel::MoveCursorToEnd(), _FlKeyEvent::origin, perform_action(), flutter::TextInputModel::SelectToBeginning(), flutter::TextInputModel::SelectToEnd(), _FlKeyEvent::state, FlTextInputPluginPrivate::text_model, TRUE, and update_editing_state().

Referenced by fl_text_input_plugin_class_init().

510  {
511  g_return_val_if_fail(FL_IS_TEXT_INPUT_PLUGIN(self), false);
512 
514  fl_text_input_plugin_get_instance_private(self));
515 
516  if (priv->client_id == kClientIdUnset) {
517  return FALSE;
518  }
519 
520  if (priv->im_filter(priv->im_context, event->origin)) {
521  return TRUE;
522  }
523 
524  // Handle the enter/return key.
525  gboolean do_action = FALSE;
526  // Handle navigation keys.
527  gboolean changed = FALSE;
528  if (event->is_press) {
529  switch (event->keyval) {
530  case GDK_KEY_End:
531  case GDK_KEY_KP_End:
532  if (event->state & GDK_SHIFT_MASK) {
533  changed = priv->text_model->SelectToEnd();
534  } else {
535  changed = priv->text_model->MoveCursorToEnd();
536  }
537  break;
538  case GDK_KEY_Return:
539  case GDK_KEY_KP_Enter:
540  case GDK_KEY_ISO_Enter:
542  priv->text_model->AddCodePoint('\n');
543  changed = TRUE;
544  }
545  do_action = TRUE;
546  break;
547  case GDK_KEY_Home:
548  case GDK_KEY_KP_Home:
549  if (event->state & GDK_SHIFT_MASK) {
550  changed = priv->text_model->SelectToBeginning();
551  } else {
552  changed = priv->text_model->MoveCursorToBeginning();
553  }
554  break;
555  case GDK_KEY_BackSpace:
556  case GDK_KEY_Delete:
557  case GDK_KEY_KP_Delete:
558  case GDK_KEY_Left:
559  case GDK_KEY_KP_Left:
560  case GDK_KEY_Right:
561  case GDK_KEY_KP_Right:
562  // Already handled inside the framework in RenderEditable.
563  break;
564  }
565  }
566 
567  if (changed) {
568  update_editing_state(self);
569  }
570  if (do_action) {
571  perform_action(self);
572  }
573 
574  return changed;
575 }
FlTextInputPluginImFilter im_filter
guint keyval
Definition: fl_key_event.h:39
void AddCodePoint(char32_t c)
static void update_editing_state(FlTextInputPlugin *self)
static void perform_action(FlTextInputPlugin *self)
static constexpr int64_t kClientIdUnset
gpointer origin
Definition: fl_key_event.h:50
flutter::TextInputModel * text_model
return FALSE

◆ fl_text_input_plugin_init()

static void fl_text_input_plugin_init ( FlTextInputPlugin *  self)
static

Definition at line 585 of file fl_text_input_plugin.cc.

References FlTextInputPluginPrivate::client_id, FL_TEXT_INPUT_TYPE_TEXT, im_commit_cb(), FlTextInputPluginPrivate::im_context, im_delete_surrounding_cb(), im_preedit_changed_cb(), im_preedit_end_cb(), im_preedit_start_cb(), im_retrieve_surrounding_cb(), FlTextInputPluginPrivate::input_type, kClientIdUnset, and FlTextInputPluginPrivate::text_model.

585  {
587  fl_text_input_plugin_get_instance_private(self));
588 
589  priv->client_id = kClientIdUnset;
590  priv->im_context = gtk_im_multicontext_new();
592  g_signal_connect_object(priv->im_context, "preedit-start",
593  G_CALLBACK(im_preedit_start_cb), self,
594  G_CONNECT_SWAPPED);
595  g_signal_connect_object(priv->im_context, "preedit-end",
596  G_CALLBACK(im_preedit_end_cb), self,
597  G_CONNECT_SWAPPED);
598  g_signal_connect_object(priv->im_context, "preedit-changed",
599  G_CALLBACK(im_preedit_changed_cb), self,
600  G_CONNECT_SWAPPED);
601  g_signal_connect_object(priv->im_context, "commit", G_CALLBACK(im_commit_cb),
602  self, G_CONNECT_SWAPPED);
603  g_signal_connect_object(priv->im_context, "retrieve-surrounding",
604  G_CALLBACK(im_retrieve_surrounding_cb), self,
605  G_CONNECT_SWAPPED);
606  g_signal_connect_object(priv->im_context, "delete-surrounding",
607  G_CALLBACK(im_delete_surrounding_cb), self,
608  G_CONNECT_SWAPPED);
609  priv->text_model = new flutter::TextInputModel();
610 }
static gboolean im_delete_surrounding_cb(FlTextInputPlugin *self, gint offset, gint n_chars)
static void im_preedit_end_cb(FlTextInputPlugin *self)
static gboolean im_retrieve_surrounding_cb(FlTextInputPlugin *self)
static void im_preedit_start_cb(FlTextInputPlugin *self)
static void im_commit_cb(FlTextInputPlugin *self, const gchar *text)
static constexpr int64_t kClientIdUnset
flutter::TextInputModel * text_model
static void im_preedit_changed_cb(FlTextInputPlugin *self)

◆ fl_text_input_plugin_new()

FlTextInputPlugin* fl_text_input_plugin_new ( FlBinaryMessenger *  messenger,
FlView *  view,
FlTextInputPluginImFilter  im_filter 
)

fl_text_input_plugin_new: : an #FlBinaryMessenger. : the #FlView with which the text input plugin is associated. : a function used to allow an input method to internally handle key press and release events. Typically a wrap of #gtk_im_context_filter_keypress. Must not be nullptr.

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

Returns: a new #FlTextInputPlugin.

Definition at line 612 of file fl_text_input_plugin.cc.

References FlTextInputPluginPrivate::channel, fl_json_method_codec_new(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), FlTextInputPluginPrivate::im_filter, kChannelName, method_call_cb(), and FlTextInputPluginPrivate::view.

Referenced by fl_view_init_keyboard().

615  {
616  g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger), nullptr);
617  g_return_val_if_fail(im_filter != nullptr, nullptr);
618 
619  FlTextInputPlugin* self = FL_TEXT_INPUT_PLUGIN(
620  g_object_new(fl_text_input_plugin_get_type(), nullptr));
621 
622  g_autoptr(FlJsonMethodCodec) codec = fl_json_method_codec_new();
624  fl_text_input_plugin_get_instance_private(self));
625  priv->channel =
626  fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
628  nullptr);
629  priv->view = view;
630  priv->im_filter = im_filter;
631 
632  return self;
633 }
FlTextInputPluginImFilter im_filter
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
static constexpr char kChannelName[]
FlView * view
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)

◆ G_DEFINE_TYPE_WITH_PRIVATE()

G_DEFINE_TYPE_WITH_PRIVATE ( FlTextInputPlugin  ,
fl_text_input_plugin  ,
G_TYPE_OBJECT   
)

◆ hide()

static FlMethodResponse* hide ( FlTextInputPlugin *  self)
static

Definition at line 298 of file fl_text_input_plugin.cc.

References fl_method_success_response_new(), and FlTextInputPluginPrivate::im_context.

Referenced by method_call_cb(), and show().

298  {
300  fl_text_input_plugin_get_instance_private(self));
301  gtk_im_context_focus_out(priv->im_context);
302 
303  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
304 }
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)

◆ if()

if ( response  = = nullptr)

Definition at line 102 of file fl_text_input_plugin.cc.

References FALSE, and fl_method_response_get_result().

102  {
103  return FALSE;
104  }
return FALSE

◆ im_commit_cb()

static void im_commit_cb ( FlTextInputPlugin *  self,
const gchar *  text 
)
static

Definition at line 217 of file fl_text_input_plugin.cc.

References flutter::TextInputModel::AddText(), flutter::TextInputModel::CommitComposing(), flutter::TextInputModel::composing(), FlTextInputPluginPrivate::text_model, and update_editing_state().

Referenced by fl_text_input_plugin_init().

217  {
219  fl_text_input_plugin_get_instance_private(self));
220  priv->text_model->AddText(text);
221  if (priv->text_model->composing()) {
222  priv->text_model->CommitComposing();
223  }
224  update_editing_state(self);
225 }
void AddText(const std::u16string &text)
static void update_editing_state(FlTextInputPlugin *self)
std::u16string text
flutter::TextInputModel * text_model

◆ im_delete_surrounding_cb()

static gboolean im_delete_surrounding_cb ( FlTextInputPlugin *  self,
gint  offset,
gint  n_chars 
)
static

Definition at line 247 of file fl_text_input_plugin.cc.

References flutter::TextInputModel::DeleteSurrounding(), FlTextInputPluginPrivate::text_model, TRUE, and update_editing_state().

Referenced by fl_text_input_plugin_init().

249  {
251  fl_text_input_plugin_get_instance_private(self));
252  if (priv->text_model->DeleteSurrounding(offset, n_chars)) {
253  update_editing_state(self);
254  }
255  return TRUE;
256 }
static void update_editing_state(FlTextInputPlugin *self)
flutter::TextInputModel * text_model
bool DeleteSurrounding(int offset_from_cursor, int count)

◆ im_preedit_changed_cb()

static void im_preedit_changed_cb ( FlTextInputPlugin *  self)
static

Definition at line 201 of file fl_text_input_plugin.cc.

References flutter::TextRange::base(), flutter::TextInputModel::composing_range(), FlTextInputPluginPrivate::im_context, flutter::TextInputModel::SetSelection(), FlTextInputPluginPrivate::text_model, update_editing_state(), and flutter::TextInputModel::UpdateComposingText().

Referenced by fl_text_input_plugin_init().

201  {
203  fl_text_input_plugin_get_instance_private(self));
204  g_autofree gchar* buf = nullptr;
205  gint cursor_offset = 0;
206  gtk_im_context_get_preedit_string(priv->im_context, &buf, nullptr,
207  &cursor_offset);
208  cursor_offset += priv->text_model->composing_range().base();
209  priv->text_model->UpdateComposingText(buf);
210  priv->text_model->SetSelection(
211  flutter::TextRange(cursor_offset, cursor_offset));
212 
213  update_editing_state(self);
214 }
static void update_editing_state(FlTextInputPlugin *self)
TextRange composing_range() const
size_t base() const
Definition: text_range.h:30
flutter::TextInputModel * text_model
bool SetSelection(const TextRange &range)
void UpdateComposingText(const std::u16string &text)

◆ im_preedit_end_cb()

static void im_preedit_end_cb ( FlTextInputPlugin *  self)
static

Definition at line 228 of file fl_text_input_plugin.cc.

References flutter::TextInputModel::EndComposing(), FlTextInputPluginPrivate::text_model, and update_editing_state().

Referenced by fl_text_input_plugin_init().

228  {
230  fl_text_input_plugin_get_instance_private(self));
231  priv->text_model->EndComposing();
232  update_editing_state(self);
233 }
static void update_editing_state(FlTextInputPlugin *self)
flutter::TextInputModel * text_model

◆ im_preedit_start_cb()

static void im_preedit_start_cb ( FlTextInputPlugin *  self)
static

Definition at line 189 of file fl_text_input_plugin.cc.

References flutter::TextInputModel::BeginComposing(), FlTextInputPluginPrivate::im_context, FlTextInputPluginPrivate::text_model, and FlTextInputPluginPrivate::view.

Referenced by fl_text_input_plugin_init().

189  {
191  fl_text_input_plugin_get_instance_private(self));
192  priv->text_model->BeginComposing();
193 
194  // Set the top-level window used for system input method windows.
195  GdkWindow* window =
196  gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(priv->view)));
197  gtk_im_context_set_client_window(priv->im_context, window);
198 }
flutter::TextInputModel * text_model

◆ im_retrieve_surrounding_cb()

static gboolean im_retrieve_surrounding_cb ( FlTextInputPlugin *  self)
static

Definition at line 236 of file fl_text_input_plugin.cc.

References flutter::TextInputModel::GetCursorOffset(), flutter::TextInputModel::GetText(), FlTextInputPluginPrivate::im_context, text, FlTextInputPluginPrivate::text_model, and TRUE.

Referenced by fl_text_input_plugin_init().

236  {
238  fl_text_input_plugin_get_instance_private(self));
239  auto text = priv->text_model->GetText();
240  size_t cursor_offset = priv->text_model->GetCursorOffset();
241  gtk_im_context_set_surrounding(priv->im_context, text.c_str(), -1,
242  cursor_offset);
243  return TRUE;
244 }
std::string GetText() const
std::u16string text
flutter::TextInputModel * text_model

◆ method_call_cb()

static void method_call_cb ( FlMethodChannel *  channel,
FlMethodCall *  method_call,
gpointer  user_data 
)
static

Definition at line 456 of file fl_text_input_plugin.cc.

References args, clear_client(), fl_method_call_get_args(), fl_method_call_get_name(), fl_method_call_respond(), fl_method_not_implemented_response_new(), hide(), kClearClientMethod, kHideMethod, kSetClientMethod, kSetEditableSizeAndTransform, kSetEditingStateMethod, kSetMarkedTextRect, kShowMethod, set_client(), set_editable_size_and_transform(), set_editing_state(), set_marked_text_rect(), and show().

Referenced by fl_text_input_plugin_new().

458  {
459  FlTextInputPlugin* self = FL_TEXT_INPUT_PLUGIN(user_data);
460 
461  const gchar* method = fl_method_call_get_name(method_call);
463 
464  g_autoptr(FlMethodResponse) response = nullptr;
465  if (strcmp(method, kSetClientMethod) == 0) {
466  response = set_client(self, args);
467  } else if (strcmp(method, kShowMethod) == 0) {
468  response = show(self);
469  } else if (strcmp(method, kSetEditingStateMethod) == 0) {
470  response = set_editing_state(self, args);
471  } else if (strcmp(method, kClearClientMethod) == 0) {
472  response = clear_client(self);
473  } else if (strcmp(method, kHideMethod) == 0) {
474  response = hide(self);
475  } else if (strcmp(method, kSetEditableSizeAndTransform) == 0) {
476  response = set_editable_size_and_transform(self, args);
477  } else if (strcmp(method, kSetMarkedTextRect) == 0) {
478  response = set_marked_text_rect(self, args);
479  } else {
480  response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new());
481  }
482 
483  g_autoptr(GError) error = nullptr;
484  if (!fl_method_call_respond(method_call, response, &error)) {
485  g_warning("Failed to send method call response: %s", error->message);
486  }
487 }
G_BEGIN_DECLS FlValue * args
static constexpr char kSetMarkedTextRect[]
G_BEGIN_DECLS FlMethodCall * method_call
static constexpr char kSetClientMethod[]
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:40
static constexpr char kShowMethod[]
void * user_data
static FlMethodResponse * set_editing_state(FlTextInputPlugin *self, FlValue *args)
static constexpr char kSetEditableSizeAndTransform[]
GAsyncResult GError ** error
G_MODULE_EXPORT FlValue * fl_method_call_get_args(FlMethodCall *self)
G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall *self, FlMethodResponse *response, GError **error)
static FlMethodResponse * set_editable_size_and_transform(FlTextInputPlugin *self, FlValue *args)
static FlMethodResponse * hide(FlTextInputPlugin *self)
G_MODULE_EXPORT const gchar * fl_method_call_get_name(FlMethodCall *self)
static constexpr char kSetEditingStateMethod[]
static FlMethodResponse * set_marked_text_rect(FlTextInputPlugin *self, FlValue *args)
static constexpr char kClearClientMethod[]
static FlMethodResponse * clear_client(FlTextInputPlugin *self)
static constexpr char kHideMethod[]
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
static FlMethodResponse * set_client(FlTextInputPlugin *self, FlValue *args)
static FlMethodResponse * show(FlTextInputPlugin *self)

◆ perform_action()

static void perform_action ( FlTextInputPlugin *  self)
static

Definition at line 172 of file fl_text_input_plugin.cc.

References args, FlTextInputPluginPrivate::channel, FlTextInputPluginPrivate::client_id, fl_method_channel_invoke_method(), fl_value_append_take(), fl_value_new_int(), fl_value_new_list(), fl_value_new_string(), FlTextInputPluginPrivate::input_action, kPerformActionMethod, and perform_action_response_cb().

Referenced by fl_text_input_plugin_filter_keypress_default().

172  {
174  fl_text_input_plugin_get_instance_private(self));
175 
176  g_return_if_fail(FL_IS_TEXT_INPUT_PLUGIN(self));
177  g_return_if_fail(priv->client_id != 0);
178  g_return_if_fail(priv->input_action != nullptr);
179 
180  g_autoptr(FlValue) args = fl_value_new_list();
183 
185  nullptr, perform_action_response_cb, self);
186 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:338
G_BEGIN_DECLS FlValue * args
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:40
static constexpr char kPerformActionMethod[]
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:560
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:251
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:265
G_MODULE_EXPORT void fl_method_channel_invoke_method(FlMethodChannel *self, const gchar *method, FlValue *args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
static void perform_action_response_cb(GObject *object, GAsyncResult *result, gpointer user_data)

◆ perform_action_response_cb()

static void perform_action_response_cb ( GObject *  object,
GAsyncResult *  result,
gpointer  user_data 
)
static

Definition at line 162 of file fl_text_input_plugin.cc.

References kPerformActionMethod.

Referenced by perform_action().

164  {
165  g_autoptr(GError) error = nullptr;
166  if (!finish_method(object, result, &error)) {
167  g_warning("Failed to call %s: %s", kPerformActionMethod, error->message);
168  }
169 }
GAsyncResult * result
GAsyncResult GError ** error
static constexpr char kPerformActionMethod[]

◆ set_client()

static FlMethodResponse* set_client ( FlTextInputPlugin *  self,
FlValue args 
)
static

Definition at line 259 of file fl_text_input_plugin.cc.

References FlTextInputPluginPrivate::client_id, fl_method_error_response_new(), fl_method_success_response_new(), FL_TEXT_INPUT_TYPE_MULTILINE, FL_TEXT_INPUT_TYPE_NONE, FL_TEXT_INPUT_TYPE_TEXT, fl_value_get_int(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_string(), fl_value_get_type(), fl_value_lookup_string(), FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, FlTextInputPluginPrivate::input_action, FlTextInputPluginPrivate::input_type, kBadArgumentsError, kInputActionKey, kMultilineInputType, kNoneInputType, kTextInputTypeKey, and kTextInputTypeNameKey.

Referenced by method_call_cb().

259  {
261  fl_value_get_length(args) < 2) {
262  return FL_METHOD_RESPONSE(fl_method_error_response_new(
263  kBadArgumentsError, "Expected 2-element list", nullptr));
264  }
266  fl_text_input_plugin_get_instance_private(self));
267 
269  FlValue* config_value = fl_value_get_list_value(args, 1);
270  g_free(priv->input_action);
271  FlValue* input_action_value =
273  if (fl_value_get_type(input_action_value) == FL_VALUE_TYPE_STRING) {
274  priv->input_action = g_strdup(fl_value_get_string(input_action_value));
275  }
276 
277  // Reset the input type, then set only if appropriate.
279  FlValue* input_type_value =
281  if (fl_value_get_type(input_type_value) == FL_VALUE_TYPE_MAP) {
282  FlValue* input_type_name =
284  if (fl_value_get_type(input_type_name) == FL_VALUE_TYPE_STRING) {
285  const gchar* input_type = fl_value_get_string(input_type_name);
286  if (g_strcmp0(input_type, kMultilineInputType) == 0) {
288  } else if (g_strcmp0(input_type, kNoneInputType) == 0) {
290  }
291  }
292  }
293 
294  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
295 }
G_BEGIN_DECLS FlValue * args
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:428
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:40
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:628
static constexpr char kMultilineInputType[]
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:770
static constexpr char kInputActionKey[]
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:735
static constexpr char kNoneInputType[]
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:642
static constexpr char kBadArgumentsError[]
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:684
static constexpr char kTextInputTypeNameKey[]
static constexpr char kTextInputTypeKey[]
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)

◆ set_editable_size_and_transform()

static FlMethodResponse* set_editable_size_and_transform ( FlTextInputPlugin *  self,
FlValue args 
)
static

Definition at line 414 of file fl_text_input_plugin.cc.

References FlTextInputPluginPrivate::editabletext_transform, fl_method_success_response_new(), fl_value_get_float(), fl_value_get_length(), fl_value_get_list_value(), fl_value_lookup_string(), kTransform, flutter::transform, and update_im_cursor_position().

Referenced by method_call_cb().

416  {
418  size_t transform_len = fl_value_get_length(transform);
419  g_warn_if_fail(transform_len == 16);
420 
421  for (size_t i = 0; i < transform_len; ++i) {
422  double val = fl_value_get_float(fl_value_get_list_value(transform, i));
424  fl_text_input_plugin_get_instance_private(self));
425  priv->editabletext_transform[i / 4][i % 4] = val;
426  }
428 
429  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
430 }
G_BEGIN_DECLS FlValue * args
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:40
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:635
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:770
static void update_im_cursor_position(FlTextInputPlugin *self)
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:735
static constexpr char kTransform[]
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:684

◆ set_editing_state()

static FlMethodResponse* set_editing_state ( FlTextInputPlugin *  self,
FlValue args 
)
static

Definition at line 325 of file fl_text_input_plugin.cc.

References flutter::TextInputModel::EndComposing(), fl_method_success_response_new(), fl_value_get_int(), fl_value_get_string(), fl_value_lookup_string(), kComposingBaseKey, kComposingExtentKey, kSelectionBaseKey, kSelectionExtentKey, kTextKey, flutter::TextInputModel::SetComposingRange(), flutter::TextInputModel::SetSelection(), flutter::TextInputModel::SetText(), text, and FlTextInputPluginPrivate::text_model.

Referenced by method_call_cb().

326  {
328  fl_text_input_plugin_get_instance_private(self));
329  const gchar* text =
331  priv->text_model->SetText(text);
332 
333  int64_t selection_base =
335  int64_t selection_extent =
337  // Flutter uses -1/-1 for invalid; translate that to 0/0 for the model.
338  if (selection_base == -1 && selection_extent == -1) {
339  selection_base = selection_extent = 0;
340  }
341 
342  priv->text_model->SetText(text);
343  priv->text_model->SetSelection(
344  flutter::TextRange(selection_base, selection_extent));
345 
346  int64_t composing_base =
348  int64_t composing_extent =
350  if (composing_base == -1 && composing_extent == -1) {
351  priv->text_model->EndComposing();
352  } else {
353  size_t composing_start = std::min(composing_base, composing_extent);
354  size_t cursor_offset = selection_base - composing_start;
356  flutter::TextRange(composing_base, composing_extent), cursor_offset);
357  }
358 
359  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
360 }
G_BEGIN_DECLS FlValue * args
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
void SetText(const std::string &text)
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:628
bool SetComposingRange(const TextRange &range, size_t cursor_offset)
static constexpr char kComposingBaseKey[]
static constexpr char kComposingExtentKey[]
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:770
static constexpr char kTextKey[]
static constexpr char kSelectionExtentKey[]
static constexpr char kSelectionBaseKey[]
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:642
std::u16string text
flutter::TextInputModel * text_model
bool SetSelection(const TextRange &range)

◆ set_marked_text_rect()

static FlMethodResponse* set_marked_text_rect ( FlTextInputPlugin *  self,
FlValue args 
)
static

Definition at line 438 of file fl_text_input_plugin.cc.

References FlTextInputPluginPrivate::composing_rect, fl_method_success_response_new(), fl_value_get_float(), fl_value_lookup_string(), and update_im_cursor_position().

Referenced by method_call_cb().

439  {
441  fl_text_input_plugin_get_instance_private(self));
442  priv->composing_rect.x =
444  priv->composing_rect.y =
446  priv->composing_rect.width =
448  priv->composing_rect.height =
451 
452  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
453 }
G_BEGIN_DECLS FlValue * args
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:635
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:770
static void update_im_cursor_position(FlTextInputPlugin *self)

◆ show()

static FlMethodResponse* show ( FlTextInputPlugin *  self)
static

Definition at line 307 of file fl_text_input_plugin.cc.

References fl_method_success_response_new(), FL_TEXT_INPUT_TYPE_NONE, hide(), FlTextInputPluginPrivate::im_context, FlTextInputPluginPrivate::input_type, and FlTextInputPluginPrivate::view.

Referenced by method_call_cb().

307  {
309  fl_text_input_plugin_get_instance_private(self));
310  if (priv->input_type == FL_TEXT_INPUT_TYPE_NONE) {
311  return hide(self);
312  }
313 
314  // Set the top-level window used for system input method windows.
315  GdkWindow* window =
316  gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(priv->view)));
317  gtk_im_context_set_client_window(priv->im_context, window);
318 
319  gtk_im_context_focus_in(priv->im_context);
320 
321  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
322 }
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
static FlMethodResponse * hide(FlTextInputPlugin *self)

◆ update_editing_state()

static void update_editing_state ( FlTextInputPlugin *  self)
static

Definition at line 120 of file fl_text_input_plugin.cc.

References args, flutter::TextRange::base(), FlTextInputPluginPrivate::channel, FlTextInputPluginPrivate::client_id, flutter::TextInputModel::composing(), flutter::TextInputModel::composing_range(), flutter::TextRange::extent(), FALSE, fl_method_channel_invoke_method(), fl_value_append(), fl_value_append_take(), fl_value_new_bool(), fl_value_new_int(), fl_value_new_list(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), flutter::TextInputModel::GetText(), kComposingBaseKey, kComposingExtentKey, kSelectionAffinityKey, kSelectionBaseKey, kSelectionExtentKey, kSelectionIsDirectionalKey, kTextAffinityDownstream, kTextKey, kUpdateEditingStateMethod, flutter::TextInputModel::selection(), FlTextInputPluginPrivate::text_model, update_editing_state_response_cb(), and value.

Referenced by fl_text_input_plugin_filter_keypress_default(), im_commit_cb(), im_delete_surrounding_cb(), im_preedit_changed_cb(), and im_preedit_end_cb().

120  {
122  fl_text_input_plugin_get_instance_private(self));
123 
124  g_autoptr(FlValue) args = fl_value_new_list();
126  g_autoptr(FlValue) value = fl_value_new_map();
127 
128  flutter::TextRange selection = priv->text_model->selection();
130  value, kTextKey,
131  fl_value_new_string(priv->text_model->GetText().c_str()));
133  fl_value_new_int(selection.base()));
135  fl_value_new_int(selection.extent()));
136 
137  int composing_base = priv->text_model->composing()
138  ? priv->text_model->composing_range().base()
139  : -1;
140  int composing_extent = priv->text_model->composing()
141  ? priv->text_model->composing_range().extent()
142  : -1;
144  fl_value_new_int(composing_base));
146  fl_value_new_int(composing_extent));
147 
148  // The following keys are not implemented and set to default values.
153 
155 
157  args, nullptr,
159 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:338
G_BEGIN_DECLS FlValue * args
size_t extent() const
Definition: text_range.h:36
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:40
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:355
std::string GetText() const
static constexpr char kTextAffinityDownstream[]
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:244
static constexpr char kComposingBaseKey[]
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
Definition: fl_value.cc:552
static constexpr char kSelectionIsDirectionalKey[]
static constexpr char kComposingExtentKey[]
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:560
uint8_t value
static constexpr char kSelectionAffinityKey[]
TextRange composing_range() const
static constexpr char kTextKey[]
static constexpr char kSelectionExtentKey[]
static void update_editing_state_response_cb(GObject *object, GAsyncResult *result, gpointer user_data)
static constexpr char kSelectionBaseKey[]
size_t base() const
Definition: text_range.h:30
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:251
TextRange selection() const
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:265
G_MODULE_EXPORT void fl_method_channel_invoke_method(FlMethodChannel *self, const gchar *method, FlValue *args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
flutter::TextInputModel * text_model
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:610
static constexpr char kUpdateEditingStateMethod[]
return FALSE

◆ update_editing_state_response_cb()

static void update_editing_state_response_cb ( GObject *  object,
GAsyncResult *  result,
gpointer  user_data 
)
static

Definition at line 109 of file fl_text_input_plugin.cc.

References kUpdateEditingStateMethod.

Referenced by update_editing_state().

111  {
112  g_autoptr(GError) error = nullptr;
113  if (!finish_method(object, result, &error)) {
114  g_warning("Failed to call %s: %s", kUpdateEditingStateMethod,
115  error->message);
116  }
117 }
GAsyncResult * result
GAsyncResult GError ** error
static constexpr char kUpdateEditingStateMethod[]

◆ update_im_cursor_position()

static void update_im_cursor_position ( FlTextInputPlugin *  self)
static

Definition at line 379 of file fl_text_input_plugin.cc.

References flutter::TextInputModel::composing(), FlTextInputPluginPrivate::composing_rect, FlTextInputPluginPrivate::editabletext_transform, FlTextInputPluginPrivate::im_context, FlTextInputPluginPrivate::text_model, and FlTextInputPluginPrivate::view.

Referenced by set_editable_size_and_transform(), and set_marked_text_rect().

379  {
381  fl_text_input_plugin_get_instance_private(self));
382 
383  // Skip update if not composing to avoid setting to position 0.
384  if (!priv->text_model->composing()) {
385  return;
386  }
387 
388  // Transform the x, y positions of the cursor from local coordinates to
389  // Flutter view coordinates.
390  gint x = priv->composing_rect.x * priv->editabletext_transform[0][0] +
391  priv->composing_rect.y * priv->editabletext_transform[1][0] +
392  priv->editabletext_transform[3][0] + priv->composing_rect.width;
393  gint y = priv->composing_rect.x * priv->editabletext_transform[0][1] +
394  priv->composing_rect.y * priv->editabletext_transform[1][1] +
395  priv->editabletext_transform[3][1] + priv->composing_rect.height;
396 
397  // Transform from Flutter view coordinates to GTK window coordinates.
398  GdkRectangle preedit_rect;
399  gtk_widget_translate_coordinates(
400  GTK_WIDGET(priv->view), gtk_widget_get_toplevel(GTK_WIDGET(priv->view)),
401  x, y, &preedit_rect.x, &preedit_rect.y);
402 
403  // Set the cursor location in window coordinates so that GTK can position any
404  // system input method windows.
405  gtk_im_context_set_cursor_location(priv->im_context, &preedit_rect);
406 }
flutter::TextInputModel * text_model

Variable Documentation

◆ error

GAsyncResult GError** error
Initial value:
{
g_autoptr(FlMethodResponse) response = fl_method_channel_invoke_method_finish(
FL_METHOD_CHANNEL(object), result, error)
G_MODULE_EXPORT FlMethodResponse * fl_method_channel_invoke_method_finish(FlMethodChannel *self, GAsyncResult *result, GError **error)
GAsyncResult * result
GAsyncResult GError ** error

Definition at line 99 of file fl_text_input_plugin.cc.

◆ kBadArgumentsError

constexpr char kBadArgumentsError[] = "Bad Arguments"
static

Definition at line 15 of file fl_text_input_plugin.cc.

Referenced by set_client().

◆ kChannelName

constexpr char kChannelName[] = "flutter/textinput"
static

Definition at line 13 of file fl_text_input_plugin.cc.

Referenced by fl_text_input_plugin_new().

◆ kClearClientMethod

constexpr char kClearClientMethod[] = "TextInput.clearClient"
static

Definition at line 20 of file fl_text_input_plugin.cc.

Referenced by method_call_cb().

◆ kClientIdUnset

constexpr int64_t kClientIdUnset = -1
static

◆ kComposingBaseKey

constexpr char kComposingBaseKey[] = "composingBase"
static

Definition at line 37 of file fl_text_input_plugin.cc.

Referenced by set_editing_state(), and update_editing_state().

◆ kComposingExtentKey

constexpr char kComposingExtentKey[] = "composingExtent"
static

Definition at line 38 of file fl_text_input_plugin.cc.

Referenced by set_editing_state(), and update_editing_state().

◆ kHideMethod

constexpr char kHideMethod[] = "TextInput.hide"
static

Definition at line 21 of file fl_text_input_plugin.cc.

Referenced by method_call_cb().

◆ kInputActionKey

constexpr char kInputActionKey[] = "inputAction"
static

Definition at line 29 of file fl_text_input_plugin.cc.

Referenced by set_client().

◆ kMultilineInputType

constexpr char kMultilineInputType[] = "TextInputType.multiline"
static

Definition at line 43 of file fl_text_input_plugin.cc.

Referenced by set_client().

◆ kNoneInputType

constexpr char kNoneInputType[] = "TextInputType.none"
static

Definition at line 44 of file fl_text_input_plugin.cc.

Referenced by set_client().

◆ kPerformActionMethod

constexpr char kPerformActionMethod[] = "TextInputClient.performAction"
static

Definition at line 24 of file fl_text_input_plugin.cc.

Referenced by perform_action(), and perform_action_response_cb().

◆ kSelectionAffinityKey

constexpr char kSelectionAffinityKey[] = "selectionAffinity"
static

Definition at line 35 of file fl_text_input_plugin.cc.

Referenced by update_editing_state().

◆ kSelectionBaseKey

constexpr char kSelectionBaseKey[] = "selectionBase"
static

Definition at line 33 of file fl_text_input_plugin.cc.

Referenced by set_editing_state(), and update_editing_state().

◆ kSelectionExtentKey

constexpr char kSelectionExtentKey[] = "selectionExtent"
static

Definition at line 34 of file fl_text_input_plugin.cc.

Referenced by set_editing_state(), and update_editing_state().

◆ kSelectionIsDirectionalKey

constexpr char kSelectionIsDirectionalKey[] = "selectionIsDirectional"
static

Definition at line 36 of file fl_text_input_plugin.cc.

Referenced by update_editing_state().

◆ kSetClientMethod

constexpr char kSetClientMethod[] = "TextInput.setClient"
static

Definition at line 17 of file fl_text_input_plugin.cc.

Referenced by method_call_cb().

◆ kSetEditableSizeAndTransform

constexpr char kSetEditableSizeAndTransform[]
static
Initial value:
=
"TextInput.setEditableSizeAndTransform"

Definition at line 25 of file fl_text_input_plugin.cc.

Referenced by method_call_cb().

◆ kSetEditingStateMethod

constexpr char kSetEditingStateMethod[] = "TextInput.setEditingState"
static

Definition at line 19 of file fl_text_input_plugin.cc.

Referenced by method_call_cb().

◆ kSetMarkedTextRect

constexpr char kSetMarkedTextRect[] = "TextInput.setMarkedTextRect"
static

Definition at line 27 of file fl_text_input_plugin.cc.

Referenced by method_call_cb().

◆ kShowMethod

constexpr char kShowMethod[] = "TextInput.show"
static

Definition at line 18 of file fl_text_input_plugin.cc.

Referenced by method_call_cb().

◆ kTextAffinityDownstream

constexpr char kTextAffinityDownstream[] = "TextAffinity.downstream"
static

Definition at line 42 of file fl_text_input_plugin.cc.

Referenced by update_editing_state().

◆ kTextInputTypeKey

constexpr char kTextInputTypeKey[] = "inputType"
static

Definition at line 30 of file fl_text_input_plugin.cc.

Referenced by set_client().

◆ kTextInputTypeNameKey

constexpr char kTextInputTypeNameKey[] = "name"
static

Definition at line 31 of file fl_text_input_plugin.cc.

Referenced by set_client().

◆ kTextKey

constexpr char kTextKey[] = "text"
static

Definition at line 32 of file fl_text_input_plugin.cc.

Referenced by set_editing_state(), and update_editing_state().

◆ kTransform

constexpr char kTransform[] = "transform"
static

Definition at line 40 of file fl_text_input_plugin.cc.

Referenced by set_editable_size_and_transform().

◆ kUpdateEditingStateMethod

constexpr char kUpdateEditingStateMethod[]
static
Initial value:
=
"TextInputClient.updateEditingState"

Definition at line 22 of file fl_text_input_plugin.cc.

Referenced by update_editing_state(), and update_editing_state_response_cb().

◆ result

GAsyncResult* result

Definition at line 98 of file fl_text_input_plugin.cc.

Referenced by base::internal::SaturateFastAsmOp< Dst, Src >::__attribute__(), flutter::_ComputePlatformResolvedLocale(), fml::AcquireLooperForThread(), flutter_runner::testing::TouchEventBuilder::AddResult(), flutter_runner::AccessibilityBridge::AddSemanticsNodeUpdate(), fml::Base32Decode(), gfx::BoundingRect(), txt::FontAssetProvider::CanonicalFamilyName(), flutter::testing::TestGLSurface::ClearCurrent(), clipboard_text_cb(), clipboard_text_has_strings_cb(), flutter::testing::clone_string(), clone_string(), FlutterStandardMethodCodec::codecWithReaderWriter:, flutter::CompareOps(), ui::AXPosition< AXNodePosition, AXNode >::CompareTo(), flutter::Pipeline< R >::ProducerContinuation::Complete(), flutter::TextInputPlugin::ComposeChangeHook(), flutter::Paragraph::computeLineMetrics(), flutter_runner::IsolateConfigurator::ConfigureCurrentIsolate(), flutter::ConvertChar32ToUtf8(), fml::MallocMapping::Copy(), flutter::CopyToBitmap(), flutter::ImageGeneratorRegistry::CreateCompatibleGenerator(), dart_runner::CreateServiceIsolate(), vulkan::VulkanProcTable::CreateSkiaGetProc(), fml::CreateTemporaryDirectory(), flutter::CursorHandler::CursorHandler(), flutter::ImageDecoder::Decode(), decode_error_method_call(), decode_method_call(), flutter::MethodCodec< rapidjson::Document >::DecodeAndProcessResponseEnvelope(), flutter::JsonMessageCodec::DecodeMessageInternal(), base::internal::ClampedAddOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::Do(), base::internal::ClampedSubOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::Do(), base::internal::ClampedMulOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::Do(), base::internal::ClampedDivOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::Do(), base::internal::ClampedModOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::Do(), base::internal::ClampedLshOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::Do(), flutter::Rasterizer::Draw(), encode_error_message(), encode_message(), flutter::MethodCodec< rapidjson::Document >::EncodeSuccessEnvelope(), flutter::EncodeTextBoxes(), event_to_character(), fml::BitConverter< from_length, to_length, buffer_length >::Extract(), flutter_runner::testing::FakeFocuser::fail_request_focus(), tonic::FileLoader::FetchBytes(), fl_basic_message_channel_respond(), fl_binary_messenger_send_response(), fl_engine_gl_clear_current(), fl_engine_gl_external_texture_frame_callback(), fl_engine_gl_make_current(), fl_engine_gl_make_resource_current(), fl_engine_gl_present(), fl_engine_send_platform_message(), fl_engine_send_platform_message_response(), fl_engine_start(), fl_key_event_new_from_gdk_event(), fl_renderer_gl_collect_backing_store(), fl_renderer_gl_create_backing_store(), fl_renderer_start(), fl_standard_method_codec_decode_response(), fl_test_codec_decode_response(), FlutterDesktopEngineDestroy(), FlutterDesktopMessengerSend(), FlutterDesktopMessengerSendWithReply(), FlutterDesktopShutDownEngine(), FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable(), FlutterDesktopTextureRegistrarRegisterExternalTexture(), FlutterDesktopTextureRegistrarUnregisterExternalTexture(), FlutterEngineInitialize(), FlutterEngineRun(), FlutterEngineShutdown(), flutter::PlatformViewAndroidJNIImpl::FlutterViewComputePlatformResolvedLocale(), flutter::testing::UniqueEngineTraits::Free(), tonic::DartConverter< bool >::FromArguments(), tonic::DartConverterInteger< long int >::FromArguments(), tonic::DartConverterWrappable::FromArguments(), tonic::DartConverter< unsigned long long >::FromArguments(), tonic::DartConverterFloatingPoint< float >::FromArguments(), tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::FromArguments(), tonic::DartConverter< flutter::RRect >::FromDart(), tonic::DartConverter< bool >::FromDart(), tonic::DartConverterInteger< long int >::FromDart(), tonic::DartConverterWrappable::FromDart(), tonic::DartConverter< unsigned long long >::FromDart(), tonic::DartConverterFloatingPoint< float >::FromDart(), tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::FromDart(), tonic::DartConverter< const char * >::FromDart(), tonic::DartConverter< std::vector< T > >::FromDart(), filesystem::Descriptor::get(), flutter::testing::AutoIsolateShutdown::get(), ui::AXPlatformRelationWin::get_targets(), ui::AXTree::GetAllChildTreeIds(), ui::AXNodeData::GetBoolAttribute(), flutter::DisplayHelperWinUWP::GetBounds(), tonic::DartClassLibrary::GetClass(), GetCursorForKind(), fml::GetFileAttributesForUtf8Path(), ui::AXNodeData::GetFloatAttribute(), fml::GetFullHandlePath(), flutter::GetFunctionClassName(), flutter::GetFunctionName(), flutter::AndroidSurfaceGL::GetGLInterface(), flutter::PlatformHandlerWin32::GetHasStrings(), flutter::PlatformHandlerWinUwp::GetHasStrings(), ui::TestAXNodeWrapper::GetHypertextRangeBoundsRect(), ui::AXNodeData::GetIntAttribute(), flutter::RasterCache::GetIntegralTransCTM(), flutter::Paragraph::getLineBoundary(), ui::AXNode::GetOrderedSet(), flutter::AccessibilityBridge::GetPendingEvents(), flutter::PlatformHandlerWin32::GetPlainText(), flutter::PlatformHandlerWinUwp::GetPlainText(), flutter::Paragraph::getPositionForOffset(), flutter::GetPreferredBrightness(), tonic::GetReceiver(), flutter_runner::VulkanSurface::GetSize(), txt::ParagraphStyle::GetTextStyle(), ui::AXNode::GetUnignoredParent(), flutter::Paragraph::getWordBoundary(), dart_utils::HandleException(), flutter_runner::PlatformView::HandleFuchsiaShaderWarmupChannelPlatformMessage(), flutter::HandleMessageOnHandler(), FlutterTextInputPlugin(TestMethods)::handleMethodCall:result:, FlutterPlatformPlugin::handleMethodCall:result:, flutter_runner::FocusDelegate::HandlePlatformMessage(), flutter::FlutterViewController::HandleTopLevelWindowProc(), fml::HexEncode(), tonic::FileLoader::Import(), flutter::FragmentShader::init(), dart_runner::InitBuiltinLibrariesForIsolate(), flutter::InitDartAsync(), flutter::InitDartCore(), flutter::InitDartInternal(), flutter::InitDartIO(), flutter::DartUI::InitForIsolate(), flutter::DartIO::InitForIsolate(), fuchsia::dart::Initialize(), flutter::WindowWin32::InitializeChild(), flutter::testing::EmbedderConfigBuilder::InitializeEngine(), FlutterRestorationPlugin::initWithChannel:restorationEnabled:, FlutterMethodChannel::initWithName:binaryMessenger:codec:, FlutterViewController::initWithProject:, flutter::testing::MockMessageQueue::InjectMessageList(), flutter::ApplicationStore::Install(), gfx::IntersectRects(), flutter::MethodChannel< T >::InvokeMethod(), flutter::IOSExternalViewEmbedder::IOSExternalViewEmbedder(), FlutterTextInputPlugin::isFirstResponder, JNI_OnLoad(), base::JoinString(), tonic::FileLoader::Kernel(), flutter::KeyEventHandler::KeyboardHook(), flutter::KeyboardKeyEmbedderHandler::KeyboardHook(), flutter::PersistentCache::load(), flutter::FlutterProjectBundle::LoadAotData(), LoadAotData(), flutter::DartIsolate::LoadLoadingUnit(), flutter::DartIsolate::LoadLoadingUnitError(), flutter::PersistentCache::LoadSkSLs(), tonic::Log(), flutter::Logger_PrintString(), main(), flutter::testing::TestGLSurface::MakeCurrent(), MakeHandle(), flutter::testing::TestGLSurface::MakeResourceCurrent(), base::internal::CheckedNumeric< T >::MathOp(), method_call_success_cb(), method_call_success_error_cb(), method_call_success_response_cb(), flutter::testing::MockEmbedderApiForKeyboard(), flutter::MethodResult< T >::NotImplemented(), ui::AXEventGenerator::OnAtomicUpdateFinished(), tonic::DartMessageHandler::OnHandleMessage(), flutter::FlutterPlatformViewsController::OnMethodCall, flutter::WindowProcDelegateManagerWin32::OnTopLevelWindowProc(), dart_utils::OpenFdExec(), dart_utils::OpenVmo(), gfx::operator+(), base::internal::operator+(), gfx::operator-(), base::internal::operator-(), tonic::PackagesMap::Parse(), flutter::ParseCommaDelimited(), flutter::PlatformHandler::PlatformHandler(), flutter::testing::TestGLSurface::Present(), ui::AXPlatformNodeWinTest::QueryInterfaceFromNode(), filesystem::ReadFileToString(), reassign_method_cb(), fml::MallocMapping::Release(), flutter::Animator::Render(), flutter::AndroidSurfaceGL::ResourceContextClearCurrent(), dart_runner::DartComponentControllerV2::Run(), FlutterEngine::run, flutter::testing::RunDartCodeInIsolate(), flutter::Shell::RunEngine(), RunFlutter(), RunFlutterEngine(), flutter::testing::AutoIsolateShutdown::RunInIsolateScope(), tonic::DartMicrotaskQueue::RunMicrotasks(), flutter::FlutterWindowsEngine::RunWithEntrypoint(), fml::paths::SanitizeURIEscapedCharacters(), flutter::BinaryMessengerImpl::Send(), send_events_events_cb(), flutter::FlutterWindowsEngine::SendPlatformMessage(), ui::AXPosition< AXNodePosition, AXNode >::Serialize(), flutter::MethodChannel< T >::SetMethodCallHandler(), flutter::testing::TestDartNativeResolver::SetNativeResolverForIsolate(), flutter::PlatformHandlerWinUwp::SetPlainText(), flutter::PlatformHandlerWin32::SetPlainText(), tonic::DartConverter< TypedList< kTypeName, ElemType > >::SetReturnValue(), flutter::PlatformViewIOS::SetSemanticsEnabled(), flutter::EventChannel< T >::SetStreamHandler(), flutter::testing::FuchsiaShellTest::SetTimezone(), dart_runner::DartComponentControllerV2::SetUp(), setup_locales(), SetUpLocales(), FlutterEngine::shutDownEngine, flutter::RuntimeController::Spawn(), flutter::Shell::Spawn(), flutter::Engine::Spawn(), flutter::DartServiceIsolate::Startup(), flutter::FlutterWindowsEngine::Stop(), fml::jni::StringToJavaString(), gfx::SubtractRects(), ui::AXPlatformNodeDelegateBase::SubtreeToStringHelper(), TEST(), fml::testing::TEST(), flutter::testing::TEST(), flutter::TEST(), gfx::TEST(), flutter::testing::TEST_F(), ui::TEST_F(), flutter_runner_test::TEST_F(), flutter::testing::TestGLSurface::TestGLSurface(), flutter::TextInputPlugin::TextInputPlugin(), fml::TimerRearm(), tonic::DartConverter< DartConverterMapping >::ToDart(), tonic::DartConverter< std::vector< T > >::ToDart(), gfx::ToEnclosedRect(), gfx::ToEnclosedRectIgnoringError(), gfx::ToEnclosingRect(), gfx::ToEnclosingRectIgnoringError(), gfx::ToNearestRect(), gfx::ToRoundedRect(), ui::AXTreeData::ToString(), ui::AXRelativeBounds::ToString(), ui::AXTreeUpdateBase< AXNodeData, AXTreeData >::ToString(), ui::AXTableInfo::ToString(), ui::AXNodeData::ToString(), flutter::ApplicationStore::Uninstall(), gfx::UnionRects(), flutter::PluginRegistrarWindows::UnregisterTopLevelWindowProcDelegate(), flutter::AccessibilityBridge::UpdateDelegate(), FlutterTextField::updateString:withSelection:, flutter::UploadRasterImage(), dart_utils::VmoFromFilename(), dart_utils::VmoFromFilenameAt(), flutter_runner::PointerDelegate::WatchLoop(), flutter::WriteServerErrorResponse(), zircon_dart_channel_create(), zircon_dart_handle_list_create(), _FlutterTaskRunner::~_FlutterTaskRunner(), flutter::AndroidEGLSurface::~AndroidEGLSurface(), flutter::AngleSurfaceManager::~AngleSurfaceManager(), tonic::FileLoader::~FileLoader(), fml::PlatformSemaphore::~PlatformSemaphore(), flutter::RuntimeController::~RuntimeController(), and flutter::testing::TestGLSurface::~TestGLSurface().