090b4c22076013ca4d683bd661591d6e95b31173
[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_PLAYER_ERROR_NONE = 0,
34     LOT_PLAYER_ERROR_NOT_PERMITTED,
35     LOT_PLAYER_ERROR_OUT_OF_MEMORY,
36     LOT_PLAYER_ERROR_INVALID_PARAMETER,
37     LOT_PLAYER_ERROR_RESULT_OUT_OF_RANGE,
38     LOT_PLAYER_ERROR_ALREADY_IN_PROGRESS,
39     LOT_PLAYER_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 LOTNode {
75
76 #define ChangeFlagNone 0x0000
77 #define ChangeFlagPath 0x0001
78 #define ChangeFlagPaint 0x0010
79 #define ChangeFlagAll (ChangeFlagPath & ChangeFlagPaint)
80
81     struct {
82         const float *ptPtr;
83         int          ptCount;
84         const char*  elmPtr;
85         int          elmCount;
86     } mPath;
87
88     struct {
89         unsigned char r, g, b, a;
90     } mColor;
91
92     struct {
93         bool      enable;
94         int       width;
95         LOTCapStyle  cap;
96         LOTJoinStyle join;
97         int       meterLimit;
98         float*    dashArray;
99         int       dashArraySize;
100     } mStroke;
101
102     struct {
103         LOTGradientType type;
104         struct {
105             float x, y;
106         } start, end, center, focal;
107         float cradius;
108         float fradius;
109     } mGradient;
110
111     int       mFlag;
112     LOTBrushType mType;
113     LOTFillRule  mFillRule;
114 } LOTNode;
115
116
117 #endif  // _LOTTIE_COMMON_H_