mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-31 16:25:51 +00:00
refactor infrastructure.
Split common delcaration from lottieplayer.h This common delcaration will be used in c interface header files. Change-Id: Icb3e3f182b2f27fc2d7c9bed36ac29c45c813b66
This commit is contained in:
committed by
Subhransu Mohanty
parent
083ec1abb8
commit
d49fb641e0
@@ -1,5 +1,4 @@
|
||||
#include"lottieview.h"
|
||||
#include"lottieplayer.h"
|
||||
|
||||
using namespace lotplayer;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <Evas.h>
|
||||
#include <Ecore.h>
|
||||
#include <Ecore_Evas.h>
|
||||
#include"lottieplayer.h"
|
||||
#include"lotplayer.h"
|
||||
#include<future>
|
||||
class LottieView
|
||||
{
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#ifndef _LOTPLAYER_H_
|
||||
#define _LOTPLAYER_H_
|
||||
|
||||
#include <future>
|
||||
#include <vector>
|
||||
#ifndef _LOTCOMMON_H_
|
||||
#define _LOTCOMMON_H_
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef LOT_BUILD
|
||||
@@ -26,11 +23,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//TODO: Hide this.
|
||||
class LOTPlayerPrivate;
|
||||
#define _LOTPLAYER_DECLARE_PRIVATE(A) \
|
||||
class A##Private *d;
|
||||
|
||||
struct LOTNode {
|
||||
|
||||
#define ChangeFlagNone 0x0000
|
||||
@@ -84,38 +76,11 @@ struct LOTNode {
|
||||
};
|
||||
|
||||
struct LOTBuffer {
|
||||
uint32_t *buffer = nullptr;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
int bytesPerLine = 0;
|
||||
bool clear = true;
|
||||
uint32_t *buffer;
|
||||
int width;
|
||||
int height;
|
||||
int bytesPerLine;
|
||||
bool clear;
|
||||
};
|
||||
|
||||
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_
|
||||
#endif // _LOTCOMMON_H_
|
||||
41
inc/lotplayer.h
Normal file
41
inc/lotplayer.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#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_
|
||||
@@ -1 +1 @@
|
||||
install_headers(['lottieplayer.h'])
|
||||
install_headers(['lotplayer.h', 'lotcommon.h'])
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include"vpath.h"
|
||||
#include"vpoint.h"
|
||||
#include"vpathmesure.h"
|
||||
#include"lottieplayer.h"
|
||||
#include"lotcommon.h"
|
||||
#include"vpainter.h"
|
||||
#include"vdrawable.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <lottieplayer.h>
|
||||
#include <lotplayer.h>
|
||||
|
||||
#include "lottieitem.h"
|
||||
#include "lottieloader.h"
|
||||
|
||||
Reference in New Issue
Block a user