Enlightenment CVS committal Author : pfritz Project : e17 Module : libs/esmart
Dir : e17/libs/esmart/src/lib/esmart_draggies Modified Files: esmart_draggies.c Log Message: use evas_smart_class_new() =================================================================== RCS file: /cvs/e/e17/libs/esmart/src/lib/esmart_draggies/esmart_draggies.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- esmart_draggies.c 6 Sep 2006 07:17:48 -0000 1.4 +++ esmart_draggies.c 4 Aug 2007 14:50:40 -0000 1.5 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ /************************************************************************** * draggies.c : a rectangle to add to your borderless/shaped ecore_evas app * that will handle moving the ecore evas, as if it were a border. @@ -113,22 +116,22 @@ return (NULL); if ((result = esmart_dragable_object_new (ecore_evas_get (ee)))) { - if ((data = evas_object_smart_data_get (result))) - { - data->ee = ee; - o = evas_object_rectangle_add (ecore_evas_get (ee)); - evas_object_color_set (o, 255, 255, 255, 0); - evas_object_repeat_events_set (o, 1); - evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_DOWN, - _mouse_down_cb, data); - evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_UP, - _mouse_up_cb, data); - evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_MOVE, - _mouse_move_cb, data); - data->obj = o; + if ((data = evas_object_smart_data_get (result))) + { + data->ee = ee; + o = evas_object_rectangle_add (ecore_evas_get (ee)); + evas_object_color_set (o, 255, 255, 255, 0); + evas_object_repeat_events_set (o, 1); + evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_DOWN, + _mouse_down_cb, data); + evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_UP, + _mouse_up_cb, data); + evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_MOVE, + _mouse_move_cb, data); + data->obj = o; - evas_object_smart_member_add(o, result); - } + evas_object_smart_member_add(o, result); + } } return (result); } @@ -177,20 +180,26 @@ { static Evas_Smart *smart = NULL; - if (smart) - return smart; - - smart = evas_smart_new ("esmart_dragable_object", - _esmart_dragable_object_add, - _esmart_dragable_object_del, - NULL, NULL, NULL, NULL, NULL, - _esmart_dragable_object_move, - _esmart_dragable_object_resize, - _esmart_dragable_object_show, - _esmart_dragable_object_hide, - _esmart_dragable_object_color_set, - _esmart_dragable_object_clip_set, - _esmart_dragable_object_clip_unset, NULL); + if (!smart) + { + static const Evas_Smart_Class sc = + { + "esmart_dragable_object", + EVAS_SMART_CLASS_VERSION, + _esmart_dragable_object_add, + _esmart_dragable_object_del, + _esmart_dragable_object_move, + _esmart_dragable_object_resize, + _esmart_dragable_object_show, + _esmart_dragable_object_hide, + _esmart_dragable_object_color_set, + _esmart_dragable_object_clip_set, + _esmart_dragable_object_clip_unset, + NULL + }; + + smart = evas_smart_class_new(&sc); + } return smart; } ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs