summaryrefslogtreecommitdiff
path: root/eo2test/eo2_composite.c
diff options
context:
space:
mode:
Diffstat (limited to 'eo2test/eo2_composite.c')
-rw-r--r--eo2test/eo2_composite.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/eo2test/eo2_composite.c b/eo2test/eo2_composite.c
new file mode 100644
index 0000000000..aea0145621
--- /dev/null
+++ b/eo2test/eo2_composite.c
@@ -0,0 +1,54 @@
+#include "Eo.h"
+#include "eo2_simple.h"
+#include "eo2_composite.h"
+
+static int
+_get(Eo *objid, void *obj_data EINA_UNUSED)
+{
+ return eo2_do_super(objid, eo2_inc());
+}
+
+static void
+_a_get(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
+{
+ int *a;
+ a = va_arg(*list, int *);
+ eo_do_super(obj, MY_CLASS, simple_a_get(a));
+}
+
+static void
+_constructor(Eo *obj, void *obj_data)
+{
+ Private_Data *data = (Private_Data *) obj_data;
+
+ /* Eo *simple = eo_add(SIMPLE_CLASS, obj); */
+ /* eo_composite_attach(simple, obj); */
+ /* eo_do(simple, eo_event_callback_forwarder_add(EV_A_CHANGED, obj)); */
+
+ /* fail_if(eo_composite_is(obj)); */
+ /* fail_if(!eo_composite_is(simple)); */
+
+ /* eo_do(obj, eo_base_data_set("simple-obj", simple, NULL)); */
+
+ eo2_do_super(obj, eo2_simple_constructor(66));
+}
+
+static Eo2_Op_Description op_descs [] = {
+ EO2_OP_FUNC_OVERRIDE(_constructor, eo2_constructor),
+ EO2_OP_FUNC_OVERRIDE(_get, eo2_get),
+ EO2_OP_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO2_VERSION,
+ "Eo2 Composite",
+ EO_CLASS_TYPE_REGULAR,
+ EO2_CLASS_DESCRIPTION_OPS(op_descs),
+ NULL,
+ 0,
+ NULL,
+ NULL
+};
+
+EO_DEFINE_CLASS(eo2_composite_class_get, &class_desc,
+ EO2_BASE_CLASS, EO2_SIMPLE_CLASS, NULL)