summaryrefslogtreecommitdiff
path: root/src/modules/evas/vg_savers
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2017-01-27 13:54:47 +0200
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 11:54:09 +0900
commit7d9c1256a30bdbe3680c14da77d5fadf3382b6ef (patch)
treeaae39980a119e1f21d0210d5dbea9ab8206f623f /src/modules/evas/vg_savers
parent3f75c92ca9e559204c20228444810e8d482986d0 (diff)
vg_savers/svg: empty (for now) module that will save svg in original file
Just as a starter to make a working background that, later on, will go through Svg_Node's and build a certain source code to be saved in SVG picture as a file
Diffstat (limited to 'src/modules/evas/vg_savers')
-rw-r--r--src/modules/evas/vg_savers/svg/evas_vg_save_svg.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c
new file mode 100644
index 0000000000..8c11fb3d69
--- /dev/null
+++ b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c
@@ -0,0 +1,72 @@
1#include "vg_common.h"
2
3static int _evas_vg_saver_svg_log_dom = -1;
4
5#ifdef ERR
6# undef ERR
7#endif
8#define ERR(...) EINA_LOG_DOM_ERR(_evas_vg_saver_eet_log_dom, __VA_ARGS__)
9
10#ifdef INF
11# undef INF
12#endif
13#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_saver_eet_log_dom, __VA_ARGS__)
14
15int
16evas_vg_save_file_svg(Vg_File_Data *evg_data, const char *file, const char *key EINA_UNUSED, int compress EINA_UNUSED)
17{
18 Svg_Node *root EINA_UNUSED;
19 Eet_File *ef;
20
21 ef = eet_open(file, EET_FILE_MODE_WRITE);
22 if (!ef)
23 return EVAS_LOAD_ERROR_GENERIC;
24
25 root = vg_common_create_svg_node(evg_data);
26 //TODO: parse root into SVG source code and save into file as text file
27 eet_close(ef);
28
29 return EVAS_LOAD_ERROR_NONE;
30}
31
32static Evas_Vg_Save_Func evas_vg_save_svg_func =
33{
34 evas_vg_save_file_svg
35};
36
37static int
38module_open(Evas_Module *em)
39{
40 if (!em) return 0;
41 em->functions = (void *)(&evas_vg_save_svg_func);
42 _evas_vg_saver_svg_log_dom = eina_log_domain_register
43 ("vg-save-svg", EVAS_DEFAULT_LOG_COLOR);
44 if (_evas_vg_saver_svg_log_dom < 0)
45 {
46 EINA_LOG_ERR("Can not create a module log domain.");
47 return 0;
48 }
49 return 1;
50}
51
52static void
53module_close(Evas_Module *em EINA_UNUSED)
54{
55}
56
57static Evas_Module_Api evas_modapi =
58{
59 EVAS_MODULE_API_VERSION,
60 "svg",
61 "none",
62 {
63 module_open,
64 module_close
65 }
66};
67
68EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_VG_SAVER, vg_saver, svg);
69
70#ifndef EVAS_STATIC_BUILD_VG_SVG
71EVAS_EINA_MODULE_DEFINE(vg_saver, svg);
72#endif