ami pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5cac1baf1faf4b0fe56b95630648371f2c29dc3b

commit 5cac1baf1faf4b0fe56b95630648371f2c29dc3b
Author: Amitesh Singh <amitesh...@samsung.com>
Date:   Fri Jun 9 14:14:46 2017 +0900

    elm-test: ui.image.zoomable: make anim example to work with zoom
    
    mousewheel can be used to zoom in and zoom out.
---
 src/bin/elementary/test_photocam.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/bin/elementary/test_photocam.c 
b/src/bin/elementary/test_photocam.c
index f38bcd6b50..26c520ffcc 100644
--- a/src/bin/elementary/test_photocam.c
+++ b/src/bin/elementary/test_photocam.c
@@ -745,7 +745,7 @@ _zoomable_clicked_cb(void *data EINA_UNUSED, Evas_Object 
*obj, void *event_info
 void
 test_photocam_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 
void *event_info EINA_UNUSED)
 {
-   Evas_Object *win, *bx, *lbl, *zoomable;
+   Evas_Object *win, *bx, *lbl, *zoomable, *rect;
    char buf[PATH_MAX];
 
    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
@@ -777,6 +777,17 @@ test_photocam_animated(void *data EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, voi
    evas_object_show(zoomable);
    evas_object_smart_callback_add(zoomable, "clicked", _zoomable_clicked_cb, 
NULL);
 
+   rect = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_color_set(rect, 0, 0, 0, 0);
+   evas_object_repeat_events_set(rect, EINA_TRUE);
+   evas_object_show(rect);
+   evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_WHEEL, 
_photocam_mouse_wheel_cb, zoomable);
+   evas_object_raise(rect);
+
+   // add move/resize callbacks to resize rect manually
+   evas_object_event_callback_add(zoomable, EVAS_CALLBACK_RESIZE, 
_photocam_move_resize_cb, rect);
+   evas_object_event_callback_add(zoomable, EVAS_CALLBACK_MOVE, 
_photocam_move_resize_cb, rect);
+
    evas_object_resize(win, 320, 320);
    evas_object_show(win);
 }

-- 


Reply via email to