submodule: add rive-cpp to rive-tizen as submodule
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / shapes / paint / stroke_base.hpp
1 #ifndef _RIVE_STROKE_BASE_HPP_
2 #define _RIVE_STROKE_BASE_HPP_
3 #include "core/field_types/core_bool_type.hpp"
4 #include "core/field_types/core_double_type.hpp"
5 #include "core/field_types/core_uint_type.hpp"
6 #include "shapes/paint/shape_paint.hpp"
7 namespace rive
8 {
9         class StrokeBase : public ShapePaint
10         {
11         protected:
12                 typedef ShapePaint Super;
13
14         public:
15                 static const int typeKey = 24;
16
17                 /// Helper to quickly determine if a core object extends another without
18                 /// RTTI at runtime.
19                 bool isTypeOf(int typeKey) const override
20                 {
21                         switch (typeKey)
22                         {
23                                 case StrokeBase::typeKey:
24                                 case ShapePaintBase::typeKey:
25                                 case ContainerComponentBase::typeKey:
26                                 case ComponentBase::typeKey:
27                                         return true;
28                                 default:
29                                         return false;
30                         }
31                 }
32
33                 int coreType() const override { return typeKey; }
34
35                 static const int thicknessPropertyKey = 47;
36                 static const int capPropertyKey = 48;
37                 static const int joinPropertyKey = 49;
38                 static const int transformAffectsStrokePropertyKey = 50;
39
40         private:
41                 float m_Thickness = 1;
42                 int m_Cap = 0;
43                 int m_Join = 0;
44                 bool m_TransformAffectsStroke = true;
45         public:
46                 inline float thickness() const { return m_Thickness; }
47                 void thickness(float value)
48                 {
49                         if (m_Thickness == value)
50                         {
51                                 return;
52                         }
53                         m_Thickness = value;
54                         thicknessChanged();
55                 }
56
57                 inline int cap() const { return m_Cap; }
58                 void cap(int value)
59                 {
60                         if (m_Cap == value)
61                         {
62                                 return;
63                         }
64                         m_Cap = value;
65                         capChanged();
66                 }
67
68                 inline int join() const { return m_Join; }
69                 void join(int value)
70                 {
71                         if (m_Join == value)
72                         {
73                                 return;
74                         }
75                         m_Join = value;
76                         joinChanged();
77                 }
78
79                 inline bool transformAffectsStroke() const
80                 {
81                         return m_TransformAffectsStroke;
82                 }
83                 void transformAffectsStroke(bool value)
84                 {
85                         if (m_TransformAffectsStroke == value)
86                         {
87                                 return;
88                         }
89                         m_TransformAffectsStroke = value;
90                         transformAffectsStrokeChanged();
91                 }
92
93                 bool deserialize(int propertyKey, BinaryReader& reader) override
94                 {
95                         switch (propertyKey)
96                         {
97                                 case thicknessPropertyKey:
98                                         m_Thickness = CoreDoubleType::deserialize(reader);
99                                         return true;
100                                 case capPropertyKey:
101                                         m_Cap = CoreUintType::deserialize(reader);
102                                         return true;
103                                 case joinPropertyKey:
104                                         m_Join = CoreUintType::deserialize(reader);
105                                         return true;
106                                 case transformAffectsStrokePropertyKey:
107                                         m_TransformAffectsStroke =
108                                             CoreBoolType::deserialize(reader);
109                                         return true;
110                         }
111                         return ShapePaint::deserialize(propertyKey, reader);
112                 }
113
114         protected:
115                 virtual void thicknessChanged() {}
116                 virtual void capChanged() {}
117                 virtual void joinChanged() {}
118                 virtual void transformAffectsStrokeChanged() {}
119         };
120 } // namespace rive
121
122 #endif