multi-touch has a rotate button for testing.
authorCarsten Haitzler <raster@rasterman.com>
Wed, 8 Dec 2010 03:37:33 +0000 (03:37 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Wed, 8 Dec 2010 03:37:33 +0000 (03:37 +0000)
SVN revision: 55368

src/bin/test_multi.c

index 2502fd6c51417d889aa73fe84c96c492b71f9bd7..45fe59d496b572c0a39541cdb53b0c789be8e3d0 100644 (file)
@@ -69,10 +69,17 @@ _multi_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__
    evas_object_resize(indicator[ev->device], 1, 1);
 }
 
+void
+my_bt_rot(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+   Evas_Object *win = data;
+   elm_win_rotation_set(win, elm_win_rotation_get(win) + 90);
+}
+
 void
 test_multi(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
-   Evas_Object *win, *bg, *r;
+   Evas_Object *win, *bg, *r, *bx, *bt;
    int i;
 
    win = elm_win_add(NULL, "bg-plain", ELM_WIN_BASIC);
@@ -85,6 +92,7 @@ test_multi(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    evas_object_show(bg);
 
    r = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_weight_set(r, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_color_set(r, 0, 0, 0, 0);
    elm_win_resize_object_add(win, r);
    evas_object_show(r);
@@ -104,7 +112,20 @@ test_multi(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    evas_object_event_callback_add(r, EVAS_CALLBACK_MULTI_DOWN, _multi_down, win);
    evas_object_event_callback_add(r, EVAS_CALLBACK_MULTI_UP, _multi_up, win);
    evas_object_event_callback_add(r, EVAS_CALLBACK_MULTI_MOVE, _multi_move, win);
-
+   
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+   
+   bt = elm_button_add(win);
+   elm_button_label_set(bt, "Rotate");
+   evas_object_smart_callback_add(bt, "clicked", my_bt_rot, win);
+   evas_object_size_hint_align_set(bt, 0.0, 0.0);
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, bt);
+   evas_object_show(bt);
+   
    evas_object_size_hint_min_set(bg, 160, 160);
    evas_object_resize(win, 480, 800);