config_h = configuration_data()
+add_project_arguments('-DEXAMPLE_DIR="@0@/src/examples/svgs"'.format(meson.current_source_dir()), language : 'cpp')
+
if get_option('engines').contains('sw') == true
config_h.set10('THORVG_SW_RASTER_SUPPORT', true)
endif
type: 'array',
choices: ['', 'svg2png'],
value: [''],
- description: 'Enable building ThorVG Tools')
+ description: 'Enable building thorvg tools')
+
+option('examples',
+ type: 'boolean',
+ value: false,
+ description: 'Enable building examples')
if get_option('tools').contains('svg2png') == true
+ message('Enable Tools: svg2png')
subdir('svg2png')
endif
+++ /dev/null
-#include <iostream>
-
-using namespace std;
-
-int
-main(int argc, char *argv[])
-{
- cout << "test thorvg!" << endl;
-
- return 0;
-}
-executable('thorvg_sample', 'main.cpp')
+examples_dep = dependency('elementary', required : true)
+
+source_file = [
+ 'testArc.cpp',
+ 'testAsync.cpp',
+ 'testBlending.cpp',
+ 'testBoundary.cpp',
+ 'testCapi.cpp',
+ 'testCustomTransform.cpp',
+ 'testDirectUpdate.cpp',
+ 'testDuplicate.cpp',
+ 'testGradientTransform.cpp',
+ 'testLinearGradient.cpp',
+ 'testMultiCanvas.cpp',
+ 'testMultiShapes.cpp',
+ 'testPathCopy.cpp',
+ 'testPath.cpp',
+ 'testRadialGradient.cpp',
+ 'testScene.cpp',
+ 'testSceneTransform.cpp',
+ 'testShape.cpp',
+ 'testStroke.cpp',
+ 'testStrokeLine.cpp',
+ 'testSvg2.cpp',
+ 'testSvg.cpp',
+ 'testTransform.cpp',
+ 'testUpdate.cpp',
+]
+
+foreach current_file : source_file
+ name = current_file.split('.')[0]
+ executable(name, current_file,
+ include_directories : headers,
+ link_with : thorvg_lib,
+ dependencies : examples_dep)
+endforeach
\r
tvg_shape_get_path_commands(shape, &cmds, &cmdCnt);\r
printf("---- First Shape Commands(%u) ----\n", cmdCnt);\r
- for(int i=0; i < cmdCnt; ++i) {\r
+ for(uint32_t i = 0; i < cmdCnt; ++i) {\r
printf("%d\n", cmds[i]);\r
}\r
\r
tvg_shape_get_path_coords(shape, &pts, &ptsCnt);\r
printf("---- First Shape Points(%u) ----\n", ptsCnt);\r
- for(int i=0; i < ptsCnt; ++i) {\r
+ for(uint32_t i = 0; i < ptsCnt; ++i) {\r
printf("(%.2lf, %.2lf)\n", pts[i].x, pts[i].y);\r
}\r
\r
evas_object_smart_callback_add(win, "delete,request", win_del, 0);
if (tvgEngine == tvg::CanvasEngine::Sw) {
- eina_file_dir_list("./svgs", EINA_TRUE, tvgSwTest, win);
+ eina_file_dir_list(EXAMPLE_DIR, EINA_TRUE, tvgSwTest, win);
} else {
- eina_file_dir_list("./svgs", EINA_TRUE, tvgGlTest, win);
+ eina_file_dir_list(EXAMPLE_DIR, EINA_TRUE, tvgGlTest, win);
}
evas_object_geometry_set(win, 0, 0, WIDTH, HEIGHT);
cout << "engine is not supported" << endl;
}
return 0;
-}
\ No newline at end of file
+}
void svgDirCallback(const char* name, const char* path, void* data)
{
- tvg::Canvas* canvas = static_cast<tvg::Canvas*>(data);
-
auto picture = tvg::Picture::gen();
char buf[PATH_MAX];
- sprintf(buf,"%s/%s", path, name);
+ sprintf(buf, "/%s/%s", path, name);
if (picture->load(buf) != tvg::Result::Success) return;
if (canvas->push(move(shape)) != tvg::Result::Success) return;
- eina_file_dir_list("./svgs", EINA_TRUE, svgDirCallback, canvas);
+ eina_file_dir_list(EXAMPLE_DIR, EINA_TRUE, svgDirCallback, canvas);
/* This showcase shows you asynchrounous loading of svg.
For this, pushing pictures at a certian sync time.
gnu_symbol_visibility : 'hidden',
)
-subdir('bin')
-
thorvg_dep = declare_dependency(
include_directories: headers,
link_with : thorvg_lib
filebase : 'thorvg',
description : 'A Thor library for rendering vector graphics'
)
+
+subdir('bin')
+
+if get_option('examples') == true
+ message('Enable Examples')
+ subdir('examples')
+endif
+++ /dev/null
-all:
- gcc -o testShape testShape.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testMultiShapes testMultiShapes.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testBoundary testBoundary.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testPath testPath.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testPathCopy testPathCopy.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testBlending testBlending.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testUpdate testUpdate.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testDirectUpdate testDirectUpdate.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testScene testScene.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testTransform testTransform.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testCustomTransform testCustomTransform.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testSceneTransform testSceneTransform.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testStroke testStroke.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testStrokeLine testStrokeLine.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testLinearGradient testLinearGradient.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testRadialGradient testRadialGradient.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testGradientTransform testGradientTransform.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testSvg testSvg.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testSvg2 testSvg2.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testAsync testAsync.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testArc testArc.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testMultiCanvas testMultiCanvas.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testDuplicate testDuplicate.cpp -g -lstdc++ `pkg-config --cflags --libs elementary thorvg`
- gcc -o testCapi testCapi.c -g `pkg-config --cflags --libs elementary thorvg`