evas: add Evas_VG_Image. 37/43137/1
authorCedric BAIL <cedric@osg.samsung.com>
Wed, 10 Dec 2014 09:31:03 +0000 (10:31 +0100)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Wed, 8 Jul 2015 01:55:12 +0000 (10:55 +0900)
Change-Id: I5af183b030d9a73d56e839a3aaccb178f357ee82

src/Makefile_Evas.am
src/lib/evas/Evas_Eo.h
src/lib/evas/canvas/evas_vg_image.c [new file with mode: 0644]
src/lib/evas/canvas/evas_vg_image.eo [new file with mode: 0644]

index 8118373..cf9cb79 100644 (file)
@@ -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 += \
index f4c848e..1a514e1 100644 (file)
@@ -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 (file)
index 0000000..b93fc13
--- /dev/null
@@ -0,0 +1,63 @@
+#include "evas_common_private.h"
+#include "evas_private.h"
+
+#include <strings.h>
+
+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 (file)
index 0000000..6ed670e
--- /dev/null
@@ -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