Enlightenment CVS committal Author : moom Project : e17 Module : libs/etk
Dir : e17/libs/etk/src/lib Modified Files: etk_widget.c Log Message: * Quick'n'dirty hack in order to make Etk work correctly with the latest Evas (it fixes scrolling) =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_widget.c,v retrieving revision 1.130 retrieving revision 1.131 diff -u -3 -r1.130 -r1.131 --- etk_widget.c 5 Oct 2007 20:29:14 -0000 1.130 +++ etk_widget.c 13 Oct 2007 15:57:15 -0000 1.131 @@ -160,6 +160,9 @@ static void _etk_widget_content_object_clip_set_cb(Evas_Object *obj, Evas_Object *clip); static void _etk_widget_content_object_clip_unset_cb(Evas_Object *obj); +static void _evas_object_smart_move(Evas_Object *object, Evas_Coord x, Evas_Coord y); +static void _evas_object_smart_resize(Evas_Object *object, Evas_Coord w, Evas_Coord h); + static Etk_Bool _etk_widget_intercept_show_hide = ETK_TRUE; static Evas_Smart *_etk_widget_smart_object_smart = NULL; @@ -1349,9 +1352,9 @@ evas_object_geometry_get(widget->smart_object, &x, &y, &w, &h); if (geometry.x != x || geometry.y != y || widget->need_redraw) - evas_object_move(widget->smart_object, geometry.x, geometry.y); + _evas_object_smart_move(widget->smart_object, geometry.x, geometry.y); if (geometry.w != w || geometry.h != h || widget->need_redraw) - evas_object_resize(widget->smart_object, geometry.w, geometry.h); + _evas_object_smart_resize(widget->smart_object, geometry.w, geometry.h); } /** @@ -3176,10 +3179,10 @@ if (widget->theme_object) { evas_object_geometry_get(widget->theme_object, &child_x, &child_y, NULL, NULL); - evas_object_move(widget->theme_object, child_x + x_offset, child_y + y_offset); + _evas_object_smart_move(widget->theme_object, child_x + x_offset, child_y + y_offset); } if (widget->event_object) - evas_object_move(widget->event_object, widget->geometry.x, widget->geometry.y); + _evas_object_smart_move(widget->event_object, widget->geometry.x, widget->geometry.y); /* Move the member-objects and the children to the right place */ if (!widget->content_object) { @@ -3187,7 +3190,7 @@ { m = l->data; evas_object_geometry_get(m->object, &child_x, &child_y, NULL, NULL); - evas_object_move(m->object, child_x + x_offset, child_y + y_offset); + _evas_object_smart_move(m->object, child_x + x_offset, child_y + y_offset); } for (l = widget->children; l; l = l->next) { @@ -3195,7 +3198,7 @@ if (!child->swallowed) { evas_object_geometry_get(child->smart_object, &child_x, &child_y, NULL, NULL); - evas_object_move(child->smart_object, child_x + x_offset, child_y + y_offset); + _evas_object_smart_move(child->smart_object, child_x + x_offset, child_y + y_offset); } } } @@ -3229,13 +3232,13 @@ if (widget->theme_object) { - evas_object_move(widget->theme_object, widget->geometry.x, widget->geometry.y); - evas_object_resize(widget->theme_object, widget->geometry.w, widget->geometry.h); + _evas_object_smart_move(widget->theme_object, widget->geometry.x, widget->geometry.y); + _evas_object_smart_resize(widget->theme_object, widget->geometry.w, widget->geometry.h); } if (widget->event_object) { - evas_object_move(widget->event_object, widget->geometry.x, widget->geometry.y); - evas_object_resize(widget->event_object, widget->geometry.w, widget->geometry.h); + _evas_object_smart_move(widget->event_object, widget->geometry.x, widget->geometry.y); + _evas_object_smart_resize(widget->event_object, widget->geometry.w, widget->geometry.h); } if ((!widget->content_object || widget->need_redraw) && widget->size_allocate) widget->size_allocate(widget, widget->inner_geometry); @@ -3495,7 +3498,7 @@ { m = l->data; evas_object_geometry_get(m->object, &child_x, &child_y, NULL, NULL); - evas_object_move(m->object, child_x + offset_x, child_y + offset_y); + _evas_object_smart_move(m->object, child_x + offset_x, child_y + offset_y); } for (l = widget->children; l; l = l->next) { @@ -3503,7 +3506,7 @@ if (!child->swallowed) { evas_object_geometry_get(child->smart_object, &child_x, &child_y, NULL, NULL); - evas_object_move(child->smart_object, child_x + offset_x, child_y + offset_y); + _evas_object_smart_move(child->smart_object, child_x + offset_x, child_y + offset_y); } } } @@ -3579,6 +3582,40 @@ if (!child->swallowed && etk_widget_clip_get(child) == prev_clip) etk_widget_clip_unset(child); } +} + +/* Moves an Evas object and call the "move" smart-method even if the object has not been moved */ +static void _evas_object_smart_move(Evas_Object *object, Evas_Coord x, Evas_Coord y) +{ + Evas_Smart *smart; + const Evas_Smart_Class *sc; + Evas_Coord prev_x, prev_y; + + if (!object) + return; + + evas_object_geometry_get(object, &prev_x, &prev_y, NULL, NULL); + evas_object_move(object, x, y); + if (x == prev_x && y == prev_y + && (smart = evas_object_smart_smart_get(object)) && (sc = evas_smart_class_get(smart)) && sc->move) + sc->move(object, x, y); +} + +/* Resizes an Evas object and call the "resize" smart-method even if the object has not been resized */ +static void _evas_object_smart_resize(Evas_Object *object, Evas_Coord w, Evas_Coord h) +{ + Evas_Smart *smart; + const Evas_Smart_Class *sc; + Evas_Coord prev_w, prev_h; + + if (!object) + return; + + evas_object_geometry_get(object, NULL, NULL, &prev_w, &prev_h); + evas_object_resize(object, w, h); + if (w == prev_w && h == prev_h + && (smart = evas_object_smart_smart_get(object)) && (sc = evas_smart_class_get(smart)) && sc->resize) + sc->resize(object, w, h); } /** @} */ ------------------------------------------------------------------------- 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