| Flutter Linux Embedder |

Classes | Functions
fl_accessible_node.h File Reference
`#include <atk/atk.h>`
`#include <gio/gio.h>`
`#include "flutter/shell/platform/embedder/embedder.h"`
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"`

Go to the source code of this file.

## Classes
struct | _FlAccessibleNodeClass

## Functions
G_BEGIN_DECLS | G_DECLARE_DERIVABLE_TYPE (FlAccessibleNode, fl_accessible_node, FL, ACCESSIBLE_NODE, AtkObject)
FlAccessibleNode * | fl_accessible_node_new (FlEngine *engine, FlutterViewId view_id, int32_t node_id)
void | fl_accessible_node_set_parent (FlAccessibleNode *node, AtkObject *parent, gint index)
void | fl_accessible_node_set_children (FlAccessibleNode *node, GPtrArray *children)
: a node name.
fl_accessible_node_set_name: @node: an #FlAccessibleNode. Sets the name of this node as reported to the a11y consumer.
void | fl_accessible_node_set_name (FlAccessibleNode *node, const gchar *name)
void | fl_accessible_node_set_extents (FlAccessibleNode *node, gint x, gint y, gint width, gint height)
void | fl_accessible_node_set_flags (FlAccessibleNode *node, FlutterSemanticsFlags *flags)
void | fl_accessible_node_set_actions (FlAccessibleNode *node, FlutterSemanticsAction actions)
void | fl_accessible_node_set_value (FlAccessibleNode *node, const gchar *value)
void | fl_accessible_node_set_text_selection (FlAccessibleNode *node, gint base, gint extent)
void | fl_accessible_node_set_text_direction (FlAccessibleNode *node, FlutterTextDirection direction)
void | fl_accessible_node_perform_action (FlAccessibleNode *node, FlutterSemanticsAction action, GBytes *data)

## Function Documentation

## ◆ fl_accessible_node_new()

FlAccessibleNode* fl_accessible_node_new | ( | FlEngine * | engine,
|  | FlutterViewId | view_id,
|  | int32_t | node_id
| ) |  |

fl_accessible_node_new: @engine: the #FlEngine this node came from. @view_id: the view ID this object represents. @node_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 560 of file fl_accessible_node.cc.

562 {
563 FlAccessibleNode* self = FL_ACCESSIBLE_NODE(
564 g_object_new(fl_accessible_node_get_type(), "engine", engine, "view-id",
565 view_id, "node-id", node_id, nullptr));
566 return self;
567 }
view_id
G_BEGIN_DECLS FlutterViewId view_id
Definition: fl_view_accessible.h:49

References view_id.

Referenced by create_node(), and TEST_F().

## ◆ fl_accessible_node_perform_action()

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

fl_accessible_node_perform_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 661 of file fl_accessible_node.cc.

663 {
664 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
665
666 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->perform_action(self, action, data);
667 }

Referenced by fl_accessible_node_do_action(), fl_accessible_text_field_copy_text(), fl_accessible_text_field_cut_text(), fl_accessible_text_field_paste_text(), perform_set_selection_action(), and perform_set_text_action().

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

632 {
633 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
634
635 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_actions(self, actions);
636 }

Referenced by fl_view_accessible_handle_update_semantics(), TEST(), and TEST_F().

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

581 {
582 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
583 FlAccessibleNodePrivate* priv = FL_ACCESSIBLE_NODE_GET_PRIVATE(self);
584
585 // Remove nodes that are no longer required.
586 for (guint i = 0; i < priv->children->len;) {
587 AtkObject* object = ATK_OBJECT(g_ptr_array_index(priv->children, i));
588 if (has_child(children, object)) {
589 i++;
590 } else {
591 g_signal_emit_by_name(self, "children-changed::remove", i, object,
592 nullptr);
593 g_ptr_array_remove_index(priv->children, i);
594 }
595 }
596
597 // Add new nodes.
598 for (guint i = 0; i < children->len; i++) {
599 AtkObject* object = ATK_OBJECT(g_ptr_array_index(children, i));
600 if (!has_child(priv->children, object)) {
601 g_ptr_array_add(priv->children, g_object_ref(object));
602 g_signal_emit_by_name(self, "children-changed::add", i, object, nullptr);
603 }
604 }
605 }
has_child
static gboolean has_child(GPtrArray *children, AtkObject *object)
Definition: fl_accessible_node.cc:138
FL_ACCESSIBLE_NODE_GET_PRIVATE
#define FL_ACCESSIBLE_NODE_GET_PRIVATE(node)
Definition: fl_accessible_node.cc:68
priv
FlPixelBufferTexturePrivate * priv
Definition: fl_pixel_buffer_texture.cc:30
i
int i
Definition: fl_socket_accessible.cc:18
FlAccessibleNodePrivate
Definition: fl_accessible_node.cc:44

References FL_ACCESSIBLE_NODE_GET_PRIVATE, has_child(), i, and priv.

Referenced by fl_view_accessible_handle_update_semantics(), and TEST_F().

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

617 {
618 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
619
620 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_extents(self, x, y, width,
621 height);
622 }
height
self height
Definition: fl_compositor_software.cc:43
width
self width
Definition: fl_compositor_software.cc:42

References height, and width.

Referenced by fl_view_accessible_handle_update_semantics(), and TEST_F().

## ◆ fl_accessible_node_set_flags()

void fl_accessible_node_set_flags | ( | FlAccessibleNode * | node,
|  | FlutterSemanticsFlags * | flags
| ) |  |

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

Sets the flags for this node.

Definition at line 624 of file fl_accessible_node.cc.

625 {
626 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
627
628 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_flags(self, flags);
629 }

Referenced by fl_view_accessible_handle_update_semantics(), and TEST_F().

## ◆ fl_accessible_node_set_name()

void fl_accessible_node_set_name | ( | FlAccessibleNode * | node,
|  | const gchar * | name
| ) |  |

Definition at line 607 of file fl_accessible_node.cc.

607 {
608 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
609
610 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_name(self, name);
611 }

Referenced by fl_view_accessible_handle_update_semantics(), and TEST_F().

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

571 {
572 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
573 FlAccessibleNodePrivate* priv = FL_ACCESSIBLE_NODE_GET_PRIVATE(self);
574 priv->parent = parent;
575 priv->index = index;
576 g_object_add_weak_pointer(G_OBJECT(self),
577 reinterpret_cast<gpointer*>(&(priv->parent)));
578 }

References FL_ACCESSIBLE_NODE_GET_PRIVATE, and priv.

Referenced by fl_view_accessible_handle_update_semantics(), get_node(), and TEST_F().

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

654 {
655 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
656
657 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_text_direction(self,
658 direction);
659 }

Referenced by fl_view_accessible_handle_update_semantics().

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

646 {
647 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
648
649 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_text_selection(self, base,
650 extent);
651 }

Referenced by fl_view_accessible_handle_update_semantics(), and TEST().

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

638 {
639 g_return_if_fail(FL_IS_ACCESSIBLE_NODE(self));
640
641 return FL_ACCESSIBLE_NODE_GET_CLASS(self)->set_value(self, value);
642 }
value
uint8_t value
Definition: fl_standard_message_codec.cc:36

References value.

Referenced by fl_view_accessible_handle_update_semantics(), and TEST().

## ◆ G_DECLARE_DERIVABLE_TYPE()

G_BEGIN_DECLS G_DECLARE_DERIVABLE_TYPE | ( | FlAccessibleNode | ,
|  | fl_accessible_node | ,
|  | FL | ,
|  | ACCESSIBLE_NODE | ,
|  | AtkObject |
| ) |  |