- const Eo_Class *op_klass = OP_CLASS_GET(op);
- const char *_dom_name = (op_klass) ? op_klass->desc->name : NULL;
- ERR("Can't find func for op %x ('%s' of domain '%s') for class '%s'. Aborting.",
- op, _eo_op_id_name_get(op), _dom_name,
- (obj_klass) ? obj_klass->desc->name : NULL);
+ _EO_OP_ERR_NO_OP_PRINT(op, nklass);
+ ret = EINA_FALSE;
+ }
+ va_end(p_list);
+
+ return ret;
+}
+
+static Eina_Bool
+_eo_class_op_internal(Eo_Class *klass, Eo_Op op, va_list *p_list)
+{
+ Eina_Bool ret = EINA_FALSE;
+
+#ifndef NDEBUG
+ const Eo_Op_Description *op_desc = _eo_op_id_desc_get(op);
+
+ if (op_desc)
+ {
+ if (op_desc->op_type != EO_OP_TYPE_CLASS)
+ {
+ ERR("Tried calling an instance op '%s' (%x) from a class context.", (op_desc) ? op_desc->name : NULL, op);
+ return EINA_FALSE;
+ }
+ }
+#endif
+
+ Eo_Kls_Itr prev_state;
+
+ {
+ const op_type_funcs *func =
+ _eo_kls_itr_func_get(klass, &klass->mro_itr, op, &prev_state);
+ if (func)
+ {
+ ((eo_op_func_type_class) func->func)(klass, p_list);
+ ret = EINA_TRUE;
+ goto end;
+ }
+ }
+
+end:
+ _eo_kls_itr_end(&klass->mro_itr, &prev_state);
+ return ret;
+}
+
+EAPI Eina_Bool
+eo_class_do_internal(const Eo_Class *klass, ...)
+{
+ Eina_Bool ret = EINA_TRUE;
+ Eo_Op op = EO_NOOP;
+ va_list p_list;
+
+ EO_MAGIC_RETURN_VAL(klass, EO_CLASS_EINA_MAGIC, EINA_FALSE);
+
+ va_start(p_list, klass);
+
+ op = va_arg(p_list, Eo_Op);
+ while (op)
+ {
+ if (!_eo_class_op_internal((Eo_Class *) klass, op, &p_list))
+ {
+ _EO_OP_ERR_NO_OP_PRINT(op, klass);
+ ret = EINA_FALSE;
+ break;
+ }
+ op = va_arg(p_list, Eo_Op);
+ }
+
+ va_end(p_list);
+
+ return ret;
+}
+
+EAPI Eina_Bool
+eo_class_do_super_internal(const Eo_Class *klass, Eo_Op op, ...)
+{
+ const Eo_Class *nklass;
+ Eina_Bool ret = EINA_TRUE;
+ va_list p_list;
+ EO_MAGIC_RETURN_VAL(klass, EO_CLASS_EINA_MAGIC, EINA_FALSE);
+
+ /* Advance the kls itr. */
+ nklass = _eo_kls_itr_next(&((Eo_Class *) klass)->mro_itr, op);
+
+ if (klass->mro_itr.op != op)
+ return EINA_FALSE;
+
+ va_start(p_list, op);
+ if (!_eo_class_op_internal((Eo_Class *) klass, op, &p_list))
+ {
+ _EO_OP_ERR_NO_OP_PRINT(op, nklass);