From 69f2fb49654ffd19dc1ae7f708ca360aba959894 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Sun, 19 Apr 2020 12:17:48 +0900 Subject: [PATCH] test: update test code for the first showcase. 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 | 2 +- test/testShape.cpp | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/test/makefile b/test/makefile index 5fdc45c4..7b242a39 100644 --- a/test/makefile +++ b/test/makefile @@ -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` diff --git a/test/testShape.cpp b/test/testShape.cpp index d1da21e7..4ee2ad7e 100644 --- a/test/testShape.cpp +++ b/test/testShape.cpp @@ -1,4 +1,5 @@ #include +#include 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(); +}