summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-29 20:03:16 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-30 10:48:24 +0900
commitbd5b76508b0b3bdc5d92f5f7db9741c100d47d3c (patch)
tree2e16d88bf93fde807e8b06e0bfe1c9e0f518adbd /src/lib/efl/interfaces
parent8803040484721c15e5a7f48f4373b38d41d9d42e (diff)
efl: Introduce interface Efl.Dup
A few classes allow their objects to be duplicated, so they should all use the same interface. Also, rename VG's dup to copy_from as it's not conforming to the definition of dup.
Diffstat (limited to 'src/lib/efl/interfaces')
-rw-r--r--src/lib/efl/interfaces/efl_dup.eo17
-rw-r--r--src/lib/efl/interfaces/efl_gfx_path.c4
-rw-r--r--src/lib/efl/interfaces/efl_gfx_path.eo3
-rw-r--r--src/lib/efl/interfaces/efl_gfx_shape.c12
-rw-r--r--src/lib/efl/interfaces/efl_gfx_shape.eo12
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c1
6 files changed, 32 insertions, 17 deletions
diff --git a/src/lib/efl/interfaces/efl_dup.eo b/src/lib/efl/interfaces/efl_dup.eo
new file mode 100644
index 0000000000..9d40f1f895
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_dup.eo
@@ -0,0 +1,17 @@
1interface Efl.Dup
2{
3 [[An interface for duplication of objects.
4
5 Objects implementing this interface can be duplicated with @.dup.
6 ]]
7 methods {
8 dup @const {
9 [[Creates a carbon copy of this object and returns it.
10
11 The newly created object will have no event handlers or anything of
12 the sort.
13 ]]
14 return: Efl.Dup @owned;
15 }
16 }
17}
diff --git a/src/lib/efl/interfaces/efl_gfx_path.c b/src/lib/efl/interfaces/efl_gfx_path.c
index df424c1d3e..85d017fd8c 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.c
+++ b/src/lib/efl/interfaces/efl_gfx_path.c
@@ -1575,8 +1575,8 @@ _efl_gfx_path_append_svg_path(Eo *obj, Efl_Gfx_Path_Data *pd,
1575 } 1575 }
1576} 1576}
1577 1577
1578static void 1578EOLIAN static void
1579_efl_gfx_path_dup(Eo *obj, Efl_Gfx_Path_Data *pd, const Eo *dup_from) 1579_efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Path_Data *pd, const Eo *dup_from)
1580{ 1580{
1581 Efl_Gfx_Path_Data *from; 1581 Efl_Gfx_Path_Data *from;
1582 1582
diff --git a/src/lib/efl/interfaces/efl_gfx_path.eo b/src/lib/efl/interfaces/efl_gfx_path.eo
index 2311c74a33..4b8961dd74 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.eo
+++ b/src/lib/efl/interfaces/efl_gfx_path.eo
@@ -49,7 +49,8 @@ mixin Efl.Gfx.Path
49 y: double; [[Y co-ordinate of control point.]] 49 y: double; [[Y co-ordinate of control point.]]
50 } 50 }
51 } 51 }
52 dup { 52 /* FIXME: Return a new object!!! */
53 copy_from {
53 [[Copy the shape data from the object specified. 54 [[Copy the shape data from the object specified.
54 55
55 @since 1.18 56 @since 1.18
diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c
index 922f6b9226..45bf04da43 100644
--- a/src/lib/efl/interfaces/efl_gfx_shape.c
+++ b/src/lib/efl/interfaces/efl_gfx_shape.c
@@ -8,6 +8,8 @@
8 8
9#include <Efl.h> 9#include <Efl.h>
10 10
11#define MY_CLASS EFL_GFX_SHAPE_MIXIN
12
11typedef struct _Efl_Gfx_Shape_Data 13typedef struct _Efl_Gfx_Shape_Data
12{ 14{
13 Efl_Gfx_Shape_Public public; 15 Efl_Gfx_Shape_Public public;
@@ -260,15 +262,15 @@ _efl_gfx_shape_fill_rule_get(Eo *obj EINA_UNUSED,
260 return pd->fill_rule; 262 return pd->fill_rule;
261} 263}
262 264
263static void 265EOLIAN static void
264_efl_gfx_shape_dup(Eo *obj, Efl_Gfx_Shape_Data *pd, 266_efl_gfx_shape_efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Shape_Data *pd,
265 const Eo *dup_from) 267 const Eo *dup_from)
266{ 268{
267 Efl_Gfx_Shape_Data *from; 269 Efl_Gfx_Shape_Data *from;
268 270
269 if (obj == dup_from) return; 271 if (obj == dup_from) return;
270 272
271 from = efl_data_scope_get(dup_from, EFL_GFX_SHAPE_MIXIN); 273 from = efl_data_scope_get(dup_from, MY_CLASS);
272 if (!from) return; 274 if (!from) return;
273 275
274 pd->public.stroke.scale = from->public.stroke.scale; 276 pd->public.stroke.scale = from->public.stroke.scale;
@@ -285,7 +287,7 @@ _efl_gfx_shape_dup(Eo *obj, Efl_Gfx_Shape_Data *pd,
285 _efl_gfx_shape_stroke_dash_set(obj, pd, from->public.stroke.dash, 287 _efl_gfx_shape_stroke_dash_set(obj, pd, from->public.stroke.dash,
286 from->public.stroke.dash_length); 288 from->public.stroke.dash_length);
287 289
288 efl_gfx_path_dup(obj, dup_from); 290 efl_gfx_path_copy_from(efl_super(obj, MY_CLASS), dup_from);
289} 291}
290 292
291#include "interfaces/efl_gfx_shape.eo.c" 293#include "interfaces/efl_gfx_shape.eo.c"
diff --git a/src/lib/efl/interfaces/efl_gfx_shape.eo b/src/lib/efl/interfaces/efl_gfx_shape.eo
index 14964b2fa6..e66b870615 100644
--- a/src/lib/efl/interfaces/efl_gfx_shape.eo
+++ b/src/lib/efl/interfaces/efl_gfx_shape.eo
@@ -134,14 +134,8 @@ mixin Efl.Gfx.Shape (Efl.Gfx.Path)
134 @in pos_map: double; [[Position map in range 0.0 to 1.0]] 134 @in pos_map: double; [[Position map in range 0.0 to 1.0]]
135 } 135 }
136 } 136 }
137 dup { 137 }
138 [[Copy the shape data from the object specified. 138 implements {
139 139 Efl.Gfx.Path.copy_from;
140 @since 1.14
141 ]]
142 params {
143 @in dup_from: const(Efl.Object); [[Shape object from where data will be copied.]]
144 }
145 }
146 } 140 }
147} 141}
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index e3b4e5682c..29a021e9c5 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -6,6 +6,7 @@
6 6
7#include "interfaces/efl_config.eo.c" 7#include "interfaces/efl_config.eo.c"
8#include "interfaces/efl_control.eo.c" 8#include "interfaces/efl_control.eo.c"
9#include "interfaces/efl_dup.eo.c"
9#include "interfaces/efl_image.eo.c" 10#include "interfaces/efl_image.eo.c"
10#include "interfaces/efl_image_animated.eo.c" 11#include "interfaces/efl_image_animated.eo.c"
11#include "interfaces/efl_image_load.eo.c" 12#include "interfaces/efl_image_load.eo.c"