aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-10-13 18:16:41 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-13 18:36:51 +0900
commit2ac2bbf22010853f972263b32a3d705985fc5ba0 (patch)
tree64ff7b70e662561ad8ead3bdbf70fe80fcdd888b
parenteo: Add beta API for auto_unref after a call (diff)
downloadefl-devs/jpeg/work.tar.gz
edje: Use EO's beta auto_unref API for partsdevs/jpeg/work
This simplifies code and avoids unwanted leaks.
-rw-r--r--src/lib/edje/edje_part.c93
-rw-r--r--src/lib/edje/edje_part_box.c52
-rw-r--r--src/lib/edje/edje_part_external.c2
-rw-r--r--src/lib/edje/edje_part_helper.h36
-rw-r--r--src/lib/edje/edje_part_swallow.c10
-rw-r--r--src/lib/edje/edje_part_table.c32
-rw-r--r--src/lib/edje/edje_part_text.c24
-rw-r--r--src/lib/edje/edje_private.h3
8 files changed, 99 insertions, 153 deletions
diff --git a/src/lib/edje/edje_part.c b/src/lib/edje/edje_part.c
index b3f9505217..741dcbef75 100644
--- a/src/lib/edje/edje_part.c
+++ b/src/lib/edje/edje_part.c
@@ -77,7 +77,7 @@ _edje_internal_proxy_shutdown(void)
}
void
-_edje_real_part_set(Eo *obj, Edje *ed, Edje_Real_Part *rp, const char *part)
+_edje_real_part_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Real_Part *rp, const char *part)
{
Efl_Canvas_Layout_Part_Data *pd;
@@ -86,147 +86,128 @@ _edje_real_part_set(Eo *obj, Edje *ed, Edje_Real_Part *rp, const char *part)
pd->ed = ed;
pd->rp = rp;
pd->part = part;
- pd->temp = 1;
- pd->in_use = 1;
- pd->in_call = 0;
efl_parent_set(obj, ed->obj);
}
EOLIAN static Efl_Object *
-_efl_canvas_layout_part_efl_object_finalize(Eo *obj, Efl_Canvas_Layout_Part_Data *pd)
+_efl_canvas_layout_part_efl_object_finalize(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(pd->rp && pd->ed && pd->part, NULL);
- // Do not use RETURN_VAL() here!
+ // Do not use return here!
return efl_finalize(efl_super(obj, MY_CLASS));
}
EOLIAN Eina_Rect
-_efl_canvas_layout_part_efl_gfx_geometry_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd)
+_efl_canvas_layout_part_efl_gfx_geometry_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
Edje_Real_Part *rp = pd->rp;
Eina_Rect r = EINA_RECT_ZERO();
- PROXY_CALL_BEGIN(pd);
_edje_recalc_do(pd->ed);
- if (!rp) RETURN_VAL(r);
+ if (!rp) return r;
- RETURN_VAL((Eina_Rect) rp->rect);
+ return (Eina_Rect) rp->rect;
}
EOLIAN static void
-_efl_canvas_layout_part_state_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, const char **name, double *val)
+_efl_canvas_layout_part_state_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, const char **name, double *val)
{
const char *str;
- PROXY_CALL_BEGIN(pd);
- if (!name && !val)
- RETURN_VOID;
+ if (!name && !val) return;
str = _edje_object_part_state_get(pd->ed, pd->part, val);
if (name) *name = str;
- RETURN_VOID;
}
EOLIAN static Efl_Canvas_Layout_Part_Type
-_efl_canvas_layout_part_part_type_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd)
+_efl_canvas_layout_part_part_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
Edje_Real_Part *rp;
- PROXY_CALL_BEGIN(pd);
rp = _edje_real_part_recursive_get(&pd->ed, pd->part);
- if (!rp || !rp->part) RETURN_VAL(EFL_CANVAS_LAYOUT_PART_TYPE_NONE);
+ if (!rp || !rp->part) return EFL_CANVAS_LAYOUT_PART_TYPE_NONE;
- RETURN_VAL((Efl_Canvas_Layout_Part_Type) rp->part->type);
+ return (Efl_Canvas_Layout_Part_Type) rp->part->type;
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_value_set(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_value_set(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_value_set(pd->ed, pd->part, dx, dy));
+ return _edje_object_part_drag_value_set(pd->ed, pd->part, dx, dy);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_value_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_value_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_value_get(pd->ed, pd->part, dx, dy));
+ return _edje_object_part_drag_value_get(pd->ed, pd->part, dx, dy);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_size_set(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double dw, double dh)
+_efl_canvas_layout_part_efl_ui_drag_drag_size_set(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double dw, double dh)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_size_set(pd->ed, pd->part, dw, dh));
+ return _edje_object_part_drag_size_set(pd->ed, pd->part, dw, dh);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_size_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double *dw, double *dh)
+_efl_canvas_layout_part_efl_ui_drag_drag_size_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dw, double *dh)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_size_get(pd->ed, pd->part, dw, dh));
+ return _edje_object_part_drag_size_get(pd->ed, pd->part, dw, dh);
}
EOLIAN static Efl_Ui_Drag_Dir
-_efl_canvas_layout_part_efl_ui_drag_drag_dir_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd)
+_efl_canvas_layout_part_efl_ui_drag_drag_dir_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_dir_get(pd->ed, pd->part));
+ return _edje_object_part_drag_dir_get(pd->ed, pd->part);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_step_set(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_step_set(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_step_set(pd->ed, pd->part, dx, dy));
+ return _edje_object_part_drag_step_set(pd->ed, pd->part, dx, dy);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_step_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_step_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_step_get(pd->ed, pd->part, dx, dy));
+ return _edje_object_part_drag_step_get(pd->ed, pd->part, dx, dy);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_step_move(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_step_move(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_step(pd->ed, pd->part, dx, dy));
+ return _edje_object_part_drag_step(pd->ed, pd->part, dx, dy);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_page_set(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_page_set(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_page_set(pd->ed, pd->part, dx, dy));
+ return _edje_object_part_drag_page_set(pd->ed, pd->part, dx, dy);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_page_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_page_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_page_get(pd->ed, pd->part, dx, dy));
+ return _edje_object_part_drag_page_get(pd->ed, pd->part, dx, dy);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_page_move(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_page_move(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double dx, double dy)
{
- PROXY_CALL_BEGIN(pd);
- RETURN_VAL(_edje_object_part_drag_page(pd->ed, pd->part, dx, dy));
+ return _edje_object_part_drag_page(pd->ed, pd->part, dx, dy);
}
static Eo *
-_edje_invalid_part_efl_content_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd)
+_edje_invalid_part_efl_content_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
ERR("Part '%s' (type: %s) of group '%s' is not a SWALLOW part!", pd->part, _part_type_to_string(pd->rp->type), pd->ed->group);
- RETURN_VAL(NULL);
+ return NULL;
}
static Eina_Bool
-_edje_invalid_part_efl_content_set(Eo *obj, Efl_Canvas_Layout_Part_Data *pd, Eo *subobj EINA_UNUSED)
+_edje_invalid_part_efl_content_set(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, Eo *subobj EINA_UNUSED)
{
ERR("Part '%s' (type: %s) of group '%s' is not a SWALLOW part!", pd->part, _part_type_to_string(pd->rp->type), pd->ed->group);
- RETURN_VAL(EINA_FALSE);
+ return EINA_FALSE;
}
/* Internal EO APIs and hidden overrides */
diff --git a/src/lib/edje/edje_part_box.c b/src/lib/edje/edje_part_box.c
index 5c6a57a99c..b74457edd8 100644
--- a/src/lib/edje/edje_part_box.c
+++ b/src/lib/edje/edje_part_box.c
@@ -16,14 +16,14 @@ EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_pack_pack_clear(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_box_remove_all(pd->ed, pd->part, EINA_TRUE));
+ return _edje_part_box_remove_all(pd->ed, pd->part, EINA_TRUE);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_pack_unpack_all(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_box_remove_all(pd->ed, pd->part, EINA_FALSE));
+ return _edje_part_box_remove_all(pd->ed, pd->part, EINA_FALSE);
}
EOLIAN static Eina_Bool
@@ -32,63 +32,63 @@ _efl_canvas_layout_part_box_efl_pack_unpack(Eo *obj, void *_pd EINA_UNUSED, Efl_
Evas_Object *removed;
PROXY_DATA_GET(obj, pd);
removed = _edje_part_box_remove(pd->ed, pd->part, subobj);
- RETURN_VAL((removed == subobj));
+ return (removed == subobj);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_pack_pack(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_box_append(pd->ed, pd->part, subobj));
+ return _edje_part_box_append(pd->ed, pd->part, subobj);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_pack_linear_pack_begin(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_box_prepend(pd->ed, pd->part, subobj));
+ return _edje_part_box_prepend(pd->ed, pd->part, subobj);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_pack_linear_pack_end(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_box_append(pd->ed, pd->part, subobj));
+ return _edje_part_box_append(pd->ed, pd->part, subobj);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_pack_linear_pack_before(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, const Efl_Gfx *existing)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_box_insert_before(pd->ed, pd->part, subobj, existing));
+ return _edje_part_box_insert_before(pd->ed, pd->part, subobj, existing);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_pack_linear_pack_after(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, const Efl_Gfx *existing)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_box_insert_after(pd->ed, pd->part, subobj, existing));
+ return _edje_part_box_insert_after(pd->ed, pd->part, subobj, existing);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_pack_linear_pack_at(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, int index)
{
PROXY_DATA_GET(obj, pd);
- int cnt = PROXY_CALL(efl_content_count(obj));
+ int cnt = efl_content_count(obj);
if ((index < 0) && ((-index) <= (cnt + 1)))
index = cnt + index + 1;
if ((index >= 0) && (index < cnt))
- RETURN_VAL(_edje_part_box_insert_at(pd->ed, pd->part, subobj, index));
+ return _edje_part_box_insert_at(pd->ed, pd->part, subobj, index);
else
- RETURN_VAL(_edje_part_box_append(pd->ed, pd->part, subobj));
+ return _edje_part_box_append(pd->ed, pd->part, subobj);
}
EOLIAN static Efl_Gfx *
_efl_canvas_layout_part_box_efl_pack_linear_pack_unpack_at(Eo *obj, void *_pd EINA_UNUSED, int index)
{
PROXY_DATA_GET(obj, pd);
- if (index < 0) index += PROXY_CALL(efl_content_count(obj));
- RETURN_VAL(_edje_part_box_remove_at(pd->ed, pd->part, index));
+ if (index < 0) index += efl_content_count(obj);
+ return _edje_part_box_remove_at(pd->ed, pd->part, index);
}
/* New APIs with Eo */
@@ -97,15 +97,15 @@ EOLIAN static Efl_Gfx *
_efl_canvas_layout_part_box_efl_pack_linear_pack_content_get(Eo *obj, void *_pd EINA_UNUSED, int index)
{
PROXY_DATA_GET(obj, pd);
- if (index < 0) index += PROXY_CALL(efl_content_count(obj));
- RETURN_VAL(_edje_part_box_content_at(pd->ed, pd->part, index));
+ if (index < 0) index += efl_content_count(obj);
+ return _edje_part_box_content_at(pd->ed, pd->part, index);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_box_efl_container_content_remove(Eo *obj, void *_pd EINA_UNUSED EINA_UNUSED, Efl_Gfx *subobj)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(PROXY_CALL(efl_pack_unpack(obj, subobj)));
+ return efl_pack_unpack(obj, subobj);
}
EOLIAN static int
@@ -118,14 +118,14 @@ _efl_canvas_layout_part_box_efl_pack_linear_pack_index_get(Eo *obj, void *_pd EI
PROXY_DATA_GET(obj, pd);
priv = efl_data_scope_get(pd->rp->object, EVAS_BOX_CLASS);
- if (!priv) RETURN_VAL(-1);
+ if (!priv) return -1;
EINA_LIST_FOREACH(priv->children, l, opt)
{
if (opt->obj == subobj)
- RETURN_VAL(k);
+ return k;
k++;
}
- RETURN_VAL(-1);
+ return -1;
}
/* this iterator is the same as efl_ui_box */
@@ -182,17 +182,17 @@ _efl_canvas_layout_part_box_efl_container_content_iterate(Eo *obj, void *_pd EIN
Eina_Iterator *it;
PROXY_DATA_GET(obj, pd);
- if (!pd->rp->typedata.container) RETURN_VAL(NULL);
+ if (!pd->rp->typedata.container) return NULL;
it = evas_object_box_iterator_new(pd->rp->object);
- RETURN_VAL(_part_item_iterator_create(pd->rp->object, it));
+ return _part_item_iterator_create(pd->rp->object, it);
}
EOLIAN static int
_efl_canvas_layout_part_box_efl_container_content_count(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(evas_obj_box_count(pd->rp->object));
+ return evas_obj_box_count(pd->rp->object);
}
EOLIAN static Efl_Ui_Dir
@@ -203,15 +203,15 @@ _efl_canvas_layout_part_box_efl_ui_direction_direction_get(Eo *obj, void *_pd EI
(Edje_Part_Description_Box *) pd->rp->chosen_description;
if (!desc || !desc->box.layout)
- RETURN_VAL(EFL_UI_DIR_DEFAULT);
+ return EFL_UI_DIR_DEFAULT;
if (!strncmp(desc->box.layout, "vertical", 8))
- RETURN_VAL(EFL_UI_DIR_VERTICAL);
+ return EFL_UI_DIR_VERTICAL;
else if (!strncmp(desc->box.layout, "horizontal", 10))
- RETURN_VAL(EFL_UI_DIR_HORIZONTAL);
+ return EFL_UI_DIR_HORIZONTAL;
WRN("unknown orientation '%s'", desc->box.layout);
- RETURN_VAL(EFL_UI_DIR_DEFAULT);
+ return EFL_UI_DIR_DEFAULT;
}
#include "efl_canvas_layout_part_box.eo.c"
diff --git a/src/lib/edje/edje_part_external.c b/src/lib/edje/edje_part_external.c
index c2f95547fb..ffcaf8036b 100644
--- a/src/lib/edje/edje_part_external.c
+++ b/src/lib/edje/edje_part_external.c
@@ -19,7 +19,7 @@ EOLIAN static Efl_Gfx *
_efl_canvas_layout_part_external_efl_container_content_get(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_object_part_external_object_get(pd->ed, pd->part));
+ return _edje_object_part_external_object_get(pd->ed, pd->part);
}
#include "efl_canvas_layout_part_external.eo.c"
diff --git a/src/lib/edje/edje_part_helper.h b/src/lib/edje/edje_part_helper.h
index 3bea35fc45..c3214c49de 100644
--- a/src/lib/edje/edje_part_helper.h
+++ b/src/lib/edje/edje_part_helper.h
@@ -9,7 +9,6 @@ struct _Efl_Canvas_Layout_Part_Data
Edje_Real_Part *rp;
const char *part;
Eo *obj;
- unsigned char temp, in_call, in_use;
};
struct _Part_Item_Iterator
@@ -23,13 +22,6 @@ struct _Part_Item_Iterator
void _part_reuse_error(Efl_Canvas_Layout_Part_Data *pd);
const char * _part_type_to_string(unsigned char type);
-#define PROXY_CALL_BEGIN(pd) do { pd->in_call = 1; } while (0)
-#define PROXY_CALL_END(pd) do { pd->in_call = 0; } while (0)
-#define PROXY_REF(obj, pd) do { if (!(pd->temp++)) efl_ref(obj); } while(0)
-#define PROXY_UNREF(obj, pd) do { if (pd->temp) { if (!(--pd->temp)) efl_del(obj); } } while(0)
-#define RETURN_VAL(a) do { typeof(a) _ret = a; PROXY_CALL_END(pd); PROXY_UNREF(obj, pd); return _ret; } while(0)
-#define RETURN_VOID do { PROXY_CALL_END(pd); PROXY_UNREF(obj, pd); return; } while(0)
-#define PROXY_CALL(a) ({ PROXY_REF(obj, pd); a; })
#define PROXY_STATIC_VAR(type) _##type##_proxy
#ifndef PROXY_ADD_EXTRA_OP
@@ -44,10 +36,6 @@ _part_proxy_del_cb(Eo *proxy, Eo **static_var)
Efl_Canvas_Layout_Part_Data *pd;
if (*static_var)
{
- // FIXME: Enable debug checks only in debug mode
- pd = efl_data_scope_get(*static_var, EFL_CANVAS_LAYOUT_PART_CLASS);
- if (pd && pd->temp && !pd->in_call)
- _part_reuse_error(pd);
if (*static_var != proxy)
efl_del_intercept_set(*static_var, NULL);
}
@@ -58,7 +46,6 @@ _part_proxy_del_cb(Eo *proxy, Eo **static_var)
}
efl_reuse(proxy);
pd = efl_data_scope_get(proxy, EFL_CANVAS_LAYOUT_PART_CLASS);
- pd->in_use = EINA_FALSE;
*static_var = proxy;
}
@@ -77,8 +64,7 @@ void \
_ ## type ## _shutdown(void); \
#define PROXY_DATA_GET(obj, pd) \
- Efl_Canvas_Layout_Part_Data *pd = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_PART_CLASS); \
- PROXY_CALL_BEGIN(pd)
+ Efl_Canvas_Layout_Part_Data *pd = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_PART_CLASS);
#define PROXY_IMPLEMENTATION(type, KLASS, no_del_cb, ...) \
static Eo * PROXY_STATIC_VAR(type) = NULL; \
@@ -109,25 +95,15 @@ _edje_ ## type ## _internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Ed
proxy = efl_add(KLASS, ed->obj, _edje_real_part_set(efl_added, ed, rp, rp->part->name)); \
goto end ; \
} \
+ else PROXY_STATIC_VAR(type) = NULL; \
\
- if (EINA_UNLIKELY(pd->in_use)) \
- { \
- /* if (!pd->in_call) _part_reuse_error(pd); */ \
- proxy = efl_add(KLASS, ed->obj, _edje_real_part_set(efl_added, ed, rp, rp->part->name)); \
- } \
- else \
- { \
- _edje_real_part_set(proxy, ed, rp, rp->part->name); \
- } \
+ _edje_real_part_set(proxy, ed, rp, rp->part->name); \
\
end: \
- \
__VA_ARGS__; \
- if (!no_del_cb) \
- { \
- PROXY_STATIC_VAR(type) = proxy; \
- efl_del_intercept_set(proxy, _ ## type ## _del_cb); \
- } \
+ if (!no_del_cb) efl_del_intercept_set(proxy, _ ## type ## _del_cb); \
+ efl_allow_parent_unref_set(proxy, 1); \
+ efl_auto_unref_set(proxy, 1); \
return proxy; \
}
diff --git a/src/lib/edje/edje_part_swallow.c b/src/lib/edje/edje_part_swallow.c
index 6bd2721636..34e637d9b4 100644
--- a/src/lib/edje/edje_part_swallow.c
+++ b/src/lib/edje/edje_part_swallow.c
@@ -11,14 +11,14 @@ EOLIAN static Efl_Gfx *
_efl_canvas_layout_part_swallow_efl_container_content_get(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_efl_container_content_get(pd->ed, pd->part));
+ return _edje_efl_container_content_get(pd->ed, pd->part);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_swallow_efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_efl_container_content_set(pd->ed, pd->part, content));
+ return _edje_efl_container_content_set(pd->ed, pd->part, content);
}
EOLIAN static Efl_Gfx *
@@ -26,9 +26,9 @@ _efl_canvas_layout_part_swallow_efl_container_content_unset(Eo *obj, void *_pd E
{
PROXY_DATA_GET(obj, pd);
Efl_Gfx *content = _edje_efl_container_content_get(pd->ed, pd->part);
- if (!content) RETURN_VAL(NULL);
- PROXY_CALL(efl_content_remove(obj, content));
- RETURN_VAL(content);
+ if (!content) return NULL;
+ efl_content_remove(obj, content);
+ return content;
}
#include "efl_canvas_layout_part_swallow.eo.c"
diff --git a/src/lib/edje/edje_part_table.c b/src/lib/edje/edje_part_table.c
index 50c5899546..3fd7c61689 100644
--- a/src/lib/edje/edje_part_table.c
+++ b/src/lib/edje/edje_part_table.c
@@ -64,59 +64,58 @@ _efl_canvas_layout_part_table_efl_container_content_iterate(Eo *obj, void *_pd E
Eina_Iterator *it;
PROXY_DATA_GET(obj, pd);
- if (!pd->rp->typedata.container) RETURN_VAL(NULL);
+ if (!pd->rp->typedata.container) return NULL;
it = evas_object_table_iterator_new(pd->rp->object);
- RETURN_VAL(_part_item_iterator_create(pd->rp->object, it));
+ return _part_item_iterator_create(pd->rp->object, it);
}
EOLIAN static int
_efl_canvas_layout_part_table_efl_container_content_count(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(evas_obj_table_count(pd->rp->object));
+ return evas_obj_table_count(pd->rp->object);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_table_efl_container_content_remove(Eo *obj, void *_pd EINA_UNUSED EINA_UNUSED, Efl_Gfx *content)
+_efl_canvas_layout_part_table_efl_container_content_remove(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED EINA_UNUSED, Efl_Gfx *content)
{
- PROXY_DATA_GET(obj, pd);
- RETURN_VAL(PROXY_CALL(efl_pack_unpack(obj, content)));
+ return efl_pack_unpack(obj, content);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_table_efl_pack_pack_clear(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_table_clear(pd->ed, pd->part, EINA_TRUE));
+ return _edje_part_table_clear(pd->ed, pd->part, EINA_TRUE);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_table_efl_pack_unpack_all(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_table_clear(pd->ed, pd->part, EINA_FALSE));
+ return _edje_part_table_clear(pd->ed, pd->part, EINA_FALSE);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_table_efl_pack_unpack(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_table_unpack(pd->ed, pd->part, subobj));
+ return _edje_part_table_unpack(pd->ed, pd->part, subobj);
}
EOLIAN static Eina_Bool
_efl_canvas_layout_part_table_efl_pack_grid_pack_grid(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_table_pack(pd->ed, pd->part, subobj, col, row, colspan, rowspan));
+ return _edje_part_table_pack(pd->ed, pd->part, subobj, col, row, colspan, rowspan);
}
EOLIAN static Efl_Gfx *
_efl_canvas_layout_part_table_efl_pack_grid_grid_content_get(Eo *obj, void *_pd EINA_UNUSED, int col, int row)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_part_table_child_get(pd->ed, pd->part, col, row));
+ return _edje_part_table_child_get(pd->ed, pd->part, col, row);
}
EOLIAN static void
@@ -124,7 +123,6 @@ _efl_canvas_layout_part_table_efl_pack_grid_grid_size_get(Eo *obj, void *_pd EIN
{
PROXY_DATA_GET(obj, pd);
_edje_part_table_col_row_size_get(pd->ed, pd->part, cols, rows);
- RETURN_VOID;
}
EOLIAN static int
@@ -133,7 +131,7 @@ _efl_canvas_layout_part_table_efl_pack_grid_grid_columns_get(Eo *obj, void *_pd
PROXY_DATA_GET(obj, pd);
int cols = 0, rows = 0;
_edje_part_table_col_row_size_get(pd->ed, pd->part, &cols, &rows);
- RETURN_VAL(cols);
+ return cols;
}
EOLIAN static int
@@ -142,7 +140,7 @@ _efl_canvas_layout_part_table_efl_pack_grid_grid_rows_get(Eo *obj, void *_pd EIN
PROXY_DATA_GET(obj, pd);
int cols = 0, rows = 0;
_edje_part_table_col_row_size_get(pd->ed, pd->part, &cols, &rows);
- RETURN_VAL(rows);
+ return rows;
}
/* New table apis with eo */
@@ -203,7 +201,7 @@ _efl_canvas_layout_part_table_efl_pack_grid_grid_contents_get(Eo *obj, void *_pd
eina_iterator_free(it);
pit = calloc(1, sizeof(*pit));
- if (!pit) RETURN_VAL(NULL);
+ if (!pit) return NULL;
EINA_MAGIC_SET(&pit->iterator, EINA_MAGIC_ITERATOR);
@@ -215,7 +213,7 @@ _efl_canvas_layout_part_table_efl_pack_grid_grid_contents_get(Eo *obj, void *_pd
pit->iterator.free = FUNC_ITERATOR_FREE(_table_item_iterator_free);
efl_wref_add(obj, &pit->object);
- RETURN_VAL(&pit->iterator);
+ return &pit->iterator;
}
EOLIAN static Eina_Bool
@@ -231,7 +229,7 @@ _efl_canvas_layout_part_table_efl_pack_grid_grid_position_get(Eo *obj, void *_pd
if (colspan) *colspan = cs;
if (rowspan) *rowspan = rs;
- RETURN_VAL(ret);
+ return ret;
}
/* Legacy API implementation */
diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c
index 56c96ee7e0..f196c2d8a8 100644
--- a/src/lib/edje/edje_part_text.c
+++ b/src/lib/edje/edje_part_text.c
@@ -12,7 +12,6 @@ _efl_canvas_layout_part_text_efl_text_text_set(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_FALSE);
- RETURN_VOID;
}
EOLIAN static const char *
@@ -20,7 +19,7 @@ _efl_canvas_layout_part_text_efl_text_text_get(Eo *obj,
void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_efl_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_FALSE));
+ return _edje_efl_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_FALSE);
}
EOLIAN static const char *
@@ -28,7 +27,7 @@ _efl_canvas_layout_part_text_efl_text_markup_markup_get(Eo *obj,
void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_efl_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_TRUE));
+ return _edje_efl_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_TRUE);
}
EOLIAN static void
@@ -37,7 +36,6 @@ _efl_canvas_layout_part_text_efl_text_markup_markup_set(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_TRUE);
- RETURN_VOID;
}
@@ -46,7 +44,7 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_get(Eo *obj,
void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor_Get_Type get_type)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_text_cursor_get(pd->rp, (int) get_type));
+ return _edje_text_cursor_get(pd->rp, (int) get_type);
}
EOLIAN static void
@@ -55,7 +53,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_paragraph_first(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_begin(pd->rp, cur);
- RETURN_VOID;
}
EOLIAN static void
@@ -64,7 +61,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_paragraph_last(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_end(pd->rp, cur);
- RETURN_VOID;
}
EOLIAN static void
@@ -73,7 +69,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_position_set(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_pos_set(pd->rp, cur, pos);
- RETURN_VOID;
}
EOLIAN static int
@@ -81,7 +76,7 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_position_get(Eo *obj,
void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
{
PROXY_DATA_GET(obj, pd);
- RETURN_VAL(_edje_text_cursor_pos_get(pd->rp, cur));
+ return _edje_text_cursor_pos_get(pd->rp, cur);
}
EOLIAN static void
@@ -91,7 +86,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_coord_set(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_coord_set(pd->rp, cur, x, y);
- RETURN_VOID;
}
EOLIAN static void
@@ -100,7 +94,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_line_char_first(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_line_begin(pd->rp, cur);
- RETURN_VOID;
}
EOLIAN static void
@@ -109,7 +102,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_line_char_last(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_line_end(pd->rp, cur);
- RETURN_VOID;
}
EOLIAN static void
@@ -118,7 +110,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_char_prev(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_prev(pd->rp, cur);
- RETURN_VOID;
}
EOLIAN static void
@@ -127,7 +118,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_char_next(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_next(pd->rp, cur);
- RETURN_VOID;
}
EOLIAN static void
@@ -143,7 +133,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_line_jump_by(Eo *obj,
{
_edje_text_cursor_up(pd->rp, cur);
}
- RETURN_VOID;
}
EOLIAN static void
@@ -154,7 +143,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_copy(Eo *obj,
{
PROXY_DATA_GET(obj, pd);
_edje_text_cursor_copy(pd->rp, (Efl_Text_Cursor_Cursor *) cur, dst);
- RETURN_VOID;
}
EOLIAN static Eina_Unicode
@@ -176,7 +164,7 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_content_get(Eo *obj,
uc = *ustr;
free(ustr);
}
- RETURN_VAL(uc);
+ return uc;
}
EOLIAN static Eina_Bool
@@ -195,7 +183,7 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_geometry_get(Eo *obj,
if (cx) *cx -= pd->ed->x;
if (cy) *cy -= pd->ed->y;
}
- RETURN_VAL(EINA_FALSE);
+ return EINA_FALSE;
}
EOLIAN static void
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 90e248922d..2096362a89 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -39,6 +39,9 @@
# include <Evil.h>
#endif
+// auto_unref
+#define EFL_OBJECT_BETA
+#define EFL_OBJECT_PROTECTED
#define EDJE_OBJECT_BETA
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_CANVAS_LAYOUT_CALC_PROTECTED