test: update test code for the first showcase.
authorHermet Park <chuneon.park@samsung.com>
Sun, 19 Apr 2020 03:17:48 +0000 (12:17 +0900)
committerHermet Park <chuneon.park@samsung.com>
Sun, 19 Apr 2020 03:17:48 +0000 (12:17 +0900)
To show the result, we use efl library.

Most linux distribution supports efl library from their package repo,
you can easily install efl from its package repo:

Ubuntu:
$ apt-get install libelementary-dev

Or, please visit efl site to install EFL libarary manually:
https://www.enlightenment.org/download

Change-Id: I696ac72e4ec7ea3258161a15b58171d74c16830d

test/makefile
test/testShape.cpp

index 5fdc45c..7b242a3 100644 (file)
@@ -1,2 +1,2 @@
 all:
-       gcc -o testShape testShape.cpp -g -lstdc++ `pkg-config --cflags --libs tizenvg`
+       gcc -o testShape testShape.cpp -g -lstdc++ `pkg-config --cflags --libs elementary tizenvg`
index d1da21e..4ee2ad7 100644 (file)
@@ -1,4 +1,5 @@
 #include <tizenvg.h>
+#include <Elementary.h>
 
 using namespace std;
 
@@ -7,7 +8,7 @@ using namespace std;
 
 static uint32_t buffer[WIDTH * HEIGHT];
 
-int main(int argc, char **argv)
+void tvgtest()
 {
     //Initialize TizenVG Engine
     tvg::Engine::init();
@@ -32,3 +33,27 @@ int main(int argc, char **argv)
     //Terminate TizenVG Engine
     tvg::Engine::term();
 }
+
+
+int main(int argc, char **argv)
+{
+    tvgtest();
+
+    //Show the result using EFL...
+    elm_init(argc, argv);
+
+    Eo* win = elm_win_util_standard_add(NULL, "TizenVG Test");
+
+    Eo* img = evas_object_image_filled_add(evas_object_evas_get(win));
+    evas_object_image_size_set(img, WIDTH, HEIGHT);
+    evas_object_image_data_set(img, buffer);
+    evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_show(img);
+
+    elm_win_resize_object_add(win, img);
+    evas_object_geometry_set(win, 0, 0, WIDTH, HEIGHT);
+    evas_object_show(win);
+
+    elm_run();
+    elm_shutdown();
+}