Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
ui::AXTreeUpdateBase< AXNodeData, AXTreeData > Struct Template Reference

#include <ax_tree_update.h>

Public Member Functions

std::string ToString () const
 

Public Attributes

bool has_tree_data = false
 
AXTreeData tree_data
 
int node_id_to_clear = AXNode::kInvalidAXID
 
int root_id = 0
 
std::vector< AXNodeDatanodes
 
ax::mojom::EventFrom event_from = ax::mojom::EventFrom::kNone
 
std::vector< AXEventIntentevent_intents
 

Detailed Description

template<typename AXNodeData, typename AXTreeData>
struct ui::AXTreeUpdateBase< AXNodeData, AXTreeData >

Definition at line 52 of file ax_tree_update.h.

Member Function Documentation

◆ ToString()

template<typename AXNodeData , typename AXTreeData >
std::string ui::AXTreeUpdateBase< AXNodeData, AXTreeData >::ToString

Definition at line 89 of file ax_tree_update.h.

89 {
90 std::string result;
91
92 if (has_tree_data) {
93 result += "AXTreeUpdate tree data:" + tree_data.ToString() + "\n";
94 }
95
97 result += "AXTreeUpdate: clear node " +
99 }
100
102 result += "AXTreeUpdate: root id " + base::NumberToString(root_id) + "\n";
103 }
104
106 result += "event_from=" + std::string(ui::ToString(event_from)) + "\n";
107
108 if (!event_intents.empty()) {
109 result += "event_intents=[\n";
110 for (const auto& event_intent : event_intents)
111 result += " " + event_intent.ToString() + "\n";
112 result += "]\n";
113 }
114
115 // The challenge here is that we want to indent the nodes being updated
116 // so that parent/child relationships are clear, but we don't have access
117 // to the rest of the tree for context, so we have to try to show the
118 // relative indentation of child nodes in this update relative to their
119 // parents.
120 std::unordered_map<int32_t, int> id_to_indentation;
121 for (size_t i = 0; i < nodes.size(); ++i) {
122 int indent = id_to_indentation[nodes[i].id];
123 result += std::string(2 * indent, ' ');
124 result += nodes[i].ToString() + "\n";
125 for (size_t j = 0; j < nodes[i].child_ids.size(); ++j)
126 id_to_indentation[nodes[i].child_ids[j]] = indent + 1;
127 }
128
129 return result;
130}
static constexpr AXID kInvalidAXID
Definition: ax_node.h:41
GAsyncResult * result
std::string NumberToString(int32_t number)
Definition: string_utils.cc:91
const char * ToString(ax::mojom::Event event)
Definition: ax_enum_util.cc:9
virtual std::string ToString() const
Definition: ax_tree_data.cc:24
ax::mojom::EventFrom event_from
std::vector< AXEventIntent > event_intents
std::vector< AXNodeData > nodes

Member Data Documentation

◆ event_from

Definition at line 75 of file ax_tree_update.h.

◆ event_intents

template<typename AXNodeData , typename AXTreeData >
std::vector<AXEventIntent> ui::AXTreeUpdateBase< AXNodeData, AXTreeData >::event_intents

Definition at line 78 of file ax_tree_update.h.

◆ has_tree_data

template<typename AXNodeData , typename AXTreeData >
bool ui::AXTreeUpdateBase< AXNodeData, AXTreeData >::has_tree_data = false

Definition at line 55 of file ax_tree_update.h.

◆ node_id_to_clear

template<typename AXNodeData , typename AXTreeData >
int ui::AXTreeUpdateBase< AXNodeData, AXTreeData >::node_id_to_clear = AXNode::kInvalidAXID

Definition at line 63 of file ax_tree_update.h.

◆ nodes

template<typename AXNodeData , typename AXTreeData >
std::vector<AXNodeData> ui::AXTreeUpdateBase< AXNodeData, AXTreeData >::nodes

Definition at line 72 of file ax_tree_update.h.

◆ root_id

template<typename AXNodeData , typename AXTreeData >
int ui::AXTreeUpdateBase< AXNodeData, AXTreeData >::root_id = 0

Definition at line 69 of file ax_tree_update.h.

◆ tree_data

template<typename AXNodeData , typename AXTreeData >
AXTreeData ui::AXTreeUpdateBase< AXNodeData, AXTreeData >::tree_data

Definition at line 56 of file ax_tree_update.h.


The documentation for this struct was generated from the following file: