remove redundant apis.
[platform/core/uifw/lottie-player.git] / inc / lottiecommon.h
1 #ifndef _LOTTIE_COMMON_H_
2 #define _LOTTIE_COMMON_H_
3
4 #ifdef _WIN32
5 #ifdef LOT_BUILD
6 #ifdef DLL_EXPORT
7 #define LOT_EXPORT __declspec(dllexport)
8 #else
9 #define LOT_EXPORT
10 #endif
11 #else
12 #define LOT_EXPORT __declspec(dllimport)
13 #endif
14 #else
15 #ifdef __GNUC__
16 #if __GNUC__ >= 4
17 #define LOT_EXPORT __attribute__((visibility("default")))
18 #else
19 #define LOT_EXPORT
20 #endif
21 #else
22 #define LOT_EXPORT
23 #endif
24 #endif
25
26
27 /**
28  * @brief Enumeration for Lottie Player error code.
29  */
30 typedef enum
31 {
32    //TODO: Coding convention??
33     LOT_ANIMATION_ERROR_NONE = 0,
34     LOT_ANIMATION_ERROR_NOT_PERMITTED,
35     LOT_ANIMATION_ERROR_OUT_OF_MEMORY,
36     LOT_ANIMATION_ERROR_INVALID_PARAMETER,
37     LOT_ANIMATION_ERROR_RESULT_OUT_OF_RANGE,
38     LOT_ANIMATION_ERROR_ALREADY_IN_PROGRESS,
39     LOT_ANIMATION_ERROR_UNKNOWN
40 } LOTErrorType;
41
42 typedef enum
43 {
44     BrushSolid = 0,
45     BrushGradient
46 } LOTBrushType;
47
48 typedef enum
49 {
50     FillEvenOdd = 0,
51     FillWinding
52 } LOTFillRule;
53
54 typedef enum
55 {
56     JoinMiter = 0,
57     JoinBevel,
58     JoinRound
59 } LOTJoinStyle;
60
61 typedef enum
62 {
63     CapFlat = 0,
64     CapSquare,
65     CapRound
66 } LOTCapStyle;
67
68 typedef enum
69 {
70     GradientLinear = 0,
71     GradientRadial
72 } LOTGradientType;
73
74 typedef struct LOTGradientStop
75 {
76     float         pos;
77     unsigned char r, g, b, a;
78 } LOTGradientStop;
79
80 typedef enum
81 {
82     MaskModeAdd = 0,
83     MaskModeSubstract,
84     MaskModeIntersect,
85     MaskModeDifference
86 } LOTMaskMode;
87
88 typedef struct LOTMask {
89     struct {
90         const float *ptPtr;
91         int          ptCount;
92         const char*  elmPtr;
93         int          elmCount;
94     } mPath;
95     LOTMaskMode mMode;
96 }LOTMask;
97
98 typedef enum
99 {
100     MatteNone = 0,
101     MatteAlpha,
102     MatteAlphaInv,
103     MatteLuma,
104     MatteLumaInv
105 } LOTMatteType;
106
107 typedef struct LOTNode {
108
109 #define ChangeFlagNone 0x0000
110 #define ChangeFlagPath 0x0001
111 #define ChangeFlagPaint 0x0010
112 #define ChangeFlagAll (ChangeFlagPath & ChangeFlagPaint)
113
114     struct {
115         const float *ptPtr;
116         int          ptCount;
117         const char*  elmPtr;
118         int          elmCount;
119     } mPath;
120
121     struct {
122         unsigned char r, g, b, a;
123     } mColor;
124
125     struct {
126         bool      enable;
127         int       width;
128         LOTCapStyle  cap;
129         LOTJoinStyle join;
130         int       meterLimit;
131         float*    dashArray;
132         int       dashArraySize;
133     } mStroke;
134
135     struct {
136         LOTGradientType type;
137         LOTGradientStop *stopPtr;
138         unsigned int stopCount;
139         struct {
140             float x, y;
141         } start, end, center, focal;
142         float cradius;
143         float fradius;
144     } mGradient;
145
146     int       mFlag;
147     LOTBrushType mBrushType;
148     LOTFillRule  mFillRule;
149 } LOTNode;
150
151
152
153 typedef struct LOTLayerNode {
154
155     struct {
156         LOTMask        *ptr;
157         unsigned int    size;
158     } mMaskList;
159
160     struct {
161         struct LOTLayerNode   **ptr;
162         unsigned int          size;
163     } mLayerList;
164
165     struct {
166         LOTNode       **ptr;
167         unsigned int   size;
168     } mNodeList;
169
170     LOTMatteType mMatte;
171     int          mVisible;
172
173 } LOTLayerNode;
174
175
176 #endif  // _LOTTIE_COMMON_H_