Skia
2D Graphics Library
skottie::PropertyObserver Class Reference

A PropertyObserver can be used to track and manipulate certain properties of "interesting" Lottie nodes. More...

#include <SkottieProperty.h>

Inheritance diagram for skottie::PropertyObserver:

Public Types

enum class  NodeType { COMPOSITION , LAYER , EFFECT , OTHER }
 
template<typename T >
using LazyHandle = std::function< std::unique_ptr< T >()>
 

Public Member Functions

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)
 
bool unique () const
 May return true if the caller is the only owner. More...
 
void ref () const
 Increment the reference count. More...
 
void unref () const
 Decrement the reference count. More...
 

Detailed Description

A PropertyObserver can be used to track and manipulate certain properties of "interesting" Lottie nodes.

When registered with an animation builder, PropertyObserver receives notifications for various properties of layer and shape nodes. The |node_name| argument corresponds to the name ("nm") node property.

Member Typedef Documentation

◆ LazyHandle

template<typename T >
using skottie::PropertyObserver::LazyHandle = std::function<std::unique_ptr<T>()>

Member Enumeration Documentation

◆ NodeType

Enumerator
COMPOSITION 
LAYER 
EFFECT 
OTHER 

Member Function Documentation

◆ onColorProperty()

virtual void skottie::PropertyObserver::onColorProperty ( const char  node_name[],
const LazyHandle< ColorPropertyHandle > &   
)
virtual

◆ onEnterNode()

virtual void skottie::PropertyObserver::onEnterNode ( const char  node_name[],
NodeType  node_type 
)
virtual

◆ onLeavingNode()

virtual void skottie::PropertyObserver::onLeavingNode ( const char  node_name[],
NodeType  node_type 
)
virtual

◆ onOpacityProperty()

virtual void skottie::PropertyObserver::onOpacityProperty ( const char  node_name[],
const LazyHandle< OpacityPropertyHandle > &   
)
virtual

◆ onTextProperty()

virtual void skottie::PropertyObserver::onTextProperty ( const char  node_name[],
const LazyHandle< TextPropertyHandle > &   
)
virtual

◆ onTransformProperty()

virtual void skottie::PropertyObserver::onTransformProperty ( const char  node_name[],
const LazyHandle< TransformPropertyHandle > &   
)
virtual

◆ ref()

void SkRefCntBase::ref ( ) const
inlineinherited

Increment the reference count.

Must be balanced by a call to unref().

◆ unique()

bool SkRefCntBase::unique ( ) const
inlineinherited

May return true if the caller is the only owner.

Ensures that all previous owner's actions are complete.

◆ unref()

void SkRefCntBase::unref ( ) const
inlineinherited

Decrement the reference count.

If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.


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