forked from enlightenment/efl
Eo: get rid of eo_class_do(_super) which we don't need anymore.
We now completely use eo_do(_super), so those are not needed.
This commit is contained in:
parent
7ed7d7da8b
commit
e6886e05b1
|
@ -604,13 +604,6 @@ EAPI Eina_Bool eo_shutdown(void);
|
|||
*/
|
||||
#define eo_vdo(obj, args) eo_vdo_internal(__FILE__, __LINE__, obj, args)
|
||||
|
||||
/**
|
||||
* @def eo_class_do
|
||||
* A convenience wrapper around eo_class_do_internal()
|
||||
* @see eo_class_do_internal
|
||||
*/
|
||||
#define eo_class_do(klass, ...) eo_do(klass, __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Calls op functions of an object
|
||||
* @param obj The object to work on
|
||||
|
@ -650,19 +643,6 @@ EAPI Eina_Bool eo_vdo_internal(const char *file, int line, const Eo *obj, va_lis
|
|||
*/
|
||||
#define eo_do_super(obj, cur_klass, ...) eo_do_super_internal(__FILE__, __LINE__, obj, cur_klass, __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Calls the super function for the specific op.
|
||||
* @param klass The klass to work on
|
||||
* @param cur_klass The *current* class (use the class *after* this in the MRO).
|
||||
* @param ... list of parameters.
|
||||
* @return @c EINA_TRUE on success.
|
||||
*
|
||||
* Unlike eo_class_do(), this function only accepts one op.
|
||||
*
|
||||
* @see #eo_class_do
|
||||
*/
|
||||
#define eo_class_do_super(klass, cur_klass, ...) eo_do_super(klass, cur_klass, __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Calls the super function for the specific op.
|
||||
* @param obj The object to work on
|
||||
|
|
|
@ -43,8 +43,8 @@ _class_print(Eo_Class *klass, void *data EINA_UNUSED, va_list *list)
|
|||
{
|
||||
(void) list;
|
||||
printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
|
||||
fail_if(!eo_class_do_super(klass, MY_CLASS, simple_class_print()));
|
||||
fail_if(!eo_class_do_super(klass, MY_CLASS, simple_class_print2()));
|
||||
fail_if(!eo_do_super(klass, MY_CLASS, simple_class_print()));
|
||||
fail_if(!eo_do_super(klass, MY_CLASS, simple_class_print2()));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -45,13 +45,13 @@ main(int argc, char *argv[])
|
|||
fail_if(eo_do(obj, simple_class_print()));
|
||||
#endif
|
||||
|
||||
fail_if(!eo_class_do(SIMPLE_CLASS, simple_class_print()));
|
||||
fail_if(!eo_class_do(INHERIT_CLASS, simple_class_print()));
|
||||
fail_if(!eo_class_do(INHERIT2_CLASS, simple_class_print()));
|
||||
fail_if(!eo_class_do(INHERIT3_CLASS, simple_class_print()));
|
||||
fail_if(!eo_do(SIMPLE_CLASS, simple_class_print()));
|
||||
fail_if(!eo_do(INHERIT_CLASS, simple_class_print()));
|
||||
fail_if(!eo_do(INHERIT2_CLASS, simple_class_print()));
|
||||
fail_if(!eo_do(INHERIT3_CLASS, simple_class_print()));
|
||||
|
||||
#ifdef EO_DEBUG
|
||||
fail_if(eo_class_do(SIMPLE_CLASS, simple_a_print()));
|
||||
fail_if(eo_do(SIMPLE_CLASS, simple_a_print()));
|
||||
#endif
|
||||
|
||||
eo_do_super(obj, SIMPLE_CLASS, eo_constructor());
|
||||
|
|
|
@ -34,8 +34,8 @@ _class_print(Eo_Class *klass, void *data EINA_UNUSED, va_list *list)
|
|||
{
|
||||
(void) list;
|
||||
printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
|
||||
fail_if(eo_class_do_super(klass, MY_CLASS, simple_class_print()));
|
||||
fail_if(eo_class_do_super(klass, MY_CLASS, simple_class_print2()));
|
||||
fail_if(eo_do_super(klass, MY_CLASS, simple_class_print()));
|
||||
fail_if(eo_do_super(klass, MY_CLASS, simple_class_print2()));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -133,15 +133,15 @@ main(int argc, char *argv[])
|
|||
eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1));
|
||||
fail_if(pd->cb_count != 1);
|
||||
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
fail_if(fcount != 0);
|
||||
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze());
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze());
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
fail_if(fcount != 1);
|
||||
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze());
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze());
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
fail_if(fcount != 2);
|
||||
|
||||
eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2));
|
||||
|
@ -149,30 +149,30 @@ main(int argc, char *argv[])
|
|||
|
||||
eo_do(obj, simple_a_set(2));
|
||||
fail_if(cb_count != 0);
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_thaw());
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_thaw());
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
fail_if(fcount != 1);
|
||||
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_thaw());
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_thaw());
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
fail_if(fcount != 0);
|
||||
|
||||
eo_do(obj, simple_a_set(3));
|
||||
fail_if(cb_count != 2);
|
||||
|
||||
cb_count = 0;
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_thaw());
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_thaw());
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
fail_if(fcount != 0);
|
||||
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze());
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze());
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
fail_if(fcount != 1);
|
||||
|
||||
eo_do(obj, simple_a_set(2));
|
||||
fail_if(cb_count != 0);
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_thaw());
|
||||
eo_class_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_thaw());
|
||||
eo_do(EO_BASE_CLASS, eo_event_global_freeze_get(&fcount));
|
||||
fail_if(fcount != 0);
|
||||
|
||||
|
||||
|
|
|
@ -670,9 +670,9 @@ START_TEST(eo_magic_checks)
|
|||
fail_if(eo_class_get((Eo *) buf));
|
||||
fail_if(eo_class_name_get((Eo_Class*) buf));
|
||||
eo_class_funcs_set((Eo_Class *) buf, NULL);
|
||||
eo_class_do((Eo_Class *) buf, NULL);
|
||||
eo_class_do_super((Eo_Class *) buf, SIMPLE_CLASS, EO_NOOP);
|
||||
eo_class_do_super(SIMPLE_CLASS, (Eo_Class *) buf, EO_NOOP);
|
||||
eo_do((Eo_Class *) buf, NULL);
|
||||
eo_do_super((Eo_Class *) buf, SIMPLE_CLASS, EO_NOOP);
|
||||
eo_do_super(SIMPLE_CLASS, (Eo_Class *) buf, EO_NOOP);
|
||||
|
||||
fail_if(eo_class_new(NULL, (Eo_Class *) buf), NULL);
|
||||
|
||||
|
@ -791,7 +791,7 @@ START_TEST(eo_multiple_do)
|
|||
fail_if(!obj);
|
||||
|
||||
fail_if(!eo_do(obj, simple_a_print(), multi_a_print(), multi_a_print()));
|
||||
fail_if(!eo_class_do(klass, simple_class_hi_print(), multi_class_hi_print(), multi_class_hi_print()));
|
||||
fail_if(!eo_do(klass, simple_class_hi_print(), multi_class_hi_print(), multi_class_hi_print()));
|
||||
|
||||
eo_unref(obj);
|
||||
|
||||
|
|
Loading…
Reference in New Issue