Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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< T > 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)
 
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< T >
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
 
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< T >
 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 135 of file semantics_update_builder.cc.

135 {
136 SemanticsUpdate::create(semantics_update_handle, std::move(nodes_),
137 std::move(actions_));
139}
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 123 of file semantics_update_builder.cc.

126 {
127 CustomAccessibilityAction action;
128 action.id = id;
129 action.overrideId = overrideId;
130 action.label = std::move(label);
131 action.hint = std::move(hint);
132 actions_[id] = action;
133}
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 
)

Definition at line 33 of file semantics_update_builder.cc.

69 {
70 FML_CHECK(scrollChildren == 0 ||
71 (scrollChildren > 0 && childrenInHitTestOrder.data()))
72 << "Semantics update contained scrollChildren but did not have "
73 "childrenInHitTestOrder";
74 SemanticsNode node;
75 node.id = id;
76 node.flags = flags;
77 node.actions = actions;
78 node.maxValueLength = maxValueLength;
79 node.currentValueLength = currentValueLength;
80 node.textSelectionBase = textSelectionBase;
81 node.textSelectionExtent = textSelectionExtent;
82 node.platformViewId = platformViewId;
83 node.scrollChildren = scrollChildren;
84 node.scrollIndex = scrollIndex;
85 node.scrollPosition = scrollPosition;
86 node.scrollExtentMax = scrollExtentMax;
87 node.scrollExtentMin = scrollExtentMin;
88 node.rect = SkRect::MakeLTRB(SafeNarrow(left), SafeNarrow(top),
89 SafeNarrow(right), SafeNarrow(bottom));
90 node.elevation = elevation;
91 node.thickness = thickness;
92 node.identifier = std::move(identifier);
93 node.label = std::move(label);
94 pushStringAttributes(node.labelAttributes, labelAttributes);
95 node.value = std::move(value);
96 pushStringAttributes(node.valueAttributes, valueAttributes);
97 node.increasedValue = std::move(increasedValue);
98 pushStringAttributes(node.increasedValueAttributes, increasedValueAttributes);
99 node.decreasedValue = std::move(decreasedValue);
100 pushStringAttributes(node.decreasedValueAttributes, decreasedValueAttributes);
101 node.hint = std::move(hint);
102 pushStringAttributes(node.hintAttributes, hintAttributes);
103 node.tooltip = std::move(tooltip);
104 node.textDirection = textDirection;
105 SkScalar scalarTransform[16];
106 for (int i = 0; i < 16; ++i) {
107 scalarTransform[i] = SafeNarrow(transform.data()[i]);
108 }
109 node.transform = SkM44::ColMajor(scalarTransform);
110 node.childrenInTraversalOrder =
111 std::vector<int32_t>(childrenInTraversalOrder.data(),
112 childrenInTraversalOrder.data() +
113 childrenInTraversalOrder.num_elements());
114 node.childrenInHitTestOrder = std::vector<int32_t>(
115 childrenInHitTestOrder.data(),
116 childrenInHitTestOrder.data() + childrenInHitTestOrder.num_elements());
117 node.customAccessibilityActions = std::vector<int32_t>(
118 localContextActions.data(),
119 localContextActions.data() + localContextActions.num_elements());
120 nodes_[id] = node;
121}
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
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
#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: