forked from enlightenment/efl
eo2: add macros for functions with no argument
This commit is contained in:
parent
9e042c0686
commit
73f1d2a09e
|
@ -594,11 +594,22 @@ EAPI Eina_Bool eo_shutdown(void);
|
||||||
|
|
||||||
typedef struct _Eo_Internal _Eo;
|
typedef struct _Eo_Internal _Eo;
|
||||||
|
|
||||||
#define EO_FUNC_CALL(...) func(objid, obj_data, __VA_ARGS__)
|
#define EO_FUNC_CALL() func(objid, obj_data)
|
||||||
|
#define EO_FUNC_CALLV(...) func(objid, obj_data, __VA_ARGS__)
|
||||||
|
|
||||||
/* XXX: Essential, because we need to adjust objid for comp objects. */
|
/* XXX: Essential, because we need to adjust objid for comp objects. */
|
||||||
#define EO_FUNC_BODY(Name, Ret, Id, Func, DefRet, ...) \
|
#define EO_FUNC_BODY(Name, Ret, Id, Func, DefRet) \
|
||||||
EAPI Ret \
|
Ret \
|
||||||
|
Name(_Eo *obj, Eo *objid) \
|
||||||
|
{ \
|
||||||
|
Ret (*func)(Eo *, void *obj_data) = eo2_func_get(obj, Id(Name)); \
|
||||||
|
if (!func) return DefRet; \
|
||||||
|
void *obj_data = eo2_data_scope_get(obj); \
|
||||||
|
return Func; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define EO_FUNC_BODYV(Name, Ret, Id, Func, DefRet, ...) \
|
||||||
|
Ret \
|
||||||
Name(_Eo *obj, Eo *objid, __VA_ARGS__) \
|
Name(_Eo *obj, Eo *objid, __VA_ARGS__) \
|
||||||
{ \
|
{ \
|
||||||
Ret (*func)(Eo *, void *obj_data, __VA_ARGS__) = eo2_func_get(obj, Id(Name)); \
|
Ret (*func)(Eo *, void *obj_data, __VA_ARGS__) = eo2_func_get(obj, Id(Name)); \
|
||||||
|
|
Loading…
Reference in New Issue