[TBT][EFL][Non-ACR][added 3D rotation efl api] 66/100866/8
authormanu.tiwari <manu.tiwari@samsung.com>
Tue, 29 Nov 2016 11:37:33 +0000 (17:07 +0530)
committermanu.tiwari <manu.tiwari@samsung.com>
Fri, 2 Dec 2016 05:52:21 +0000 (11:22 +0530)
Change-Id: I06a2e65c46cb9ee75f551db475c8552f4c11c03f
Signed-off-by: manu.tiwari <manu.tiwari@samsung.com>
release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk
release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk
tbtcoreapp/inc/model/tbt-info.h
tbtcoreapp/inc/utils/app_module_config.h [changed mode: 0644->0755]
tbtcoreapp/src/model/tbt-list.c [changed mode: 0644->0755]
tbtcoreapp/src/view/tbt-genlist-view.c
tbtcoreapp/src/view/tbt-ui-view.c

index d4ee197bc2cccece8a700d58ad25f0e289de5f78..1308948a05586326c96e157ec2dc10f32ac1afc7 100644 (file)
Binary files a/release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk and b/release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk differ
index 9f34b6212dcb1ccd3a39fea15a7ee91fa0ef5403..530f79d29bacd0150495f11f0506904de74ee041 100644 (file)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
index 0c8d1d5dd620ccf2ddc21d70c0103c0578f845b2..5e2621799af55b9e9940d6154ee0f7e2dd7b2ffb 100644 (file)
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ
index 3224e0464f61c88e00b23edbfdce281da123a576..72df4dbaec4a9fd152bca476782626688bb86d88 100644 (file)
Binary files a/release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk and b/release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk differ
index dbd2383608874d3d1f9229b9e198efad0e06a7fe..da26f30e8e3791f8200d213aaeac0d5bb648d2e3 100644 (file)
@@ -146,6 +146,7 @@ typedef enum {
     TBT_APP_UI_RESIZE,
     TBT_APP_UI_SHAPE,
     TBT_APP_UI_ROTATE,
+    TBT_APP_UI_3D_ROTATE,
     TBT_APP_UI_FONT,
     TBT_APP_UI_LINE,
     TBT_APP_UI_ALPHA,
old mode 100644 (file)
new mode 100755 (executable)
index 3553026..94ba0f2
 #define TBT_MODULE_APP_UI_RESIZE
 #define TBT_MODULE_APP_UI_SHAPE
 #define TBT_MODULE_APP_UI_ROTATE
+#define TBT_MODULE_APP_UI_3D_ROTATE
 #define TBT_MODULE_APP_UI_FONT
 #define TBT_MODULE_APP_UI_LINE
 #define TBT_MODULE_APP_UI_ALPHA
old mode 100644 (file)
new mode 100755 (executable)
index 3b44d28..4a0502d
@@ -1493,6 +1493,19 @@ static tbt_info tbtapps[] =
                },
        #endif
 
+       #ifdef TBT_MODULE_APP_UI_3D_ROTATE
+
+               // Rotate
+               {
+                       .name = "Rotate 3D",
+                       .parent = "UI Test",
+                       .apptype = TBT_APP_UI_3D_ROTATE,
+                       .icon_name = "dummy",
+                       .info = "Rotate rectangle in 3D",
+                       .result = 0
+               },
+       #endif
+
        #ifdef TBT_MODULE_APP_UI_FONT
 
                // Font
index 352960677bb5d1092451f64ab1d030aa1755839c..728ad1c0728fae0386d06512daea619ecafed366 100644 (file)
@@ -918,8 +918,10 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void
                        case TBT_APP_UI_ALPHA:
                                ui_view_add(view->navi, info, it);
                                break;
+                       case TBT_APP_UI_3D_ROTATE:
+                               ui_view_add(view->navi, info, it);
+                               break;
                #endif
-
                #ifdef TBT_MODULE_TOUCH
                        case TBT_APP_TOUCH_TOUCH:
                                touch_view_add(view->navi, info, it);
index b1b2678201eb3bc64dcd2864d8b2e4e0ca6e0278..21a2b21e6de647875f73e468808ddc0120a60d62 100644 (file)
@@ -59,6 +59,7 @@ struct _ui_view
 };
 
 static void set_rotation(ui_view *this);
+static void set_rotation_3D(ui_view *this);
 static void calc_coordinate(ui_view *this);
 static void get_screen_resolution(ui_view *this);
 
@@ -235,7 +236,35 @@ ui_view *ui_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *ite
                evas_object_color_set(this->ui_element, r, g, b, this->alpha);
                evas_object_show(this->ui_element);
        }
+       else if(this->view->tbt_info->apptype == TBT_APP_UI_3D_ROTATE)
+       {
+               int r, g, b, a;
+
+               r = 0;
+               g = 255;
+               b = 0;
+               a = 250;
+
+               int offset;
 
+               #ifdef DEVICE_TYPE_MOBILE
+                       offset = 100;
+               #else
+                       offset = 50;
+               #endif
+               this->x = this->screen_width / 2 - offset;
+               this->y = this->screen_height / 2 - offset + this->toolbar_height;
+
+               Evas *evas = evas_object_evas_get(this->view->layout);
+               this->ui_element = evas_object_rectangle_add(evas);
+
+               evas_object_move(this->ui_element, this->x, this->y);
+               evas_object_resize(this->ui_element, 2*offset, 2*offset);
+               evas_object_color_set(this->ui_element, r, g, b, a);
+               evas_object_show(this->ui_element);
+       }
+       
+       
     this->timer = ecore_timer_add(1, _ui_view_timer_cb, this);
 
     return this;
@@ -288,7 +317,36 @@ static void set_rotation(ui_view *this)
        evas_object_map_enable_set(o, EINA_TRUE);
        evas_map_free(m);
 }
+/**
+ * @function           set_rotation_3D
+ * @since_tizen                2.3
+ * @description                Set Rotation
+ * @parameter          ui_view*: Ui View Pointer
+ * @return             static void
+ */
+static void set_rotation_3D(ui_view *this)
+{
+       Evas_Coord x, y, w, h;
+    double degree = 45;
+       Evas_Object *o;
+       o = this->ui_element;
+
+       if(this->rotation < 0) this->rotation=-this->rotation;
+       if(this->rotation>=360) this->rotation=this->rotation%360;
 
+       evas_object_geometry_get(o, &x, &y, &w, &h);
+       Evas_Map *m = evas_map_new(4);
+       // Set the object image UV values to map
+       evas_map_util_points_populate_from_object_full(m, o, 0);
+       // Rotate by 45 degrees on object's local Y axis
+       evas_map_util_3d_rotate(m, this->rotation, degree, 0, x + w / 2, y + h / 2, 0);
+       // Set the perspective transform
+       evas_map_util_3d_perspective(m, x + w / 2, y + h / 2, 0, 400);
+
+       evas_object_map_set(o, m);
+       evas_object_map_enable_set(o, EINA_TRUE);
+       evas_map_free(m);
+}
 
 /**
  * @function           get_screen_resolution
@@ -354,6 +412,11 @@ static Eina_Bool _ui_view_timer_cb(void *data)
                set_rotation(this);
                this->rotation += 36;
        }
+       else if(this->view->tbt_info->apptype == TBT_APP_UI_3D_ROTATE)
+       {
+               set_rotation_3D(this);
+               this->rotation += 36;
+       }
        else if(this->view->tbt_info->apptype == TBT_APP_UI_FONT)
        {
                evas_object_color_set(this->ui_element, rand()%256,rand()%256,rand()%256, 255);