1 #include <Elementary.h>
8 #define MY_CLASS EVAS_OBJ_CLASS
10 EAPI Eo_Op EVAS_OBJ_BASE_ID = 0;
18 _position_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
20 Evas_Object *evas_obj = eo_evas_object_get(obj);
22 x = va_arg(*list, Evas_Coord);
23 y = va_arg(*list, Evas_Coord);
24 evas_object_move(evas_obj, x, y);
28 _size_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
30 Evas_Object *evas_obj = eo_evas_object_get(obj);
32 w = va_arg(*list, Evas_Coord);
33 h = va_arg(*list, Evas_Coord);
34 evas_object_resize(evas_obj, w, h);
38 _color_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
40 Evas_Object *evas_obj = eo_evas_object_get(obj);
42 r = va_arg(*list, int);
43 g = va_arg(*list, int);
44 b = va_arg(*list, int);
45 a = va_arg(*list, int);
46 evas_object_color_set(evas_obj, r, g, b, a);
50 _color_get(const Eo *obj, const void *class_data EINA_UNUSED, va_list *list)
52 Evas_Object *evas_obj = eo_evas_object_get(obj);
54 r = va_arg(*list, int *);
55 g = va_arg(*list, int *);
56 b = va_arg(*list, int *);
57 a = va_arg(*list, int *);
58 evas_object_color_get(evas_obj, r, g, b, a);
62 _visibility_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
64 Evas_Object *evas_obj = eo_evas_object_get(obj);
66 v = va_arg(*list, int);
67 if (v) evas_object_show(evas_obj);
68 else evas_object_hide(evas_obj);
72 _child_add(Eo *obj, void *class_data, va_list *list)
74 Widget_Data *wd = class_data;
76 child = va_arg(*list, Eo *);
77 wd->children = eina_list_append(wd->children, eo_xref(child, obj));
81 _constructor(Eo *obj, void *class_data EINA_UNUSED)
83 eo_constructor_super(obj);
86 Eo *parent = eo_parent_get(obj);
88 eo_do(parent, evas_obj_child_add(obj));
92 _destructor(Eo *obj, void *class_data)
94 eo_destructor_super(obj);
96 Widget_Data *wd = class_data;
99 EINA_LIST_FREE(wd->children, child)
101 eo_xunref(child, obj);
106 _class_constructor(Eo_Class *klass)
108 const Eo_Op_Func_Description func_desc[] = {
109 EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_POSITION_SET), _position_set),
110 EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_SIZE_SET), _size_set),
111 EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_COLOR_SET), _color_set),
112 EO_OP_FUNC_CONST(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_COLOR_GET), _color_get),
113 EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_VISIBILITY_SET), _visibility_set),
114 EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_CHILD_ADD), _child_add),
118 eo_class_funcs_set(klass, func_desc);
121 static const Eo_Op_Description op_desc[] = {
122 EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_POSITION_SET, "ii", "Position of an evas object."),
123 EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_SIZE_SET, "ii", "Size of an evas object."),
124 EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_COLOR_SET, "iiii", "Color of an evas object."),
125 EO_OP_DESCRIPTION_CONST(EVAS_OBJ_SUB_ID_COLOR_GET, "iiii", "Color of an evas object."),
126 EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_VISIBILITY_SET, "b", "Visibility of an evas object."),
127 EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_CHILD_ADD, "o", "Add a child eo."),
128 EO_OP_DESCRIPTION_SENTINEL
131 static const Eo_Class_Description class_desc = {
133 EO_CLASS_TYPE_REGULAR_NO_INSTANT,
134 EO_CLASS_DESCRIPTION_OPS(&EVAS_OBJ_BASE_ID, op_desc, EVAS_OBJ_SUB_ID_LAST),
143 EO_DEFINE_CLASS(evas_object_class_get, &class_desc, EO_BASE_CLASS, NULL)