From 51ea981bc9030c401213a2e4dab4dbabfdd658cb Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Wed, 10 Dec 2014 10:31:03 +0100 Subject: [PATCH] evas: add Evas_VG_Image. Change-Id: I5af183b030d9a73d56e839a3aaccb178f357ee82 --- src/Makefile_Evas.am | 6 ++-- src/lib/evas/Evas_Eo.h | 1 + src/lib/evas/canvas/evas_vg_image.c | 63 ++++++++++++++++++++++++++++++++++++ src/lib/evas/canvas/evas_vg_image.eo | 32 ++++++++++++++++++ 4 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 src/lib/evas/canvas/evas_vg_image.c create mode 100644 src/lib/evas/canvas/evas_vg_image.eo diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 8118373..cf9cb79 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -39,7 +39,8 @@ evas_eolian_files = \ lib/evas/canvas/evas_vg_root_node.eo \ lib/evas/canvas/evas_vg_gradient.eo \ lib/evas/canvas/evas_vg_gradient_radial.eo \ - lib/evas/canvas/evas_vg_gradient_linear.eo + lib/evas/canvas/evas_vg_gradient_linear.eo \ + lib/evas/canvas/evas_vg_image.eo evas_eolian_c = $(evas_eolian_files:%.eo=%.eo.c) evas_eolian_h = $(evas_eolian_files:%.eo=%.eo.h) \ @@ -219,7 +220,8 @@ lib/evas/canvas/evas_vg_root_node.c \ lib/evas/canvas/evas_vg_gradient.c \ lib/evas/canvas/evas_vg_gradient_linear.c \ lib/evas/canvas/evas_vg_gradient_radial.c \ -lib/evas/canvas/evas_vg_utils.c +lib/evas/canvas/evas_vg_utils.c \ +lib/evas/canvas/evas_vg_image.c # Engine lib_evas_libevas_la_SOURCES += \ diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index f4c848e..1a514e1 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -897,3 +897,4 @@ typedef enum _Evas_VG_Gradient_Spread #include "canvas/evas_vg_gradient.eo.h" #include "canvas/evas_vg_gradient_linear.eo.h" #include "canvas/evas_vg_gradient_radial.eo.h" +#include "canvas/evas_vg_image.eo.h" diff --git a/src/lib/evas/canvas/evas_vg_image.c b/src/lib/evas/canvas/evas_vg_image.c new file mode 100644 index 0000000..b93fc13 --- /dev/null +++ b/src/lib/evas/canvas/evas_vg_image.c @@ -0,0 +1,63 @@ +#include "evas_common_private.h" +#include "evas_private.h" + +#include + +typedef struct _Evas_VG_Image_Data Evas_VG_Image_Data; +struct _Evas_VG_Image_Data +{ + // FIXME: only manipulate Eina_File internally. + Eina_Stringshare *file, *key; + + int x, y; + unsigned int w, h; +}; + +void +_evas_vg_image_position_set(Eo *obj, Evas_VG_Image_Data *pd, int x, int y) +{ + pd->x = x; + pd->y = y; +} + +void +_evas_vg_image_position_get(Eo *obj, Evas_VG_Image_Data *pd, int *x, int *y) +{ + if (x) *x = pd->x; + if (y) *y = pd->y; +} + +void +_evas_vg_image_size_set(Eo *obj, Evas_VG_Image_Data *pd, + unsigned int w, unsigned int h) +{ + pd->w = w; + pd->h = h; +} + +void +_evas_vg_image_size_get(Eo *obj, Evas_VG_Image_Data *pd, + unsigned int *w, unsigned int *h) +{ + if (w) *w = pd->w; + if (h) *h = pd->h; +} + +Eina_Bool +_evas_vg_image_efl_file_file_set(Eo *obj, Evas_VG_Image_Data *pd, + const char *file, const char *key) +{ + eina_stringshare_replace(&pd->file, file); + eina_stringshare_replace(&pd->key, key); +} + +void +_evas_vg_image_efl_file_file_get(Eo *obj, Evas_VG_Image_Data *pd, + const char **file, const char **key) +{ + if (file) *file = pd->file; + if (key) *key = pd->key; +} + + +#include "evas_vg_image.eo.c" diff --git a/src/lib/evas/canvas/evas_vg_image.eo b/src/lib/evas/canvas/evas_vg_image.eo new file mode 100644 index 0000000..6ed670e --- /dev/null +++ b/src/lib/evas/canvas/evas_vg_image.eo @@ -0,0 +1,32 @@ +class Evas.VG_Image (Evas.VG_Node, Efl.File) +{ + eo_prefix: evas_vg_image; + legacy_prefix: null; + properties { + position { + set { + } + get { + } + values { + int x; + int y; + } + } + size { + set { + } + get { + } + values { + uint w; + uint h; + } + } + // FIXME: add aspect ratio following SVG specification + } + implements { + Efl.File.file.set; + Efl.File.file.get; + } +} \ No newline at end of file -- 2.7.4