1 #ifndef _RIVE_CLIPPING_SHAPE_BASE_HPP_
2 #define _RIVE_CLIPPING_SHAPE_BASE_HPP_
3 #include "component.hpp"
4 #include "core/field_types/core_bool_type.hpp"
5 #include "core/field_types/core_uint_type.hpp"
8 class ClippingShapeBase : public Component
11 typedef Component Super;
14 static const int typeKey = 42;
16 /// Helper to quickly determine if a core object extends another without
18 bool isTypeOf(int typeKey) const override
22 case ClippingShapeBase::typeKey:
23 case ComponentBase::typeKey:
30 int coreType() const override { return typeKey; }
32 static const int sourceIdPropertyKey = 92;
33 static const int fillRulePropertyKey = 93;
34 static const int isVisiblePropertyKey = 94;
39 bool m_IsVisible = true;
41 inline int sourceId() const { return m_SourceId; }
42 void sourceId(int value)
44 if (m_SourceId == value)
52 inline int fillRule() const { return m_FillRule; }
53 void fillRule(int value)
55 if (m_FillRule == value)
63 inline bool isVisible() const { return m_IsVisible; }
64 void isVisible(bool value)
66 if (m_IsVisible == value)
74 bool deserialize(int propertyKey, BinaryReader& reader) override
78 case sourceIdPropertyKey:
79 m_SourceId = CoreUintType::deserialize(reader);
81 case fillRulePropertyKey:
82 m_FillRule = CoreUintType::deserialize(reader);
84 case isVisiblePropertyKey:
85 m_IsVisible = CoreBoolType::deserialize(reader);
88 return Component::deserialize(propertyKey, reader);
92 virtual void sourceIdChanged() {}
93 virtual void fillRuleChanged() {}
94 virtual void isVisibleChanged() {}