Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
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 identifier, std::string label, const std::vector< NativeStringAttribute * > &labelAttributes, std::string value, const std::vector< NativeStringAttribute * > &valueAttributes, std::string increasedValue, const std::vector< NativeStringAttribute * > &increasedValueAttributes, std::string decreasedValue, const std::vector< NativeStringAttribute * > &decreasedValueAttributes, std::string hint, const 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, int headingLevel)
 
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 void RetainDartWrappableReference () const =0
 
virtual void ReleaseDartWrappableReference () const =0
 
Dart_Handle CreateDartWrapper (DartState *dart_state)
 
void AssociateWithDartWrapper (Dart_Handle wrappable)
 
void ClearDartWrapper ()
 
Dart_WeakPersistentHandle dart_wrapper () const
 

Static Public Member Functions

static void Create (Dart_Handle wrapper)
 

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 18 of file semantics_update_builder.h.

Constructor & Destructor Documentation

◆ ~SemanticsUpdateBuilder()

flutter::SemanticsUpdateBuilder::~SemanticsUpdateBuilder ( )
overridedefault

Member Function Documentation

◆ build()

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

Definition at line 138 of file semantics_update_builder.cc.

138 {
139 SemanticsUpdate::create(semantics_update_handle, std::move(nodes_),
140 std::move(actions_));
142}
static void create(Dart_Handle semantics_update_handle, SemanticsNodeUpdates nodes, CustomAccessibilityActionUpdates actions)

◆ Create()

static void flutter::SemanticsUpdateBuilder::Create ( Dart_Handle  wrapper)
inlinestatic

Definition at line 24 of file semantics_update_builder.h.

24 {
26 auto res = fml::MakeRefCounted<SemanticsUpdateBuilder>();
27 res->AssociateWithDartWrapper(wrapper);
28 }
static void ThrowIfUIOperationsProhibited()

◆ updateCustomAction()

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

Definition at line 126 of file semantics_update_builder.cc.

129 {
130 CustomAccessibilityAction action;
131 action.id = id;
132 action.overrideId = overrideId;
133 action.label = std::move(label);
134 action.hint = std::move(hint);
135 actions_[id] = action;
136}
const uintptr_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  identifier,
std::string  label,
const std::vector< NativeStringAttribute * > &  labelAttributes,
std::string  value,
const std::vector< NativeStringAttribute * > &  valueAttributes,
std::string  increasedValue,
const std::vector< NativeStringAttribute * > &  increasedValueAttributes,
std::string  decreasedValue,
const std::vector< NativeStringAttribute * > &  decreasedValueAttributes,
std::string  hint,
const 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,
int  headingLevel 
)

Definition at line 33 of file semantics_update_builder.cc.

70 {
71 FML_CHECK(scrollChildren == 0 ||
72 (scrollChildren > 0 && childrenInHitTestOrder.data()))
73 << "Semantics update contained scrollChildren but did not have "
74 "childrenInHitTestOrder";
75 SemanticsNode node;
76 node.id = id;
77 node.flags = flags;
78 node.actions = actions;
79 node.maxValueLength = maxValueLength;
80 node.currentValueLength = currentValueLength;
81 node.textSelectionBase = textSelectionBase;
82 node.textSelectionExtent = textSelectionExtent;
83 node.platformViewId = platformViewId;
84 node.scrollChildren = scrollChildren;
85 node.scrollIndex = scrollIndex;
86 node.scrollPosition = scrollPosition;
87 node.scrollExtentMax = scrollExtentMax;
88 node.scrollExtentMin = scrollExtentMin;
89 node.rect = SkRect::MakeLTRB(SafeNarrow(left), SafeNarrow(top),
90 SafeNarrow(right), SafeNarrow(bottom));
91 node.elevation = elevation;
92 node.thickness = thickness;
93 node.identifier = std::move(identifier);
94 node.label = std::move(label);
95 pushStringAttributes(node.labelAttributes, labelAttributes);
96 node.value = std::move(value);
97 pushStringAttributes(node.valueAttributes, valueAttributes);
98 node.increasedValue = std::move(increasedValue);
99 pushStringAttributes(node.increasedValueAttributes, increasedValueAttributes);
100 node.decreasedValue = std::move(decreasedValue);
101 pushStringAttributes(node.decreasedValueAttributes, decreasedValueAttributes);
102 node.hint = std::move(hint);
103 pushStringAttributes(node.hintAttributes, hintAttributes);
104 node.tooltip = std::move(tooltip);
105 node.textDirection = textDirection;
106 SkScalar scalarTransform[16];
107 for (int i = 0; i < 16; ++i) {
108 scalarTransform[i] = SafeNarrow(transform.data()[i]);
109 }
110 node.transform = SkM44::ColMajor(scalarTransform);
111 node.childrenInTraversalOrder =
112 std::vector<int32_t>(childrenInTraversalOrder.data(),
113 childrenInTraversalOrder.data() +
114 childrenInTraversalOrder.num_elements());
115 node.childrenInHitTestOrder = std::vector<int32_t>(
116 childrenInHitTestOrder.data(),
117 childrenInHitTestOrder.data() + childrenInHitTestOrder.num_elements());
118 node.customAccessibilityActions = std::vector<int32_t>(
119 localContextActions.data(),
120 localContextActions.data() + localContextActions.num_elements());
121 nodes_[id] = node;
122
123 node.headingLevel = headingLevel;
124}
static SkM44 ColMajor(const SkScalar c[16])
Definition: SkM44.h:218
static SkString identifier(const FontFamilyDesc &family, const FontDesc &font)
float SkScalar
Definition: extension.cpp:12
FlutterSemanticsFlag flags
uint8_t value
#define FML_CHECK(condition)
Definition: logging.h:85
void pushStringAttributes(StringAttributes &destination, const std::vector< NativeStringAttribute * > &native_attributes)
static float SafeNarrow(double value)
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition: p3.cpp:47
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

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