aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/eobj/examples/evas/elw_win.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2012-04-23 08:09:54 +0000
committerTom Hacohen <tom@stosb.com>2012-04-23 08:09:54 +0000
commite0f6adbea62ce1cd54449e7959ff6fb721420ac2 (patch)
treec5f52320c0777672b421a860e80e294ca8fb829a /legacy/eobj/examples/evas/elw_win.c
parentEobj: Fixed issue with FindEina.cmake and things using it. (diff)
downloadefl-e0f6adbea62ce1cd54449e7959ff6fb721420ac2.tar.gz
Eobj: Add a convenience macro for defining the class_get functions.
This macro makes the code a tad simpler, but more importantly, makes it easier for us to be thread safe, or more corrctly, easier for us the make user code thread safe. SVN revision: 70407
Diffstat (limited to 'legacy/eobj/examples/evas/elw_win.c')
-rw-r--r--legacy/eobj/examples/evas/elw_win.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/legacy/eobj/examples/evas/elw_win.c b/legacy/eobj/examples/evas/elw_win.c
index 3fe4214703..2393bada42 100644
--- a/legacy/eobj/examples/evas/elw_win.c
+++ b/legacy/eobj/examples/evas/elw_win.c
@@ -10,7 +10,7 @@ typedef struct
Evas_Object *bg;
} Widget_Data;
-static const Eobj_Class *_my_class = NULL;
+#define MY_CLASS ELW_WIN_CLASS
static void
my_win_del(void *data, Evas_Object *obj, void *event_info)
@@ -43,23 +43,18 @@ _constructor(Eobj *obj, void *class_data)
eobj_evas_object_set(obj, wd->win);
}
-const Eobj_Class *
-elw_win_class_get(void)
-{
- if (_my_class) return _my_class;
+static const Eobj_Class_Description class_desc = {
+ "Elw Win",
+ EOBJ_CLASS_TYPE_REGULAR,
+ EOBJ_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
+ NULL,
+ sizeof(Widget_Data),
+ _constructor,
+ NULL,
+ NULL,
+ NULL
+};
- static const Eobj_Class_Description class_desc = {
- "Elw Win",
- EOBJ_CLASS_TYPE_REGULAR,
- EOBJ_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
- NULL,
- sizeof(Widget_Data),
- _constructor,
- NULL,
- NULL,
- NULL
- };
- return _my_class = eobj_class_new(&class_desc, EVAS_OBJ_CLASS, NULL);
-}
+EOBJ_DEFINE_CLASS(elw_win_class_get, &class_desc, EVAS_OBJ_CLASS, NULL)