From: manu.tiwari Date: Tue, 29 Nov 2016 11:37:33 +0000 (+0530) Subject: [TBT][EFL][Non-ACR][added 3D rotation efl api] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F100866%2F8;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][EFL][Non-ACR][added 3D rotation efl api] Change-Id: I06a2e65c46cb9ee75f551db475c8552f4c11c03f Signed-off-by: manu.tiwari --- diff --git a/release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk b/release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk index d4ee197..1308948 100644 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 diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 9f34b62..530f79d 100644 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 diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk index 0c8d1d5..5e26217 100644 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 diff --git a/release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk b/release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk index 3224e04..72df4db 100644 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 diff --git a/tbtcoreapp/inc/model/tbt-info.h b/tbtcoreapp/inc/model/tbt-info.h index dbd2383..da26f30 100644 --- a/tbtcoreapp/inc/model/tbt-info.h +++ b/tbtcoreapp/inc/model/tbt-info.h @@ -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, diff --git a/tbtcoreapp/inc/utils/app_module_config.h b/tbtcoreapp/inc/utils/app_module_config.h old mode 100644 new mode 100755 index 3553026..94ba0f2 --- a/tbtcoreapp/inc/utils/app_module_config.h +++ b/tbtcoreapp/inc/utils/app_module_config.h @@ -131,6 +131,7 @@ #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 diff --git a/tbtcoreapp/src/model/tbt-list.c b/tbtcoreapp/src/model/tbt-list.c old mode 100644 new mode 100755 index 3b44d28..4a0502d --- a/tbtcoreapp/src/model/tbt-list.c +++ b/tbtcoreapp/src/model/tbt-list.c @@ -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 diff --git a/tbtcoreapp/src/view/tbt-genlist-view.c b/tbtcoreapp/src/view/tbt-genlist-view.c index 3529606..728ad1c 100644 --- a/tbtcoreapp/src/view/tbt-genlist-view.c +++ b/tbtcoreapp/src/view/tbt-genlist-view.c @@ -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); diff --git a/tbtcoreapp/src/view/tbt-ui-view.c b/tbtcoreapp/src/view/tbt-ui-view.c index b1b2678..21a2b21 100644 --- a/tbtcoreapp/src/view/tbt-ui-view.c +++ b/tbtcoreapp/src/view/tbt-ui-view.c @@ -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);