21 "TextInputClient.updateEditingState";
23 "TextInputClient.updateEditingStateWithDeltas";
26 "TextInput.setEditableSizeAndTransform";
73G_DEFINE_TYPE(FlTextInputChannel, fl_text_input_channel, G_TYPE_OBJECT)
82 g_assert_not_reached();
88 GtkInputPurpose* im_purpose,
89 GtkInputHints* im_hints) {
90 if (input_type_name ==
nullptr) {
97 *im_hints =
static_cast<GtkInputHints
>(GTK_INPUT_HINT_SPELLCHECK |
98 GTK_INPUT_HINT_UPPERCASE_SENTENCES);
101 *im_purpose = GTK_INPUT_PURPOSE_NUMBER;
103 *im_purpose = GTK_INPUT_PURPOSE_PHONE;
107 *im_purpose = GTK_INPUT_PURPOSE_EMAIL;
109 *im_purpose = GTK_INPUT_PURPOSE_URL;
111 *im_purpose = GTK_INPUT_PURPOSE_PASSWORD;
113 *im_purpose = GTK_INPUT_PURPOSE_NAME;
114 *im_hints = GTK_INPUT_HINT_UPPERCASE_WORDS;
116 *im_hints = GTK_INPUT_HINT_UPPERCASE_WORDS;
121 *im_hints = GTK_INPUT_HINT_LOWERCASE;
123 *im_hints =
static_cast<GtkInputHints
>(GTK_INPUT_HINT_SPELLCHECK |
124 GTK_INPUT_HINT_UPPERCASE_SENTENCES);
126 g_warning(
"Unhandled input type name: %s", input_type_name);
141 self->vtable->set_client(client_id,
self->user_data);
148 const gchar* input_action =
nullptr;
155 FlValue* enable_delta_model_value =
161 GtkInputPurpose im_purpose = GTK_INPUT_PURPOSE_FREE_FORM;
162 GtkInputHints im_hints = GTK_INPUT_HINT_NONE;
166 FlValue* input_type_name_value =
171 &im_purpose, &im_hints);
175 self->vtable->configure(input_action, enable_delta_model, input_type,
176 im_purpose, im_hints,
self->user_data);
182static FlMethodResponse*
hide(FlTextInputChannel*
self) {
183 self->vtable->hide(
self->user_data);
188static FlMethodResponse*
show(FlTextInputChannel*
self) {
189 self->vtable->show(
self->user_data);
198 int64_t selection_base =
200 int64_t selection_extent =
202 int64_t composing_base =
204 int64_t composing_extent =
207 self->vtable->set_editing_state(
text, selection_base, selection_extent,
208 composing_base, composing_extent,
216 self->vtable->clear_client(
self->user_data);
227 FlTextInputChannel*
self,
236 for (
size_t i = 0;
i < 16;
i++) {
272 g_autoptr(FlMethodResponse) response =
nullptr;
295 g_warning(
"Failed to send method call response: %s",
error->message);
300 FlTextInputChannel*
self = FL_TEXT_INPUT_CHANNEL(
object);
302 g_clear_object(&
self->channel);
304 G_OBJECT_CLASS(fl_text_input_channel_parent_class)->dispose(
object);
316 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
317 g_return_val_if_fail(vtable !=
nullptr,
nullptr);
319 FlTextInputChannel*
self = FL_TEXT_INPUT_CHANNEL(
320 g_object_new(fl_text_input_channel_get_type(),
nullptr));
322 self->vtable = vtable;
335 FlTextInputChannel*
self,
338 int64_t selection_base,
339 int64_t selection_extent,
341 gboolean selection_is_directional,
342 int64_t composing_base,
343 int64_t composing_extent,
344 GCancellable* cancellable,
347 g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(
self));
375 GAsyncResult* result,
378 FL_METHOD_CHANNEL(
object), result,
error);
379 if (response ==
nullptr) {
386 FlTextInputChannel*
self,
388 const gchar* old_text,
389 const gchar* delta_text,
392 int64_t selection_base,
393 int64_t selection_extent,
395 gboolean selection_is_directional,
396 int64_t composing_base,
397 int64_t composing_extent,
398 GCancellable* cancellable,
401 g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(
self));
419 deltaValue,
"selectionAffinity",
442 GAsyncResult* result,
445 FL_METHOD_CHANNEL(
object), result,
error);
446 if (response ==
nullptr) {
454 const gchar* input_action,
455 GCancellable* cancellable,
458 g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(
self));
469 GAsyncResult* result,
472 FL_METHOD_CHANNEL(
object), result,
error);
473 if (response ==
nullptr) {
g_autoptr(FlEngine) engine
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
G_MODULE_EXPORT const gchar * fl_method_call_get_name(FlMethodCall *self)
G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall *self, FlMethodResponse *response, GError **error)
G_MODULE_EXPORT FlValue * fl_method_call_get_args(FlMethodCall *self)
G_MODULE_EXPORT FlMethodResponse * fl_method_channel_invoke_method_finish(FlMethodChannel *self, GAsyncResult *result, GError **error)
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
G_MODULE_EXPORT void fl_method_channel_invoke_method(FlMethodChannel *self, const gchar *method, FlValue *args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
G_MODULE_EXPORT FlValue * fl_method_response_get_result(FlMethodResponse *self, GError **error)
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
const uint8_t uint32_t uint32_t GError ** error
static constexpr char kClearClientMethod[]
static constexpr char kSetEditableSizeAndTransform[]
void fl_text_input_channel_update_editing_state_with_deltas(FlTextInputChannel *self, int64_t client_id, const gchar *old_text, const gchar *delta_text, int64_t delta_start, int64_t delta_end, int64_t selection_base, int64_t selection_extent, FlTextAffinity selection_affinity, gboolean selection_is_directional, int64_t composing_base, int64_t composing_extent, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
static constexpr char kTextAffinityUpstream[]
static constexpr char kSetMarkedTextRect[]
static constexpr char kEnableDeltaModel[]
static constexpr char kNoneInputType[]
static constexpr char kAddressInputType[]
static constexpr char kTwitterInputType[]
static void fl_text_input_channel_dispose(GObject *object)
static void fl_text_input_parse_input_type_name(const gchar *input_type_name, FlTextInputType *input_type, GtkInputPurpose *im_purpose, GtkInputHints *im_hints)
static constexpr char kTransform[]
static constexpr char kSelectionIsDirectionalKey[]
FlTextInputChannel * fl_text_input_channel_new(FlBinaryMessenger *messenger, FlTextInputChannelVTable *vtable, gpointer user_data)
static constexpr char kHideMethod[]
static constexpr char kMultilineInputType[]
static FlMethodResponse * set_client(FlTextInputChannel *self, FlValue *args)
static FlMethodResponse * set_marked_text_rect(FlTextInputChannel *self, FlValue *args)
static constexpr char kPhoneInputType[]
static constexpr char kSetEditingStateMethod[]
static constexpr char kSelectionExtentKey[]
static constexpr char kEmailAddressInputType[]
static constexpr char kTextInputTypeNameKey[]
static constexpr char kUrlInputType[]
void fl_text_input_channel_update_editing_state(FlTextInputChannel *self, int64_t client_id, const gchar *text, int64_t selection_base, int64_t selection_extent, FlTextAffinity selection_affinity, gboolean selection_is_directional, int64_t composing_base, int64_t composing_extent, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
static constexpr char kTextInputType[]
gboolean fl_text_input_channel_update_editing_state_finish(GObject *object, GAsyncResult *result, GError **error)
static FlMethodResponse * set_editing_state(FlTextInputChannel *self, FlValue *args)
static FlMethodResponse * set_editable_size_and_transform(FlTextInputChannel *self, FlValue *args)
static constexpr char kChannelName[]
static constexpr char kPasswordInputType[]
void fl_text_input_channel_perform_action(FlTextInputChannel *self, int64_t client_id, const gchar *input_action, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
static constexpr char kSetClientMethod[]
static constexpr char kUpdateEditingStateMethod[]
static constexpr char kTextInputTypeKey[]
static constexpr char kBadArgumentsError[]
static constexpr char kPerformActionMethod[]
static constexpr char kShowMethod[]
static FlMethodResponse * clear_client(FlTextInputChannel *self)
static FlMethodResponse * show(FlTextInputChannel *self)
static constexpr char kComposingExtentKey[]
static constexpr char kTextAffinityDownstream[]
static constexpr char kWebSearchInputType[]
static constexpr char kDatetimeInputType[]
static constexpr char kInputActionKey[]
gboolean fl_text_input_channel_perform_action_finish(GObject *object, GAsyncResult *result, GError **error)
static constexpr char kComposingBaseKey[]
static constexpr char kUpdateEditingStateWithDeltasMethod[]
static const gchar * text_affinity_to_string(FlTextAffinity affinity)
static void fl_text_input_channel_class_init(FlTextInputChannelClass *klass)
static constexpr char kUpdateConfigMethod[]
static constexpr char kSelectionAffinityKey[]
gboolean fl_text_input_channel_update_editing_state_with_deltas_finish(GObject *object, GAsyncResult *result, GError **error)
static FlMethodResponse * hide(FlTextInputChannel *self)
static constexpr char kTextKey[]
static FlMethodResponse * update_config(FlTextInputChannel *self, FlValue *config_value)
static constexpr char kSelectionBaseKey[]
static void fl_text_input_channel_init(FlTextInputChannel *self)
static constexpr char kNameInputType[]
static constexpr char kNumberInputType[]
@ FL_TEXT_AFFINITY_DOWNSTREAM
@ FL_TEXT_AFFINITY_UPSTREAM
@ FL_TEXT_INPUT_TYPE_MULTILINE
@ FL_TEXT_INPUT_TYPE_TEXT
@ FL_TEXT_INPUT_TYPE_NONE
G_MODULE_EXPORT void fl_value_set_string(FlValue *self, const gchar *key, FlValue *value)
G_MODULE_EXPORT FlValue * fl_value_new_map()
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_new_list()
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
typedefG_BEGIN_DECLS struct _FlValue FlValue
FlutterDesktopBinaryReply callback
FlTextInputChannelVTable * vtable
FlMethodChannel * channel