#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/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 | FlTextInputHandlerPrivate |
Enumerations | |
enum | FlTextInputType { kFlTextInputTypeText, kFlTextInputTypeMultiline, kFlTextInputTypeNone } |
Functions | |
G_DEFINE_TYPE_WITH_PRIVATE (FlTextInputHandler, fl_text_input_handler, 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 (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 FlMethodResponse * | set_client (FlTextInputHandler *self, FlValue *args) |
static FlMethodResponse * | hide (FlTextInputHandler *self) |
static FlMethodResponse * | show (FlTextInputHandler *self) |
static FlMethodResponse * | set_editing_state (FlTextInputHandler *self, FlValue *args) |
static FlMethodResponse * | clear_client (FlTextInputHandler *self) |
static void | update_im_cursor_position (FlTextInputHandler *self) |
static FlMethodResponse * | set_editable_size_and_transform (FlTextInputHandler *self, FlValue *args) |
static FlMethodResponse * | set_marked_text_rect (FlTextInputHandler *self, FlValue *args) |
static void | method_call_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
static void | fl_text_input_handler_dispose (GObject *object) |
static gboolean | fl_text_input_handler_filter_keypress_default (FlTextInputHandler *self, FlKeyEvent *event) |
static void | fl_text_input_handler_class_init (FlTextInputHandlerClass *klass) |
static void | fl_text_input_handler_init (FlTextInputHandler *self) |
static void | init_im_context (FlTextInputHandler *self, GtkIMContext *im_context) |
FlTextInputHandler * | fl_text_input_handler_new (FlBinaryMessenger *messenger, GtkIMContext *im_context, FlTextInputViewDelegate *view_delegate) |
gboolean | fl_text_input_handler_filter_keypress (FlTextInputHandler *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 | kUpdateEditingStateWithDeltasMethod [] |
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 | kEnableDeltaModel [] = "enableDeltaModel" |
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 char | kNewlineInputAction [] = "TextInputAction.newline" |
static constexpr int64_t | kClientIdUnset = -1 |
GAsyncResult * | result |
GAsyncResult GError ** | error |
enum FlTextInputType |
Enumerator | |
---|---|
kFlTextInputTypeText | |
kFlTextInputTypeMultiline | |
kFlTextInputTypeNone |
Definition at line 54 of file fl_text_input_handler.cc.
|
static |
Definition at line 468 of file fl_text_input_handler.cc.
References fl_method_success_response_new(), kClientIdUnset, and priv.
Referenced by method_call_cb().
return fl_method_response_get_result | ( | response | , |
error | |||
) |
|
static |
Definition at line 701 of file fl_text_input_handler.cc.
References fl_text_input_handler_dispose(), and fl_text_input_handler_filter_keypress_default().
|
static |
Definition at line 594 of file fl_text_input_handler.cc.
References priv.
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 Gdk key event.
Returns: TRUE if the event was used.
Definition at line 778 of file fl_text_input_handler.cc.
References event.
Referenced by fl_view_keyboard_delegate_iface_init(), and send_key_event().
|
static |
Definition at line 617 of file fl_text_input_handler.cc.
References event, fl_key_event_get_is_press(), fl_key_event_get_keyval(), fl_key_event_get_origin(), fl_key_event_get_state(), kClientIdUnset, kFlTextInputTypeMultiline, kNewlineInputAction, perform_action(), priv, TRUE, update_editing_state(), and update_editing_state_with_delta().
Referenced by fl_text_input_handler_class_init().
|
static |
Definition at line 708 of file fl_text_input_handler.cc.
References kClientIdUnset, kFlTextInputTypeText, and priv.
FlTextInputHandler* fl_text_input_handler_new | ( | FlBinaryMessenger * | messenger, |
GtkIMContext * | im_context, | ||
FlTextInputViewDelegate * | view_delegate | ||
) |
fl_text_input_handler_new: @messenger: an #FlBinaryMessenger. @im_context: (allow-none): a #GtkIMContext. @view_delegate: an #FlTextInputViewDelegate.
Creates a new handler that implements SystemChannels.textInput from the Flutter services library.
Returns: a new #FlTextInputHandler.
Definition at line 747 of file fl_text_input_handler.cc.
References fl_json_method_codec_new(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), init_im_context(), kChannelName, method_call_cb(), and priv.
Referenced by init_keyboard(), and TEST().
G_DEFINE_TYPE_WITH_PRIVATE | ( | FlTextInputHandler | , |
fl_text_input_handler | , | ||
G_TYPE_OBJECT | |||
) |
|
static |
Definition at line 408 of file fl_text_input_handler.cc.
References fl_method_success_response_new(), and priv.
Referenced by method_call_cb(), and show().
if | ( | response | = = nullptr | ) |
Definition at line 110 of file fl_text_input_handler.cc.
|
static |
Definition at line 291 of file fl_text_input_handler.cc.
References priv, update_editing_state(), and update_editing_state_with_delta().
Referenced by init_im_context().
|
static |
Definition at line 343 of file fl_text_input_handler.cc.
References priv, TRUE, update_editing_state(), and update_editing_state_with_delta().
Referenced by init_im_context().
|
static |
Definition at line 262 of file fl_text_input_handler.cc.
References priv, update_editing_state(), and update_editing_state_with_delta().
Referenced by init_im_context().
|
static |
Definition at line 318 of file fl_text_input_handler.cc.
References priv, update_editing_state(), and update_editing_state_with_delta().
Referenced by init_im_context().
|
static |
Definition at line 255 of file fl_text_input_handler.cc.
References priv.
Referenced by init_im_context().
|
static |
|
static |
Definition at line 717 of file fl_text_input_handler.cc.
References im_commit_cb(), im_delete_surrounding_cb(), im_preedit_changed_cb(), im_preedit_end_cb(), im_preedit_start_cb(), im_retrieve_surrounding_cb(), and priv.
Referenced by fl_text_input_handler_new().
|
static |
Definition at line 560 of file fl_text_input_handler.cc.
References args, clear_client(), error, 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, method_call, set_client(), set_editable_size_and_transform(), set_editing_state(), set_marked_text_rect(), show(), and user_data.
Referenced by fl_text_input_handler_new().
|
static |
Definition at line 238 of file fl_text_input_handler.cc.
References args, fl_method_channel_invoke_method(), fl_value_append_take(), fl_value_new_int(), fl_value_new_list(), fl_value_new_string(), kPerformActionMethod, perform_action_response_cb(), and priv.
Referenced by fl_text_input_handler_filter_keypress_default().
|
static |
Definition at line 228 of file fl_text_input_handler.cc.
References error, finish_method(), kPerformActionMethod, and result.
Referenced by perform_action().
|
static |
Definition at line 364 of file fl_text_input_handler.cc.
References args, fl_method_error_response_new(), fl_method_success_response_new(), fl_value_get_bool(), 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, kBadArgumentsError, kEnableDeltaModel, kFlTextInputTypeMultiline, kFlTextInputTypeNone, kFlTextInputTypeText, kInputActionKey, kMultilineInputType, kNoneInputType, kTextInputTypeKey, kTextInputTypeNameKey, and priv.
Referenced by method_call_cb(), and TEST().
|
static |
Definition at line 518 of file fl_text_input_handler.cc.
References args, fl_method_success_response_new(), fl_value_get_float(), fl_value_get_length(), fl_value_get_list_value(), fl_value_lookup_string(), i, kTransform, priv, and update_im_cursor_position().
Referenced by method_call_cb(), and TEST().
|
static |
Definition at line 430 of file fl_text_input_handler.cc.
References args, fl_method_success_response_new(), fl_value_get_int(), fl_value_get_string(), fl_value_lookup_string(), kComposingBaseKey, kComposingExtentKey, kSelectionBaseKey, kSelectionExtentKey, kTextKey, and priv.
Referenced by method_call_cb().
|
static |
Definition at line 542 of file fl_text_input_handler.cc.
References args, fl_method_success_response_new(), fl_value_get_float(), fl_value_lookup_string(), priv, and update_im_cursor_position().
Referenced by method_call_cb(), and TEST().
|
static |
Definition at line 417 of file fl_text_input_handler.cc.
References fl_method_success_response_new(), hide(), kFlTextInputTypeNone, and priv.
Referenced by method_call_cb(), and TEST().
|
static |
Definition at line 128 of file fl_text_input_handler.cc.
References args, flutter::TextRange::base(), flutter::TextRange::extent(), 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(), kComposingBaseKey, kComposingExtentKey, kSelectionAffinityKey, kSelectionBaseKey, kSelectionExtentKey, kSelectionIsDirectionalKey, kTextAffinityDownstream, kTextKey, kUpdateEditingStateMethod, priv, update_editing_state_response_cb(), and value.
Referenced by fl_text_input_handler_filter_keypress_default(), im_commit_cb(), im_delete_surrounding_cb(), im_preedit_changed_cb(), and im_preedit_end_cb().
|
static |
Definition at line 117 of file fl_text_input_handler.cc.
References error, finish_method(), kUpdateEditingStateMethod, and result.
Referenced by update_editing_state(), and update_editing_state_with_delta().
|
static |
Definition at line 170 of file fl_text_input_handler.cc.
References args, flutter::TextRange::base(), flutter::TextEditingDelta::delta_end(), flutter::TextEditingDelta::delta_start(), flutter::TextEditingDelta::delta_text(), flutter::TextRange::extent(), 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(), fl_value_set_string_take(), kTextAffinityDownstream, kUpdateEditingStateWithDeltasMethod, flutter::TextEditingDelta::old_text(), priv, update_editing_state_response_cb(), and value.
Referenced by fl_text_input_handler_filter_keypress_default(), im_commit_cb(), im_delete_surrounding_cb(), im_preedit_changed_cb(), and im_preedit_end_cb().
|
static |
Definition at line 484 of file fl_text_input_handler.cc.
References fl_text_input_view_delegate_translate_coordinates(), and priv.
Referenced by set_editable_size_and_transform(), and set_marked_text_rect().
GAsyncResult GError** error |
Definition at line 107 of file fl_text_input_handler.cc.
Referenced by method_call_cb(), perform_action_response_cb(), and update_editing_state_response_cb().
|
staticconstexpr |
Definition at line 16 of file fl_text_input_handler.cc.
Referenced by set_client().
|
staticconstexpr |
Definition at line 14 of file fl_text_input_handler.cc.
Referenced by fl_text_input_handler_new().
|
staticconstexpr |
Definition at line 21 of file fl_text_input_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 52 of file fl_text_input_handler.cc.
Referenced by clear_client(), fl_text_input_handler_filter_keypress_default(), and fl_text_input_handler_init().
|
staticconstexpr |
Definition at line 41 of file fl_text_input_handler.cc.
Referenced by set_editing_state(), and update_editing_state().
|
staticconstexpr |
Definition at line 42 of file fl_text_input_handler.cc.
Referenced by set_editing_state(), and update_editing_state().
|
staticconstexpr |
Definition at line 34 of file fl_text_input_handler.cc.
Referenced by set_client().
|
staticconstexpr |
Definition at line 22 of file fl_text_input_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 32 of file fl_text_input_handler.cc.
Referenced by set_client().
|
staticconstexpr |
Definition at line 47 of file fl_text_input_handler.cc.
Referenced by set_client().
|
staticconstexpr |
Definition at line 50 of file fl_text_input_handler.cc.
Referenced by fl_text_input_handler_filter_keypress_default().
|
staticconstexpr |
Definition at line 48 of file fl_text_input_handler.cc.
Referenced by set_client().
|
staticconstexpr |
Definition at line 27 of file fl_text_input_handler.cc.
Referenced by perform_action(), and perform_action_response_cb().
|
staticconstexpr |
Definition at line 39 of file fl_text_input_handler.cc.
Referenced by update_editing_state().
|
staticconstexpr |
Definition at line 37 of file fl_text_input_handler.cc.
Referenced by set_editing_state(), and update_editing_state().
|
staticconstexpr |
Definition at line 38 of file fl_text_input_handler.cc.
Referenced by set_editing_state(), and update_editing_state().
|
staticconstexpr |
Definition at line 40 of file fl_text_input_handler.cc.
Referenced by update_editing_state().
|
staticconstexpr |
Definition at line 18 of file fl_text_input_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 28 of file fl_text_input_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 20 of file fl_text_input_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 30 of file fl_text_input_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 19 of file fl_text_input_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 46 of file fl_text_input_handler.cc.
Referenced by update_editing_state(), and update_editing_state_with_delta().
|
staticconstexpr |
Definition at line 33 of file fl_text_input_handler.cc.
Referenced by set_client().
|
staticconstexpr |
Definition at line 35 of file fl_text_input_handler.cc.
Referenced by set_client().
|
staticconstexpr |
Definition at line 36 of file fl_text_input_handler.cc.
Referenced by set_editing_state(), and update_editing_state().
|
staticconstexpr |
Definition at line 44 of file fl_text_input_handler.cc.
Referenced by set_editable_size_and_transform().
|
staticconstexpr |
Definition at line 23 of file fl_text_input_handler.cc.
Referenced by update_editing_state(), and update_editing_state_response_cb().
|
staticconstexpr |
Definition at line 25 of file fl_text_input_handler.cc.
Referenced by update_editing_state_with_delta().
GAsyncResult* result |
Definition at line 106 of file fl_text_input_handler.cc.
Referenced by add_view_cb(), add_view_engine_error_cb(), add_view_error_cb(), clipboard_text_cb(), clipboard_text_has_strings_cb(), decode_error_method_call(), decode_method_call(), decode_response_with_success(), flutter::MethodCodec< rapidjson::Document >::DecodeAndProcessResponseEnvelope(), flutter::JsonMethodCodec::DecodeAndProcessResponseEnvelopeInternal(), flutter::StandardMethodCodec::DecodeAndProcessResponseEnvelopeInternal(), flutter::JsonMessageCodec::DecodeMessageInternal(), echo_response_cb(), encode_error_message(), encode_message(), encode_success_envelope(), flutter::MethodCodec< rapidjson::Document >::EncodeSuccessEnvelope(), flutter::JsonMethodCodec::EncodeSuccessEnvelopeInternal(), flutter::StandardMethodCodec::EncodeSuccessEnvelopeInternal(), error_response_cb(), event_to_character(), failure_response_cb(), fake_response_cb(), finish_method(), fl_basic_message_channel_respond(), fl_basic_message_channel_send_finish(), fl_binary_messenger_send_on_channel_finish(), fl_engine_add_view(), fl_engine_add_view_finish(), fl_engine_gl_external_texture_frame_callback(), fl_engine_remove_view(), fl_engine_remove_view_finish(), fl_engine_send_platform_message(), fl_engine_send_platform_message_finish(), fl_engine_send_platform_message_response(), fl_engine_start(), fl_json_method_codec_encode_success_envelope(), fl_method_call_respond_success(), fl_method_channel_invoke_method_finish(), fl_method_codec_encode_success_envelope(), fl_method_success_response_new(), fl_standard_method_codec_decode_response(), fl_standard_method_codec_encode_success_envelope(), fl_test_codec_decode_response(), fl_test_codec_encode_success_envelope(), get_exit_response(), get_keyboard_state(), flutter::AccessibilityBridge::GetPendingEvents(), handle_response(), flutter::MethodChannel< T >::InvokeMethod(), MethodCallMatcher::MatchAndExplain(), MATCHER_P(), message_response_cb(), method_call_success_cb(), method_call_success_error_cb(), method_call_success_response_cb(), method_response_cb(), not_implemented_response_cb(), null_message_response_cb(), nullptr_args_response_cb(), nullptr_response_cb(), perform_action_response_cb(), platform_message_ready_cb(), reassign_method_cb(), remove_view_cb(), remove_view_engine_error_cb(), remove_view_error_cb(), request_app_exit_response_cb(), resize_channel_response_cb(), flutter::BinaryMessengerImpl::Send(), send_events_events_cb(), send_on_channel_finish(), send_response(), set_warns_on_channel_overflow_response_cb(), flutter::MethodChannel< T >::SetMethodCallHandler(), flutter::EventChannel< T >::SetStreamHandler(), setup_locales(), flutter::MethodResult< EncodableValue >::Success(), flutter::MethodResultFunctions< T >::SuccessInternal(), flutter::EngineMethodResult< T >::SuccessInternal(), flutter::TEST(), flutter::testing::TEST(), TEST(), unregister_texture(), update_editing_state_response_cb(), view_added_cb(), and view_removed_cb().