Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
fl_accessible_node.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
7
8// Maps Flutter semantics actions to ATK actions.
9typedef struct {
11 const gchar* name;
24 "MoveCursorForwardByCharacter"},
26 "MoveCursorBackwardByCharacter"},
31 "DidGainAccessibilityFocus"},
33 "DidLoseAccessibilityFocus"},
36 {kFlutterSemanticsActionMoveCursorForwardByWord, "MoveCursorForwardByWord"},
38 "MoveCursorBackwardByWord"},
42 {static_cast<FlutterSemanticsAction>(0), nullptr}};
43
45 AtkObject parent_instance;
46
47 // Weak reference to the engine this node is created for.
48 GWeakRef engine;
49
50 /// The unique identifier of the view to which this node belongs.
52
53 // Weak reference to the parent node of this one or %NULL.
54 GWeakRef parent;
55
56 int32_t node_id;
57 gchar* name;
58 gint index;
59 gint x, y, width, height;
60 GPtrArray* actions;
62 GPtrArray* children;
64};
65
67
68#define FL_ACCESSIBLE_NODE_GET_PRIVATE(node) \
69 ((FlAccessibleNodePrivate*)fl_accessible_node_get_instance_private( \
70 FL_ACCESSIBLE_NODE(node)))
71
73 AtkComponentIface* iface);
74static void fl_accessible_node_action_interface_init(AtkActionIface* iface);
75
77 FlAccessibleNode,
78 fl_accessible_node,
79 ATK_TYPE_OBJECT,
80 G_ADD_PRIVATE(FlAccessibleNode)
81 G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT,
83 G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
85
86// Returns TRUE if [flags] indicate this element is checkable.
87static gboolean is_checkable(FlutterSemanticsFlags flags) {
88 return flags.is_checked != kFlutterCheckStateNone ||
90}
91
92// Returns TRUE if [flags] indicate this element is checked.
93static gboolean is_checked(FlutterSemanticsFlags flags) {
94 return flags.is_checked == kFlutterCheckStateTrue ||
96}
97
98// Returns TRUE if [flags] indicate this element is focusable.
99static gboolean is_focusable(FlutterSemanticsFlags flags) {
100 return flags.is_focused != kFlutterTristateNone;
101}
102
103// Returns TRUE if [flags] indicate this element is focused.
104static gboolean is_focused(FlutterSemanticsFlags flags) {
105 return flags.is_focused == kFlutterTristateTrue;
106}
107
108// Returns TRUE if [flags] indicate this element is selected.
109static gboolean is_selected(FlutterSemanticsFlags flags) {
110 return flags.is_selected == kFlutterTristateTrue;
111}
112
113// Returns TRUE if [flags] indicate this element is sensitive.
114static gboolean is_sensitive(FlutterSemanticsFlags flags) {
115 return flags.is_enabled != kFlutterTristateNone;
116}
117
118// Returns TRUE if [flags] indicate this element is enabled.
119static gboolean is_enabled(FlutterSemanticsFlags flags) {
120 return flags.is_enabled == kFlutterTristateTrue;
121}
122
123// Returns TRUE if [action] is set in [actions].
124static gboolean has_action(FlutterSemanticsAction actions,
126 return (actions & action) != 0;
127}
128
129// Gets the nth action.
131 if (index < 0 || static_cast<guint>(index) >= priv->actions->len) {
132 return nullptr;
133 }
134 return static_cast<ActionData*>(g_ptr_array_index(priv->actions, index));
135}
136
137// Checks if [object] is in [children].
138static gboolean has_child(GPtrArray* children, AtkObject* object) {
139 for (guint i = 0; i < children->len; i++) {
140 if (g_ptr_array_index(children, i) == object) {
141 return TRUE;
142 }
143 }
144
145 return FALSE;
146}
147
148static void fl_accessible_node_set_property(GObject* object,
149 guint prop_id,
150 const GValue* value,
151 GParamSpec* pspec) {
153 switch (prop_id) {
154 case PROP_ENGINE:
155 g_weak_ref_set(&priv->engine, g_value_get_object(value));
156 break;
157 case PROP_VIEW_ID:
158 priv->view_id = g_value_get_int64(value);
159 break;
160 case PROP_ID:
161 priv->node_id = g_value_get_int(value);
162 break;
163 default:
164 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
165 break;
166 }
167}
168
169static void fl_accessible_node_dispose(GObject* object) {
171
172 g_weak_ref_clear(&priv->engine);
173 g_weak_ref_clear(&priv->parent);
174 g_clear_pointer(&priv->name, g_free);
175 g_clear_pointer(&priv->actions, g_ptr_array_unref);
176 g_clear_pointer(&priv->children, g_ptr_array_unref);
177
178 G_OBJECT_CLASS(fl_accessible_node_parent_class)->dispose(object);
179}
180
181// Implements AtkObject::get_name.
186
187// Implements AtkObject::get_parent.
188static AtkObject* fl_accessible_node_get_parent(AtkObject* accessible) {
190 g_autoptr(AtkObject) parent = ATK_OBJECT(g_weak_ref_get(&priv->parent));
191 return parent;
192}
193
194// Implements AtkObject::get_index_in_parent.
199
200// Implements AtkObject::get_n_children.
205
206// Implements AtkObject::ref_child.
207static AtkObject* fl_accessible_node_ref_child(AtkObject* accessible, gint i) {
209
210 if (i < 0 || static_cast<guint>(i) >= priv->children->len) {
211 return nullptr;
212 }
213
214 return ATK_OBJECT(g_object_ref(g_ptr_array_index(priv->children, i)));
215}
216
217// Implements AtkObject::get_role.
218static AtkRole fl_accessible_node_get_role(AtkObject* accessible) {
220 if (priv->flags.is_button) {
221 return ATK_ROLE_PUSH_BUTTON;
222 }
223 if (priv->flags.is_in_mutually_exclusive_group &&
224 priv->flags.is_checked != kFlutterCheckStateNone) {
225 return ATK_ROLE_RADIO_BUTTON;
226 }
227 if (priv->flags.is_checked != kFlutterCheckStateNone) {
228 return ATK_ROLE_CHECK_BOX;
229 }
230 if (priv->flags.is_toggled != kFlutterTristateNone) {
231 return ATK_ROLE_TOGGLE_BUTTON;
232 }
233 if (priv->flags.is_slider) {
234 return ATK_ROLE_SLIDER;
235 }
236 if (priv->flags.is_text_field && priv->flags.is_obscured) {
237 return ATK_ROLE_PASSWORD_TEXT;
238 }
239 if (priv->flags.is_text_field) {
240 return ATK_ROLE_TEXT;
241 }
242 if (priv->flags.is_header) {
243 return ATK_ROLE_HEADER;
244 }
245 if (priv->flags.is_link) {
246 return ATK_ROLE_LINK;
247 }
248 if (priv->flags.is_image) {
249 return ATK_ROLE_IMAGE;
250 }
251
252 return ATK_ROLE_PANEL;
253}
254
255// Implements AtkObject::ref_state_set.
256static AtkStateSet* fl_accessible_node_ref_state_set(AtkObject* accessible) {
258
259 AtkStateSet* state_set = atk_state_set_new();
260
261 if (!priv->flags.is_obscured) {
262 atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
263 }
264 if (!priv->flags.is_hidden) {
265 atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
266 }
267 if (is_checkable(priv->flags)) {
268 atk_state_set_add_state(state_set, ATK_STATE_CHECKABLE);
269 }
270 if (is_checked(priv->flags)) {
271 atk_state_set_add_state(state_set, ATK_STATE_CHECKED);
272 }
273 if (is_focusable(priv->flags)) {
274 atk_state_set_add_state(state_set, ATK_STATE_FOCUSABLE);
275 }
276 if (is_focused(priv->flags)) {
277 atk_state_set_add_state(state_set, ATK_STATE_FOCUSED);
278 }
279 if (is_selected(priv->flags)) {
280 atk_state_set_add_state(state_set, ATK_STATE_SELECTED);
281 }
282 if (is_enabled(priv->flags)) {
283 atk_state_set_add_state(state_set, ATK_STATE_ENABLED);
284 }
285 if (is_sensitive(priv->flags)) {
286 atk_state_set_add_state(state_set, ATK_STATE_SENSITIVE);
287 }
288 if (priv->flags.is_read_only) {
289 atk_state_set_add_state(state_set, ATK_STATE_READ_ONLY);
290 }
291 if (priv->flags.is_text_field) {
292 atk_state_set_add_state(state_set, ATK_STATE_EDITABLE);
293 }
294
295 return state_set;
296}
297
298// Implements AtkComponent::get_extents.
299static void fl_accessible_node_get_extents(AtkComponent* component,
300 gint* x,
301 gint* y,
302 gint* width,
303 gint* height,
304 AtkCoordType coord_type) {
306
307 *x = 0;
308 *y = 0;
309 g_autoptr(AtkObject) parent = ATK_OBJECT(g_weak_ref_get(&priv->parent));
310 if (parent != nullptr) {
311 atk_component_get_extents(ATK_COMPONENT(parent), x, y, nullptr, nullptr,
312 coord_type);
313 }
314
315 *x += priv->x;
316 *y += priv->y;
317 *width = priv->width;
318 *height = priv->height;
319}
320
321// Implements AtkComponent::get_layer.
322static AtkLayer fl_accessible_node_get_layer(AtkComponent* component) {
323 return ATK_LAYER_WIDGET;
324}
325
326// Implements AtkAction::do_action.
327static gboolean fl_accessible_node_do_action(AtkAction* action, gint i) {
329
330 g_autoptr(FlEngine) engine = FL_ENGINE(g_weak_ref_get(&priv->engine));
331 if (engine == nullptr) {
332 return FALSE;
333 }
334
335 ActionData* data = get_action(priv, i);
336 if (data == nullptr) {
337 return FALSE;
338 }
339
340 fl_accessible_node_perform_action(FL_ACCESSIBLE_NODE(action), data->action,
341 nullptr);
342 return TRUE;
343}
344
345// Implements AtkAction::get_n_actions.
348 return priv->actions->len;
349}
350
351// Implements AtkAction::get_name.
352static const gchar* fl_accessible_node_get_name(AtkAction* action, gint i) {
354
355 ActionData* data = get_action(priv, i);
356 if (data == nullptr) {
357 return nullptr;
358 }
359
360 return data->name;
361}
362
363// Implements FlAccessibleNode::set_name.
364static void fl_accessible_node_set_name_impl(FlAccessibleNode* self,
365 const gchar* name) {
367 g_free(priv->name);
368 priv->name = g_strdup(name);
369}
370
371// Implements FlAccessibleNode::set_extents.
372static void fl_accessible_node_set_extents_impl(FlAccessibleNode* self,
373 gint x,
374 gint y,
375 gint width,
376 gint height) {
378 priv->x = x;
379 priv->y = y;
380 priv->width = width;
381 priv->height = height;
382}
383
384// Check two boolean flags are different, in a way that handles true values
385// being different (e.g. 1 and 2).
386static bool flag_changed(bool old_flag, bool new_flag) {
387 return !old_flag != !new_flag;
388}
389
390// Implements FlAccessibleNode::set_flags.
391static void fl_accessible_node_set_flags_impl(FlAccessibleNode* self,
392 FlutterSemanticsFlags* flags) {
394
395 FlutterSemanticsFlags old_flags = priv->flags;
396 priv->flags = *flags;
397
398 if (flag_changed(old_flags.is_obscured, flags->is_obscured)) {
399 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_SHOWING,
400 !flags->is_obscured);
401 }
402 if (flag_changed(old_flags.is_hidden, flags->is_hidden)) {
403 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_VISIBLE,
404 !flags->is_hidden);
405 }
406 if (flag_changed(is_checkable(old_flags), is_checkable(priv->flags))) {
407 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_CHECKABLE,
408 is_checkable(priv->flags));
409 }
410 if (flag_changed(is_checked(old_flags), is_checked(priv->flags))) {
411 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_CHECKED,
412 is_checked(priv->flags));
413 }
414 if (flag_changed(is_focusable(old_flags), is_focusable(priv->flags))) {
415 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_FOCUSABLE,
416 is_focusable(priv->flags));
417 }
418 if (flag_changed(is_focused(old_flags), is_focused(priv->flags))) {
419 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_FOCUSED,
420 is_focused(priv->flags));
421 }
422 if (flag_changed(is_selected(old_flags), is_selected(priv->flags))) {
423 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_SELECTED,
424 is_selected(priv->flags));
425 }
426 if (flag_changed(is_sensitive(old_flags), is_sensitive(priv->flags))) {
427 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_SENSITIVE,
428 is_sensitive(priv->flags));
429 }
430 if (flag_changed(is_enabled(old_flags), is_enabled(priv->flags))) {
431 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_ENABLED,
432 is_enabled(priv->flags));
433 }
434 if (flag_changed(old_flags.is_read_only, flags->is_read_only)) {
435 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_READ_ONLY,
436 flags->is_read_only);
437 }
438 if (flag_changed(old_flags.is_text_field, flags->is_text_field)) {
439 atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_EDITABLE,
440 flags->is_text_field);
441 }
442}
443
444// Implements FlAccessibleNode::set_actions.
446 FlAccessibleNode* self,
447 FlutterSemanticsAction actions) {
449
450 // NOTE(robert-ancell): It appears that AtkAction doesn't have a method of
451 // notifying that actions have changed, and even if it did an ATK client
452 // might access the old IDs before checking for new ones. Keep an eye
453 // out for a case where Flutter changes the actions on an item and see
454 // if we can resolve this in another way.
455 g_ptr_array_remove_range(priv->actions, 0, priv->actions->len);
456 for (int i = 0; action_mapping[i].name != nullptr; i++) {
457 if (has_action(actions, action_mapping[i].action)) {
458 g_ptr_array_add(priv->actions, &action_mapping[i]);
459 }
460 }
461}
462
463// Implements FlAccessibleNode::set_value.
464static void fl_accessible_node_set_value_impl(FlAccessibleNode* self,
465 const gchar* value) {}
466
467// Implements FlAccessibleNode::set_text_selection.
469 gint base,
470 gint extent) {}
471
472// Implements FlAccessibleNode::set_text_direction.
474 FlAccessibleNode* self,
475 FlutterTextDirection direction) {}
476
477// Implements FlAccessibleNode::perform_action.
479 FlAccessibleNode* self,
481 GBytes* data) {
483 g_autoptr(FlEngine) engine = FL_ENGINE(g_weak_ref_get(&priv->engine));
484 if (engine == nullptr) {
485 return;
486 }
488 action, data);
489}
490
491static void fl_accessible_node_class_init(FlAccessibleNodeClass* klass) {
492 G_OBJECT_CLASS(klass)->set_property = fl_accessible_node_set_property;
493 G_OBJECT_CLASS(klass)->dispose = fl_accessible_node_dispose;
494 ATK_OBJECT_CLASS(klass)->get_name = fl_accessible_node_get_name;
495 ATK_OBJECT_CLASS(klass)->get_parent = fl_accessible_node_get_parent;
496 ATK_OBJECT_CLASS(klass)->get_index_in_parent =
498 ATK_OBJECT_CLASS(klass)->get_n_children = fl_accessible_node_get_n_children;
499 ATK_OBJECT_CLASS(klass)->ref_child = fl_accessible_node_ref_child;
500 ATK_OBJECT_CLASS(klass)->get_role = fl_accessible_node_get_role;
501 ATK_OBJECT_CLASS(klass)->ref_state_set = fl_accessible_node_ref_state_set;
502 FL_ACCESSIBLE_NODE_CLASS(klass)->set_name = fl_accessible_node_set_name_impl;
503 FL_ACCESSIBLE_NODE_CLASS(klass)->set_extents =
505 FL_ACCESSIBLE_NODE_CLASS(klass)->set_flags =
507 FL_ACCESSIBLE_NODE_CLASS(klass)->set_actions =
509 FL_ACCESSIBLE_NODE_CLASS(klass)->set_value =
511 FL_ACCESSIBLE_NODE_CLASS(klass)->set_text_selection =
513 FL_ACCESSIBLE_NODE_CLASS(klass)->set_text_direction =
515 FL_ACCESSIBLE_NODE_CLASS(klass)->perform_action =
517
518 g_object_class_install_property(
519 G_OBJECT_CLASS(klass), PROP_ENGINE,
520 g_param_spec_object(
521 "engine", "engine", "Flutter engine", fl_engine_get_type(),
522 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
523 G_PARAM_STATIC_STRINGS)));
524 g_object_class_install_property(
525 G_OBJECT_CLASS(klass), PROP_VIEW_ID,
526 g_param_spec_int64(
527 "view-id", "view-id", "View ID that this node belongs to", 0,
528 G_MAXINT64, 0,
529 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
530 g_object_class_install_property(
531 G_OBJECT_CLASS(klass), PROP_ID,
532 g_param_spec_int(
533 "node-id", "node-id", "Accessibility node ID", 0, G_MAXINT, 0,
534 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
535 G_PARAM_STATIC_STRINGS)));
536}
537
539 AtkComponentIface* iface) {
540 iface->get_extents = fl_accessible_node_get_extents;
541 iface->get_layer = fl_accessible_node_get_layer;
542}
543
544static void fl_accessible_node_action_interface_init(AtkActionIface* iface) {
545 iface->do_action = fl_accessible_node_do_action;
546 iface->get_n_actions = fl_accessible_node_get_n_actions;
547 iface->get_name = fl_accessible_node_get_name;
548}
549
550static void fl_accessible_node_init(FlAccessibleNode* self) {
552 g_weak_ref_init(&priv->engine, nullptr);
553 g_weak_ref_init(&priv->parent, nullptr);
554 priv->actions = g_ptr_array_new();
555 priv->children = g_ptr_array_new_with_free_func(g_object_unref);
556}
557
558FlAccessibleNode* fl_accessible_node_new(FlEngine* engine,
560 int32_t node_id) {
561 FlAccessibleNode* self = FL_ACCESSIBLE_NODE(
562 g_object_new(fl_accessible_node_get_type(), "engine", engine, "view-id",
563 view_id, "node-id", node_id, nullptr));
564 return self;
565}
566
567void fl_accessible_node_set_parent(FlAccessibleNode* self,
568 AtkObject* parent,
569 gint index) {
570 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
572 g_weak_ref_set(&priv->parent, parent);
573 priv->index = index;
574}
575
577 GPtrArray* children) {
578 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
580
581 // Remove nodes that are no longer required.
582 for (guint i = 0; i < priv->children->len;) {
583 AtkObject* object = ATK_OBJECT(g_ptr_array_index(priv->children, i));
584 if (has_child(children, object)) {
585 i++;
586 } else {
587 g_signal_emit_by_name(self, "children-changed::remove", i, object,
588 nullptr);
589 g_ptr_array_remove_index(priv->children, i);
590 }
591 }
592
593 // Add new nodes.
594 for (guint i = 0; i < children->len; i++) {
595 AtkObject* object = ATK_OBJECT(g_ptr_array_index(children, i));
596 if (!has_child(priv->children, object)) {
597 g_ptr_array_add(priv->children, g_object_ref(object));
598 g_signal_emit_by_name(self, "children-changed::add", i, object, nullptr);
599 }
600 }
601}
602
603void fl_accessible_node_set_name(FlAccessibleNode* self, const gchar* name) {
604 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
605
606 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_name(self, name);
607}
608
610 gint x,
611 gint y,
612 gint width,
613 gint height) {
614 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
615
616 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_extents(self, x, y, width,
617 height);
618}
619
620void fl_accessible_node_set_flags(FlAccessibleNode* self,
621 FlutterSemanticsFlags* flags) {
622 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
623
624 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_flags(self, flags);
625}
626
628 FlutterSemanticsAction actions) {
629 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
630
631 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_actions(self, actions);
632}
633
634void fl_accessible_node_set_value(FlAccessibleNode* self, const gchar* value) {
635 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
636
637 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_value(self, value);
638}
639
641 gint base,
642 gint extent) {
643 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
644
645 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_text_selection(self, base,
646 extent);
647}
648
650 FlutterTextDirection direction) {
651 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
652
653 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_text_direction(self,
654 direction);
655}
656
659 GBytes* data) {
660 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
661
662 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->perform_action(self, action, data);
663}
int32_t value
int32_t x
@ kFlutterCheckStateNone
The semantics node does not have check state.
Definition embedder.h:289
@ kFlutterCheckStateTrue
The semantics node is checked.
Definition embedder.h:291
FlutterSemanticsAction
Definition embedder.h:122
@ kFlutterSemanticsActionMoveCursorForwardByCharacter
Move the cursor forward by one character.
Definition embedder.h:149
@ kFlutterSemanticsActionDidLoseAccessibilityFocus
Indicate that the node has lost accessibility focus.
Definition embedder.h:163
@ kFlutterSemanticsActionExpand
A request that the node should be expanded.
Definition embedder.h:180
@ kFlutterSemanticsActionDecrease
Decrease the value represented by the semantics node.
Definition embedder.h:145
@ kFlutterSemanticsActionCollapse
A request that the node should be collapsed.
Definition embedder.h:182
@ kFlutterSemanticsActionScrollDown
Definition embedder.h:141
@ kFlutterSemanticsActionMoveCursorBackwardByCharacter
Move the cursor backward by one character.
Definition embedder.h:151
@ kFlutterSemanticsActionMoveCursorForwardByWord
Move the cursor forward by one word.
Definition embedder.h:169
@ kFlutterSemanticsActionLongPress
Definition embedder.h:128
@ kFlutterSemanticsActionScrollRight
Definition embedder.h:135
@ kFlutterSemanticsActionShowOnScreen
A request to fully show the semantics node on screen.
Definition embedder.h:147
@ kFlutterSemanticsActionDismiss
A request that the node should be dismissed.
Definition embedder.h:167
@ kFlutterSemanticsActionFocus
Request that the respective focusable widget gain input focus.
Definition embedder.h:175
@ kFlutterSemanticsActionPaste
Paste the current content of the clipboard.
Definition embedder.h:159
@ kFlutterSemanticsActionScrollUp
Definition embedder.h:138
@ kFlutterSemanticsActionCut
Cut the current selection and place it in the clipboard.
Definition embedder.h:157
@ kFlutterSemanticsActionCustomAction
Indicate that the user has invoked a custom accessibility action.
Definition embedder.h:165
@ kFlutterSemanticsActionCopy
Copy the current selection to the clipboard.
Definition embedder.h:155
@ kFlutterSemanticsActionMoveCursorBackwardByWord
Move the cursor backward by one word.
Definition embedder.h:171
@ kFlutterSemanticsActionIncrease
Increase the value represented by the semantics node.
Definition embedder.h:143
@ kFlutterSemanticsActionScrollLeft
Definition embedder.h:131
@ kFlutterSemanticsActionDidGainAccessibilityFocus
Indicate that the node has gained accessibility focus.
Definition embedder.h:161
@ kFlutterSemanticsActionTap
Definition embedder.h:125
int64_t FlutterViewId
Definition embedder.h:393
@ kFlutterTristateTrue
The property is applicable and its state is "true" or "on".
Definition embedder.h:282
@ kFlutterTristateNone
The property is not applicable to this semantics node.
Definition embedder.h:280
FlutterTextDirection
Definition embedder.h:366
FlutterEngine engine
Definition main.cc:84
FlViewAccessible * accessible
g_autoptr(FlEngine) engine
FlAccessibilityHandlerPrivate * priv
static gboolean has_child(GPtrArray *children, AtkObject *object)
static void fl_accessible_node_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
void fl_accessible_node_set_name(FlAccessibleNode *self, const gchar *name)
static gboolean fl_accessible_node_do_action(AtkAction *action, gint i)
static void fl_accessible_node_action_interface_init(AtkActionIface *iface)
static void fl_accessible_node_set_text_direction_impl(FlAccessibleNode *self, FlutterTextDirection direction)
void fl_accessible_node_set_text_direction(FlAccessibleNode *self, FlutterTextDirection direction)
void fl_accessible_node_perform_action(FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
@ PROP_ENGINE
@ PROP_VIEW_ID
@ PROP_LAST
static AtkStateSet * fl_accessible_node_ref_state_set(AtkObject *accessible)
static gboolean is_sensitive(FlutterSemanticsFlags flags)
static AtkRole fl_accessible_node_get_role(AtkObject *accessible)
static bool flag_changed(bool old_flag, bool new_flag)
static void fl_accessible_node_set_value_impl(FlAccessibleNode *self, const gchar *value)
void fl_accessible_node_set_text_selection(FlAccessibleNode *self, gint base, gint extent)
static AtkObject * fl_accessible_node_get_parent(AtkObject *accessible)
static void fl_accessible_node_class_init(FlAccessibleNodeClass *klass)
static void fl_accessible_node_set_actions_impl(FlAccessibleNode *self, FlutterSemanticsAction actions)
static void fl_accessible_node_component_interface_init(AtkComponentIface *iface)
void fl_accessible_node_set_actions(FlAccessibleNode *self, FlutterSemanticsAction actions)
static void fl_accessible_node_dispose(GObject *object)
void fl_accessible_node_set_children(FlAccessibleNode *self, GPtrArray *children)
void fl_accessible_node_set_extents(FlAccessibleNode *self, gint x, gint y, gint width, gint height)
static AtkLayer fl_accessible_node_get_layer(AtkComponent *component)
void fl_accessible_node_set_value(FlAccessibleNode *self, const gchar *value)
static gboolean is_enabled(FlutterSemanticsFlags flags)
static void fl_accessible_node_get_extents(AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type)
static gint fl_accessible_node_get_n_actions(AtkAction *action)
G_DEFINE_TYPE_WITH_CODE(FlAccessibleNode, fl_accessible_node, ATK_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT, fl_accessible_node_component_interface_init) G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION, fl_accessible_node_action_interface_init)) static gboolean is_checkable(FlutterSemanticsFlags flags)
static ActionData * get_action(FlAccessibleNodePrivate *priv, gint index)
static const gchar * fl_accessible_node_get_name(AtkObject *accessible)
static gboolean is_selected(FlutterSemanticsFlags flags)
static gboolean has_action(FlutterSemanticsAction actions, FlutterSemanticsAction action)
static gint fl_accessible_node_get_index_in_parent(AtkObject *accessible)
static gboolean is_focusable(FlutterSemanticsFlags flags)
static void fl_accessible_node_init(FlAccessibleNode *self)
void fl_accessible_node_set_parent(FlAccessibleNode *self, AtkObject *parent, gint index)
static void fl_accessible_node_perform_action_impl(FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
static ActionData action_mapping[]
static void fl_accessible_node_set_text_selection_impl(FlAccessibleNode *self, gint base, gint extent)
void fl_accessible_node_set_flags(FlAccessibleNode *self, FlutterSemanticsFlags *flags)
static gint fl_accessible_node_get_n_children(AtkObject *accessible)
static gboolean is_checked(FlutterSemanticsFlags flags)
static void fl_accessible_node_set_extents_impl(FlAccessibleNode *self, gint x, gint y, gint width, gint height)
FlAccessibleNode * fl_accessible_node_new(FlEngine *engine, FlutterViewId view_id, int32_t node_id)
#define FL_ACCESSIBLE_NODE_GET_PRIVATE(node)
static void fl_accessible_node_set_name_impl(FlAccessibleNode *self, const gchar *name)
static AtkObject * fl_accessible_node_ref_child(AtkObject *accessible, gint i)
static gboolean is_focused(FlutterSemanticsFlags flags)
static void fl_accessible_node_set_flags_impl(FlAccessibleNode *self, FlutterSemanticsFlags *flags)
return TRUE
void fl_engine_dispatch_semantics_action(FlEngine *self, FlutterViewId view_id, uint64_t node_id, FlutterSemanticsAction action, GBytes *data)
guint const GValue GParamSpec * pspec
G_BEGIN_DECLS FlutterViewId view_id
const char * name
Definition fuchsia.cc:50
void atk_object_notify_state_change(AtkObject *accessible, AtkState state, gboolean value)
Definition mock_gtk.cc:391
double y
int32_t height
int32_t width
const gchar * name
FlutterSemanticsAction action
FlutterSemanticsFlags flags
FlutterViewId view_id
The unique identifier of the view to which this node belongs.
FlutterTristate is_enabled
Whether a semantic node is currently enabled.
Definition embedder.h:306
bool is_obscured
Whether the value of the semantics node is obscured.
Definition embedder.h:326
FlutterTristate is_selected
Whether a semantics node is selected.
Definition embedder.h:304
FlutterTristate is_toggled
Definition embedder.h:309
FlutterTristate is_focused
Whether the semantic node currently holds the user's focus.
Definition embedder.h:316
bool is_hidden
Whether the semantics node is considered hidden.
Definition embedder.h:333
bool is_text_field
Whether the semantic node represents a text field.
Definition embedder.h:320
FlutterCheckState is_checked
Whether a semantics node is checked.
Definition embedder.h:302