 |
Flutter Linux Embedder
|
|
Go to the documentation of this file.
20 "TextInputClient.updateEditingState";
22 "TextInputClient.updateEditingStateWithDeltas";
25 "TextInput.setEditableSizeAndTransform";
58 G_DEFINE_TYPE(FlTextInputChannel, fl_text_input_channel, G_TYPE_OBJECT)
67 g_assert_not_reached();
81 const gchar* input_action =
nullptr;
88 FlValue* enable_delta_model_value =
97 FlValue* input_type_name_value =
109 self->vtable->set_client(client_id, input_action, enable_delta_model,
110 input_type, self->user_data);
116 static FlMethodResponse*
hide(FlTextInputChannel*
self) {
117 self->vtable->hide(self->user_data);
122 static FlMethodResponse*
show(FlTextInputChannel*
self) {
123 self->vtable->show(self->user_data);
132 int64_t selection_base =
134 int64_t selection_extent =
136 int64_t composing_base =
138 int64_t composing_extent =
141 self->vtable->set_editing_state(text, selection_base, selection_extent,
142 composing_base, composing_extent,
150 self->vtable->clear_client(self->user_data);
161 FlTextInputChannel*
self,
169 double transform[16];
170 for (
size_t i = 0;
i < 16;
i++) {
174 self->vtable->set_editable_size_and_transform(transform, self->user_data);
192 self->vtable->set_marked_text_rect(x, y,
width,
height, self->user_data);
201 FlTextInputChannel*
self = FL_TEXT_INPUT_CHANNEL(
user_data);
206 g_autoptr(FlMethodResponse) response =
nullptr;
210 response =
show(
self);
216 response =
hide(
self);
225 g_autoptr(GError)
error =
nullptr;
227 g_warning(
"Failed to send method call response: %s",
error->message);
232 FlTextInputChannel*
self = FL_TEXT_INPUT_CHANNEL(
object);
234 g_clear_object(&self->channel);
236 G_OBJECT_CLASS(fl_text_input_channel_parent_class)->dispose(
object);
248 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
249 g_return_val_if_fail(vtable !=
nullptr,
nullptr);
251 FlTextInputChannel*
self = FL_TEXT_INPUT_CHANNEL(
252 g_object_new(fl_text_input_channel_get_type(),
nullptr));
254 self->vtable = vtable;
267 FlTextInputChannel*
self,
270 int64_t selection_base,
271 int64_t selection_extent,
273 gboolean selection_is_directional,
274 int64_t composing_base,
275 int64_t composing_extent,
276 GCancellable* cancellable,
277 GAsyncReadyCallback callback,
279 g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(
self));
307 GAsyncResult* result,
310 FL_METHOD_CHANNEL(
object), result,
error);
311 if (response ==
nullptr) {
318 FlTextInputChannel*
self,
320 const gchar* old_text,
321 const gchar* delta_text,
324 int64_t selection_base,
325 int64_t selection_extent,
327 gboolean selection_is_directional,
328 int64_t composing_base,
329 int64_t composing_extent,
330 GCancellable* cancellable,
331 GAsyncReadyCallback callback,
333 g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(
self));
351 deltaValue,
"selectionAffinity",
374 GAsyncResult* result,
377 FL_METHOD_CHANNEL(
object), result,
error);
378 if (response ==
nullptr) {
386 const gchar* input_action,
387 GCancellable* cancellable,
388 GAsyncReadyCallback callback,
390 g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(
self));
401 GAsyncResult* result,
404 FL_METHOD_CHANNEL(
object), result,
error);
405 if (response ==
nullptr) {
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
static constexpr char kNoneInputType[]
static constexpr char kTextAffinityDownstream[]
static constexpr char kPerformActionMethod[]
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)
static FlMethodResponse * clear_client(FlTextInputChannel *self)
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
static void fl_text_input_channel_class_init(FlTextInputChannelClass *klass)
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
FlTextInputChannel * fl_text_input_channel_new(FlBinaryMessenger *messenger, FlTextInputChannelVTable *vtable, gpointer user_data)
G_MODULE_EXPORT FlValue * fl_value_new_list()
static constexpr char kSetMarkedTextRect[]
static FlMethodResponse * set_marked_text_rect(FlTextInputChannel *self, FlValue *args)
G_MODULE_EXPORT FlMethodResponse * fl_method_channel_invoke_method_finish(FlMethodChannel *self, GAsyncResult *result, GError **error)
static constexpr char kTextInputTypeNameKey[]
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
typedefG_BEGIN_DECLS struct _FlValue FlValue
static constexpr char kChannelName[]
static constexpr char kBadArgumentsError[]
static FlMethodResponse * set_editable_size_and_transform(FlTextInputChannel *self, FlValue *args)
@ FL_TEXT_AFFINITY_DOWNSTREAM
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)
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
static void fl_text_input_channel_dispose(GObject *object)
G_MODULE_EXPORT FlValue * fl_method_response_get_result(FlMethodResponse *self, GError **error)
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
static constexpr char kSelectionIsDirectionalKey[]
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
const G_MODULE_EXPORT gchar * fl_value_get_string(FlValue *self)
static constexpr char kTextInputTypeKey[]
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
@ FL_TEXT_INPUT_TYPE_TEXT
static FlMethodResponse * set_client(FlTextInputChannel *self, FlValue *args)
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
FlMethodChannel * channel
G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall *self, FlMethodResponse *response, GError **error)
G_MODULE_EXPORT FlValue * fl_value_new_map()
static constexpr char kSelectionBaseKey[]
static constexpr char kSelectionExtentKey[]
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
static constexpr char kSetEditableSizeAndTransform[]
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
static constexpr char kInputActionKey[]
static constexpr char kMultilineInputType[]
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
static constexpr char kEnableDeltaModel[]
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 kSetEditingStateMethod[]
const G_MODULE_EXPORT gchar * fl_method_call_get_name(FlMethodCall *self)
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object)
@ FL_TEXT_INPUT_TYPE_MULTILINE
gboolean fl_text_input_channel_perform_action_finish(GObject *object, GAsyncResult *result, GError **error)
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
static constexpr char kClearClientMethod[]
static FlMethodResponse * set_editing_state(FlTextInputChannel *self, FlValue *args)
G_MODULE_EXPORT void fl_method_channel_invoke_method(FlMethodChannel *self, const gchar *method, FlValue *args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
gboolean fl_text_input_channel_update_editing_state_finish(GObject *object, GAsyncResult *result, GError **error)
FlTextInputChannelVTable * vtable
G_MODULE_EXPORT void fl_value_set_string(FlValue *self, const gchar *key, FlValue *value)
static constexpr char kSelectionAffinityKey[]
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
static void fl_text_input_channel_init(FlTextInputChannel *self)
const uint8_t uint32_t uint32_t * height
static constexpr char kTransform[]
static constexpr char kTextKey[]
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
@ FL_TEXT_INPUT_TYPE_NONE
static constexpr char kShowMethod[]
@ FL_TEXT_AFFINITY_UPSTREAM
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
static FlMethodResponse * hide(FlTextInputChannel *self)
static constexpr char kUpdateEditingStateMethod[]
static const gchar * text_affinity_to_string(FlTextAffinity affinity)
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
static constexpr char kComposingBaseKey[]
static FlMethodResponse * show(FlTextInputChannel *self)
static constexpr char kTextAffinityUpstream[]
static constexpr char kSetClientMethod[]
G_MODULE_EXPORT FlValue * fl_method_call_get_args(FlMethodCall *self)
const uint8_t uint32_t * width
static constexpr char kUpdateEditingStateWithDeltasMethod[]
gboolean fl_text_input_channel_update_editing_state_with_deltas_finish(GObject *object, GAsyncResult *result, GError **error)
static constexpr char kComposingExtentKey[]
static constexpr char kHideMethod[]
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
void fl_text_input_channel_perform_action(FlTextInputChannel *self, int64_t client_id, const gchar *input_action, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)