Flip widget: add 2 new flip style:
authorDavide Andreoli <dave@gurumeditation.it>
Fri, 16 Jul 2010 20:30:11 +0000 (20:30 +0000)
committerDavide Andreoli <dave@gurumeditation.it>
Fri, 16 Jul 2010 20:30:11 +0000 (20:30 +0000)
   ELM_FLIP_CUBE_RIGHT, ELM_FLIP_CUBE_LEFT

As you can imagine the new animations make the flip as a rotating cube,
the 2 contents are on 2 different faces.

SVN revision: 50287

src/bin/test_flip.c
src/lib/elm_flip.c

index f8932a2..7cc676b 100644 (file)
@@ -30,6 +30,20 @@ my_fl_4(void *data, Evas_Object *obj, void *event_info)
 }
 
 void
+my_fl_5(void *data, Evas_Object *obj, void *event_info)
+{
+   Evas_Object *fl = data;
+   elm_flip_go(fl, ELM_FLIP_CUBE_LEFT);
+}
+
+void
+my_fl_6(void *data, Evas_Object *obj, void *event_info)
+{
+   Evas_Object *fl = data;
+   elm_flip_go(fl, ELM_FLIP_CUBE_RIGHT);
+}
+
+void
 test_flip(void *data, Evas_Object *obj, void *event_info)
 {
    Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt, *ly;
@@ -123,6 +137,22 @@ test_flip(void *data, Evas_Object *obj, void *event_info)
    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
    elm_box_pack_end(bx2, bt);
    evas_object_show(bt);
+
+   bt = elm_button_add(win);
+   elm_button_label_set(bt, "5");
+   evas_object_smart_callback_add(bt, "clicked", my_fl_5, fl);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+   elm_box_pack_end(bx2, bt);
+   evas_object_show(bt);
+   
+   bt = elm_button_add(win);
+   elm_button_label_set(bt, "6");
+   evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+   elm_box_pack_end(bx2, bt);
+   evas_object_show(bt);
    
    elm_box_pack_end(bx, bx2);
    evas_object_show(bx2);
index e82023a..9287dfa 100644 (file)
@@ -192,6 +192,37 @@ _flip(Evas_Object *obj)
         evas_map_util_3d_rotate(mf, 0.0, deg, deg, cx, cy, 0);
         evas_map_util_3d_rotate(mb, 0.0, deg + 180.0, deg + 180.0, cx, cy, 0);
         break;
+     case ELM_FLIP_CUBE_LEFT:
+        p = 1.0 - t;
+        p = 1.0 - (p * p);
+        deg = -90.0 * p;
+        if (wd->state)
+          {
+            evas_map_util_3d_rotate(mf, 0.0, deg, 0.0, cx, cy, w / 2);
+            evas_map_util_3d_rotate(mb, 0.0, deg + 90, 0.0, cx, cy, w / 2);
+          }
+        else
+          {
+            evas_map_util_3d_rotate(mf, 0.0, deg + 90, 0.0, cx, cy, w / 2);
+            evas_map_util_3d_rotate(mb, 0.0, deg, 0.0, cx, cy, w / 2);
+          }
+        break;
+     case ELM_FLIP_CUBE_RIGHT:
+        p = 1.0 - t;
+        p = 1.0 - (p * p);
+        deg = 90.0 * p;
+        if (wd->state)
+          {
+            evas_map_util_3d_rotate(mf, 0.0, deg, 0.0, cx, cy, w / 2);
+            evas_map_util_3d_rotate(mb, 0.0, deg - 90, 0.0, cx, cy, w / 2);
+          }
+        else
+          {
+            evas_map_util_3d_rotate(mf, 0.0, deg - 90, 0.0, cx, cy, w / 2);
+            evas_map_util_3d_rotate(mb, 0.0, deg, 0.0, cx, cy, w / 2);
+          }
+        break;
+    
      default:
         break;
      }
@@ -479,6 +510,8 @@ elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc __UNUSED__, Evas_Coord
  * ELM_FLIP_ROTATE_X_CENTER_AXIS
  * ELM_FLIP_ROTATE_XZ_CENTER_AXIS
  * ELM_FLIP_ROTATE_YZ_CENTER_AXIS
+ * ELM_FLIP_SLIDE_LEFT
+ * ELM_FLIP_SLIDE_RIGHT
  *
  * @ingroup Flip
  */