Flutter Engine
The Flutter Engine
Classes | Macros | 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
 

Macros

#define FL_TYPE_ACCESSIBLE_NODE   fl_accessible_node_get_type()
 

Functions

 G_DECLARE_DERIVABLE_TYPE (FlAccessibleNode, fl_accessible_node, FL, ACCESSIBLE_NODE, AtkObject)
 
FlAccessibleNode * fl_accessible_node_new (FlEngine *engine, int32_t 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, FlutterSemanticsFlag 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)
 

Macro Definition Documentation

◆ FL_TYPE_ACCESSIBLE_NODE

#define FL_TYPE_ACCESSIBLE_NODE   fl_accessible_node_get_type()

Definition at line 22 of file fl_accessible_node.h.

Function Documentation

◆ 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}
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ 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_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)
#define FL_ACCESSIBLE_NODE_GET_PRIVATE(node)
FlPixelBufferTexturePrivate * priv

◆ 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}
double y
double x
int32_t height
int32_t width

◆ 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_name()

void fl_accessible_node_set_name ( FlAccessibleNode *  node,
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_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_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_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_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}
uint8_t value

◆ G_DECLARE_DERIVABLE_TYPE()

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