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.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kProp0 
kPropEngine 
kPropId 
kPropLast 

Definition at line 83 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 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}
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 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}
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 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}
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 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}
#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 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}
SemanticsAction action
void fl_accessible_node_perform_action(FlAccessibleNode *self, FlutterSemanticsAction action, GBytes *data)
static ActionData * get_action(FlAccessibleNodePrivate *priv, gint index)
return FALSE
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

◆ 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}
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 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}
@ 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

◆ 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}
FlutterEngine engine
Definition: main.cc:67

◆ 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

Definition at line 414 of file fl_accessible_node.cc.

417 {
420}
void fl_engine_dispatch_semantics_action(FlEngine *self, uint64_t id, FlutterSemanticsAction action, GBytes *data)
Definition: fl_engine.cc:851

◆ 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}
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 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}
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 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}
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 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}
FlutterSemanticsFlag flags

◆ 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}
FlutterSemanticsFlag
Definition: embedder.h:170
FlutterSemanticsFlag flag

◆ 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}
const char * name
Definition: fuchsia.cc:50

◆ 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}
g_object_add_weak_pointer(G_OBJECT(self), reinterpret_cast< gpointer * >(&self->engine))

◆ 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}
uint8_t value

◆ 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}}
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
@ 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: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.