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::string hint, std::string value, std::string increasedValue, std::string decreasedValue, 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,
  kWrapperInfoIndex,
  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 14 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 130 of file semantics_update_builder.cc.

References flutter::SemanticsUpdate::create().

Referenced by create().

130  {
131  SemanticsUpdate::create(semantics_update_handle, std::move(nodes_),
132  std::move(actions_));
133 }
static void create(Dart_Handle semantics_update_handle, SemanticsNodeUpdates nodes, CustomAccessibilityActionUpdates actions)

◆ create()

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

Definition at line 20 of file semantics_update_builder.h.

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

Referenced by flutter::SemanticsUpdateBuilder_constructor().

20  {
21  return fml::MakeRefCounted<SemanticsUpdateBuilder>();
22  }

◆ RegisterNatives()

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

Definition at line 30 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().

31  {
32  natives->Register({{"SemanticsUpdateBuilder_constructor",
35 }
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 118 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().

121  {
122  CustomAccessibilityAction action;
123  action.id = id;
124  action.overrideId = overrideId;
125  action.label = label;
126  action.hint = hint;
127  actions_[id] = action;
128 }
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::string  hint,
std::string  value,
std::string  increasedValue,
std::string  decreasedValue,
int  textDirection,
const tonic::Float64List &  transform,
const tonic::Int32List &  childrenInTraversalOrder,
const tonic::Int32List &  childrenInHitTestOrder,
const tonic::Int32List &  customAccessibilityActions 
)

Definition at line 41 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::elevation, flutter::flags, flutter::SemanticsNode::flags, FML_CHECK, flutter::SemanticsNode::hint, id, flutter::SemanticsNode::id, flutter::SemanticsNode::increasedValue, flutter::SemanticsNode::label, flutter::SemanticsNode::maxValueLength, flutter::SemanticsNode::platformViewId, 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::transform, value, and flutter::SemanticsNode::value.

Referenced by create().

70  {
71  FML_CHECK(transform.data() && SkScalarsAreFinite(*transform.data(), 9))
72  << "Semantics update transform was not set or not finite.";
73  FML_CHECK(scrollChildren == 0 ||
74  (scrollChildren > 0 && childrenInHitTestOrder.data()))
75  << "Semantics update contained scrollChildren but did not have "
76  "childrenInHitTestOrder";
77  SemanticsNode node;
78  node.id = id;
79  node.flags = flags;
80  node.actions = actions;
81  node.maxValueLength = maxValueLength;
82  node.currentValueLength = currentValueLength;
83  node.textSelectionBase = textSelectionBase;
84  node.textSelectionExtent = textSelectionExtent;
85  node.platformViewId = platformViewId;
86  node.scrollChildren = scrollChildren;
87  node.scrollIndex = scrollIndex;
88  node.scrollPosition = scrollPosition;
89  node.scrollExtentMax = scrollExtentMax;
90  node.scrollExtentMin = scrollExtentMin;
91  node.rect = SkRect::MakeLTRB(left, top, right, bottom);
92  node.elevation = elevation;
93  node.thickness = thickness;
94  node.label = label;
95  node.hint = hint;
96  node.value = value;
97  node.increasedValue = increasedValue;
98  node.decreasedValue = decreasedValue;
99  node.textDirection = textDirection;
100  SkScalar scalarTransform[16];
101  for (int i = 0; i < 16; ++i) {
102  scalarTransform[i] = transform.data()[i];
103  }
104  node.transform = SkM44::ColMajor(scalarTransform);
105  node.childrenInTraversalOrder =
106  std::vector<int32_t>(childrenInTraversalOrder.data(),
107  childrenInTraversalOrder.data() +
108  childrenInTraversalOrder.num_elements());
109  node.childrenInHitTestOrder = std::vector<int32_t>(
110  childrenInHitTestOrder.data(),
111  childrenInHitTestOrder.data() + childrenInHitTestOrder.num_elements());
112  node.customAccessibilityActions = std::vector<int32_t>(
113  localContextActions.data(),
114  localContextActions.data() + localContextActions.num_elements());
115  nodes_[id] = node;
116 }
uint8_t value
#define FML_CHECK(condition)
Definition: logging.h:68
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: