From: barbieri Date: Fri, 27 Feb 2009 15:30:32 +0000 (+0000) Subject: Create macros to help initialize class structures. X-Git-Tag: accepted/2.0/20130306.225542~242^2~2585 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e74ce8ef3619ace762085a4ebfa994b4249044c;p=profile%2Fivi%2Fevas.git Create macros to help initialize class structures. also defined evas_smart_new() as deprecated. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@39266 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_box.c b/src/lib/canvas/evas_object_box.c index af5ba38..26d4682 100644 --- a/src/lib/canvas/evas_object_box.c +++ b/src/lib/canvas/evas_object_box.c @@ -50,7 +50,7 @@ struct _Evas_Object_Box_Accessor return val; \ } -static Evas_Smart_Class _parent_sc = {NULL}; +static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; static Eina_Bool _evas_object_box_iterator_next(Evas_Object_Box_Iterator *it, void **data) @@ -456,9 +456,7 @@ _evas_object_box_smart_calculate(Evas_Object *o) static Evas_Smart * _evas_object_box_smart_class_new(void) { - static Evas_Object_Box_Api api = { - {"Evas_Object_Box", EVAS_SMART_CLASS_VERSION}, - }; + static Evas_Object_Box_Api api = EVAS_OBJECT_BOX_API_INIT_NAME_VERSION("Evas_Object_Box"); if (!_parent_sc.name) evas_object_box_smart_set(&api); diff --git a/src/lib/canvas/evas_object_smart_clipped.c b/src/lib/canvas/evas_object_smart_clipped.c index 72c2b48..4eae6f5 100644 --- a/src/lib/canvas/evas_object_smart_clipped.c +++ b/src/lib/canvas/evas_object_smart_clipped.c @@ -179,7 +179,7 @@ evas_object_smart_clipped_smart_member_del(Evas_Object *obj, Evas_Object *member * somewhere, example: * * @code - * static Evas_Smart_Class parent_sc = {NULL}; + * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL; * * static void my_class_smart_add(Evas_Object *o) * { @@ -190,7 +190,7 @@ evas_object_smart_clipped_smart_member_del(Evas_Object *obj, Evas_Object *member * * Evas_Smart_Class *my_class_new(void) * { - * static Evas_Smart_Class sc = {"MyClass"}; + * static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass"); * if (!parent_sc.name) * { * evas_object_smart_clipped_smart_set(&sc); diff --git a/src/lib/canvas/evas_object_table.c b/src/lib/canvas/evas_object_table.c index 8d45950..809bf30 100644 --- a/src/lib/canvas/evas_object_table.c +++ b/src/lib/canvas/evas_object_table.c @@ -799,7 +799,7 @@ _evas_object_table_smart_calculate_regular(Evas_Object *o, Evas_Object_Table_Dat _evas_object_table_calculate_layout_regular(o, priv); } -static Evas_Smart_Class _parent_sc = {NULL}; +static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; static void _evas_object_table_smart_add(Evas_Object *o) @@ -907,9 +907,7 @@ _evas_object_table_smart_set(Evas_Smart_Class *sc) static Evas_Smart * _evas_object_table_smart_class_new(void) { - static Evas_Smart_Class sc = { - "Evas_Object_Table", EVAS_SMART_CLASS_VERSION, - }; + static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("Evas_Object_Table"); if (!_parent_sc.name) _evas_object_table_smart_set(&sc);