Flutter Engine
The Flutter Engine
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)))

Definition at line 86 of file fl_accessible_node.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kProp0 
kPropEngine 
kPropId 
kPropLast 

Definition at line 84 of file fl_accessible_node.cc.

@ kPropEngine
@ kPropLast
@ kPropId
@ kProp0

Function Documentation

◆ fl_accessible_node_action_interface_init()

static void fl_accessible_node_action_interface_init ( AtkActionIface *  iface)
static

Definition at line 470 of file fl_accessible_node.cc.

470 {
471 iface->do_action = fl_accessible_node_do_action;
472 iface->get_n_actions = fl_accessible_node_get_n_actions;
473 iface->get_name = fl_accessible_node_get_name;
474}
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(AtkObject *accessible)

◆ fl_accessible_node_class_init()

static void fl_accessible_node_class_init ( FlAccessibleNodeClass *  klass)
static

Definition at line 423 of file fl_accessible_node.cc.

423 {
424 G_OBJECT_CLASS(klass)->set_property = fl_accessible_node_set_property;
425 G_OBJECT_CLASS(klass)->dispose = fl_accessible_node_dispose;
426 ATK_OBJECT_CLASS(klass)->get_name = fl_accessible_node_get_name;
427 ATK_OBJECT_CLASS(klass)->get_parent = fl_accessible_node_get_parent;
428 ATK_OBJECT_CLASS(klass)->get_index_in_parent =
430 ATK_OBJECT_CLASS(klass)->get_n_children = fl_accessible_node_get_n_children;
431 ATK_OBJECT_CLASS(klass)->ref_child = fl_accessible_node_ref_child;
432 ATK_OBJECT_CLASS(klass)->get_role = fl_accessible_node_get_role;
433 ATK_OBJECT_CLASS(klass)->ref_state_set = fl_accessible_node_ref_state_set;
434 FL_ACCESSIBLE_NODE_CLASS(klass)->set_name = fl_accessible_node_set_name_impl;
435 FL_ACCESSIBLE_NODE_CLASS(klass)->set_extents =
437 FL_ACCESSIBLE_NODE_CLASS(klass)->set_flags =
439 FL_ACCESSIBLE_NODE_CLASS(klass)->set_actions =
441 FL_ACCESSIBLE_NODE_CLASS(klass)->set_value =
443 FL_ACCESSIBLE_NODE_CLASS(klass)->set_text_selection =
445 FL_ACCESSIBLE_NODE_CLASS(klass)->set_text_direction =
447 FL_ACCESSIBLE_NODE_CLASS(klass)->perform_action =
449
450 g_object_class_install_property(
451 G_OBJECT_CLASS(klass), kPropEngine,
452 g_param_spec_object(
453 "engine", "engine", "Flutter engine", fl_engine_get_type(),
454 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
455 G_PARAM_STATIC_STRINGS)));
456 g_object_class_install_property(
457 G_OBJECT_CLASS(klass), kPropId,
458 g_param_spec_int(
459 "id", "id", "Accessibility node ID", 0, G_MAXINT, 0,
460 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
461 G_PARAM_STATIC_STRINGS)));
462}
static void fl_accessible_node_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
static void fl_accessible_node_set_text_direction_impl(FlAccessibleNode *self, FlutterTextDirection direction)
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)
static AtkObject * fl_accessible_node_get_parent(AtkObject *accessible)
static void fl_accessible_node_set_actions_impl(FlAccessibleNode *self, FlutterSemanticsAction actions)
static void fl_accessible_node_dispose(GObject *object)
static void fl_accessible_node_set_flags_impl(FlAccessibleNode *self, FlutterSemanticsFlag flags)
static gint fl_accessible_node_get_index_in_parent(AtkObject *accessible)
static void fl_accessible_node_perform_action_impl(FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
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 void fl_accessible_node_set_name_impl(FlAccessibleNode *self, const gchar *name)
static AtkObject * fl_accessible_node_ref_child(AtkObject *accessible, gint i)

◆ fl_accessible_node_component_interface_init()

static void fl_accessible_node_component_interface_init ( AtkComponentIface *  iface)
static

Definition at line 464 of file fl_accessible_node.cc.

465 {
466 iface->get_extents = fl_accessible_node_get_extents;
467 iface->get_layer = fl_accessible_node_get_layer;
468}
static AtkLayer fl_accessible_node_get_layer(AtkComponent *component)
static void fl_accessible_node_get_extents(AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type)

◆ fl_accessible_node_dispose()

static void fl_accessible_node_dispose ( GObject *  object)
static

Definition at line 163 of file fl_accessible_node.cc.

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

◆ fl_accessible_node_do_action()

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

Definition at line 304 of file fl_accessible_node.cc.

304 {
306
307 if (priv->engine == nullptr) {
308 return FALSE;
309 }
310
312 if (data == nullptr) {
313 return FALSE;
314 }
315
316 fl_accessible_node_perform_action(FL_ACCESSIBLE_NODE(action), data->action,
317 nullptr);
318 return TRUE;
319}
void fl_accessible_node_perform_action(FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
static ActionData * get_action(FlAccessibleNodePrivate *priv, gint index)
return FALSE
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ 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 277 of file fl_accessible_node.cc.

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

◆ fl_accessible_node_get_index_in_parent()

static gint fl_accessible_node_get_index_in_parent ( AtkObject *  accessible)
static

Definition at line 196 of file fl_accessible_node.cc.

196 {
198 return priv->index;
199}

◆ fl_accessible_node_get_layer()

static AtkLayer fl_accessible_node_get_layer ( AtkComponent *  component)
static

Definition at line 299 of file fl_accessible_node.cc.

299 {
300 return ATK_LAYER_WIDGET;
301}

◆ fl_accessible_node_get_n_actions()

static gint fl_accessible_node_get_n_actions ( AtkAction *  action)
static

Definition at line 322 of file fl_accessible_node.cc.

322 {
324 return priv->actions->len;
325}

◆ fl_accessible_node_get_n_children()

static gint fl_accessible_node_get_n_children ( AtkObject *  accessible)
static

Definition at line 202 of file fl_accessible_node.cc.

202 {
204 return priv->children->len;
205}

◆ fl_accessible_node_get_name() [1/2]

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

Definition at line 328 of file fl_accessible_node.cc.

328 {
330
332 if (data == nullptr) {
333 return nullptr;
334 }
335
336 return data->name;
337}

◆ fl_accessible_node_get_name() [2/2]

static const gchar * fl_accessible_node_get_name ( AtkObject *  accessible)
static

Definition at line 184 of file fl_accessible_node.cc.

184 {
186 return priv->name;
187}

◆ fl_accessible_node_get_parent()

static AtkObject * fl_accessible_node_get_parent ( AtkObject *  accessible)
static

Definition at line 190 of file fl_accessible_node.cc.

190 {
192 return priv->parent;
193}

◆ fl_accessible_node_get_role()

static AtkRole fl_accessible_node_get_role ( AtkObject *  accessible)
static

Definition at line 219 of file fl_accessible_node.cc.

219 {
221 if ((priv->flags & kFlutterSemanticsFlagIsButton) != 0) {
222 return ATK_ROLE_PUSH_BUTTON;
223 }
226 return ATK_ROLE_RADIO_BUTTON;
227 }
228 if ((priv->flags & kFlutterSemanticsFlagHasCheckedState) != 0) {
229 return ATK_ROLE_CHECK_BOX;
230 }
231 if ((priv->flags & kFlutterSemanticsFlagHasToggledState) != 0) {
232 return ATK_ROLE_TOGGLE_BUTTON;
233 }
234 if ((priv->flags & kFlutterSemanticsFlagIsSlider) != 0) {
235 return ATK_ROLE_SLIDER;
236 }
237 if ((priv->flags & kFlutterSemanticsFlagIsTextField) != 0 &&
238 (priv->flags & kFlutterSemanticsFlagIsObscured) != 0) {
239 return ATK_ROLE_PASSWORD_TEXT;
240 }
241 if ((priv->flags & kFlutterSemanticsFlagIsTextField) != 0) {
242 return ATK_ROLE_TEXT;
243 }
244 if ((priv->flags & kFlutterSemanticsFlagIsHeader) != 0) {
245 return ATK_ROLE_HEADER;
246 }
247 if ((priv->flags & kFlutterSemanticsFlagIsLink) != 0) {
248 return ATK_ROLE_LINK;
249 }
250 if ((priv->flags & kFlutterSemanticsFlagIsImage) != 0) {
251 return ATK_ROLE_IMAGE;
252 }
253
254 return ATK_ROLE_PANEL;
255}
@ kFlutterSemanticsFlagIsHeader
Whether a semantic node is a header that divides content into sections.
Definition: embedder.h:194
@ kFlutterSemanticsFlagIsSlider
Whether the semantics node represents a slider.
Definition: embedder.h:236
@ kFlutterSemanticsFlagHasToggledState
The semantics node has the quality of either being "on" or "off".
Definition: embedder.h:209
@ kFlutterSemanticsFlagIsInMutuallyExclusiveGroup
Whether a semantic node is in a mutually exclusive group.
Definition: embedder.h:192
@ kFlutterSemanticsFlagIsButton
Whether the semantic node represents a button.
Definition: embedder.h:181
@ kFlutterSemanticsFlagIsObscured
Whether the value of the semantics node is obscured.
Definition: embedder.h:196
@ kFlutterSemanticsFlagIsLink
Whether the semantics node represents a link.
Definition: embedder.h:234
@ kFlutterSemanticsFlagIsImage
Whether the semantics node represents an image.
Definition: embedder.h:205
@ kFlutterSemanticsFlagIsTextField
Whether the semantic node represents a text field.
Definition: embedder.h:183
@ kFlutterSemanticsFlagHasCheckedState
Definition: embedder.h:175

◆ fl_accessible_node_init()

static void fl_accessible_node_init ( FlAccessibleNode *  self)
static

Definition at line 476 of file fl_accessible_node.cc.

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

◆ 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 482 of file fl_accessible_node.cc.

482 {
483 FlAccessibleNode* self = FL_ACCESSIBLE_NODE(g_object_new(
484 fl_accessible_node_get_type(), "engine", engine, "id", id, nullptr));
485 return self;
486}
FlutterEngine engine
Definition: main.cc:68

◆ 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 580 of file fl_accessible_node.cc.

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

◆ fl_accessible_node_perform_action_impl()

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

Definition at line 415 of file fl_accessible_node.cc.

418 {
421}
void fl_engine_dispatch_semantics_action(FlEngine *self, uint64_t id, FlutterSemanticsAction action, GBytes *data)
Definition: fl_engine.cc:873

◆ fl_accessible_node_ref_child()

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

Definition at line 208 of file fl_accessible_node.cc.

208 {
210
211 if (i < 0 || static_cast<guint>(i) >= priv->children->len) {
212 return nullptr;
213 }
214
215 return ATK_OBJECT(g_object_ref(g_ptr_array_index(priv->children, i)));
216}

◆ fl_accessible_node_ref_state_set()

static AtkStateSet * fl_accessible_node_ref_state_set ( AtkObject *  accessible)
static

Definition at line 258 of file fl_accessible_node.cc.

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

◆ 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 550 of file fl_accessible_node.cc.

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

◆ fl_accessible_node_set_actions_impl()

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

Definition at line 382 of file fl_accessible_node.cc.

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

◆ 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 499 of file fl_accessible_node.cc.

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

◆ 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 532 of file fl_accessible_node.cc.

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

◆ 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 348 of file fl_accessible_node.cc.

352 {
354 priv->x = x;
355 priv->y = y;
356 priv->width = width;
357 priv->height = height;
358}

◆ 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 543 of file fl_accessible_node.cc.

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

◆ fl_accessible_node_set_flags_impl()

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

Definition at line 361 of file fl_accessible_node.cc.

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

◆ fl_accessible_node_set_name()

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

Definition at line 526 of file fl_accessible_node.cc.

526 {
527 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
528
529 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_name(self, name);
530}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ fl_accessible_node_set_name_impl()

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

Definition at line 340 of file fl_accessible_node.cc.

341 {
343 g_free(priv->name);
344 priv->name = g_strdup(name);
345}

◆ 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 488 of file fl_accessible_node.cc.

490 {
491 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
493 priv->parent = parent;
494 priv->index = index;
495 g_object_add_weak_pointer(G_OBJECT(self),
496 reinterpret_cast<gpointer*>(&(priv->parent)));
497}

◆ 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 142 of file fl_accessible_node.cc.

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

◆ 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 572 of file fl_accessible_node.cc.

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

◆ fl_accessible_node_set_text_direction_impl()

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

Definition at line 410 of file fl_accessible_node.cc.

412 {}

◆ 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 563 of file fl_accessible_node.cc.

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

◆ 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 405 of file fl_accessible_node.cc.

407 {}

◆ 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 557 of file fl_accessible_node.cc.

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

◆ fl_accessible_node_set_value_impl()

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

Definition at line 401 of file fl_accessible_node.cc.

402 {}

◆ 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 124 of file fl_accessible_node.cc.

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

◆ has_action()

static gboolean has_action ( FlutterSemanticsAction  actions,
FlutterSemanticsAction  action 
)
static

Definition at line 118 of file fl_accessible_node.cc.

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

◆ has_child()

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

Definition at line 132 of file fl_accessible_node.cc.

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

◆ has_flag()

static gboolean has_flag ( FlutterSemanticsFlag  flags,
FlutterSemanticsFlag  flag 
)
static

Definition at line 112 of file fl_accessible_node.cc.

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

Variable Documentation

◆ action_mapping

ActionData action_mapping[]
static
Initial value:
= {
"MoveCursorForwardByCharacter"},
"MoveCursorBackwardByCharacter"},
"DidGainAccessibilityFocus"},
"DidLoseAccessibilityFocus"},
{kFlutterSemanticsActionMoveCursorForwardByWord, "MoveCursorForwardByWord"},
"MoveCursorBackwardByWord"},
{static_cast<FlutterSemanticsAction>(0), nullptr}}
FlutterSemanticsAction
Definition: embedder.h:113
@ 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
@ kFlutterSemanticsActionFocus
Request that the respective focusable widget gain input focus.
Definition: embedder.h:166
@ 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.

◆ flag

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

Definition at line 11 of file fl_accessible_node.cc.

◆ 

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:203
@ kFlutterSemanticsFlagIsSelected
Whether a semantics node is selected.
Definition: embedder.h:179
@ kFlutterSemanticsFlagIsChecked
Whether a semantics node is checked.
Definition: embedder.h:177
@ kFlutterSemanticsFlagIsToggled
Definition: embedder.h:212
@ kFlutterSemanticsFlagIsReadOnly
Definition: embedder.h:230
@ kFlutterSemanticsFlagIsFocused
Whether the semantic node currently holds the user's focus.
Definition: embedder.h:185
@ kFlutterSemanticsFlagIsEnabled
Whether a semantic node that hasEnabledState is currently enabled.
Definition: embedder.h:190
@ kFlutterSemanticsFlagIsFocusable
Whether the semantic node can hold the user's focus.
Definition: embedder.h:232

◆ flags

Definition at line 106 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.