Eobj: s/__UNUSED__/EINA_UNUSED/ I had no idea that exists.
[profile/ivi/eobj.git] / examples / evas / elw_boxedbutton.c
1 #include <Elementary.h>
2
3 #include "Eobj.h"
4 #include "evas_obj.h"
5 #include "elw_box.h"
6 #include "elw_button.h"
7 #include "elw_boxedbutton.h"
8
9 #include "config.h"
10
11 typedef struct
12 {
13 //   Evas_Object *bx;
14 } Widget_Data;
15
16 static const Eobj_Class *_my_class = NULL;
17
18 static void
19 _constructor(Eobj *obj, void *class_data EINA_UNUSED)
20 {
21    eobj_constructor_super(obj);
22
23    Eobj *bt = eobj_add(ELW_BUTTON_CLASS, obj);
24    eobj_composite_object_attach(obj, bt);
25    eobj_event_callback_forwarder_add(bt, SIG_CLICKED, obj);
26    eobj_do(bt, EVAS_OBJ_VISIBILITY_SET(EINA_TRUE));
27
28    eobj_do(obj, ELW_BOX_PACK_END(bt));
29    eobj_unref(bt);
30 }
31
32 const Eobj_Class *
33 elw_boxedbutton_class_get(void)
34 {
35    if (_my_class) return _my_class;
36
37    static const Eobj_Class_Description class_desc = {
38         "Elw BoxedButton",
39         EOBJ_CLASS_TYPE_REGULAR,
40         EOBJ_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
41         NULL,
42         sizeof(Widget_Data),
43         _constructor,
44         NULL,
45         NULL,
46         NULL
47    };
48
49    return _my_class = eobj_class_new(&class_desc, ELW_BOX_CLASS,
50          ELW_BUTTON_CLASS, NULL);
51 }
52