Flutter Linux Embedder
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 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 }

References engine.

Referenced by create_node(), and TEST().

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

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

Referenced by fl_view_accessible_handle_update_semantics(), and TEST().

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

References FL_ACCESSIBLE_NODE_GET_PRIVATE, has_child(), and priv.

Referenced by fl_view_accessible_handle_update_semantics(), and TEST().

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

References height, and width.

Referenced by fl_view_accessible_handle_update_semantics(), and TEST().

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

References flags.

Referenced by fl_view_accessible_handle_update_semantics(), and TEST().

◆ fl_accessible_node_set_name()

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

Referenced by fl_view_accessible_handle_update_semantics(), and TEST().

◆ 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;
494  g_object_add_weak_pointer(G_OBJECT(self),
495  reinterpret_cast<gpointer*>(&(priv->parent)));
496 }

References FL_ACCESSIBLE_NODE_GET_PRIVATE, g_object_add_weak_pointer(), and priv.

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

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

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

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

References value.

Referenced by fl_view_accessible_handle_update_semantics(), and TEST().

◆ G_DECLARE_DERIVABLE_TYPE()

G_DECLARE_DERIVABLE_TYPE ( FlAccessibleNode  ,
fl_accessible_node  ,
FL  ,
ACCESSIBLE_NODE  ,
AtkObject   
)
FL_ACCESSIBLE_NODE_GET_PRIVATE
#define FL_ACCESSIBLE_NODE_GET_PRIVATE(node)
Definition: fl_accessible_node.cc:85
priv
FlPixelBufferTexturePrivate * priv
Definition: fl_pixel_buffer_texture.cc:30
flags
FlutterSemanticsFlag flags
Definition: fl_accessible_node.cc:105
height
G_BEGIN_DECLS int height
Definition: fl_backing_store_provider.h:37
has_child
static gboolean has_child(GPtrArray *children, AtkObject *object)
Definition: fl_accessible_node.cc:131
g_object_add_weak_pointer
g_object_add_weak_pointer(G_OBJECT(self), reinterpret_cast< gpointer * >(&self->engine))
FlAccessibleNodePrivate
Definition: fl_accessible_node.cc:64
engine
FlEngine * engine
Definition: fl_view_accessible.cc:26
width
const uint8_t uint32_t * width
Definition: fl_pixel_buffer_texture_test.cc:38
value
uint8_t value
Definition: fl_standard_message_codec.cc:36