Flutter Linux Embedder
fl_text_input_channel.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
9 
10 static constexpr char kChannelName[] = "flutter/textinput";
11 
12 static constexpr char kBadArgumentsError[] = "Bad Arguments";
13 
14 static constexpr char kSetClientMethod[] = "TextInput.setClient";
15 static constexpr char kUpdateConfigMethod[] = "TextInput.updateConfig";
16 static constexpr char kShowMethod[] = "TextInput.show";
17 static constexpr char kSetEditingStateMethod[] = "TextInput.setEditingState";
18 static constexpr char kClearClientMethod[] = "TextInput.clearClient";
19 static constexpr char kHideMethod[] = "TextInput.hide";
20 static constexpr char kUpdateEditingStateMethod[] =
21  "TextInputClient.updateEditingState";
22 static constexpr char kUpdateEditingStateWithDeltasMethod[] =
23  "TextInputClient.updateEditingStateWithDeltas";
24 static constexpr char kPerformActionMethod[] = "TextInputClient.performAction";
25 static constexpr char kSetEditableSizeAndTransform[] =
26  "TextInput.setEditableSizeAndTransform";
27 static constexpr char kSetMarkedTextRect[] = "TextInput.setMarkedTextRect";
28 
29 static constexpr char kInputActionKey[] = "inputAction";
30 static constexpr char kTextInputTypeKey[] = "inputType";
31 static constexpr char kEnableDeltaModel[] = "enableDeltaModel";
32 static constexpr char kTextInputTypeNameKey[] = "name";
33 static constexpr char kTextKey[] = "text";
34 static constexpr char kSelectionBaseKey[] = "selectionBase";
35 static constexpr char kSelectionExtentKey[] = "selectionExtent";
36 static constexpr char kSelectionAffinityKey[] = "selectionAffinity";
37 static constexpr char kSelectionIsDirectionalKey[] = "selectionIsDirectional";
38 static constexpr char kComposingBaseKey[] = "composingBase";
39 static constexpr char kComposingExtentKey[] = "composingExtent";
40 
41 static constexpr char kTransform[] = "transform";
42 
43 static constexpr char kTextInputType[] = "TextInputType.text";
44 static constexpr char kMultilineInputType[] = "TextInputType.multiline";
45 static constexpr char kNumberInputType[] = "TextInputType.number";
46 static constexpr char kPhoneInputType[] = "TextInputType.phone";
47 static constexpr char kDatetimeInputType[] = "TextInputType.datetime";
48 static constexpr char kEmailAddressInputType[] = "TextInputType.emailAddress";
49 static constexpr char kUrlInputType[] = "TextInputType.url";
50 static constexpr char kPasswordInputType[] = "TextInputType.visiblePassword";
51 static constexpr char kNameInputType[] = "TextInputType.name";
52 static constexpr char kAddressInputType[] = "TextInputType.address";
53 static constexpr char kNoneInputType[] = "TextInputType.none";
54 static constexpr char kWebSearchInputType[] = "TextInputType.webSearch";
55 static constexpr char kTwitterInputType[] = "TextInputType.twitter";
56 
57 static constexpr char kTextAffinityUpstream[] = "TextAffinity.upstream";
58 static constexpr char kTextAffinityDownstream[] = "TextAffinity.downstream";
59 
61  GObject parent_instance;
62 
63  FlMethodChannel* channel;
64 
66 
67  gpointer user_data;
68 };
69 
70 static FlMethodResponse* update_config(FlTextInputChannel* self,
71  FlValue* config_value);
72 
73 G_DEFINE_TYPE(FlTextInputChannel, fl_text_input_channel, G_TYPE_OBJECT)
74 
75 static const gchar* text_affinity_to_string(FlTextAffinity affinity) {
76  switch (affinity) {
78  return kTextAffinityUpstream;
81  default:
82  g_assert_not_reached();
83  }
84 }
85 
86 static void fl_text_input_parse_input_type_name(const gchar* input_type_name,
87  FlTextInputType* input_type,
88  GtkInputPurpose* im_purpose,
89  GtkInputHints* im_hints) {
90  if (input_type_name == nullptr) {
91  input_type_name = kTextInputType;
92  }
93 
94  if (g_strcmp0(input_type_name, kTextInputType) == 0) {
95  // default
96  } else if (g_strcmp0(input_type_name, kMultilineInputType) == 0) {
97  *im_hints = static_cast<GtkInputHints>(GTK_INPUT_HINT_SPELLCHECK |
98  GTK_INPUT_HINT_UPPERCASE_SENTENCES);
99  *input_type = FL_TEXT_INPUT_TYPE_MULTILINE;
100  } else if (g_strcmp0(input_type_name, kNumberInputType) == 0) {
101  *im_purpose = GTK_INPUT_PURPOSE_NUMBER;
102  } else if (g_strcmp0(input_type_name, kPhoneInputType) == 0) {
103  *im_purpose = GTK_INPUT_PURPOSE_PHONE;
104  } else if (g_strcmp0(input_type_name, kDatetimeInputType) == 0) {
105  // Not in GTK 3
106  } else if (g_strcmp0(input_type_name, kEmailAddressInputType) == 0) {
107  *im_purpose = GTK_INPUT_PURPOSE_EMAIL;
108  } else if (g_strcmp0(input_type_name, kUrlInputType) == 0) {
109  *im_purpose = GTK_INPUT_PURPOSE_URL;
110  } else if (g_strcmp0(input_type_name, kPasswordInputType) == 0) {
111  *im_purpose = GTK_INPUT_PURPOSE_PASSWORD;
112  } else if (g_strcmp0(input_type_name, kNameInputType) == 0) {
113  *im_purpose = GTK_INPUT_PURPOSE_NAME;
114  *im_hints = GTK_INPUT_HINT_UPPERCASE_WORDS;
115  } else if (g_strcmp0(input_type_name, kAddressInputType) == 0) {
116  *im_hints = GTK_INPUT_HINT_UPPERCASE_WORDS;
117  } else if (g_strcmp0(input_type_name, kNoneInputType) == 0) {
118  // keep defaults
119  *input_type = FL_TEXT_INPUT_TYPE_NONE;
120  } else if (g_strcmp0(input_type_name, kWebSearchInputType) == 0) {
121  *im_hints = GTK_INPUT_HINT_LOWERCASE;
122  } else if (g_strcmp0(input_type_name, kTwitterInputType) == 0) {
123  *im_hints = static_cast<GtkInputHints>(GTK_INPUT_HINT_SPELLCHECK |
124  GTK_INPUT_HINT_UPPERCASE_SENTENCES);
125  } else {
126  g_warning("Unhandled input type name: %s", input_type_name);
127  }
128 }
129 
130 // Called when the input method client is set up.
131 static FlMethodResponse* set_client(FlTextInputChannel* self, FlValue* args) {
133  fl_value_get_length(args) < 2) {
134  return FL_METHOD_RESPONSE(fl_method_error_response_new(
135  kBadArgumentsError, "Expected 2-element list", nullptr));
136  }
137 
138  int64_t client_id = fl_value_get_int(fl_value_get_list_value(args, 0));
139  FlValue* config_value = fl_value_get_list_value(args, 1);
140 
141  self->vtable->set_client(client_id, self->user_data);
142 
143  return update_config(self, config_value);
144 }
145 
146 static FlMethodResponse* update_config(FlTextInputChannel* self,
147  FlValue* config_value) {
148  const gchar* input_action = nullptr;
149  FlValue* input_action_value =
151  if (fl_value_get_type(input_action_value) == FL_VALUE_TYPE_STRING) {
152  input_action = fl_value_get_string(input_action_value);
153  }
154 
155  FlValue* enable_delta_model_value =
157  gboolean enable_delta_model = fl_value_get_bool(enable_delta_model_value);
158 
159  // Reset the input type, then set only if appropriate.
161  GtkInputPurpose im_purpose = GTK_INPUT_PURPOSE_FREE_FORM;
162  GtkInputHints im_hints = GTK_INPUT_HINT_NONE;
163  FlValue* input_type_value =
165  if (fl_value_get_type(input_type_value) == FL_VALUE_TYPE_MAP) {
166  FlValue* input_type_name_value =
168  if (fl_value_get_type(input_type_name_value) == FL_VALUE_TYPE_STRING) {
169  const gchar* input_type_name = fl_value_get_string(input_type_name_value);
170  fl_text_input_parse_input_type_name(input_type_name, &input_type,
171  &im_purpose, &im_hints);
172  }
173  }
174 
175  self->vtable->configure(input_action, enable_delta_model, input_type,
176  im_purpose, im_hints, self->user_data);
177 
178  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
179 }
180 
181 // Hides the input method.
182 static FlMethodResponse* hide(FlTextInputChannel* self) {
183  self->vtable->hide(self->user_data);
184  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
185 }
186 
187 // Shows the input method.
188 static FlMethodResponse* show(FlTextInputChannel* self) {
189  self->vtable->show(self->user_data);
190  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
191 }
192 
193 // Updates the editing state from Flutter.
194 static FlMethodResponse* set_editing_state(FlTextInputChannel* self,
195  FlValue* args) {
196  const gchar* text =
198  int64_t selection_base =
200  int64_t selection_extent =
202  int64_t composing_base =
204  int64_t composing_extent =
206 
207  self->vtable->set_editing_state(text, selection_base, selection_extent,
208  composing_base, composing_extent,
209  self->user_data);
210 
211  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
212 }
213 
214 // Called when the input method client is complete.
215 static FlMethodResponse* clear_client(FlTextInputChannel* self) {
216  self->vtable->clear_client(self->user_data);
217  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
218 }
219 
220 // Handles updates to the EditableText size and position from the framework.
221 //
222 // On changes to the size or position of the RenderObject underlying the
223 // EditableText, this update may be triggered. It provides an updated size and
224 // transform from the local coordinate system of the EditableText to root
225 // Flutter coordinate system.
226 static FlMethodResponse* set_editable_size_and_transform(
227  FlTextInputChannel* self,
228  FlValue* args) {
229  FlValue* transform_value = fl_value_lookup_string(args, kTransform);
230  if (fl_value_get_length(transform_value) != 16) {
231  return FL_METHOD_RESPONSE(fl_method_error_response_new(
232  kBadArgumentsError, "Invalid transform", nullptr));
233  }
234 
235  double transform[16];
236  for (size_t i = 0; i < 16; i++) {
237  transform[i] =
238  fl_value_get_float(fl_value_get_list_value(transform_value, i));
239  }
240  self->vtable->set_editable_size_and_transform(transform, self->user_data);
241 
242  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
243 }
244 
245 // Handles updates to the composing rect from the framework.
246 //
247 // On changes to the state of the EditableText in the framework, this update
248 // may be triggered. It provides an updated rect for the composing region in
249 // local coordinates of the EditableText. In the case where there is no
250 // composing region, the cursor rect is sent.
251 static FlMethodResponse* set_marked_text_rect(FlTextInputChannel* self,
252  FlValue* args) {
257 
258  self->vtable->set_marked_text_rect(x, y, width, height, self->user_data);
259 
260  return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
261 }
262 
263 // Called when a method call is received from Flutter.
264 static void method_call_cb(FlMethodChannel* channel,
265  FlMethodCall* method_call,
266  gpointer user_data) {
267  FlTextInputChannel* self = FL_TEXT_INPUT_CHANNEL(user_data);
268 
269  const gchar* method = fl_method_call_get_name(method_call);
271 
272  g_autoptr(FlMethodResponse) response = nullptr;
273  if (strcmp(method, kSetClientMethod) == 0) {
274  response = set_client(self, args);
275  } else if (strcmp(method, kShowMethod) == 0) {
276  response = show(self);
277  } else if (strcmp(method, kSetEditingStateMethod) == 0) {
278  response = set_editing_state(self, args);
279  } else if (strcmp(method, kClearClientMethod) == 0) {
280  response = clear_client(self);
281  } else if (strcmp(method, kHideMethod) == 0) {
282  response = hide(self);
283  } else if (strcmp(method, kSetEditableSizeAndTransform) == 0) {
284  response = set_editable_size_and_transform(self, args);
285  } else if (strcmp(method, kSetMarkedTextRect) == 0) {
286  response = set_marked_text_rect(self, args);
287  } else if (strcmp(method, kUpdateConfigMethod) == 0) {
288  response = update_config(self, args);
289  } else {
290  response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new());
291  }
292 
293  g_autoptr(GError) error = nullptr;
294  if (!fl_method_call_respond(method_call, response, &error)) {
295  g_warning("Failed to send method call response: %s", error->message);
296  }
297 }
298 
299 static void fl_text_input_channel_dispose(GObject* object) {
300  FlTextInputChannel* self = FL_TEXT_INPUT_CHANNEL(object);
301 
302  g_clear_object(&self->channel);
303 
304  G_OBJECT_CLASS(fl_text_input_channel_parent_class)->dispose(object);
305 }
306 
307 static void fl_text_input_channel_class_init(FlTextInputChannelClass* klass) {
308  G_OBJECT_CLASS(klass)->dispose = fl_text_input_channel_dispose;
309 }
310 
311 static void fl_text_input_channel_init(FlTextInputChannel* self) {}
312 
313 FlTextInputChannel* fl_text_input_channel_new(FlBinaryMessenger* messenger,
314  FlTextInputChannelVTable* vtable,
315  gpointer user_data) {
316  g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger), nullptr);
317  g_return_val_if_fail(vtable != nullptr, nullptr);
318 
319  FlTextInputChannel* self = FL_TEXT_INPUT_CHANNEL(
320  g_object_new(fl_text_input_channel_get_type(), nullptr));
321 
322  self->vtable = vtable;
323  self->user_data = user_data;
324 
325  g_autoptr(FlJsonMethodCodec) codec = fl_json_method_codec_new();
326  self->channel =
327  fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
329  nullptr);
330 
331  return self;
332 }
333 
335  FlTextInputChannel* self,
336  int64_t client_id,
337  const gchar* text,
338  int64_t selection_base,
339  int64_t selection_extent,
340  FlTextAffinity selection_affinity,
341  gboolean selection_is_directional,
342  int64_t composing_base,
343  int64_t composing_extent,
344  GCancellable* cancellable,
345  GAsyncReadyCallback callback,
346  gpointer user_data) {
347  g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(self));
348 
352 
355  fl_value_new_int(selection_base));
357  fl_value_new_int(selection_extent));
360  fl_value_new_string(text_affinity_to_string(selection_affinity)));
362  fl_value_new_bool(selection_is_directional));
364  fl_value_new_int(composing_base));
366  fl_value_new_int(composing_extent));
367 
369 
371  args, cancellable, callback, user_data);
372 }
373 
375  GAsyncResult* result,
376  GError** error) {
377  g_autoptr(FlMethodResponse) response = fl_method_channel_invoke_method_finish(
378  FL_METHOD_CHANNEL(object), result, error);
379  if (response == nullptr) {
380  return FALSE;
381  }
382  return fl_method_response_get_result(response, error) != nullptr;
383 }
384 
386  FlTextInputChannel* self,
387  int64_t client_id,
388  const gchar* old_text,
389  const gchar* delta_text,
390  int64_t delta_start,
391  int64_t delta_end,
392  int64_t selection_base,
393  int64_t selection_extent,
394  FlTextAffinity selection_affinity,
395  gboolean selection_is_directional,
396  int64_t composing_base,
397  int64_t composing_extent,
398  GCancellable* cancellable,
399  GAsyncReadyCallback callback,
400  gpointer user_data) {
401  g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(self));
402 
405 
406  g_autoptr(FlValue) deltaValue = fl_value_new_map();
407  fl_value_set_string_take(deltaValue, "oldText",
408  fl_value_new_string(old_text));
409  fl_value_set_string_take(deltaValue, "deltaText",
410  fl_value_new_string(delta_text));
411  fl_value_set_string_take(deltaValue, "deltaStart",
412  fl_value_new_int(delta_start));
413  fl_value_set_string_take(deltaValue, "deltaEnd", fl_value_new_int(delta_end));
414  fl_value_set_string_take(deltaValue, "selectionBase",
415  fl_value_new_int(selection_base));
416  fl_value_set_string_take(deltaValue, "selectionExtent",
417  fl_value_new_int(selection_extent));
419  deltaValue, "selectionAffinity",
420  fl_value_new_string(text_affinity_to_string(selection_affinity)));
421  fl_value_set_string_take(deltaValue, "selectionIsDirectional",
422  fl_value_new_bool(selection_is_directional));
423  fl_value_set_string_take(deltaValue, "composingBase",
424  fl_value_new_int(composing_base));
425  fl_value_set_string_take(deltaValue, "composingExtent",
426  fl_value_new_int(composing_extent));
427 
428  g_autoptr(FlValue) deltas = fl_value_new_list();
429  fl_value_append(deltas, deltaValue);
431  fl_value_set_string(value, "deltas", deltas);
432 
434 
435  fl_method_channel_invoke_method(self->channel,
437  cancellable, callback, user_data);
438 }
439 
441  GObject* object,
442  GAsyncResult* result,
443  GError** error) {
444  g_autoptr(FlMethodResponse) response = fl_method_channel_invoke_method_finish(
445  FL_METHOD_CHANNEL(object), result, error);
446  if (response == nullptr) {
447  return FALSE;
448  }
449  return fl_method_response_get_result(response, error) != nullptr;
450 }
451 
452 void fl_text_input_channel_perform_action(FlTextInputChannel* self,
453  int64_t client_id,
454  const gchar* input_action,
455  GCancellable* cancellable,
456  GAsyncReadyCallback callback,
457  gpointer user_data) {
458  g_return_if_fail(FL_IS_TEXT_INPUT_CHANNEL(self));
459 
463 
465  cancellable, callback, user_data);
466 }
467 
469  GAsyncResult* result,
470  GError** error) {
471  g_autoptr(FlMethodResponse) response = fl_method_channel_invoke_method_finish(
472  FL_METHOD_CHANNEL(object), result, error);
473  if (response == nullptr) {
474  return FALSE;
475  }
476  return fl_method_response_get_result(response, error) != nullptr;
477 }
g_autoptr(FlEngine) engine
const char FlTextDirection FlAssertiveness gpointer user_data
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object)
self height
self width
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall *self, FlMethodResponse *response, GError **error)
G_MODULE_EXPORT const gchar * fl_method_call_get_name(FlMethodCall *self)
G_MODULE_EXPORT FlValue * fl_method_call_get_args(FlMethodCall *self)
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 FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
G_MODULE_EXPORT FlMethodResponse * fl_method_channel_invoke_method_finish(FlMethodChannel *self, GAsyncResult *result, GError **error)
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 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 FlValue * fl_method_response_get_result(FlMethodResponse *self, GError **error)
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
const uint8_t uint32_t uint32_t GError ** error
uint8_t value
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 FlMethodResponse * set_editing_state(FlTextInputChannel *self, FlValue *args)
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[]
static constexpr char kHideMethod[]
static constexpr char kMultilineInputType[]
static FlMethodResponse * set_editable_size_and_transform(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[]
FlTextInputChannel * fl_text_input_channel_new(FlBinaryMessenger *messenger, FlTextInputChannelVTable *vtable, gpointer user_data)
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 * hide(FlTextInputChannel *self)
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 const gchar * text_affinity_to_string(FlTextAffinity affinity)
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 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 FlMethodResponse * set_client(FlTextInputChannel *self, FlValue *args)
static FlMethodResponse * show(FlTextInputChannel *self)
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 constexpr char kTextKey[]
static FlMethodResponse * update_config(FlTextInputChannel *self, FlValue *config_value)
static constexpr char kSelectionBaseKey[]
static FlMethodResponse * set_marked_text_rect(FlTextInputChannel *self, FlValue *args)
static void fl_text_input_channel_init(FlTextInputChannel *self)
static FlMethodResponse * clear_client(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)
Definition: fl_value.cc:639
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:811
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:650
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:776
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:668
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:276
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:466
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:255
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
Definition: fl_value.cc:592
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:349
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:600
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
Definition: fl_value.cc:661
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:682
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:262
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:366
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:675
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:724
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42
@ FL_VALUE_TYPE_STRING
Definition: fl_value.h:68
@ FL_VALUE_TYPE_LIST
Definition: fl_value.h:73
@ FL_VALUE_TYPE_MAP
Definition: fl_value.h:74
FlTextInputChannelVTable * vtable
FlMethodChannel * channel