1 #ifndef _RIVE_DRAW_RULES_BASE_HPP_
2 #define _RIVE_DRAW_RULES_BASE_HPP_
3 #include "container_component.hpp"
4 #include "core/field_types/core_uint_type.hpp"
7 class DrawRulesBase : public ContainerComponent
10 typedef ContainerComponent Super;
13 static const uint16_t typeKey = 49;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case DrawRulesBase::typeKey:
22 case ContainerComponentBase::typeKey:
23 case ComponentBase::typeKey:
30 uint16_t coreType() const override { return typeKey; }
32 static const uint16_t drawTargetIdPropertyKey = 121;
35 int m_DrawTargetId = -1;
37 inline int drawTargetId() const { return m_DrawTargetId; }
38 void drawTargetId(int value)
40 if (m_DrawTargetId == value)
44 m_DrawTargetId = value;
45 drawTargetIdChanged();
48 Core* clone() const override;
49 void copy(const DrawRulesBase& object)
51 m_DrawTargetId = object.m_DrawTargetId;
52 ContainerComponent::copy(object);
55 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
59 case drawTargetIdPropertyKey:
60 m_DrawTargetId = CoreUintType::deserialize(reader);
63 return ContainerComponent::deserialize(propertyKey, reader);
67 virtual void drawTargetIdChanged() {}