Flutter Engine
flutter::SemanticsUpdateBuilder Class Reference

#include <semantics_update_builder.h>

Inheritance diagram for flutter::SemanticsUpdateBuilder:
flutter::RefCountedDartWrappable< SemanticsUpdateBuilder > fml::RefCountedThreadSafe< SemanticsUpdateBuilder > tonic::DartWrappable fml::internal::RefCountedThreadSafeBase

Public Member Functions

 ~SemanticsUpdateBuilder () override
 
void updateNode (int id, int flags, int actions, int maxValueLength, int currentValueLength, int textSelectionBase, int textSelectionExtent, int platformViewId, int scrollChildren, int scrollIndex, double scrollPosition, double scrollExtentMax, double scrollExtentMin, double left, double top, double right, double bottom, double elevation, double thickness, std::string label, std::vector< NativeStringAttribute *> labelAttributes, std::string value, std::vector< NativeStringAttribute *> valueAttributes, std::string increasedValue, std::vector< NativeStringAttribute *> increasedValueAttributes, std::string decreasedValue, std::vector< NativeStringAttribute *> decreasedValueAttributes, std::string hint, std::vector< NativeStringAttribute *> hintAttributes, std::string tooltip, int textDirection, const tonic::Float64List &transform, const tonic::Int32List &childrenInTraversalOrder, const tonic::Int32List &childrenInHitTestOrder, const tonic::Int32List &customAccessibilityActions)
 
void updateCustomAction (int id, std::string label, std::string hint, int overrideId)
 
void build (Dart_Handle semantics_update_handle)
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< SemanticsUpdateBuilder >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< SemanticsUpdateBuilder >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 
- Public Member Functions inherited from tonic::DartWrappable
 DartWrappable ()
 
virtual const DartWrapperInfoGetDartWrapperInfo () const =0
 
virtual size_t GetAllocationSize () const
 
Dart_Handle CreateDartWrapper (DartState *dart_state)
 
void AssociateWithDartWrapper (Dart_Handle wrappable)
 
void ClearDartWrapper ()
 
Dart_WeakPersistentHandle dart_wrapper () const
 

Static Public Member Functions

static fml::RefPtr< SemanticsUpdateBuildercreate ()
 
static void RegisterNatives (tonic::DartLibraryNatives *natives)
 

Additional Inherited Members

- Public Types inherited from tonic::DartWrappable
enum  DartNativeFields {
  kPeerIndex,
  kNumberOfNativeFields
}
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< SemanticsUpdateBuilder >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 
- Protected Member Functions inherited from tonic::DartWrappable
virtual ~DartWrappable ()
 
- Static Protected Member Functions inherited from tonic::DartWrappable
static Dart_PersistentHandle GetTypeForWrapper (tonic::DartState *dart_state, const tonic::DartWrapperInfo &wrapper_info)
 

Detailed Description

Definition at line 17 of file semantics_update_builder.h.

Constructor & Destructor Documentation

◆ ~SemanticsUpdateBuilder()

flutter::SemanticsUpdateBuilder::~SemanticsUpdateBuilder ( )
overridedefault

Referenced by create(), and RegisterNatives().

Member Function Documentation

◆ build()

void flutter::SemanticsUpdateBuilder::build ( Dart_Handle  semantics_update_handle)

Definition at line 150 of file semantics_update_builder.cc.

References flutter::SemanticsUpdate::create().

Referenced by create().

150  {
151  SemanticsUpdate::create(semantics_update_handle, std::move(nodes_),
152  std::move(actions_));
153 }
static void create(Dart_Handle semantics_update_handle, SemanticsNodeUpdates nodes, CustomAccessibilityActionUpdates actions)

◆ create()

static fml::RefPtr<SemanticsUpdateBuilder> flutter::SemanticsUpdateBuilder::create ( )
inlinestatic

Definition at line 23 of file semantics_update_builder.h.

References build(), flutter::flags, RegisterNatives(), flutter::transform, updateCustomAction(), updateNode(), value, and ~SemanticsUpdateBuilder().

Referenced by flutter::SemanticsUpdateBuilder_constructor().

23  {
24  return fml::MakeRefCounted<SemanticsUpdateBuilder>();
25  }

◆ RegisterNatives()

void flutter::SemanticsUpdateBuilder::RegisterNatives ( tonic::DartLibraryNatives natives)
static

Definition at line 38 of file semantics_update_builder.cc.

References DART_REGISTER_NATIVE, FOR_EACH_BINDING, flutter::SemanticsUpdateBuilder_constructor(), and ~SemanticsUpdateBuilder().

Referenced by create(), and flutter::DartUI::InitForGlobal().

39  {
40  natives->Register({{"SemanticsUpdateBuilder_constructor",
43 }
void Register(std::initializer_list< Entry > entries)
static void SemanticsUpdateBuilder_constructor(Dart_NativeArguments args)
#define FOR_EACH_BINDING(V)
#define DART_REGISTER_NATIVE(CLASS, METHOD)

◆ updateCustomAction()

void flutter::SemanticsUpdateBuilder::updateCustomAction ( int  id,
std::string  label,
std::string  hint,
int  overrideId 
)

Definition at line 138 of file semantics_update_builder.cc.

References action, flutter::CustomAccessibilityAction::hint, flutter::CustomAccessibilityAction::id, id, flutter::CustomAccessibilityAction::label, and flutter::CustomAccessibilityAction::overrideId.

Referenced by create().

141  {
142  CustomAccessibilityAction action;
143  action.id = id;
144  action.overrideId = overrideId;
145  action.label = label;
146  action.hint = hint;
147  actions_[id] = action;
148 }
SemanticsAction action
int32_t id

◆ updateNode()

void flutter::SemanticsUpdateBuilder::updateNode ( int  id,
int  flags,
int  actions,
int  maxValueLength,
int  currentValueLength,
int  textSelectionBase,
int  textSelectionExtent,
int  platformViewId,
int  scrollChildren,
int  scrollIndex,
double  scrollPosition,
double  scrollExtentMax,
double  scrollExtentMin,
double  left,
double  top,
double  right,
double  bottom,
double  elevation,
double  thickness,
std::string  label,
std::vector< NativeStringAttribute *>  labelAttributes,
std::string  value,
std::vector< NativeStringAttribute *>  valueAttributes,
std::string  increasedValue,
std::vector< NativeStringAttribute *>  increasedValueAttributes,
std::string  decreasedValue,
std::vector< NativeStringAttribute *>  decreasedValueAttributes,
std::string  hint,
std::vector< NativeStringAttribute *>  hintAttributes,
std::string  tooltip,
int  textDirection,
const tonic::Float64List &  transform,
const tonic::Int32List &  childrenInTraversalOrder,
const tonic::Int32List &  childrenInHitTestOrder,
const tonic::Int32List &  customAccessibilityActions 
)

Definition at line 49 of file semantics_update_builder.cc.

References flutter::SemanticsNode::actions, flutter::SemanticsNode::childrenInHitTestOrder, flutter::SemanticsNode::childrenInTraversalOrder, flutter::SemanticsNode::currentValueLength, flutter::SemanticsNode::customAccessibilityActions, flutter::SemanticsNode::decreasedValue, flutter::SemanticsNode::decreasedValueAttributes, flutter::SemanticsNode::elevation, flutter::flags, flutter::SemanticsNode::flags, FML_CHECK, flutter::SemanticsNode::hint, flutter::SemanticsNode::hintAttributes, id, flutter::SemanticsNode::id, flutter::SemanticsNode::increasedValue, flutter::SemanticsNode::increasedValueAttributes, flutter::SemanticsNode::label, flutter::SemanticsNode::labelAttributes, flutter::SemanticsNode::maxValueLength, node, flutter::SemanticsNode::platformViewId, flutter::pushStringAttributes(), flutter::SemanticsNode::rect, flutter::SemanticsNode::scrollChildren, flutter::SemanticsNode::scrollExtentMax, flutter::SemanticsNode::scrollExtentMin, flutter::SemanticsNode::scrollIndex, flutter::SemanticsNode::scrollPosition, flutter::SemanticsNode::textDirection, flutter::SemanticsNode::textSelectionBase, flutter::SemanticsNode::textSelectionExtent, flutter::SemanticsNode::thickness, flutter::SemanticsNode::tooltip, flutter::SemanticsNode::transform, value, flutter::SemanticsNode::value, and flutter::SemanticsNode::valueAttributes.

Referenced by create().

84  {
85  FML_CHECK(transform.data() && SkScalarsAreFinite(*transform.data(), 9))
86  << "Semantics update transform was not set or not finite.";
87  FML_CHECK(scrollChildren == 0 ||
88  (scrollChildren > 0 && childrenInHitTestOrder.data()))
89  << "Semantics update contained scrollChildren but did not have "
90  "childrenInHitTestOrder";
91  SemanticsNode node;
92  node.id = id;
93  node.flags = flags;
94  node.actions = actions;
95  node.maxValueLength = maxValueLength;
96  node.currentValueLength = currentValueLength;
97  node.textSelectionBase = textSelectionBase;
98  node.textSelectionExtent = textSelectionExtent;
99  node.platformViewId = platformViewId;
100  node.scrollChildren = scrollChildren;
101  node.scrollIndex = scrollIndex;
102  node.scrollPosition = scrollPosition;
103  node.scrollExtentMax = scrollExtentMax;
104  node.scrollExtentMin = scrollExtentMin;
105  node.rect = SkRect::MakeLTRB(left, top, right, bottom);
106  node.elevation = elevation;
107  node.thickness = thickness;
108  node.label = label;
109  pushStringAttributes(node.labelAttributes, labelAttributes);
110  node.value = value;
111  pushStringAttributes(node.valueAttributes, valueAttributes);
112  node.increasedValue = increasedValue;
113  pushStringAttributes(node.increasedValueAttributes, increasedValueAttributes);
114  node.decreasedValue = decreasedValue;
115  pushStringAttributes(node.decreasedValueAttributes, decreasedValueAttributes);
116  node.hint = hint;
117  pushStringAttributes(node.hintAttributes, hintAttributes);
118  node.tooltip = tooltip;
119  node.textDirection = textDirection;
120  SkScalar scalarTransform[16];
121  for (int i = 0; i < 16; ++i) {
122  scalarTransform[i] = transform.data()[i];
123  }
124  node.transform = SkM44::ColMajor(scalarTransform);
125  node.childrenInTraversalOrder =
126  std::vector<int32_t>(childrenInTraversalOrder.data(),
127  childrenInTraversalOrder.data() +
128  childrenInTraversalOrder.num_elements());
129  node.childrenInHitTestOrder = std::vector<int32_t>(
130  childrenInHitTestOrder.data(),
131  childrenInHitTestOrder.data() + childrenInHitTestOrder.num_elements());
132  node.customAccessibilityActions = std::vector<int32_t>(
133  localContextActions.data(),
134  localContextActions.data() + localContextActions.num_elements());
135  nodes_[id] = node;
136 }
uint8_t value
const FlutterSemanticsNode * node
Definition: fl_view.cc:83
int32_t id
The unique identifier for this node.
Definition: embedder.h:798
#define FML_CHECK(condition)
Definition: logging.h:68
void pushStringAttributes(StringAttributes &destination, const std::vector< NativeStringAttribute *> &native_attributes)
int32_t id
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart flags
Definition: switches.h:66

The documentation for this class was generated from the following files: