105 {
107}
108
109
113}
114
115
118 return (actions &
action) != 0;
119}
120
121
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
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) {
134 }
135 }
136
138}
139
142 const GValue* value,
147 g_assert(
priv->engine ==
nullptr);
148 priv->engine = FL_ENGINE(g_value_get_object(value));
150 reinterpret_cast<gpointer*
>(&
priv->engine));
151 break;
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
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
185}
186
187
191}
192
193
197}
198
199
202 return priv->children->len;
203}
204
205
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
220 return ATK_ROLE_PUSH_BUTTON;
221 }
224 return ATK_ROLE_RADIO_BUTTON;
225 }
227 return ATK_ROLE_CHECK_BOX;
228 }
230 return ATK_ROLE_TOGGLE_BUTTON;
231 }
233 return ATK_ROLE_SLIDER;
234 }
237 return ATK_ROLE_PASSWORD_TEXT;
238 }
240 return ATK_ROLE_TEXT;
241 }
243 return ATK_ROLE_HEADER;
244 }
246 return ATK_ROLE_LINK;
247 }
249 return ATK_ROLE_IMAGE;
250 }
251
252 return ATK_ROLE_PANEL;
253}
254
255
258
259 AtkStateSet* state_set = atk_state_set_new();
260
261 for (
int i = 0;
flag_mapping[i].state != ATK_STATE_INVALID; i++) {
264 enabled = !enabled;
265 }
266 if (enabled) {
268 }
269 }
270
271 return state_set;
272}
273
274
280 AtkCoordType coord_type) {
282
285 if (
priv->parent !=
nullptr) {
286 atk_component_get_extents(ATK_COMPONENT(
priv->parent),
x,
y,
nullptr,
287 nullptr, coord_type);
288 }
289
294}
295
296
298 return ATK_LAYER_WIDGET;
299}
300
301
304
305 if (
priv->engine ==
nullptr) {
307 }
308
310 if (data == nullptr) {
312 }
313
315 nullptr);
317}
318
319
322 return priv->actions->len;
323}
324
325
328
330 if (data == nullptr) {
331 return nullptr;
332 }
333
335}
336
337
343}
344
345
356}
357
358
362
365
366 for (
int i = 0;
flag_mapping[i].state != ATK_STATE_INVALID; i++) {
370 enabled = !enabled;
371 }
372
374 enabled);
375 }
376 }
377}
378
379
381 FlAccessibleNode* self,
384
385
386
387
388
389
390 g_ptr_array_remove_range(
priv->actions, 0,
priv->actions->len);
394 }
395 }
396}
397
398
400 const gchar* value) {}
401
402
405 gint extent) {}
406
407
409 FlAccessibleNode* self,
411
412
414 FlAccessibleNode* self,
416 GBytes* data) {
419}
420
426 ATK_OBJECT_CLASS(klass)->get_index_in_parent =
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(
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) {
466}
467
472}
473
476 priv->actions = g_ptr_array_new();
477 priv->children = g_ptr_array_new_with_free_func(g_object_unref);
478}
479
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
487 AtkObject* parent,
488 gint index) {
489 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
491 priv->parent = parent;
494 reinterpret_cast<gpointer*
>(&(
priv->parent)));
495}
496
498 GPtrArray* children) {
499 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
501
502
503 for (guint i = 0; i <
priv->children->len;) {
504 AtkObject*
object = ATK_OBJECT(g_ptr_array_index(
priv->children, i));
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
515 for (guint i = 0; i < children->len; i++) {
516 AtkObject* object = ATK_OBJECT(g_ptr_array_index(children, i));
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
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
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,
539}
540
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
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
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
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
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
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}
@ kFlutterSemanticsFlagIsHeader
Whether a semantic node is a header that divides content into sections.
@ kFlutterSemanticsFlagIsSlider
Whether the semantics node represents a slider.
@ kFlutterSemanticsFlagHasToggledState
The semantics node has the quality of either being "on" or "off".
@ kFlutterSemanticsFlagIsInMutuallyExclusiveGroup
Whether a semantic node is in a mutually exclusive group.
@ kFlutterSemanticsFlagIsButton
Whether the semantic node represents a button.
@ kFlutterSemanticsFlagIsObscured
Whether the value of the semantics node is obscured.
@ kFlutterSemanticsFlagIsLink
Whether the semantics node represents a link.
@ kFlutterSemanticsFlagIsImage
Whether the semantics node represents an image.
@ kFlutterSemanticsFlagIsTextField
Whether the semantic node represents a text field.
@ kFlutterSemanticsFlagHasCheckedState
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)
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)
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)
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)
FlPixelBufferTexturePrivate * priv
guint const GValue GParamSpec * pspec
g_object_add_weak_pointer(G_OBJECT(self), reinterpret_cast< gpointer * >(&self->engine))
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data