Eobj: Add a convenience macro for defining the class_get functions.
[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 #define MY_CLASS ELW_BOXEDBUTTON_CLASS
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 static const Eobj_Class_Description class_desc = {
33      "Elw BoxedButton",
34      EOBJ_CLASS_TYPE_REGULAR,
35      EOBJ_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
36      NULL,
37      sizeof(Widget_Data),
38      _constructor,
39      NULL,
40      NULL,
41      NULL
42 };
43
44 EOBJ_DEFINE_CLASS(elw_boxedbutton_class_get, &class_desc, ELW_BOX_CLASS, ELW_BUTTON_CLASS, NULL)
45