Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skottie_utils::CustomPropertyManager::PropertyInterceptor Class Referencefinal
Inheritance diagram for skottie_utils::CustomPropertyManager::PropertyInterceptor:
skottie::PropertyObserver SkRefCnt SkRefCntBase

Public Member Functions

 PropertyInterceptor (CustomPropertyManager *mgr)
 
void onColorProperty (const char node_name[], const LazyHandle< skottie::ColorPropertyHandle > &c) override
 
void onOpacityProperty (const char node_name[], const LazyHandle< skottie::OpacityPropertyHandle > &o) override
 
void onTransformProperty (const char node_name[], const LazyHandle< skottie::TransformPropertyHandle > &t) override
 
void onTextProperty (const char node_name[], const LazyHandle< skottie::TextPropertyHandle > &t) override
 
void onEnterNode (const char node_name[], PropertyObserver::NodeType node_type) override
 
void onLeavingNode (const char node_name[], PropertyObserver::NodeType node_type) override
 
- Public Member Functions inherited from skottie::PropertyObserver
virtual void onColorProperty (const char node_name[], const LazyHandle< ColorPropertyHandle > &)
 
virtual void onOpacityProperty (const char node_name[], const LazyHandle< OpacityPropertyHandle > &)
 
virtual void onTextProperty (const char node_name[], const LazyHandle< TextPropertyHandle > &)
 
virtual void onTransformProperty (const char node_name[], const LazyHandle< TransformPropertyHandle > &)
 
virtual void onEnterNode (const char node_name[], NodeType node_type)
 
virtual void onLeavingNode (const char node_name[], NodeType node_type)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Additional Inherited Members

- Public Types inherited from skottie::PropertyObserver
enum class  NodeType { COMPOSITION , LAYER , EFFECT , OTHER }
 
template<typename T >
using LazyHandle = std::function< std::unique_ptr< T >()>
 

Detailed Description

Definition at line 24 of file SkottieUtils.cpp.

Constructor & Destructor Documentation

◆ PropertyInterceptor()

skottie_utils::CustomPropertyManager::PropertyInterceptor::PropertyInterceptor ( CustomPropertyManager mgr)
inlineexplicit

Definition at line 26 of file SkottieUtils.cpp.

26: fMgr(mgr) {}

Member Function Documentation

◆ onColorProperty()

void skottie_utils::CustomPropertyManager::PropertyInterceptor::onColorProperty ( const char  node_name[],
const LazyHandle< skottie::ColorPropertyHandle > &  c 
)
inlineoverride

Definition at line 28 of file SkottieUtils.cpp.

29 {
30 const auto key = fMgr->acceptKey(node_name, ".Color");
31 if (!key.empty()) {
32 fMgr->fColorMap[key].push_back(c());
33 }
34 }

◆ onEnterNode()

void skottie_utils::CustomPropertyManager::PropertyInterceptor::onEnterNode ( const char  node_name[],
PropertyObserver::NodeType  node_type 
)
inlineoverride

Definition at line 60 of file SkottieUtils.cpp.

60 {
61 if (node_name == nullptr) {
62 return;
63 }
64 fMgr->fCurrentNode =
65 fMgr->fCurrentNode.empty() ? node_name : fMgr->fCurrentNode + "." + node_name;
66 }

◆ onLeavingNode()

void skottie_utils::CustomPropertyManager::PropertyInterceptor::onLeavingNode ( const char  node_name[],
PropertyObserver::NodeType  node_type 
)
inlineoverride

Definition at line 68 of file SkottieUtils.cpp.

68 {
69 if (node_name == nullptr) {
70 return;
71 }
72 auto length = strlen(node_name);
73 fMgr->fCurrentNode =
74 fMgr->fCurrentNode.length() > length
75 ? fMgr->fCurrentNode.substr(
76 0, fMgr->fCurrentNode.length() - strlen(node_name) - 1)
77 : "";
78 }
size_t length

◆ onOpacityProperty()

void skottie_utils::CustomPropertyManager::PropertyInterceptor::onOpacityProperty ( const char  node_name[],
const LazyHandle< skottie::OpacityPropertyHandle > &  o 
)
inlineoverride

Definition at line 36 of file SkottieUtils.cpp.

37 {
38 const auto key = fMgr->acceptKey(node_name, ".Opacity");
39 if (!key.empty()) {
40 fMgr->fOpacityMap[key].push_back(o());
41 }
42 }

◆ onTextProperty()

void skottie_utils::CustomPropertyManager::PropertyInterceptor::onTextProperty ( const char  node_name[],
const LazyHandle< skottie::TextPropertyHandle > &  t 
)
inlineoverride

Definition at line 52 of file SkottieUtils.cpp.

53 {
54 const auto key = fMgr->acceptKey(node_name, ".Text");
55 if (!key.empty()) {
56 fMgr->fTextMap[key].push_back(t());
57 }
58 }

◆ onTransformProperty()

void skottie_utils::CustomPropertyManager::PropertyInterceptor::onTransformProperty ( const char  node_name[],
const LazyHandle< skottie::TransformPropertyHandle > &  t 
)
inlineoverride

Definition at line 44 of file SkottieUtils.cpp.

45 {
46 const auto key = fMgr->acceptKey(node_name, ".Transform");
47 if (!key.empty()) {
48 fMgr->fTransformMap[key].push_back(t());
49 }
50 }

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