Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
skottie_utils::CustomPropertyManager Class Referencefinal

#include <SkottieUtils.h>

Classes

struct  MarkerInfo
 
class  MarkerInterceptor
 
class  PropertyInterceptor
 

Public Types

enum class  Mode { kCollapseProperties , kNamespacedProperties }
 
using PropKey = std::string
 

Public Member Functions

 CustomPropertyManager (Mode=Mode::kNamespacedProperties, const char *prefix=nullptr)
 
 ~CustomPropertyManager ()
 
std::vector< PropKeygetColorProps () const
 
skottie::ColorPropertyValue getColor (const PropKey &) const
 
std::unique_ptr< skottie::ColorPropertyHandlegetColorHandle (const PropKey &, size_t) const
 
bool setColor (const PropKey &, const skottie::ColorPropertyValue &)
 
std::vector< PropKeygetOpacityProps () const
 
skottie::OpacityPropertyValue getOpacity (const PropKey &) const
 
std::unique_ptr< skottie::OpacityPropertyHandlegetOpacityHandle (const PropKey &, size_t) const
 
bool setOpacity (const PropKey &, const skottie::OpacityPropertyValue &)
 
std::vector< PropKeygetTransformProps () const
 
skottie::TransformPropertyValue getTransform (const PropKey &) const
 
std::unique_ptr< skottie::TransformPropertyHandlegetTransformHandle (const PropKey &, size_t) const
 
bool setTransform (const PropKey &, const skottie::TransformPropertyValue &)
 
std::vector< PropKeygetTextProps () const
 
skottie::TextPropertyValue getText (const PropKey &) const
 
std::unique_ptr< skottie::TextPropertyHandlegetTextHandle (const PropKey &, size_t index) const
 
bool setText (const PropKey &, const skottie::TextPropertyValue &)
 
const std::vector< MarkerInfo > & markers () const
 
sk_sp< skottie::PropertyObservergetPropertyObserver () const
 
sk_sp< skottie::MarkerObservergetMarkerObserver () const
 

Detailed Description

CustomPropertyManager implements a property management scheme where color/opacity/transform attributes are grouped and manipulated by name (one-to-many mapping).

Attach to an Animation::Builder using the utility methods below to intercept properties and markers at build time.

Definition at line 46 of file SkottieUtils.h.

Member Typedef Documentation

◆ PropKey

Definition at line 58 of file SkottieUtils.h.

Member Enumeration Documentation

◆ Mode

Enumerator
kCollapseProperties 
kNamespacedProperties 

Definition at line 48 of file SkottieUtils.h.

48 {
49 kCollapseProperties, // keys ignore the ancestor chain and are
50 // grouped based on the local node name
51 kNamespacedProperties, // keys include the ancestor node names (no grouping)
52 };

Constructor & Destructor Documentation

◆ CustomPropertyManager()

skottie_utils::CustomPropertyManager::CustomPropertyManager ( Mode  mode = Mode::kNamespacedProperties,
const char *  prefix = nullptr 
)
explicit

Definition at line 97 of file SkottieUtils.cpp.

98 : fMode(mode)
99 , fPrefix(prefix ? prefix : "$")
100 , fPropertyInterceptor(sk_make_sp<PropertyInterceptor>(this))
101 , fMarkerInterceptor(sk_make_sp<MarkerInterceptor>(this)) {}
sk_sp< T > sk_make_sp(Args &&... args)
Definition SkRefCnt.h:371

◆ ~CustomPropertyManager()

skottie_utils::CustomPropertyManager::~CustomPropertyManager ( )
default

Member Function Documentation

◆ getColor()

skottie::ColorPropertyValue skottie_utils::CustomPropertyManager::getColor ( const PropKey key) const

Definition at line 178 of file SkottieUtils.cpp.

178 {
179 return this->get<skottie::ColorPropertyValue>(key, fColorMap);
180}

◆ getColorHandle()

std::unique_ptr< skottie::ColorPropertyHandle > skottie_utils::CustomPropertyManager::getColorHandle ( const PropKey key,
size_t  index 
) const

Definition at line 183 of file SkottieUtils.cpp.

183 {
184 return this->getHandle(key, index, fColorMap);
185}

◆ getColorProps()

std::vector< CustomPropertyManager::PropKey > skottie_utils::CustomPropertyManager::getColorProps ( ) const

Definition at line 174 of file SkottieUtils.cpp.

174 {
175 return this->getProps(fColorMap);
176}

◆ getMarkerObserver()

sk_sp< skottie::MarkerObserver > skottie_utils::CustomPropertyManager::getMarkerObserver ( ) const

Definition at line 119 of file SkottieUtils.cpp.

119 {
120 return fMarkerInterceptor;
121}

◆ getOpacity()

skottie::OpacityPropertyValue skottie_utils::CustomPropertyManager::getOpacity ( const PropKey key) const

Definition at line 196 of file SkottieUtils.cpp.

196 {
197 return this->get<skottie::OpacityPropertyValue>(key, fOpacityMap);
198}

◆ getOpacityHandle()

std::unique_ptr< skottie::OpacityPropertyHandle > skottie_utils::CustomPropertyManager::getOpacityHandle ( const PropKey key,
size_t  index 
) const

Definition at line 201 of file SkottieUtils.cpp.

201 {
202 return this->getHandle(key, index, fOpacityMap);
203}

◆ getOpacityProps()

std::vector< CustomPropertyManager::PropKey > skottie_utils::CustomPropertyManager::getOpacityProps ( ) const

Definition at line 192 of file SkottieUtils.cpp.

192 {
193 return this->getProps(fOpacityMap);
194}

◆ getPropertyObserver()

sk_sp< skottie::PropertyObserver > skottie_utils::CustomPropertyManager::getPropertyObserver ( ) const

Definition at line 115 of file SkottieUtils.cpp.

115 {
116 return fPropertyInterceptor;
117}

◆ getText()

skottie::TextPropertyValue skottie_utils::CustomPropertyManager::getText ( const PropKey key) const

Definition at line 233 of file SkottieUtils.cpp.

233 {
234 return this->get<skottie::TextPropertyValue>(key, fTextMap);
235}

◆ getTextHandle()

std::unique_ptr< skottie::TextPropertyHandle > skottie_utils::CustomPropertyManager::getTextHandle ( const PropKey key,
size_t  index 
) const

Definition at line 238 of file SkottieUtils.cpp.

238 {
239 return this->getHandle(key, index, fTextMap);
240}

◆ getTextProps()

std::vector< CustomPropertyManager::PropKey > skottie_utils::CustomPropertyManager::getTextProps ( ) const

Definition at line 229 of file SkottieUtils.cpp.

229 {
230 return this->getProps(fTextMap);
231}

◆ getTransform()

skottie::TransformPropertyValue skottie_utils::CustomPropertyManager::getTransform ( const PropKey key) const

Definition at line 214 of file SkottieUtils.cpp.

214 {
215 return this->get<skottie::TransformPropertyValue>(key, fTransformMap);
216}

◆ getTransformHandle()

std::unique_ptr< skottie::TransformPropertyHandle > skottie_utils::CustomPropertyManager::getTransformHandle ( const PropKey key,
size_t  index 
) const

Definition at line 219 of file SkottieUtils.cpp.

219 {
220 return this->getHandle(key, index, fTransformMap);
221}

◆ getTransformProps()

std::vector< CustomPropertyManager::PropKey > skottie_utils::CustomPropertyManager::getTransformProps ( ) const

Definition at line 210 of file SkottieUtils.cpp.

210 {
211 return this->getProps(fTransformMap);
212}

◆ markers()

const std::vector< MarkerInfo > & skottie_utils::CustomPropertyManager::markers ( ) const
inline

Definition at line 85 of file SkottieUtils.h.

85{ return fMarkers; }

◆ setColor()

bool skottie_utils::CustomPropertyManager::setColor ( const PropKey key,
const skottie::ColorPropertyValue c 
)

Definition at line 187 of file SkottieUtils.cpp.

187 {
188 return this->set(key, c, fColorMap);
189}

◆ setOpacity()

bool skottie_utils::CustomPropertyManager::setOpacity ( const PropKey key,
const skottie::OpacityPropertyValue o 
)

Definition at line 205 of file SkottieUtils.cpp.

205 {
206 return this->set(key, o, fOpacityMap);
207}

◆ setText()

bool skottie_utils::CustomPropertyManager::setText ( const PropKey key,
const skottie::TextPropertyValue o 
)

Definition at line 242 of file SkottieUtils.cpp.

242 {
243 return this->set(key, o, fTextMap);
244}

◆ setTransform()

bool skottie_utils::CustomPropertyManager::setTransform ( const PropKey key,
const skottie::TransformPropertyValue t 
)

Definition at line 223 of file SkottieUtils.cpp.

224 {
225 return this->set(key, t, fTransformMap);
226}

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