#include"lottieview.h"
-#include"lottieplayer.h"
using namespace lotplayer;
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
-#include"lottieplayer.h"
+#include"lotplayer.h"
#include<future>
class LottieView
{
--- /dev/null
+#ifndef _LOTCOMMON_H_
+#define _LOTCOMMON_H_
+
+#ifdef _WIN32
+#ifdef LOT_BUILD
+#ifdef DLL_EXPORT
+#define LOT_EXPORT __declspec(dllexport)
+#else
+#define LOT_EXPORT
+#endif
+#else
+#define LOT_EXPORT __declspec(dllimport)
+#endif
+#else
+#ifdef __GNUC__
+#if __GNUC__ >= 4
+#define LOT_EXPORT __attribute__((visibility("default")))
+#else
+#define LOT_EXPORT
+#endif
+#else
+#define LOT_EXPORT
+#endif
+#endif
+
+struct LOTNode {
+
+#define ChangeFlagNone 0x0000
+#define ChangeFlagPath 0x0001
+#define ChangeFlagPaint 0x0010
+#define ChangeFlagAll (ChangeFlagPath & ChangeFlagPaint)
+
+ enum BrushType { BrushSolid, BrushGradient };
+ enum FillRule { EvenOdd, Winding };
+ enum JoinStyle { MiterJoin, BevelJoin, RoundJoin };
+ enum CapStyle { FlatCap, SquareCap, RoundCap };
+
+ struct PathData {
+ const float *ptPtr;
+ int ptCount;
+ const char* elmPtr;
+ int elmCount;
+ };
+
+ struct Color {
+ unsigned char r, g, b, a;
+ };
+
+ struct Stroke {
+ bool enable;
+ int width;
+ CapStyle cap;
+ JoinStyle join;
+ int meterLimit;
+ float* dashArray;
+ int dashArraySize;
+ };
+
+ struct Gradient {
+ enum Type { Linear = 1, Radial = 2 };
+ Gradient::Type type;
+ struct {
+ float x, y;
+ } start, end, center, focal;
+ float cradius;
+ float fradius;
+ };
+
+ int mFlag;
+ BrushType mType;
+ FillRule mFillRule;
+ PathData mPath;
+ Color mColor;
+ Stroke mStroke;
+ Gradient mGradient;
+};
+
+struct LOTBuffer {
+ uint32_t *buffer;
+ int width;
+ int height;
+ int bytesPerLine;
+ bool clear;
+};
+
+#endif // _LOTCOMMON_H_
--- /dev/null
+#ifndef _LOTPLAYER_H_
+#define _LOTPLAYER_H_
+
+#include <future>
+#include <vector>
+
+#include "lotcommon.h"
+
+//TODO: Hide this.
+class LOTPlayerPrivate;
+#define _LOTPLAYER_DECLARE_PRIVATE(A) \
+ class A##Private *d;
+
+namespace lotplayer {
+
+class LOT_EXPORT LOTPlayer {
+public:
+ ~LOTPlayer();
+ LOTPlayer();
+
+ bool setFilePath(const char *filePath);
+
+ float playTime() const;
+
+ float pos();
+
+ const std::vector<LOTNode *> &renderList(float pos) const;
+
+ // TODO: Consider correct position...
+ void setSize(int width, int height);
+ void size(int &width, int &height) const;
+ std::future<bool> render(float pos, LOTBuffer buffer, bool forceRender = false);
+ bool renderSync(float pos, LOTBuffer buffer, bool forceRender = false);
+
+private:
+ _LOTPLAYER_DECLARE_PRIVATE(LOTPlayer);
+};
+
+} // namespace lotplayer
+
+#endif // _LOTPLAYER_H_
+++ /dev/null
-#ifndef _LOTPLAYER_H_
-#define _LOTPLAYER_H_
-
-#include <future>
-#include <vector>
-
-#ifdef _WIN32
-#ifdef LOT_BUILD
-#ifdef DLL_EXPORT
-#define LOT_EXPORT __declspec(dllexport)
-#else
-#define LOT_EXPORT
-#endif
-#else
-#define LOT_EXPORT __declspec(dllimport)
-#endif
-#else
-#ifdef __GNUC__
-#if __GNUC__ >= 4
-#define LOT_EXPORT __attribute__((visibility("default")))
-#else
-#define LOT_EXPORT
-#endif
-#else
-#define LOT_EXPORT
-#endif
-#endif
-
-//TODO: Hide this.
-class LOTPlayerPrivate;
-#define _LOTPLAYER_DECLARE_PRIVATE(A) \
- class A##Private *d;
-
-struct LOTNode {
-
-#define ChangeFlagNone 0x0000
-#define ChangeFlagPath 0x0001
-#define ChangeFlagPaint 0x0010
-#define ChangeFlagAll (ChangeFlagPath & ChangeFlagPaint)
-
- enum BrushType { BrushSolid, BrushGradient };
- enum FillRule { EvenOdd, Winding };
- enum JoinStyle { MiterJoin, BevelJoin, RoundJoin };
- enum CapStyle { FlatCap, SquareCap, RoundCap };
-
- struct PathData {
- const float *ptPtr;
- int ptCount;
- const char* elmPtr;
- int elmCount;
- };
-
- struct Color {
- unsigned char r, g, b, a;
- };
-
- struct Stroke {
- bool enable;
- int width;
- CapStyle cap;
- JoinStyle join;
- int meterLimit;
- float* dashArray;
- int dashArraySize;
- };
-
- struct Gradient {
- enum Type { Linear = 1, Radial = 2 };
- Gradient::Type type;
- struct {
- float x, y;
- } start, end, center, focal;
- float cradius;
- float fradius;
- };
-
- int mFlag;
- BrushType mType;
- FillRule mFillRule;
- PathData mPath;
- Color mColor;
- Stroke mStroke;
- Gradient mGradient;
-};
-
-struct LOTBuffer {
- uint32_t *buffer = nullptr;
- int width = 0;
- int height = 0;
- int bytesPerLine = 0;
- bool clear = true;
-};
-
-namespace lotplayer {
-
-class LOT_EXPORT LOTPlayer {
-public:
- ~LOTPlayer();
- LOTPlayer();
-
- bool setFilePath(const char *filePath);
-
- float playTime() const;
-
- float pos();
-
- const std::vector<LOTNode *> &renderList(float pos) const;
-
- // TODO: Consider correct position...
- void setSize(int width, int height);
- void size(int &width, int &height) const;
- std::future<bool> render(float pos, LOTBuffer buffer, bool forceRender = false);
- bool renderSync(float pos, LOTBuffer buffer, bool forceRender = false);
-
-private:
- _LOTPLAYER_DECLARE_PRIVATE(LOTPlayer);
-};
-
-} // namespace lotplayer
-
-#endif // _LOTPLAYER_H_
-install_headers(['lottieplayer.h'])
+install_headers(['lotplayer.h', 'lotcommon.h'])
#include"vpath.h"
#include"vpoint.h"
#include"vpathmesure.h"
-#include"lottieplayer.h"
+#include"lotcommon.h"
#include"vpainter.h"
#include"vdrawable.h"
-#include <lottieplayer.h>
+#include <lotplayer.h>
#include "lottieitem.h"
#include "lottieloader.h"