#include "flutter/shell/platform/linux/fl_text_input_handler.h"#include <gtk/gtk.h>#include "flutter/shell/platform/common/text_editing_delta.h"#include "flutter/shell/platform/common/text_input_model.h"#include "flutter/shell/platform/linux/fl_text_input_channel.h"Go to the source code of this file.
Classes | |
| struct | _FlTextInputHandler |
Functions | |
| static void | update_editing_state_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
| static void | update_editing_state_with_deltas_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
| static void | update_editing_state (FlTextInputHandler *self) |
| static void | update_editing_state_with_delta (FlTextInputHandler *self, flutter::TextEditingDelta *delta) |
| static void | perform_action_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
| static void | perform_action (FlTextInputHandler *self) |
| static void | im_preedit_start_cb (FlTextInputHandler *self) |
| static void | im_preedit_changed_cb (FlTextInputHandler *self) |
| static void | im_commit_cb (FlTextInputHandler *self, const gchar *text) |
| static void | im_preedit_end_cb (FlTextInputHandler *self) |
| static gboolean | im_retrieve_surrounding_cb (FlTextInputHandler *self) |
| static gboolean | im_delete_surrounding_cb (FlTextInputHandler *self, gint offset, gint n_chars) |
| static void | set_client (int64_t client_id, const gchar *input_action, gboolean enable_delta_model, FlTextInputType input_type, gpointer user_data) |
| static void | hide (gpointer user_data) |
| static void | show (gpointer user_data) |
| static void | set_editing_state (const gchar *text, int64_t selection_base, int64_t selection_extent, int64_t composing_base, int64_t composing_extent, gpointer user_data) |
| static void | clear_client (gpointer user_data) |
| static void | update_im_cursor_position (FlTextInputHandler *self) |
| static void | set_editable_size_and_transform (double *transform, gpointer user_data) |
| static void | set_marked_text_rect (double x, double y, double width, double height, gpointer user_data) |
| static void | fl_text_input_handler_dispose (GObject *object) |
| static void | fl_text_input_handler_class_init (FlTextInputHandlerClass *klass) |
| static void | fl_text_input_handler_init (FlTextInputHandler *self) |
| FlTextInputHandler * | fl_text_input_handler_new (FlBinaryMessenger *messenger) |
| GtkIMContext * | fl_text_input_handler_get_im_context (FlTextInputHandler *self) |
| void | fl_text_input_handler_set_widget (FlTextInputHandler *self, GtkWidget *widget) |
| GtkWidget * | fl_text_input_handler_get_widget (FlTextInputHandler *self) |
| gboolean | fl_text_input_handler_filter_keypress (FlTextInputHandler *self, FlKeyEvent *event) |
Variables | |
| static constexpr char | kNewlineInputAction [] = "TextInputAction.newline" |
| static constexpr int64_t | kClientIdUnset = -1 |
| static FlTextInputChannelVTable | text_input_vtable |
|
static |
Definition at line 306 of file fl_text_input_handler.cc.
References kClientIdUnset, self, and user_data.
|
static |
Definition at line 400 of file fl_text_input_handler.cc.
References fl_text_input_handler_dispose().
|
static |
Definition at line 382 of file fl_text_input_handler.cc.
References self.
Referenced by fl_text_input_handler_class_init().
| gboolean fl_text_input_handler_filter_keypress | ( | FlTextInputHandler * | handler, |
| FlKeyEvent * | event | ||
| ) |
fl_text_input_handler_filter_keypress @handler: an #FlTextInputHandler. @event: a #FlKeyEvent
Process a key event.
Returns: TRUE if the event was used.
Definition at line 477 of file fl_text_input_handler.cc.
References fl_key_event_get_is_press(), fl_key_event_get_keyval(), fl_key_event_get_origin(), fl_key_event_get_state(), FL_TEXT_INPUT_TYPE_MULTILINE, gtk_im_context_filter_keypress(), kClientIdUnset, kNewlineInputAction, perform_action(), self, text, TRUE, update_editing_state(), and update_editing_state_with_delta().
Referenced by handle_key_event(), and send_key_event().
| GtkIMContext * fl_text_input_handler_get_im_context | ( | FlTextInputHandler * | handler | ) |
fl_text_input_handler_get_im_context: @handler: an #FlTextInputHandler.
Get the IM context that is being used. Provided for testing purposes.
Returns: a #GtkIMContext.
Definition at line 459 of file fl_text_input_handler.cc.
References self.
| GtkWidget * fl_text_input_handler_get_widget | ( | FlTextInputHandler * | handler | ) |
fl_text_input_handler_get_widget: @handler: an #FlTextInputHandler.
Get the widget that has input focus.
Returns: a #GtkWidget or NULL if none active.
Definition at line 472 of file fl_text_input_handler.cc.
References self.
Referenced by setup_keyboard().
|
static |
Definition at line 405 of file fl_text_input_handler.cc.
References FL_TEXT_INPUT_TYPE_TEXT, kClientIdUnset, and self.
| FlTextInputHandler * fl_text_input_handler_new | ( | FlBinaryMessenger * | messenger | ) |
FlTextInputHandler:
#FlTextInputHandler is a handler that implements the shell side of SystemChannels.textInput from the Flutter services library. fl_text_input_handler_new: @messenger: an #FlBinaryMessenger.
Creates a new handler that implements SystemChannels.textInput from the Flutter services library.
Returns: a new #FlTextInputHandler.
Definition at line 422 of file fl_text_input_handler.cc.
References fl_text_input_channel_new(), gtk_im_context_focus_out(), im_commit_cb(), im_delete_surrounding_cb(), im_preedit_changed_cb(), im_preedit_end_cb(), im_preedit_start_cb(), im_retrieve_surrounding_cb(), self, and text_input_vtable.
Referenced by setup_keyboard(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| void fl_text_input_handler_set_widget | ( | FlTextInputHandler * | handler, |
| GtkWidget * | widget | ||
| ) |
fl_text_input_handler_set_widget: @handler: an #FlTextInputHandler. @widget: the widget with keyboard focus.
Set the widget that has input focus.
Definition at line 464 of file fl_text_input_handler.cc.
References gtk_im_context_set_client_window(), gtk_widget_get_window(), and self.
Referenced by fl_view_focus_in_event(), and setup_keyboard().
|
static |
Definition at line 257 of file fl_text_input_handler.cc.
References gtk_im_context_focus_out(), self, and user_data.
Referenced by show().
|
static |
Definition at line 178 of file fl_text_input_handler.cc.
References self, text, update_editing_state(), and update_editing_state_with_delta().
Referenced by fl_text_input_handler_new().
|
static |
Definition at line 224 of file fl_text_input_handler.cc.
References self, TRUE, update_editing_state(), and update_editing_state_with_delta().
Referenced by fl_text_input_handler_new().
|
static |
Definition at line 151 of file fl_text_input_handler.cc.
References gtk_im_context_get_preedit_string(), self, text, update_editing_state(), and update_editing_state_with_delta().
Referenced by fl_text_input_handler_new().
|
static |
Definition at line 203 of file fl_text_input_handler.cc.
References self, update_editing_state(), and update_editing_state_with_delta().
Referenced by fl_text_input_handler_new().
|
static |
Definition at line 146 of file fl_text_input_handler.cc.
References self.
Referenced by fl_text_input_handler_new().
|
static |
Definition at line 215 of file fl_text_input_handler.cc.
References gtk_im_context_set_surrounding(), self, text, and TRUE.
Referenced by fl_text_input_handler_new().
|
static |
Definition at line 135 of file fl_text_input_handler.cc.
References fl_text_input_channel_perform_action(), perform_action_response_cb(), and self.
Referenced by fl_text_input_handler_filter_keypress().
|
static |
Definition at line 123 of file fl_text_input_handler.cc.
References error, fl_text_input_channel_perform_action_finish(), and g_autoptr().
Referenced by perform_action().
|
static |
|
static |
Definition at line 351 of file fl_text_input_handler.cc.
References i, self, transform, update_im_cursor_position(), and user_data.
|
static |
Definition at line 276 of file fl_text_input_handler.cc.
|
static |
Definition at line 367 of file fl_text_input_handler.cc.
References height, self, update_im_cursor_position(), user_data, width, x, and y.
|
static |
Definition at line 264 of file fl_text_input_handler.cc.
References FL_TEXT_INPUT_TYPE_NONE, gtk_im_context_focus_in(), hide(), self, and user_data.
|
static |
Definition at line 89 of file fl_text_input_handler.cc.
References flutter::TextRange::base(), flutter::TextRange::extent(), FL_TEXT_AFFINITY_DOWNSTREAM, fl_text_input_channel_update_editing_state(), self, and update_editing_state_response_cb().
Referenced by fl_text_input_handler_filter_keypress(), im_commit_cb(), im_delete_surrounding_cb(), im_preedit_changed_cb(), and im_preedit_end_cb().
|
static |
Definition at line 61 of file fl_text_input_handler.cc.
References error, fl_text_input_channel_update_editing_state_finish(), and g_autoptr().
Referenced by update_editing_state().
|
static |
Definition at line 105 of file fl_text_input_handler.cc.
References flutter::TextRange::base(), flutter::TextEditingDelta::delta_end(), flutter::TextEditingDelta::delta_start(), flutter::TextEditingDelta::delta_text(), flutter::TextRange::extent(), FL_TEXT_AFFINITY_DOWNSTREAM, fl_text_input_channel_update_editing_state_with_deltas(), flutter::TextEditingDelta::old_text(), self, and update_editing_state_with_deltas_response_cb().
Referenced by fl_text_input_handler_filter_keypress(), im_commit_cb(), im_delete_surrounding_cb(), im_preedit_changed_cb(), and im_preedit_end_cb().
|
static |
Definition at line 75 of file fl_text_input_handler.cc.
References error, fl_text_input_channel_update_editing_state_with_deltas_finish(), and g_autoptr().
Referenced by update_editing_state_with_delta().
|
static |
Definition at line 319 of file fl_text_input_handler.cc.
References gtk_im_context_set_cursor_location(), gtk_widget_get_toplevel(), gtk_widget_translate_coordinates(), self, x, and y.
Referenced by set_editable_size_and_transform(), and set_marked_text_rect().
|
staticconstexpr |
Definition at line 15 of file fl_text_input_handler.cc.
Referenced by clear_client(), fl_text_input_handler_filter_keypress(), and fl_text_input_handler_init().
|
staticconstexpr |
Definition at line 13 of file fl_text_input_handler.cc.
Referenced by fl_text_input_handler_filter_keypress().
|
static |
Definition at line 412 of file fl_text_input_handler.cc.
Referenced by fl_text_input_handler_new().