lottie: build fix. 02/187202/2
authorsubhransu mohanty <sub.mohanty@samsung.com>
Tue, 21 Aug 2018 03:59:33 +0000 (12:59 +0900)
committerHermet Park <chuneon.park@samsung.com>
Tue, 21 Aug 2018 04:01:24 +0000 (04:01 +0000)
Change-Id: Ie008c71e2fcb3bcf7197245e26880e71e2bedc32

src/binding/c/lottieplayer.cpp [deleted file]
src/binding/c/lottieplayer_c.cpp [new file with mode: 0644]
src/binding/c/meson.build

diff --git a/src/binding/c/lottieplayer.cpp b/src/binding/c/lottieplayer.cpp
deleted file mode 100644 (file)
index b3ee6a8..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <lotplayer.h>
-#include "vdebug.h"
-
-extern "C" {
-
-using namespace lottieplayer;
-
-using lotplayer = LOTPlayer;
-
-LOT_EXPORT lotplayer *lotplayer_create(void)
-{
-   lotplayer* p = new LOTPlayer();
-   if (!p) {
-      vCritical << "Failed to initialize lotplayer";
-   }
-   return p;
-}
-
-LOT_EXPORT int lotplayer_destroy(lotplayer *player)
-{
-    if (!player) return LOT_PLAYER_ERROR_INVALID_PARAMETER;
-    delete(player);
-
-    return LOT_PLAYER_ERROR_NONE;
-}
-
-LOT_EXPORT int lotplayer_set_file(lotplayer *player, const char *file)
-{
-   if (!player) return LOT_PLAYER_ERROR_INVALID_PARAMETER;
-   bool ret = player->setFilePath(file);
-
-   if (!ret) return -1;
-
-   return LOT_PLAYER_ERROR_NONE;
-}
-
-LOT_EXPORT int lotplayer_set_size(lotplayer *player, int w, int h)
-{
-   if (!player) return LOT_PLAYER_ERROR_INVALID_PARAMETER;
-
-   player->setSize(w, h);
-
-   return LOT_PLAYER_ERROR_NONE;
-}
-
-LOT_EXPORT int lotplayer_get_size(const lotplayer *player, int* w, int* h)
-{
-   if (!player) return LOT_PLAYER_ERROR_INVALID_PARAMETER;
-
-   player->size(*w, *h);
-
-   return LOT_PLAYER_ERROR_NONE;
-}
-
-LOT_EXPORT float lotplayer_get_pos(const lotplayer *player)
-{
-   if (!player) {
-        vWarning << "Invalid parameter player = nullptr";
-        return -1.0f;
-   }
-
-   return player->pos();
-}
-
-LOT_EXPORT size_t lotplayer_get_node_count(const lotplayer *player, float pos)
-{
-   if (!player) return LOT_PLAYER_ERROR_NONE;
-
-   return player->renderList(pos).size();
-}
-
-LOT_EXPORT float lotplayer_get_playtime(const lotplayer *player)
-{
-   if (!player) {
-        vWarning << "Invalid parameter player = nullptr";
-        return 0.0f;
-   }
-
-   return player->playTime();
-}
-
-LOT_EXPORT const lotnode* lotplayer_get_node(lotplayer *player, float pos, size_t idx)
-{
-   if (!player) {
-        vWarning << "Invalid parameter player = nullptr";
-        return nullptr;
-   }
-
-   if (idx >= player->renderList(pos).size()) {
-      vWarning << "Invalid parameter idx? (0 ~ " << player->renderList(pos).size() << "), given idx = " << idx;
-      return nullptr;
-   }
-
-   return player->renderList(pos)[idx];
-}
-
-}
diff --git a/src/binding/c/lottieplayer_c.cpp b/src/binding/c/lottieplayer_c.cpp
new file mode 100644 (file)
index 0000000..b3ee6a8
--- /dev/null
@@ -0,0 +1,97 @@
+#include <lotplayer.h>
+#include "vdebug.h"
+
+extern "C" {
+
+using namespace lottieplayer;
+
+using lotplayer = LOTPlayer;
+
+LOT_EXPORT lotplayer *lotplayer_create(void)
+{
+   lotplayer* p = new LOTPlayer();
+   if (!p) {
+      vCritical << "Failed to initialize lotplayer";
+   }
+   return p;
+}
+
+LOT_EXPORT int lotplayer_destroy(lotplayer *player)
+{
+    if (!player) return LOT_PLAYER_ERROR_INVALID_PARAMETER;
+    delete(player);
+
+    return LOT_PLAYER_ERROR_NONE;
+}
+
+LOT_EXPORT int lotplayer_set_file(lotplayer *player, const char *file)
+{
+   if (!player) return LOT_PLAYER_ERROR_INVALID_PARAMETER;
+   bool ret = player->setFilePath(file);
+
+   if (!ret) return -1;
+
+   return LOT_PLAYER_ERROR_NONE;
+}
+
+LOT_EXPORT int lotplayer_set_size(lotplayer *player, int w, int h)
+{
+   if (!player) return LOT_PLAYER_ERROR_INVALID_PARAMETER;
+
+   player->setSize(w, h);
+
+   return LOT_PLAYER_ERROR_NONE;
+}
+
+LOT_EXPORT int lotplayer_get_size(const lotplayer *player, int* w, int* h)
+{
+   if (!player) return LOT_PLAYER_ERROR_INVALID_PARAMETER;
+
+   player->size(*w, *h);
+
+   return LOT_PLAYER_ERROR_NONE;
+}
+
+LOT_EXPORT float lotplayer_get_pos(const lotplayer *player)
+{
+   if (!player) {
+        vWarning << "Invalid parameter player = nullptr";
+        return -1.0f;
+   }
+
+   return player->pos();
+}
+
+LOT_EXPORT size_t lotplayer_get_node_count(const lotplayer *player, float pos)
+{
+   if (!player) return LOT_PLAYER_ERROR_NONE;
+
+   return player->renderList(pos).size();
+}
+
+LOT_EXPORT float lotplayer_get_playtime(const lotplayer *player)
+{
+   if (!player) {
+        vWarning << "Invalid parameter player = nullptr";
+        return 0.0f;
+   }
+
+   return player->playTime();
+}
+
+LOT_EXPORT const lotnode* lotplayer_get_node(lotplayer *player, float pos, size_t idx)
+{
+   if (!player) {
+        vWarning << "Invalid parameter player = nullptr";
+        return nullptr;
+   }
+
+   if (idx >= player->renderList(pos).size()) {
+      vWarning << "Invalid parameter idx? (0 ~ " << player->renderList(pos).size() << "), given idx = " << idx;
+      return nullptr;
+   }
+
+   return player->renderList(pos)[idx];
+}
+
+}
index 223e5f72cd2c45a6cf7078e61e47f13f03587f29..646983b9ce318c34d79cae943a9ab6c12e76500a 100644 (file)
@@ -1,6 +1,6 @@
 install_headers(['lotplayer_capi.h'])
 
-source_file = files('lottieplayer.cpp')
+source_file = files('lottieplayer_c.cpp')
 
 binding_c_dep = declare_dependency(
                                       include_directories : include_directories('.'),