Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
fl_accessible_node.cc File Reference
#include "flutter/shell/platform/linux/fl_accessible_node.h"
#include "flutter/shell/platform/linux/fl_engine_private.h"

Go to the source code of this file.

Classes

struct  ActionData
 
struct  FlAccessibleNodePrivate
 

Macros

#define FL_ACCESSIBLE_NODE_GET_PRIVATE(node)
 

Enumerations

enum  { kProp0 , kPropEngine , kPropId , kPropLast }
 

Functions

static void fl_accessible_node_component_interface_init (AtkComponentIface *iface)
 
static void fl_accessible_node_action_interface_init (AtkActionIface *iface)
 
 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 flag_is_changed(FlutterSemanticsFlag old_flags
 
static gboolean has_flag (FlutterSemanticsFlag flags, FlutterSemanticsFlag flag)
 
static gboolean has_action (FlutterSemanticsAction actions, FlutterSemanticsAction action)
 
static ActionDataget_action (FlAccessibleNodePrivate *priv, gint index)
 
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)
 
static void fl_accessible_node_dispose (GObject *object)
 
static const gchar * fl_accessible_node_get_name (AtkObject *accessible)
 
static AtkObject * fl_accessible_node_get_parent (AtkObject *accessible)
 
static gint fl_accessible_node_get_index_in_parent (AtkObject *accessible)
 
static gint fl_accessible_node_get_n_children (AtkObject *accessible)
 
static AtkObject * fl_accessible_node_ref_child (AtkObject *accessible, gint i)
 
static AtkRole fl_accessible_node_get_role (AtkObject *accessible)
 
static AtkStateSet * fl_accessible_node_ref_state_set (AtkObject *accessible)
 
static void fl_accessible_node_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type)
 
static AtkLayer fl_accessible_node_get_layer (AtkComponent *component)
 
static gboolean fl_accessible_node_do_action (AtkAction *action, gint i)
 
static gint fl_accessible_node_get_n_actions (AtkAction *action)
 
static const gchar * fl_accessible_node_get_name (AtkAction *action, gint i)
 
static void fl_accessible_node_set_name_impl (FlAccessibleNode *self, const gchar *name)
 
static void fl_accessible_node_set_extents_impl (FlAccessibleNode *self, gint x, gint y, gint width, gint height)
 
static void fl_accessible_node_set_flags_impl (FlAccessibleNode *self, FlutterSemanticsFlag flags)
 
static void fl_accessible_node_set_actions_impl (FlAccessibleNode *self, FlutterSemanticsAction actions)
 
static void fl_accessible_node_set_value_impl (FlAccessibleNode *self, const gchar *value)
 
static void fl_accessible_node_set_text_selection_impl (FlAccessibleNode *self, gint base, gint extent)
 
static void fl_accessible_node_set_text_direction_impl (FlAccessibleNode *self, FlutterTextDirection direction)
 
static void fl_accessible_node_perform_action_impl (FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
 
static void fl_accessible_node_class_init (FlAccessibleNodeClass *klass)
 
static void fl_accessible_node_init (FlAccessibleNode *self)
 
FlAccessibleNode * fl_accessible_node_new (FlEngine *engine, int32_t id)
 
void fl_accessible_node_set_parent (FlAccessibleNode *self, AtkObject *parent, gint index)
 
void fl_accessible_node_set_children (FlAccessibleNode *self, GPtrArray *children)
 
void fl_accessible_node_set_name (FlAccessibleNode *self, const gchar *name)
 
void fl_accessible_node_set_extents (FlAccessibleNode *self, gint x, gint y, gint width, gint height)
 
void fl_accessible_node_set_flags (FlAccessibleNode *self, FlutterSemanticsFlag flags)
 
void fl_accessible_node_set_actions (FlAccessibleNode *self, FlutterSemanticsAction actions)
 
void fl_accessible_node_set_value (FlAccessibleNode *self, const gchar *value)
 
void fl_accessible_node_set_text_selection (FlAccessibleNode *self, gint base, gint extent)
 
void fl_accessible_node_set_text_direction (FlAccessibleNode *self, FlutterTextDirection direction)
 
void fl_accessible_node_perform_action (FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
 

Variables

struct { 
 
   AtkStateType   state 
 
   FlutterSemanticsFlag   flag 
 
   gboolean   invert 
 
flag_mapping [] 
 
static ActionData action_mapping []
 
FlutterSemanticsFlag flags
 

Macro Definition Documentation

◆ FL_ACCESSIBLE_NODE_GET_PRIVATE

#define FL_ACCESSIBLE_NODE_GET_PRIVATE (   node)
Value:
((FlAccessibleNodePrivate*)fl_accessible_node_get_instance_private( \
FL_ACCESSIBLE_NODE(node)))
G_BEGIN_DECLS const FlutterSemanticsNode * node

Definition at line 85 of file fl_accessible_node.cc.

105 {
106 return (old_flags & flag) != (flags & flag);
107}
108
109// Returns TRUE if [flag] is set in [flags].
110static gboolean has_flag(FlutterSemanticsFlag flags,
112 return (flags & flag) != 0;
113}
114
115// Returns TRUE if [action] is set in [actions].
116static gboolean has_action(FlutterSemanticsAction actions,
118 return (actions & action) != 0;
119}
120
121// Gets the nth action.
123 if (index < 0 || static_cast<guint>(index) >= priv->actions->len) {
124 return nullptr;
125 }
126 return static_cast<ActionData*>(g_ptr_array_index(priv->actions, index));
127}
128
129// Checks if [object] is in [children].
130static gboolean has_child(GPtrArray* children, AtkObject* object) {
131 for (guint i = 0; i < children->len; i++) {
132 if (g_ptr_array_index(children, i) == object) {
133 return TRUE;
134 }
135 }
136
137 return FALSE;
138}
139
140static void fl_accessible_node_set_property(GObject* object,
141 guint prop_id,
142 const GValue* value,
143 GParamSpec* pspec) {
145 switch (prop_id) {
146 case kPropEngine:
147 g_assert(priv->engine == nullptr);
148 priv->engine = FL_ENGINE(g_value_get_object(value));
150 reinterpret_cast<gpointer*>(&priv->engine));
151 break;
152 case kPropId:
153 priv->id = g_value_get_int(value);
154 break;
155 default:
156 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
157 break;
158 }
159}
160
161static void fl_accessible_node_dispose(GObject* object) {
163
164 if (priv->engine != nullptr) {
165 g_object_remove_weak_pointer(object,
166 reinterpret_cast<gpointer*>(&(priv->engine)));
167 priv->engine = nullptr;
168 }
169 if (priv->parent != nullptr) {
170 g_object_remove_weak_pointer(object,
171 reinterpret_cast<gpointer*>(&(priv->parent)));
172 priv->parent = nullptr;
173 }
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.
182static const gchar* fl_accessible_node_get_name(AtkObject* accessible) {
184 return priv->name;
185}
186
187// Implements AtkObject::get_parent.
188static AtkObject* fl_accessible_node_get_parent(AtkObject* accessible) {
190 return priv->parent;
191}
192
193// Implements AtkObject::get_index_in_parent.
194static gint fl_accessible_node_get_index_in_parent(AtkObject* accessible) {
196 return priv->index;
197}
198
199// Implements AtkObject::get_n_children.
200static gint fl_accessible_node_get_n_children(AtkObject* accessible) {
202 return priv->children->len;
203}
204
205// Implements AtkObject::ref_child.
206static AtkObject* fl_accessible_node_ref_child(AtkObject* accessible, gint i) {
208
209 if (i < 0 || static_cast<guint>(i) >= priv->children->len) {
210 return nullptr;
211 }
212
213 return ATK_OBJECT(g_object_ref(g_ptr_array_index(priv->children, i)));
214}
215
216// Implements AtkObject::get_role.
217static AtkRole fl_accessible_node_get_role(AtkObject* accessible) {
219 if ((priv->flags & kFlutterSemanticsFlagIsButton) != 0) {
220 return ATK_ROLE_PUSH_BUTTON;
221 }
224 return ATK_ROLE_RADIO_BUTTON;
225 }
226 if ((priv->flags & kFlutterSemanticsFlagHasCheckedState) != 0) {
227 return ATK_ROLE_CHECK_BOX;
228 }
229 if ((priv->flags & kFlutterSemanticsFlagHasToggledState) != 0) {
230 return ATK_ROLE_TOGGLE_BUTTON;
231 }
232 if ((priv->flags & kFlutterSemanticsFlagIsSlider) != 0) {
233 return ATK_ROLE_SLIDER;
234 }
235 if ((priv->flags & kFlutterSemanticsFlagIsTextField) != 0 &&
236 (priv->flags & kFlutterSemanticsFlagIsObscured) != 0) {
237 return ATK_ROLE_PASSWORD_TEXT;
238 }
239 if ((priv->flags & kFlutterSemanticsFlagIsTextField) != 0) {
240 return ATK_ROLE_TEXT;
241 }
242 if ((priv->flags & kFlutterSemanticsFlagIsHeader) != 0) {
243 return ATK_ROLE_HEADER;
244 }
245 if ((priv->flags & kFlutterSemanticsFlagIsLink) != 0) {
246 return ATK_ROLE_LINK;
247 }
248 if ((priv->flags & kFlutterSemanticsFlagIsImage) != 0) {
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 for (int i = 0; flag_mapping[i].state != ATK_STATE_INVALID; i++) {
262 gboolean enabled = has_flag(priv->flags, flag_mapping[i].flag);
263 if (flag_mapping[i].invert) {
264 enabled = !enabled;
265 }
266 if (enabled) {
267 atk_state_set_add_state(state_set, flag_mapping[i].state);
268 }
269 }
270
271 return state_set;
272}
273
274// Implements AtkComponent::get_extents.
275static void fl_accessible_node_get_extents(AtkComponent* component,
276 gint* x,
277 gint* y,
278 gint* width,
279 gint* height,
280 AtkCoordType coord_type) {
282
283 *x = 0;
284 *y = 0;
285 if (priv->parent != nullptr) {
286 atk_component_get_extents(ATK_COMPONENT(priv->parent), x, y, nullptr,
287 nullptr, coord_type);
288 }
289
290 *x += priv->x;
291 *y += priv->y;
292 *width = priv->width;
293 *height = priv->height;
294}
295
296// Implements AtkComponent::get_layer.
297static AtkLayer fl_accessible_node_get_layer(AtkComponent* component) {
298 return ATK_LAYER_WIDGET;
299}
300
301// Implements AtkAction::do_action.
302static gboolean fl_accessible_node_do_action(AtkAction* action, gint i) {
304
305 if (priv->engine == nullptr) {
306 return FALSE;
307 }
308
310 if (data == nullptr) {
311 return FALSE;
312 }
313
314 fl_accessible_node_perform_action(FL_ACCESSIBLE_NODE(action), data->action,
315 nullptr);
316 return TRUE;
317}
318
319// Implements AtkAction::get_n_actions.
320static gint fl_accessible_node_get_n_actions(AtkAction* action) {
322 return priv->actions->len;
323}
324
325// Implements AtkAction::get_name.
326static const gchar* fl_accessible_node_get_name(AtkAction* action, gint i) {
328
330 if (data == nullptr) {
331 return nullptr;
332 }
333
334 return data->name;
335}
336
337// Implements FlAccessibleNode::set_name.
338static void fl_accessible_node_set_name_impl(FlAccessibleNode* self,
339 const gchar* name) {
341 g_free(priv->name);
342 priv->name = g_strdup(name);
343}
344
345// Implements FlAccessibleNode::set_extents.
346static void fl_accessible_node_set_extents_impl(FlAccessibleNode* self,
347 gint x,
348 gint y,
349 gint width,
350 gint height) {
352 priv->x = x;
353 priv->y = y;
354 priv->width = width;
355 priv->height = height;
356}
357
358// Implements FlAccessibleNode::set_flags.
359static void fl_accessible_node_set_flags_impl(FlAccessibleNode* self,
362
363 FlutterSemanticsFlag old_flags = priv->flags;
364 priv->flags = flags;
365
366 for (int i = 0; flag_mapping[i].state != ATK_STATE_INVALID; i++) {
367 if (flag_is_changed(old_flags, flags, flag_mapping[i].flag)) {
368 gboolean enabled = has_flag(flags, flag_mapping[i].flag);
369 if (flag_mapping[i].invert) {
370 enabled = !enabled;
371 }
372
373 atk_object_notify_state_change(ATK_OBJECT(self), flag_mapping[i].state,
374 enabled);
375 }
376 }
377}
378
379// Implements FlAccessibleNode::set_actions.
381 FlAccessibleNode* self,
382 FlutterSemanticsAction actions) {
384
385 // NOTE(robert-ancell): It appears that AtkAction doesn't have a method of
386 // notifying that actions have changed, and even if it did an ATK client
387 // might access the old IDs before checking for new ones. Keep an eye
388 // out for a case where Flutter changes the actions on an item and see
389 // if we can resolve this in another way.
390 g_ptr_array_remove_range(priv->actions, 0, priv->actions->len);
391 for (int i = 0; action_mapping[i].name != nullptr; i++) {
392 if (has_action(actions, action_mapping[i].action)) {
393 g_ptr_array_add(priv->actions, &action_mapping[i]);
394 }
395 }
396}
397
398// Implements FlAccessibleNode::set_value.
399static void fl_accessible_node_set_value_impl(FlAccessibleNode* self,
400 const gchar* value) {}
401
402// Implements FlAccessibleNode::set_text_selection.
403static void fl_accessible_node_set_text_selection_impl(FlAccessibleNode* self,
404 gint base,
405 gint extent) {}
406
407// Implements FlAccessibleNode::set_text_direction.
409 FlAccessibleNode* self,
410 FlutterTextDirection direction) {}
411
412// Implements FlAccessibleNode::perform_action.
414 FlAccessibleNode* self,
416 GBytes* data) {
419}
420
421static void fl_accessible_node_class_init(FlAccessibleNodeClass* klass) {
422 G_OBJECT_CLASS(klass)->set_property = fl_accessible_node_set_property;
423 G_OBJECT_CLASS(klass)->dispose = fl_accessible_node_dispose;
424 ATK_OBJECT_CLASS(klass)->get_name = fl_accessible_node_get_name;
425 ATK_OBJECT_CLASS(klass)->get_parent = fl_accessible_node_get_parent;
426 ATK_OBJECT_CLASS(klass)->get_index_in_parent =
428 ATK_OBJECT_CLASS(klass)->get_n_children = fl_accessible_node_get_n_children;
429 ATK_OBJECT_CLASS(klass)->ref_child = fl_accessible_node_ref_child;
430 ATK_OBJECT_CLASS(klass)->get_role = fl_accessible_node_get_role;
431 ATK_OBJECT_CLASS(klass)->ref_state_set = fl_accessible_node_ref_state_set;
432 FL_ACCESSIBLE_NODE_CLASS(klass)->set_name = fl_accessible_node_set_name_impl;
433 FL_ACCESSIBLE_NODE_CLASS(klass)->set_extents =
435 FL_ACCESSIBLE_NODE_CLASS(klass)->set_flags =
437 FL_ACCESSIBLE_NODE_CLASS(klass)->set_actions =
439 FL_ACCESSIBLE_NODE_CLASS(klass)->set_value =
441 FL_ACCESSIBLE_NODE_CLASS(klass)->set_text_selection =
443 FL_ACCESSIBLE_NODE_CLASS(klass)->set_text_direction =
445 FL_ACCESSIBLE_NODE_CLASS(klass)->perform_action =
447
448 g_object_class_install_property(
449 G_OBJECT_CLASS(klass), kPropEngine,
450 g_param_spec_object(
451 "engine", "engine", "Flutter engine", fl_engine_get_type(),
452 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
453 G_PARAM_STATIC_STRINGS)));
454 g_object_class_install_property(
455 G_OBJECT_CLASS(klass), kPropId,
456 g_param_spec_int(
457 "id", "id", "Accessibility node ID", 0, G_MAXINT, 0,
458 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
459 G_PARAM_STATIC_STRINGS)));
460}
461
463 AtkComponentIface* iface) {
464 iface->get_extents = fl_accessible_node_get_extents;
465 iface->get_layer = fl_accessible_node_get_layer;
466}
467
468static void fl_accessible_node_action_interface_init(AtkActionIface* iface) {
469 iface->do_action = fl_accessible_node_do_action;
470 iface->get_n_actions = fl_accessible_node_get_n_actions;
471 iface->get_name = fl_accessible_node_get_name;
472}
473
474static void fl_accessible_node_init(FlAccessibleNode* self) {
476 priv->actions = g_ptr_array_new();
477 priv->children = g_ptr_array_new_with_free_func(g_object_unref);
478}
479
480FlAccessibleNode* fl_accessible_node_new(FlEngine* engine, int32_t id) {
481 FlAccessibleNode* self = FL_ACCESSIBLE_NODE(g_object_new(
482 fl_accessible_node_get_type(), "engine", engine, "id", id, nullptr));
483 return self;
484}
485
486void fl_accessible_node_set_parent(FlAccessibleNode* self,
487 AtkObject* parent,
488 gint index) {
489 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
491 priv->parent = parent;
492 priv->index = index;
493 g_object_add_weak_pointer(G_OBJECT(self),
494 reinterpret_cast<gpointer*>(&(priv->parent)));
495}
496
497void fl_accessible_node_set_children(FlAccessibleNode* self,
498 GPtrArray* children) {
499 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
501
502 // Remove nodes that are no longer required.
503 for (guint i = 0; i < priv->children->len;) {
504 AtkObject* object = ATK_OBJECT(g_ptr_array_index(priv->children, i));
505 if (has_child(children, object)) {
506 i++;
507 } else {
508 g_signal_emit_by_name(self, "children-changed::remove", i, object,
509 nullptr);
510 g_ptr_array_remove_index(priv->children, i);
511 }
512 }
513
514 // Add new nodes.
515 for (guint i = 0; i < children->len; i++) {
516 AtkObject* object = ATK_OBJECT(g_ptr_array_index(children, i));
517 if (!has_child(priv->children, object)) {
518 g_ptr_array_add(priv->children, g_object_ref(object));
519 g_signal_emit_by_name(self, "children-changed::add", i, object, nullptr);
520 }
521 }
522}
523
524void fl_accessible_node_set_name(FlAccessibleNode* self, const gchar* name) {
525 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
526
527 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_name(self, name);
528}
529
530void fl_accessible_node_set_extents(FlAccessibleNode* self,
531 gint x,
532 gint y,
533 gint width,
534 gint height) {
535 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
536
537 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_extents(self, x, y, width,
538 height);
539}
540
541void fl_accessible_node_set_flags(FlAccessibleNode* self,
543 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
544
545 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_flags(self, flags);
546}
547
548void fl_accessible_node_set_actions(FlAccessibleNode* self,
549 FlutterSemanticsAction actions) {
550 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
551
552 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_actions(self, actions);
553}
554
555void fl_accessible_node_set_value(FlAccessibleNode* self, const gchar* value) {
556 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
557
558 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_value(self, value);
559}
560
561void fl_accessible_node_set_text_selection(FlAccessibleNode* self,
562 gint base,
563 gint extent) {
564 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
565
566 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_text_selection(self, base,
567 extent);
568}
569
570void fl_accessible_node_set_text_direction(FlAccessibleNode* self,
571 FlutterTextDirection direction) {
572 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
573
574 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_text_direction(self,
575 direction);
576}
577
578void fl_accessible_node_perform_action(FlAccessibleNode* self,
580 GBytes* data) {
581 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
582
583 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->perform_action(self, action, data);
584}
FlutterSemanticsAction
Definition embedder.h:113
FlutterTextDirection
Definition embedder.h:246
FlutterSemanticsFlag
Definition embedder.h:170
@ kFlutterSemanticsFlagIsHeader
Whether a semantic node is a header that divides content into sections.
Definition embedder.h:192
@ kFlutterSemanticsFlagIsSlider
Whether the semantics node represents a slider.
Definition embedder.h:234
@ kFlutterSemanticsFlagHasToggledState
The semantics node has the quality of either being "on" or "off".
Definition embedder.h:207
@ kFlutterSemanticsFlagIsInMutuallyExclusiveGroup
Whether a semantic node is in a mutually exclusive group.
Definition embedder.h:190
@ kFlutterSemanticsFlagIsButton
Whether the semantic node represents a button.
Definition embedder.h:179
@ kFlutterSemanticsFlagIsObscured
Whether the value of the semantics node is obscured.
Definition embedder.h:194
@ kFlutterSemanticsFlagIsLink
Whether the semantics node represents a link.
Definition embedder.h:232
@ kFlutterSemanticsFlagIsImage
Whether the semantics node represents an image.
Definition embedder.h:203
@ kFlutterSemanticsFlagIsTextField
Whether the semantic node represents a text field.
Definition embedder.h:181
@ kFlutterSemanticsFlagHasCheckedState
Definition embedder.h:173
FlutterEngine engine
Definition main.cc:67
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)
FlutterSemanticsFlag flag
void fl_accessible_node_set_text_direction(FlAccessibleNode *self, FlutterTextDirection direction)
void fl_accessible_node_perform_action(FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
@ kPropEngine
static AtkStateSet * fl_accessible_node_ref_state_set(AtkObject *accessible)
static AtkRole fl_accessible_node_get_role(AtkObject *accessible)
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)
static void fl_accessible_node_set_flags_impl(FlAccessibleNode *self, FlutterSemanticsFlag flags)
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 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)
AtkStateType state
FlutterSemanticsFlag flags
static ActionData * get_action(FlAccessibleNodePrivate *priv, gint index)
void fl_accessible_node_set_flags(FlAccessibleNode *self, FlutterSemanticsFlag flags)
static const gchar * fl_accessible_node_get_name(AtkObject *accessible)
static gboolean has_action(FlutterSemanticsAction actions, FlutterSemanticsAction action)
static gint fl_accessible_node_get_index_in_parent(AtkObject *accessible)
static void fl_accessible_node_init(FlAccessibleNode *self)
void fl_accessible_node_set_parent(FlAccessibleNode *self, AtkObject *parent, gint index)
static struct @68 flag_mapping[]
static void fl_accessible_node_perform_action_impl(FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
gboolean invert
static ActionData action_mapping[]
static void fl_accessible_node_set_text_selection_impl(FlAccessibleNode *self, gint base, gint extent)
static gint fl_accessible_node_get_n_children(AtkObject *accessible)
static void fl_accessible_node_set_extents_impl(FlAccessibleNode *self, gint x, gint y, gint width, gint height)
static gboolean has_flag(FlutterSemanticsFlag flags, FlutterSemanticsFlag flag)
#define FL_ACCESSIBLE_NODE_GET_PRIVATE(node)
FlAccessibleNode * fl_accessible_node_new(FlEngine *engine, int32_t id)
static void fl_accessible_node_set_name_impl(FlAccessibleNode *self, const gchar *name)
static AtkObject * fl_accessible_node_ref_child(AtkObject *accessible, gint i)
void fl_engine_dispatch_semantics_action(FlEngine *self, uint64_t id, FlutterSemanticsAction action, GBytes *data)
Definition fl_engine.cc:860
FlPixelBufferTexturePrivate * priv
g_object_add_weak_pointer(G_OBJECT(self), reinterpret_cast< gpointer * >(&self->engine))
const char * name
Definition fuchsia.cc:50
return FALSE
double y
double x
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41
int32_t height
int32_t width
const gchar * name

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kProp0 
kPropEngine 
kPropId 
kPropLast 

Definition at line 83 of file fl_accessible_node.cc.

Function Documentation

◆ fl_accessible_node_action_interface_init()

static void fl_accessible_node_action_interface_init ( AtkActionIface *  iface)
static

Definition at line 469 of file fl_accessible_node.cc.

469 {
470 iface->do_action = fl_accessible_node_do_action;
471 iface->get_n_actions = fl_accessible_node_get_n_actions;
472 iface->get_name = fl_accessible_node_get_name;
473}

◆ fl_accessible_node_class_init()

static void fl_accessible_node_class_init ( FlAccessibleNodeClass *  klass)
static

Definition at line 422 of file fl_accessible_node.cc.

422 {
423 G_OBJECT_CLASS(klass)->set_property = fl_accessible_node_set_property;
424 G_OBJECT_CLASS(klass)->dispose = fl_accessible_node_dispose;
425 ATK_OBJECT_CLASS(klass)->get_name = fl_accessible_node_get_name;
426 ATK_OBJECT_CLASS(klass)->get_parent = fl_accessible_node_get_parent;
427 ATK_OBJECT_CLASS(klass)->get_index_in_parent =
429 ATK_OBJECT_CLASS(klass)->get_n_children = fl_accessible_node_get_n_children;
430 ATK_OBJECT_CLASS(klass)->ref_child = fl_accessible_node_ref_child;
431 ATK_OBJECT_CLASS(klass)->get_role = fl_accessible_node_get_role;
432 ATK_OBJECT_CLASS(klass)->ref_state_set = fl_accessible_node_ref_state_set;
433 FL_ACCESSIBLE_NODE_CLASS(klass)->set_name = fl_accessible_node_set_name_impl;
434 FL_ACCESSIBLE_NODE_CLASS(klass)->set_extents =
436 FL_ACCESSIBLE_NODE_CLASS(klass)->set_flags =
438 FL_ACCESSIBLE_NODE_CLASS(klass)->set_actions =
440 FL_ACCESSIBLE_NODE_CLASS(klass)->set_value =
442 FL_ACCESSIBLE_NODE_CLASS(klass)->set_text_selection =
444 FL_ACCESSIBLE_NODE_CLASS(klass)->set_text_direction =
446 FL_ACCESSIBLE_NODE_CLASS(klass)->perform_action =
448
449 g_object_class_install_property(
450 G_OBJECT_CLASS(klass), kPropEngine,
451 g_param_spec_object(
452 "engine", "engine", "Flutter engine", fl_engine_get_type(),
453 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
454 G_PARAM_STATIC_STRINGS)));
455 g_object_class_install_property(
456 G_OBJECT_CLASS(klass), kPropId,
457 g_param_spec_int(
458 "id", "id", "Accessibility node ID", 0, G_MAXINT, 0,
459 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
460 G_PARAM_STATIC_STRINGS)));
461}

◆ fl_accessible_node_component_interface_init()

static void fl_accessible_node_component_interface_init ( AtkComponentIface *  iface)
static

Definition at line 463 of file fl_accessible_node.cc.

464 {
465 iface->get_extents = fl_accessible_node_get_extents;
466 iface->get_layer = fl_accessible_node_get_layer;
467}

◆ fl_accessible_node_dispose()

static void fl_accessible_node_dispose ( GObject *  object)
static

Definition at line 162 of file fl_accessible_node.cc.

162 {
164
165 if (priv->engine != nullptr) {
166 g_object_remove_weak_pointer(object,
167 reinterpret_cast<gpointer*>(&(priv->engine)));
168 priv->engine = nullptr;
169 }
170 if (priv->parent != nullptr) {
171 g_object_remove_weak_pointer(object,
172 reinterpret_cast<gpointer*>(&(priv->parent)));
173 priv->parent = nullptr;
174 }
175 g_clear_pointer(&priv->name, g_free);
176 g_clear_pointer(&priv->actions, g_ptr_array_unref);
177 g_clear_pointer(&priv->children, g_ptr_array_unref);
178
179 G_OBJECT_CLASS(fl_accessible_node_parent_class)->dispose(object);
180}

◆ fl_accessible_node_do_action()

static gboolean fl_accessible_node_do_action ( AtkAction *  action,
gint  i 
)
static

Definition at line 303 of file fl_accessible_node.cc.

303 {
305
306 if (priv->engine == nullptr) {
307 return FALSE;
308 }
309
311 if (data == nullptr) {
312 return FALSE;
313 }
314
315 fl_accessible_node_perform_action(FL_ACCESSIBLE_NODE(action), data->action,
316 nullptr);
317 return TRUE;
318}

◆ fl_accessible_node_get_extents()

static void fl_accessible_node_get_extents ( AtkComponent *  component,
gint *  x,
gint *  y,
gint *  width,
gint *  height,
AtkCoordType  coord_type 
)
static

Definition at line 276 of file fl_accessible_node.cc.

281 {
283
284 *x = 0;
285 *y = 0;
286 if (priv->parent != nullptr) {
287 atk_component_get_extents(ATK_COMPONENT(priv->parent), x, y, nullptr,
288 nullptr, coord_type);
289 }
290
291 *x += priv->x;
292 *y += priv->y;
293 *width = priv->width;
294 *height = priv->height;
295}

◆ fl_accessible_node_get_index_in_parent()

static gint fl_accessible_node_get_index_in_parent ( AtkObject *  accessible)
static

Definition at line 195 of file fl_accessible_node.cc.

195 {
197 return priv->index;
198}

◆ fl_accessible_node_get_layer()

static AtkLayer fl_accessible_node_get_layer ( AtkComponent *  component)
static

Definition at line 298 of file fl_accessible_node.cc.

298 {
299 return ATK_LAYER_WIDGET;
300}

◆ fl_accessible_node_get_n_actions()

static gint fl_accessible_node_get_n_actions ( AtkAction *  action)
static

Definition at line 321 of file fl_accessible_node.cc.

321 {
323 return priv->actions->len;
324}

◆ fl_accessible_node_get_n_children()

static gint fl_accessible_node_get_n_children ( AtkObject *  accessible)
static

Definition at line 201 of file fl_accessible_node.cc.

201 {
203 return priv->children->len;
204}

◆ fl_accessible_node_get_name() [1/2]

static const gchar * fl_accessible_node_get_name ( AtkAction *  action,
gint  i 
)
static

Definition at line 327 of file fl_accessible_node.cc.

327 {
329
331 if (data == nullptr) {
332 return nullptr;
333 }
334
335 return data->name;
336}

◆ fl_accessible_node_get_name() [2/2]

static const gchar * fl_accessible_node_get_name ( AtkObject *  accessible)
static

Definition at line 183 of file fl_accessible_node.cc.

183 {
185 return priv->name;
186}

◆ fl_accessible_node_get_parent()

static AtkObject * fl_accessible_node_get_parent ( AtkObject *  accessible)
static

Definition at line 189 of file fl_accessible_node.cc.

189 {
191 return priv->parent;
192}

◆ fl_accessible_node_get_role()

static AtkRole fl_accessible_node_get_role ( AtkObject *  accessible)
static

Definition at line 218 of file fl_accessible_node.cc.

218 {
220 if ((priv->flags & kFlutterSemanticsFlagIsButton) != 0) {
221 return ATK_ROLE_PUSH_BUTTON;
222 }
225 return ATK_ROLE_RADIO_BUTTON;
226 }
227 if ((priv->flags & kFlutterSemanticsFlagHasCheckedState) != 0) {
228 return ATK_ROLE_CHECK_BOX;
229 }
230 if ((priv->flags & kFlutterSemanticsFlagHasToggledState) != 0) {
231 return ATK_ROLE_TOGGLE_BUTTON;
232 }
233 if ((priv->flags & kFlutterSemanticsFlagIsSlider) != 0) {
234 return ATK_ROLE_SLIDER;
235 }
236 if ((priv->flags & kFlutterSemanticsFlagIsTextField) != 0 &&
237 (priv->flags & kFlutterSemanticsFlagIsObscured) != 0) {
238 return ATK_ROLE_PASSWORD_TEXT;
239 }
240 if ((priv->flags & kFlutterSemanticsFlagIsTextField) != 0) {
241 return ATK_ROLE_TEXT;
242 }
243 if ((priv->flags & kFlutterSemanticsFlagIsHeader) != 0) {
244 return ATK_ROLE_HEADER;
245 }
246 if ((priv->flags & kFlutterSemanticsFlagIsLink) != 0) {
247 return ATK_ROLE_LINK;
248 }
249 if ((priv->flags & kFlutterSemanticsFlagIsImage) != 0) {
250 return ATK_ROLE_IMAGE;
251 }
252
253 return ATK_ROLE_PANEL;
254}

◆ fl_accessible_node_init()

static void fl_accessible_node_init ( FlAccessibleNode *  self)
static

Definition at line 475 of file fl_accessible_node.cc.

475 {
477 priv->actions = g_ptr_array_new();
478 priv->children = g_ptr_array_new_with_free_func(g_object_unref);
479}

◆ fl_accessible_node_new()

FlAccessibleNode * fl_accessible_node_new ( FlEngine *  engine,
int32_t  id 
)

fl_accessible_node_new: @engine: the #FlEngine this node came from. @id: the semantics node ID this object represents.

Creates a new accessibility object that exposes Flutter accessibility information to ATK.

Returns: a new #FlAccessibleNode.

Definition at line 481 of file fl_accessible_node.cc.

481 {
482 FlAccessibleNode* self = FL_ACCESSIBLE_NODE(g_object_new(
483 fl_accessible_node_get_type(), "engine", engine, "id", id, nullptr));
484 return self;
485}

◆ fl_accessible_node_perform_action()

void fl_accessible_node_perform_action ( FlAccessibleNode *  node,
FlutterSemanticsAction  action,
GBytes *  data 
)

fl_accessible_node_dispatch_action: @node: an #FlAccessibleNode. @action: the action being dispatched. @data: (allow-none): data associated with the action.

Performs a semantic action for this node.

Definition at line 579 of file fl_accessible_node.cc.

581 {
582 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
583
584 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->perform_action(self, action, data);
585}

◆ fl_accessible_node_perform_action_impl()

static void fl_accessible_node_perform_action_impl ( FlAccessibleNode *  self,
FlutterSemanticsAction  action,
GBytes *  data 
)
static

◆ fl_accessible_node_ref_child()

static AtkObject * fl_accessible_node_ref_child ( AtkObject *  accessible,
gint  i 
)
static

Definition at line 207 of file fl_accessible_node.cc.

207 {
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}

◆ fl_accessible_node_ref_state_set()

static AtkStateSet * fl_accessible_node_ref_state_set ( AtkObject *  accessible)
static

Definition at line 257 of file fl_accessible_node.cc.

257 {
259
260 AtkStateSet* state_set = atk_state_set_new();
261
262 for (int i = 0; flag_mapping[i].state != ATK_STATE_INVALID; i++) {
263 gboolean enabled = has_flag(priv->flags, flag_mapping[i].flag);
264 if (flag_mapping[i].invert) {
265 enabled = !enabled;
266 }
267 if (enabled) {
268 atk_state_set_add_state(state_set, flag_mapping[i].state);
269 }
270 }
271
272 return state_set;
273}

◆ fl_accessible_node_set_actions()

void fl_accessible_node_set_actions ( FlAccessibleNode *  node,
FlutterSemanticsAction  actions 
)

fl_accessible_node_set_actions: @node: an #FlAccessibleNode. @actions: the actions this node can perform.

Sets the actions that this node can perform.

Definition at line 549 of file fl_accessible_node.cc.

550 {
551 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
552
553 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_actions(self, actions);
554}

◆ fl_accessible_node_set_actions_impl()

static void fl_accessible_node_set_actions_impl ( FlAccessibleNode *  self,
FlutterSemanticsAction  actions 
)
static

Definition at line 381 of file fl_accessible_node.cc.

383 {
385
386 // NOTE(robert-ancell): It appears that AtkAction doesn't have a method of
387 // notifying that actions have changed, and even if it did an ATK client
388 // might access the old IDs before checking for new ones. Keep an eye
389 // out for a case where Flutter changes the actions on an item and see
390 // if we can resolve this in another way.
391 g_ptr_array_remove_range(priv->actions, 0, priv->actions->len);
392 for (int i = 0; action_mapping[i].name != nullptr; i++) {
393 if (has_action(actions, action_mapping[i].action)) {
394 g_ptr_array_add(priv->actions, &action_mapping[i]);
395 }
396 }
397}

◆ fl_accessible_node_set_children()

void fl_accessible_node_set_children ( FlAccessibleNode *  node,
GPtrArray *  children 
)

fl_accessible_node_set_children: @node: an #FlAccessibleNode. @children: (transfer none) (element-type AtkObject): a list of #AtkObject.

Sets the children of this node. The children can be changed at any time.

Definition at line 498 of file fl_accessible_node.cc.

499 {
500 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
502
503 // Remove nodes that are no longer required.
504 for (guint i = 0; i < priv->children->len;) {
505 AtkObject* object = ATK_OBJECT(g_ptr_array_index(priv->children, i));
506 if (has_child(children, object)) {
507 i++;
508 } else {
509 g_signal_emit_by_name(self, "children-changed::remove", i, object,
510 nullptr);
511 g_ptr_array_remove_index(priv->children, i);
512 }
513 }
514
515 // Add new nodes.
516 for (guint i = 0; i < children->len; i++) {
517 AtkObject* object = ATK_OBJECT(g_ptr_array_index(children, i));
518 if (!has_child(priv->children, object)) {
519 g_ptr_array_add(priv->children, g_object_ref(object));
520 g_signal_emit_by_name(self, "children-changed::add", i, object, nullptr);
521 }
522 }
523}

◆ fl_accessible_node_set_extents()

void fl_accessible_node_set_extents ( FlAccessibleNode *  node,
gint  x,
gint  y,
gint  width,
gint  height 
)

fl_accessible_node_set_extents: @node: an #FlAccessibleNode. @x: x co-ordinate of this node relative to its parent. @y: y co-ordinate of this node relative to its parent. @width: width of this node in pixels. @height: height of this node in pixels.

Sets the position and size of this node.

Definition at line 531 of file fl_accessible_node.cc.

535 {
536 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
537
538 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_extents(self, x, y, width,
539 height);
540}

◆ fl_accessible_node_set_extents_impl()

static void fl_accessible_node_set_extents_impl ( FlAccessibleNode *  self,
gint  x,
gint  y,
gint  width,
gint  height 
)
static

Definition at line 347 of file fl_accessible_node.cc.

351 {
353 priv->x = x;
354 priv->y = y;
355 priv->width = width;
356 priv->height = height;
357}

◆ fl_accessible_node_set_flags()

void fl_accessible_node_set_flags ( FlAccessibleNode *  node,
FlutterSemanticsFlag  flags 
)

fl_accessible_node_set_flags: @node: an #FlAccessibleNode. @flags: the flags for this node.

Sets the flags for this node.

Definition at line 542 of file fl_accessible_node.cc.

543 {
544 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
545
546 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_flags(self, flags);
547}

◆ fl_accessible_node_set_flags_impl()

static void fl_accessible_node_set_flags_impl ( FlAccessibleNode *  self,
FlutterSemanticsFlag  flags 
)
static

Definition at line 360 of file fl_accessible_node.cc.

361 {
363
364 FlutterSemanticsFlag old_flags = priv->flags;
365 priv->flags = flags;
366
367 for (int i = 0; flag_mapping[i].state != ATK_STATE_INVALID; i++) {
368 if (flag_is_changed(old_flags, flags, flag_mapping[i].flag)) {
369 gboolean enabled = has_flag(flags, flag_mapping[i].flag);
370 if (flag_mapping[i].invert) {
371 enabled = !enabled;
372 }
373
374 atk_object_notify_state_change(ATK_OBJECT(self), flag_mapping[i].state,
375 enabled);
376 }
377 }
378}

◆ fl_accessible_node_set_name()

void fl_accessible_node_set_name ( FlAccessibleNode *  self,
const gchar *  name 
)

Definition at line 525 of file fl_accessible_node.cc.

525 {
526 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
527
528 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_name(self, name);
529}

◆ fl_accessible_node_set_name_impl()

static void fl_accessible_node_set_name_impl ( FlAccessibleNode *  self,
const gchar *  name 
)
static

Definition at line 339 of file fl_accessible_node.cc.

340 {
342 g_free(priv->name);
343 priv->name = g_strdup(name);
344}

◆ fl_accessible_node_set_parent()

void fl_accessible_node_set_parent ( FlAccessibleNode *  node,
AtkObject *  parent,
gint  index 
)

fl_accessible_node_set_parent: @node: an #FlAccessibleNode. @parent: an #AtkObject. @index: the index of this node in the parent.

Sets the parent of this node. The parent can be changed at any time.

Definition at line 487 of file fl_accessible_node.cc.

489 {
490 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
492 priv->parent = parent;
493 priv->index = index;
495 reinterpret_cast<gpointer*>(&(priv->parent)));
496}

◆ fl_accessible_node_set_property()

static void fl_accessible_node_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

Definition at line 141 of file fl_accessible_node.cc.

144 {
146 switch (prop_id) {
147 case kPropEngine:
148 g_assert(priv->engine == nullptr);
149 priv->engine = FL_ENGINE(g_value_get_object(value));
151 reinterpret_cast<gpointer*>(&priv->engine));
152 break;
153 case kPropId:
154 priv->id = g_value_get_int(value);
155 break;
156 default:
157 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
158 break;
159 }
160}

◆ fl_accessible_node_set_text_direction()

void fl_accessible_node_set_text_direction ( FlAccessibleNode *  node,
FlutterTextDirection  direction 
)

fl_accessible_node_set_text_direction: @node: an #FlAccessibleNode. @direction: the direction of the text.

Sets the text direction of this node.

Definition at line 571 of file fl_accessible_node.cc.

572 {
573 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
574
575 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_text_direction(self,
576 direction);
577}

◆ fl_accessible_node_set_text_direction_impl()

static void fl_accessible_node_set_text_direction_impl ( FlAccessibleNode *  self,
FlutterTextDirection  direction 
)
static

Definition at line 409 of file fl_accessible_node.cc.

411 {}

◆ fl_accessible_node_set_text_selection()

void fl_accessible_node_set_text_selection ( FlAccessibleNode *  node,
gint  base,
gint  extent 
)

fl_accessible_node_set_text_selection: @node: an #FlAccessibleNode. @base: the position at which the text selection originates. @extent: the position at which the text selection terminates.

Sets the text selection of this node.

Definition at line 562 of file fl_accessible_node.cc.

564 {
565 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
566
567 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_text_selection(self, base,
568 extent);
569}

◆ fl_accessible_node_set_text_selection_impl()

static void fl_accessible_node_set_text_selection_impl ( FlAccessibleNode *  self,
gint  base,
gint  extent 
)
static

Definition at line 404 of file fl_accessible_node.cc.

406 {}

◆ fl_accessible_node_set_value()

void fl_accessible_node_set_value ( FlAccessibleNode *  node,
const gchar *  value 
)

fl_accessible_node_set_value: @node: an #FlAccessibleNode. @value: a node value.

Sets the value of this node.

Definition at line 556 of file fl_accessible_node.cc.

556 {
557 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
558
559 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_value(self, value);
560}

◆ fl_accessible_node_set_value_impl()

static void fl_accessible_node_set_value_impl ( FlAccessibleNode *  self,
const gchar *  value 
)
static

Definition at line 400 of file fl_accessible_node.cc.

401 {}

◆ G_DEFINE_TYPE_WITH_CODE()

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  
)

◆ get_action()

static ActionData * get_action ( FlAccessibleNodePrivate priv,
gint  index 
)
static

Definition at line 123 of file fl_accessible_node.cc.

123 {
124 if (index < 0 || static_cast<guint>(index) >= priv->actions->len) {
125 return nullptr;
126 }
127 return static_cast<ActionData*>(g_ptr_array_index(priv->actions, index));
128}

◆ has_action()

static gboolean has_action ( FlutterSemanticsAction  actions,
FlutterSemanticsAction  action 
)
static

Definition at line 117 of file fl_accessible_node.cc.

118 {
119 return (actions & action) != 0;
120}

◆ has_child()

static gboolean has_child ( GPtrArray *  children,
AtkObject *  object 
)
static

Definition at line 131 of file fl_accessible_node.cc.

131 {
132 for (guint i = 0; i < children->len; i++) {
133 if (g_ptr_array_index(children, i) == object) {
134 return TRUE;
135 }
136 }
137
138 return FALSE;
139}

◆ has_flag()

static gboolean has_flag ( FlutterSemanticsFlag  flags,
FlutterSemanticsFlag  flag 
)
static

Definition at line 111 of file fl_accessible_node.cc.

112 {
113 return (flags & flag) != 0;
114}

Variable Documentation

◆ action_mapping

ActionData action_mapping[]
static
Initial value:
= {
"MoveCursorForwardByCharacter"},
"MoveCursorBackwardByCharacter"},
"DidGainAccessibilityFocus"},
"DidLoseAccessibilityFocus"},
{kFlutterSemanticsActionMoveCursorForwardByWord, "MoveCursorForwardByWord"},
"MoveCursorBackwardByWord"},
{static_cast<FlutterSemanticsAction>(0), nullptr}}
@ kFlutterSemanticsActionMoveCursorForwardByCharacter
Move the cursor forward by one character.
Definition embedder.h:140
@ kFlutterSemanticsActionDidLoseAccessibilityFocus
Indicate that the node has lost accessibility focus.
Definition embedder.h:154
@ kFlutterSemanticsActionDecrease
Decrease the value represented by the semantics node.
Definition embedder.h:136
@ kFlutterSemanticsActionScrollDown
Definition embedder.h:132
@ kFlutterSemanticsActionMoveCursorBackwardByCharacter
Move the cursor backward by one character.
Definition embedder.h:142
@ kFlutterSemanticsActionMoveCursorForwardByWord
Move the cursor forward by one word.
Definition embedder.h:160
@ kFlutterSemanticsActionLongPress
Definition embedder.h:119
@ kFlutterSemanticsActionScrollRight
Definition embedder.h:126
@ kFlutterSemanticsActionShowOnScreen
A request to fully show the semantics node on screen.
Definition embedder.h:138
@ kFlutterSemanticsActionDismiss
A request that the node should be dismissed.
Definition embedder.h:158
@ kFlutterSemanticsActionPaste
Paste the current content of the clipboard.
Definition embedder.h:150
@ kFlutterSemanticsActionScrollUp
Definition embedder.h:129
@ kFlutterSemanticsActionCut
Cut the current selection and place it in the clipboard.
Definition embedder.h:148
@ kFlutterSemanticsActionCustomAction
Indicate that the user has invoked a custom accessibility action.
Definition embedder.h:156
@ kFlutterSemanticsActionCopy
Copy the current selection to the clipboard.
Definition embedder.h:146
@ kFlutterSemanticsActionMoveCursorBackwardByWord
Move the cursor backward by one word.
Definition embedder.h:162
@ kFlutterSemanticsActionIncrease
Increase the value represented by the semantics node.
Definition embedder.h:134
@ kFlutterSemanticsActionScrollLeft
Definition embedder.h:122
@ kFlutterSemanticsActionDidGainAccessibilityFocus
Indicate that the node has gained accessibility focus.
Definition embedder.h:152
@ kFlutterSemanticsActionTap
Definition embedder.h:116

Definition at line 36 of file fl_accessible_node.cc.

36 {
47 "MoveCursorForwardByCharacter"},
49 "MoveCursorBackwardByCharacter"},
54 "DidGainAccessibilityFocus"},
56 "DidLoseAccessibilityFocus"},
59 {kFlutterSemanticsActionMoveCursorForwardByWord, "MoveCursorForwardByWord"},
61 "MoveCursorBackwardByWord"},
62 {static_cast<FlutterSemanticsAction>(0), nullptr}};

◆ flag

Initial value:
{
return (old_flags & flag) != (flags & flag)

Definition at line 11 of file fl_accessible_node.cc.

◆ [struct]

struct { ... } flag_mapping[]
Initial value:
= {
{ATK_STATE_SHOWING, kFlutterSemanticsFlagIsObscured, TRUE},
{ATK_STATE_VISIBLE, kFlutterSemanticsFlagIsHidden, TRUE},
{ATK_STATE_FOCUSABLE, kFlutterSemanticsFlagIsFocusable, FALSE},
{ATK_STATE_FOCUSED, kFlutterSemanticsFlagIsFocused, FALSE},
{ATK_STATE_CHECKED,
{ATK_STATE_SELECTED, kFlutterSemanticsFlagIsSelected, FALSE},
{ATK_STATE_ENABLED, kFlutterSemanticsFlagIsEnabled, FALSE},
{ATK_STATE_SENSITIVE, kFlutterSemanticsFlagIsEnabled, FALSE},
{ATK_STATE_READ_ONLY, kFlutterSemanticsFlagIsReadOnly, FALSE},
{ATK_STATE_EDITABLE, kFlutterSemanticsFlagIsTextField, FALSE},
{ATK_STATE_INVALID, static_cast<FlutterSemanticsFlag>(0), FALSE},
}
@ kFlutterSemanticsFlagIsHidden
Whether the semantics node is considered hidden.
Definition embedder.h:201
@ kFlutterSemanticsFlagIsSelected
Whether a semantics node is selected.
Definition embedder.h:177
@ kFlutterSemanticsFlagIsChecked
Whether a semantics node is checked.
Definition embedder.h:175
@ kFlutterSemanticsFlagIsToggled
Definition embedder.h:210
@ kFlutterSemanticsFlagIsReadOnly
Definition embedder.h:228
@ kFlutterSemanticsFlagIsFocused
Whether the semantic node currently holds the user's focus.
Definition embedder.h:183
@ kFlutterSemanticsFlagIsEnabled
Whether a semantic node that hasEnabledState is currently enabled.
Definition embedder.h:188
@ kFlutterSemanticsFlagIsFocusable
Whether the semantic node can hold the user's focus.
Definition embedder.h:230

◆ flags

Definition at line 105 of file fl_accessible_node.cc.

◆ invert

gboolean invert

Definition at line 12 of file fl_accessible_node.cc.

◆ state

AtkStateType state

Definition at line 10 of file fl_accessible_node.cc.