summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_gfx_shape.c
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2015-11-18 15:27:59 +0900
committerCedric BAIL <cedric@osg.samsung.com>2015-11-30 15:52:25 -0800
commite79dd4c1612b32428800b13b2b0385f1aec0312a (patch)
tree7b159db65e8f54b67f5d96237ff87836153ac16a /src/lib/efl/interfaces/efl_gfx_shape.c
parent71b2efe94d7973ec64e7ab56ec3ddbeb44842a52 (diff)
efl: updated efl_gfx_shape_dup() implementation to use direct access to internal data.
As I don't see the use of inheritance for stroke anymore, we will use internal access rather than inherited get/set function. This behavior can be reverted if anyone find a real use case for it. Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/efl/interfaces/efl_gfx_shape.c74
1 files changed, 29 insertions, 45 deletions
diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c
index e285e27347..364bd44879 100644
--- a/src/lib/efl/interfaces/efl_gfx_shape.c
+++ b/src/lib/efl/interfaces/efl_gfx_shape.c
@@ -434,51 +434,6 @@ _efl_gfx_shape_equal_commands(Eo *obj EINA_UNUSED,
434} 434}
435 435
436static void 436static void
437_efl_gfx_shape_dup(Eo *obj, Efl_Gfx_Shape_Data *pd, const Eo *dup_from)
438{
439 const Efl_Gfx_Dash *dash = NULL;
440 Efl_Gfx_Shape_Data *from;
441 Efl_Gfx_Fill_Rule fill_rule;
442 unsigned int dash_length = 0;
443 Efl_Gfx_Cap cap;
444 Efl_Gfx_Join j;
445 int sr, sg, sb, sa;
446 double scale, location;
447 double sw;
448
449 if (obj == dup_from) return ;
450 from = eo_data_scope_get(dup_from, EFL_GFX_SHAPE_MIXIN);
451 if (!from) return ;
452
453 eo_do(dup_from,
454 scale = efl_gfx_shape_stroke_scale_get(),
455 efl_gfx_shape_stroke_color_get(&sr, &sg, &sb, &sa),
456 sw = efl_gfx_shape_stroke_width_get(),
457 location = efl_gfx_shape_stroke_location_get(),
458 efl_gfx_shape_stroke_dash_get(&dash, &dash_length),
459 cap = efl_gfx_shape_stroke_cap_get(),
460 j = efl_gfx_shape_stroke_join_get(),
461 fill_rule = efl_gfx_shape_fill_rule_get());
462 eo_do(obj,
463 efl_gfx_shape_stroke_scale_set(scale),
464 efl_gfx_shape_stroke_color_set(sr, sg, sb, sa),
465 efl_gfx_shape_stroke_width_set(sw),
466 efl_gfx_shape_stroke_location_set(location),
467 efl_gfx_shape_stroke_dash_set(dash, dash_length),
468 efl_gfx_shape_stroke_cap_set(cap),
469 efl_gfx_shape_stroke_join_set(j),
470 efl_gfx_shape_fill_rule_set(fill_rule));
471
472 _efl_gfx_shape_path_set(obj, pd, from->commands, from->points);
473
474 pd->convex = from->convex;
475
476 eo_do(obj,
477 eo_event_callback_call(EFL_GFX_PATH_CHANGED, NULL),
478 eo_event_callback_call(EFL_GFX_CHANGED, NULL));
479}
480
481static void
482_efl_gfx_shape_reset(Eo *obj, Efl_Gfx_Shape_Data *pd) 437_efl_gfx_shape_reset(Eo *obj, Efl_Gfx_Shape_Data *pd)
483{ 438{
484 free(pd->commands); 439 free(pd->commands);
@@ -1836,4 +1791,33 @@ _efl_gfx_shape_fill_rule_get(Eo *obj EINA_UNUSED,
1836 return pd->fill_rule; 1791 return pd->fill_rule;
1837} 1792}
1838 1793
1794static void
1795_efl_gfx_shape_dup(Eo *obj, Efl_Gfx_Shape_Data *pd, const Eo *dup_from)
1796{
1797 Efl_Gfx_Shape_Data *from;
1798
1799 if (obj == dup_from) return ;
1800 from = eo_data_scope_get(dup_from, EFL_GFX_SHAPE_MIXIN);
1801 if (!from) return ;
1802
1803 pd->public.stroke.scale = from->public.stroke.scale;
1804 pd->public.stroke.width = from->public.stroke.width;
1805 pd->public.stroke.centered = from->public.stroke.centered;
1806 pd->public.stroke.cap = from->public.stroke.cap;
1807 pd->public.stroke.join = from->public.stroke.join;
1808 pd->public.stroke.color.r = from->public.stroke.color.r;
1809 pd->public.stroke.color.g = from->public.stroke.color.g;
1810 pd->public.stroke.color.b = from->public.stroke.color.b;
1811 pd->public.stroke.color.a = from->public.stroke.color.a;
1812 pd->fill_rule = from->fill_rule;
1813 pd->convex = from->convex;
1814
1815 _efl_gfx_shape_stroke_dash_set(obj, pd, from->public.stroke.dash, from->public.stroke.dash_length);
1816 _efl_gfx_shape_path_set(obj, pd, from->commands, from->points);
1817
1818 eo_do(obj,
1819 eo_event_callback_call(EFL_GFX_PATH_CHANGED, NULL),
1820 eo_event_callback_call(EFL_GFX_CHANGED, NULL));
1821}
1822
1839#include "interfaces/efl_gfx_shape.eo.c" 1823#include "interfaces/efl_gfx_shape.eo.c"