forked from enlightenment/efl
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
This commit is contained in:
parent
3f75c92ca9
commit
7d9c1256a3
|
@ -1607,7 +1607,7 @@ endif
|
|||
|
||||
if BUILD_VG_LOADER_SVG
|
||||
if EVAS_STATIC_BUILD_VG_SVG
|
||||
lib_evas_libevas_la_SOURCES += modules/evas/vg_loaders/svg/evas_vg_load_svg.c \
|
||||
lib_evas_libevas_la_SOURCES += modules/evas/vg_loaders/svg/evas_vg_load_svg.c modules/evas/vg_savers/svg/evas_vg_save_svg.c \
|
||||
static_libs/vg_common/vg_common.c \
|
||||
static_libs/vg_common/vg_common.h
|
||||
lib_evas_libevas_la_CPPFLAGS += -I$(top_srcdir)/src/static_libs/vg_common \
|
||||
|
@ -1636,6 +1636,29 @@ modules_evas_vg_loaders_svg_module_la_LIBADD = \
|
|||
modules_evas_vg_loaders_svg_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@
|
||||
modules_evas_vg_loaders_svg_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
|
||||
modules_evas_vg_loaders_svg_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
vgsaversvgpkgdir = $(libdir)/evas/modules/vg_savers/svg/$(MODULE_ARCH)
|
||||
vgsaversvgpkg_LTLIBRARIES = modules/evas/vg_savers/svg/module.la
|
||||
|
||||
# Workaround for broken parallel install support in automake (relink issue)
|
||||
# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328
|
||||
install_vgsaversvgpkgLTLIBRARIES = install-vgloadersvgpkgLTLIBRARIES
|
||||
$(install_vgsaversvgpkgLTLIBRARIES): install-libLTLIBRARIES
|
||||
|
||||
modules_evas_vg_savers_svg_module_la_SOURCES = modules/evas/vg_savers/svg/evas_vg_save_svg.c \
|
||||
static_libs/vg_common/vg_common.c \
|
||||
static_libs/vg_common/vg_common.h
|
||||
modules_evas_vg_savers_svg_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
|
||||
-I$(top_srcdir)/src/lib/evas/include \
|
||||
-I$(top_srcdir)/src/static_libs/vg_common \
|
||||
@EVAS_CFLAGS@ \
|
||||
@evas_vg_saver_svg_cflags@
|
||||
modules_evas_vg_savers_svg_module_la_LIBADD = \
|
||||
@USE_EVAS_LIBS@ \
|
||||
@evas_vg_saver_svg_libs@
|
||||
modules_evas_vg_savers_svg_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@
|
||||
modules_evas_vg_savers_svg_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
|
||||
modules_evas_vg_savers_svg_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -207,6 +207,7 @@ EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tgv);
|
|||
|
||||
#if !EVAS_MODULE_NO_VG_SAVERS
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(vg_saver, eet);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(vg_saver, svg);
|
||||
#endif
|
||||
|
||||
#if !EVAS_MODULE_NO_IMAGE_SAVERS
|
||||
|
@ -319,6 +320,9 @@ static const struct {
|
|||
#ifdef EVAS_STATIC_BUILD_VG_EET
|
||||
EVAS_EINA_STATIC_MODULE_USE(vg_saver, eet),
|
||||
#endif
|
||||
#ifdef EVAS_STATIC_BUILD_VG_SVG
|
||||
EVAS_EINA_STATIC_MODULE_USE(vg_saver, svg),
|
||||
#endif
|
||||
#endif
|
||||
#if !EVAS_MODULE_NO_IMAGE_SAVERS
|
||||
#ifdef EVAS_STATIC_BUILD_EET
|
||||
|
|
|
@ -102,7 +102,8 @@ struct ext_saver_s
|
|||
static const struct ext_saver_s savers[] =
|
||||
{ /* map extensions to savers to use for good first-guess tries */
|
||||
MATCHING(".eet", "eet"),
|
||||
MATCHING(".edj", "eet")
|
||||
MATCHING(".edj", "eet"),
|
||||
MATCHING(".svg", "svg")
|
||||
};
|
||||
|
||||
static Evas_Module *
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
#include "vg_common.h"
|
||||
|
||||
static int _evas_vg_saver_svg_log_dom = -1;
|
||||
|
||||
#ifdef ERR
|
||||
# undef ERR
|
||||
#endif
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_evas_vg_saver_eet_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef INF
|
||||
# undef INF
|
||||
#endif
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_saver_eet_log_dom, __VA_ARGS__)
|
||||
|
||||
int
|
||||
evas_vg_save_file_svg(Vg_File_Data *evg_data, const char *file, const char *key EINA_UNUSED, int compress EINA_UNUSED)
|
||||
{
|
||||
Svg_Node *root EINA_UNUSED;
|
||||
Eet_File *ef;
|
||||
|
||||
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
||||
if (!ef)
|
||||
return EVAS_LOAD_ERROR_GENERIC;
|
||||
|
||||
root = vg_common_create_svg_node(evg_data);
|
||||
//TODO: parse root into SVG source code and save into file as text file
|
||||
eet_close(ef);
|
||||
|
||||
return EVAS_LOAD_ERROR_NONE;
|
||||
}
|
||||
|
||||
static Evas_Vg_Save_Func evas_vg_save_svg_func =
|
||||
{
|
||||
evas_vg_save_file_svg
|
||||
};
|
||||
|
||||
static int
|
||||
module_open(Evas_Module *em)
|
||||
{
|
||||
if (!em) return 0;
|
||||
em->functions = (void *)(&evas_vg_save_svg_func);
|
||||
_evas_vg_saver_svg_log_dom = eina_log_domain_register
|
||||
("vg-save-svg", EVAS_DEFAULT_LOG_COLOR);
|
||||
if (_evas_vg_saver_svg_log_dom < 0)
|
||||
{
|
||||
EINA_LOG_ERR("Can not create a module log domain.");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
module_close(Evas_Module *em EINA_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
static Evas_Module_Api evas_modapi =
|
||||
{
|
||||
EVAS_MODULE_API_VERSION,
|
||||
"svg",
|
||||
"none",
|
||||
{
|
||||
module_open,
|
||||
module_close
|
||||
}
|
||||
};
|
||||
|
||||
EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_VG_SAVER, vg_saver, svg);
|
||||
|
||||
#ifndef EVAS_STATIC_BUILD_VG_SVG
|
||||
EVAS_EINA_MODULE_DEFINE(vg_saver, svg);
|
||||
#endif
|
Loading…
Reference in New Issue