blob: e36d3e429d3b4041a257f39db0248b1b7829ebd5 [file]
#ifndef _RIVE_SKINNABLE_HPP_
#define _RIVE_SKINNABLE_HPP_
#include "rive/rive_types.hpp"
namespace rive
{
class Skin;
class Component;
class Skinnable
{
friend class Skin;
private:
Skin* m_Skin = nullptr;
protected:
void skin(Skin* skin);
public:
virtual ~Skinnable() {}
Skin* skin() const { return m_Skin; }
virtual void markSkinDirty() = 0;
#ifdef WITH_RIVE_EDITOR
/// Skin::editorParentChanged calls these on parent transitions.
void setSkinForEditor(Skin* s) { m_Skin = s; }
void clearSkinIfForEditor(Skin* expected)
{
if (m_Skin == expected)
{
m_Skin = nullptr;
}
}
#endif
static Skinnable* from(Component* component);
};
} // namespace rive
#endif