efl: add a gradient interface.
authorCedric BAIL <cedric@osg.samsung.com>
Fri, 3 Apr 2015 14:15:03 +0000 (16:15 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 3 Apr 2015 14:15:03 +0000 (16:15 +0200)
src/Makefile_Efl.am
src/lib/efl/Efl.h
src/lib/efl/interfaces/efl_graphics_gradient.eo [new file with mode: 0644]
src/lib/efl/interfaces/efl_interfaces_main.c
src/lib/evas/Evas_Eo.h
src/lib/evas/canvas/evas_vg_gradient.c
src/lib/evas/canvas/evas_vg_gradient.eo

index 0336e8f..815c78a 100644 (file)
@@ -5,7 +5,8 @@ efl_eolian_files = \
       lib/efl/interfaces/efl_player.eo \
       lib/efl/interfaces/efl_text.eo \
       lib/efl/interfaces/efl_text_properties.eo \
-      lib/efl/interfaces/efl_graphics_shape.eo
+      lib/efl/interfaces/efl_graphics_shape.eo \
+      lib/efl/interfaces/efl_graphics_gradient.eo
 
 efl_eolian_files_h = $(efl_eolian_files:%.eo=%.eo.h)
 efl_eolian_files_c = $(efl_eolian_files:%.eo=%.eo.c)
index d184aca..bafa685 100644 (file)
@@ -89,6 +89,32 @@ typedef enum _Efl_Graphics_Join
   EFL_GRAPHICS_JOIN_LAST
 } Efl_Graphics_Join;
 
+/**
+ * Type defining gradient stop.
+ * @since 1.13
+ */
+typedef struct _Efl_Graphics_Gradient_Stop Efl_Graphics_Gradient_Stop;
+struct _Efl_Graphics_Gradient_Stop
+{
+   double offset;
+   int r;
+   int g;
+   int b;
+   int a;
+};
+
+/**
+ * Type defining how the gradient spread after its limit.
+ * @since 1.13
+ */
+typedef enum _Efl_Graphics_Gradient_Spread
+{
+  EFL_GRAPHICS_GRADIENT_SPREAD_PAD,
+  EFL_GRAPHICS_GRADIENT_SPREAD_REFLECT,
+  EFL_GRAPHICS_GRADIENT_SPREAD_REPEAT,
+  EFL_GRAPHICS_GRADIENT_SPREAD_LAST
+} Efl_Graphics_Gradient_Spread;
+
 #ifdef EFL_BETA_API_SUPPORT
 
 /* Interfaces */
@@ -100,6 +126,7 @@ typedef enum _Efl_Graphics_Join
 #include "interfaces/efl_text_properties.eo.h"
 
 #include "interfaces/efl_graphics_shape.eo.h"
+#include "interfaces/efl_graphics_gradient.eo.h"
 
 #endif
 
diff --git a/src/lib/efl/interfaces/efl_graphics_gradient.eo b/src/lib/efl/interfaces/efl_graphics_gradient.eo
new file mode 100644 (file)
index 0000000..378ffaf
--- /dev/null
@@ -0,0 +1,26 @@
+interface Efl.Graphics.Gradient
+{
+   legacy_prefix: null;
+   properties {
+      stop {
+         set {
+        }
+        get {
+        }
+        values {
+           const(Efl_Graphics_Gradient_Stop) *colors;
+           uint length;
+        }
+      }
+      spread {
+         set {
+        }
+        get {
+        }
+        values {
+           Efl_Graphics_Gradient_Spread s;
+        }
+      }
+   }
+
+}
index 793dbb6..10f9d1e 100644 (file)
@@ -12,3 +12,4 @@
 #include "interfaces/efl_text_properties.eo.c"
 
 #include "interfaces/efl_graphics_shape.eo.c"
+#include "interfaces/efl_graphics_gradient.eo.c"
index b28e7ce..0209677 100644 (file)
@@ -850,24 +850,6 @@ typedef enum _Evas_3D_Material_Attrib
  */
 typedef Eo      Evas_VG_Node;
 
-typedef struct _Evas_VG_Gradient_Stop Evas_VG_Gradient_Stop;
-struct _Evas_VG_Gradient_Stop
-{
-   double offset;
-   int r;
-   int g;
-   int b;
-   int a;
-};
-
-typedef enum _Evas_VG_Gradient_Spread
-{
-  EVAS_VG_GRADIENT_SPREAD_PAD,
-  EVAS_VG_GRADIENT_SPREAD_REFLECT,
-  EVAS_VG_GRADIENT_SPREAD_REPEAT,
-  EVAS_VG_GRADIENT_SPREAD_LAST
-} Evas_VG_Gradient_Spread;
-
 /**
  * @ingroup Evas_Object_VG
  *
index df7edc6..72bddf7 100644 (file)
@@ -7,50 +7,50 @@ typedef struct _Evas_VG_Gradient_Data Evas_VG_Gradient_Data;
 struct _Evas_VG_Gradient_Data
 {
    // FIXME: Later on we should deduplicate it somehow.
-   Evas_VG_Gradient_Stop *colors;
+   Efl_Graphics_Gradient_Stop *colors;
    unsigned int colors_count;
 
-   Evas_VG_Gradient_Spread s;
+   Efl_Graphics_Gradient_Spread s;
 };
 
 void
-_evas_vg_gradient_stop_set(Eo *obj EINA_UNUSED,
-                           Evas_VG_Gradient_Data *pd,
-                           const Evas_VG_Gradient_Stop *colors,
-                           unsigned int length)
+_evas_vg_gradient_efl_graphics_gradient_stop_set(Eo *obj EINA_UNUSED,
+                                                 Evas_VG_Gradient_Data *pd,
+                                                 const Efl_Graphics_Gradient_Stop *colors,
+                                                 unsigned int length)
 {
-   pd->colors = realloc(pd->colors, length * sizeof(Evas_VG_Gradient_Stop));
+   pd->colors = realloc(pd->colors, length * sizeof(Efl_Graphics_Gradient_Stop));
    if (!pd->colors)
      {
         pd->colors_count = 0;
         return ;
      }
 
-   memcpy(pd->colors, colors, length * sizeof(Evas_VG_Gradient_Stop));
+   memcpy(pd->colors, colors, length * sizeof(Efl_Graphics_Gradient_Stop));
    pd->colors_count = length;
 }
 
 void
-_evas_vg_gradient_stop_get(Eo *obj EINA_UNUSED,
-                           Evas_VG_Gradient_Data *pd,
-                           const Evas_VG_Gradient_Stop **colors,
-                           unsigned int *length)
+_evas_vg_gradient_efl_graphics_gradient_stop_get(Eo *obj EINA_UNUSED,
+                                                 Evas_VG_Gradient_Data *pd,
+                                                 const Efl_Graphics_Gradient_Stop **colors,
+                                                 unsigned int *length)
 {
    if (colors) *colors = pd->colors;
    if (length) *length = pd->colors_count;
 }
 
 void
-_evas_vg_gradient_spread_set(Eo *obj EINA_UNUSED,
-                             Evas_VG_Gradient_Data *pd,
-                             Evas_VG_Gradient_Spread s)
+_evas_vg_gradient_efl_graphics_gradient_spread_set(Eo *obj EINA_UNUSED,
+                                                   Evas_VG_Gradient_Data *pd,
+                                                   Efl_Graphics_Gradient_Spread s)
 {
    pd->s = s;
 }
 
-Evas_VG_Gradient_Spread
-_evas_vg_gradient_spread_get(Eo *obj EINA_UNUSED,
-                             Evas_VG_Gradient_Data *pd)
+Efl_Graphics_Gradient_Spread
+_evas_vg_gradient_efl_graphics_gradient_spread_get(Eo *obj EINA_UNUSED,
+                                                   Evas_VG_Gradient_Data *pd)
 {
    return pd->s;
 }
index 549d28a..a71a7e7 100644 (file)
@@ -1,26 +1,11 @@
-abstract Evas.VG_Gradient (Evas.VG_Node)
+abstract Evas.VG_Gradient (Evas.VG_Node, Efl.Graphics.Gradient)
 {
    eo_prefix: evas_vg_gradient;
    legacy_prefix: null;
-   properties {
-      stop {
-         set {
-        }
-        get {
-        }
-        values {
-           const(Evas_VG_Gradient_Stop) *colors;
-           uint length;
-        }
-      }
-      spread {
-         set {
-        }
-        get {
-        }
-        values {
-           Evas_VG_Gradient_Spread s;
-        }
-      }
+   implements {
+      Efl.Graphics.Gradient.stop.set;
+      Efl.Graphics.Gradient.stop.get;
+      Efl.Graphics.Gradient.spread.set;
+      Efl.Graphics.Gradient.spread.get;
    }
 }