From 60080221be116dca8fe156fa2e62e223c4f46e8c Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Sat, 11 May 2013 16:07:28 +0900 Subject: [PATCH] [Release] wrt_0.8.198 Change-Id: Iabaa473c54fa123f268ba760b5bd2e7e1ffdd376 --- packaging/wrt.spec | 4 ++-- src/domain/widget_data_types.cpp | 4 ++++ src/domain/widget_data_types.h | 28 ++++++++++++++++++++++++++- src/view/webkit/view_logic.cpp | 25 ++++++++---------------- src/wrt-client/wrt-client.cpp | 42 ++++++++++++++++++++++++++++------------ src/wrt-client/wrt-client.h | 1 + wrt.manifest | 8 ++++++-- 7 files changed, 78 insertions(+), 34 deletions(-) diff --git a/packaging/wrt.spec b/packaging/wrt.spec index b1b6f40..c4a7158 100644 --- a/packaging/wrt.spec +++ b/packaging/wrt.spec @@ -1,7 +1,7 @@ -#git:framework/web/wrt wrt_0.8.197 +#git:framework/web/wrt wrt_0.8.198 Name: wrt Summary: web runtime -Version: 0.8.197 +Version: 0.8.198 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 diff --git a/src/domain/widget_data_types.cpp b/src/domain/widget_data_types.cpp index 7ebbb6d..06e87ca 100644 --- a/src/domain/widget_data_types.cpp +++ b/src/domain/widget_data_types.cpp @@ -122,6 +122,10 @@ WidgetSettingList::WidgetSettingList(WrtDB::WidgetSettings &widgetSettings) SETTING_VALUE_SCREEN_ORIENTATION_LANDSCAPE) { m_RotationLock = Screen_Landscape; + } else if (value == + SETTING_VALUE_SCREEN_ORIENTATION_AUTO_ROTATION) + { + m_RotationLock = Screen_AutoRotation; } else { LogError("Invalid screen orientation value!! [" << value << "]"); diff --git a/src/domain/widget_data_types.h b/src/domain/widget_data_types.h index 6072b1c..5be7c13 100644 --- a/src/domain/widget_data_types.h +++ b/src/domain/widget_data_types.h @@ -117,6 +117,8 @@ static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_PORTRAIT = L"portrait"; static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_LANDSCAPE = L"landscape"; +static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_AUTO_ROTATION = + L"auto-rotation"; static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_ENALBE = L"enable"; static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_DISABLE = @@ -133,7 +135,8 @@ static const DPL::String SETTING_VALUE_ENCRYPTION_DISABLE = enum WidgetSettingScreenLock { Screen_Portrait, /* Default */ - Screen_Landscape + Screen_Landscape, + Screen_AutoRotation }; enum WidgetSettingIndicatorPresence @@ -201,4 +204,27 @@ class WidgetSettingList std::string m_UserAgent; }; +namespace OrientationAngle { +namespace W3C { +namespace Portrait { +const int PRIMARY = 0; +const int SECONDARY = 180; +} // namespace Portrait +namespace Landscape { +const int PRIMARY = 90; +const int SECONDARY = -90; +} // namespace Landscape +} // namespace W3C +namespace Window { +namespace Portrait { +const int PRIMARY = 0; +const int SECONDARY = 180; +} // namespace Portrait +namespace Landscape { +const int PRIMARY = 270; +const int SECONDARY = 90; +} // namespace Landscape +} // namespace Window +} // namespace OrientationAngle + #endif /* WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_ */ diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index 3f7dbb3..cb7fd3b 100644 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -96,15 +96,6 @@ const char CONTENT_HANDLER_ASK_MSG[] = "Add content?"; const char CONTENT_HANDLER_ASK_TITLE[] = "Add content"; const char CONTENT_HANDLER_AKS_REMEMBER[] = "Remember dicision"; -const int WIN_ORIENTATION_PORTRAIT_PRIMARY_ANGLE = 0; -const int WIN_ORIENTATION_PORTRAIT_SECONDARY_ANGLE = 180; -const int WIN_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE = 270; -const int WIN_ORIENTATION_LANDSCAPE_SECONDARY_ANGLE = 90; -const int W3C_ORIENTATION_PORTRAIT_PRIMARY_ANGLE = 0; -const int W3C_ORIENTATION_PORTRAIT_SECONDARY_ANGLE = 180; -const int W3C_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE = 90; -const int W3C_ORIENTATION_LANDSCAPE_SECONDARY_ANGLE = -90; - const char* const DEFAULT_ENCODING = "UTF-8"; #ifdef CSP_ENABLED const char* const DEFAULT_CSP_POLICY = @@ -1363,32 +1354,32 @@ Eina_Bool ViewLogic::orientationLockCallback( LogDebug("orientation is portrait-primary"); elm_win_wm_rotation_preferred_rotation_set( This->m_window, - WIN_ORIENTATION_PORTRAIT_PRIMARY_ANGLE); - ewk_view_orientation_send(obj, W3C_ORIENTATION_PORTRAIT_PRIMARY_ANGLE); + OrientationAngle::Window::Portrait::PRIMARY); + ewk_view_orientation_send(obj, OrientationAngle::W3C::Portrait::PRIMARY); } else if (orientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_PRIMARY) { LogDebug("orientation is landscape-primary"); elm_win_wm_rotation_preferred_rotation_set( This->m_window, - WIN_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE); + OrientationAngle::Window::Landscape::PRIMARY); ewk_view_orientation_send( obj, - W3C_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE); + OrientationAngle::W3C::Landscape::PRIMARY); } else if (orientation & EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY) { LogDebug("orientation is portrait-secondary"); elm_win_wm_rotation_preferred_rotation_set( This->m_window, - WIN_ORIENTATION_PORTRAIT_SECONDARY_ANGLE); + OrientationAngle::Window::Portrait::SECONDARY); ewk_view_orientation_send( obj, - W3C_ORIENTATION_PORTRAIT_SECONDARY_ANGLE); + OrientationAngle::W3C::Portrait::SECONDARY); } else if (orientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_SECONDARY) { LogDebug("orientation is landscape-secondary"); elm_win_wm_rotation_preferred_rotation_set( This->m_window, - WIN_ORIENTATION_LANDSCAPE_SECONDARY_ANGLE); + OrientationAngle::Window::Landscape::SECONDARY); ewk_view_orientation_send( obj, - W3C_ORIENTATION_LANDSCAPE_SECONDARY_ANGLE); + OrientationAngle::W3C::Landscape::SECONDARY); } else { LogDebug("Wrong orientation is set"); return EINA_FALSE; diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp index 8943a16..24d8cdd 100644 --- a/src/wrt-client/wrt-client.cpp +++ b/src/wrt-client/wrt-client.cpp @@ -59,12 +59,6 @@ static WindowData* s_preparedWindowData = NULL; static int app_argc = 0; static char** app_argv = NULL; -// orientation -const int WIN_ORIENTATION_PORTRAIT_PRIMARY_ANGLE = 0; -const int WIN_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE = 270; -const int W3C_ORIENTATION_PORTRAIT_PRIMARY_ANGLE = 0; -const int W3C_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE = 90; - // env const char* const HOME = "HOME"; const char* const APP_HOME_PATH = "/opt/home/app"; @@ -604,18 +598,35 @@ void WrtClient::setOrientationWindow(void) if (rotationValue == Screen_Portrait) { elm_win_wm_rotation_preferred_rotation_set( m_windowData->m_win, - WIN_ORIENTATION_PORTRAIT_PRIMARY_ANGLE); + OrientationAngle::Window::Portrait::PRIMARY); } else if (rotationValue == Screen_Landscape) { elm_win_wm_rotation_preferred_rotation_set( m_windowData->m_win, - WIN_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE); + OrientationAngle::Window::Landscape::PRIMARY); + } else if (rotationValue == Screen_AutoRotation) { + LogInfo("Nothing to do"); } else { elm_win_wm_rotation_preferred_rotation_set( m_windowData->m_win, - WIN_ORIENTATION_PORTRAIT_PRIMARY_ANGLE); + OrientationAngle::W3C::Portrait::PRIMARY); + } +} + +void WrtClient::unsetOrientationWindow(void) +{ + Assert(m_windowData); + Assert(m_dao); + + WrtDB::WidgetSettings widgetSettings; + m_dao->getWidgetSettings(widgetSettings); + WidgetSettingList settings(widgetSettings); + WidgetSettingScreenLock rotationValue = settings.getRotationValue(); + if (rotationValue == Screen_AutoRotation) { + LogInfo("Nothing to do"); } } + void WrtClient::setOrientationEwk(void) { Assert(m_widget); @@ -628,15 +639,19 @@ void WrtClient::setOrientationEwk(void) if (rotationValue == Screen_Portrait) { ewk_view_orientation_send( m_widget->GetCurrentWebview(), - W3C_ORIENTATION_PORTRAIT_PRIMARY_ANGLE); + OrientationAngle::W3C::Portrait::PRIMARY); } else if (rotationValue == Screen_Landscape) { ewk_view_orientation_send( m_widget->GetCurrentWebview(), - W3C_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE); + OrientationAngle::W3C::Landscape::PRIMARY); + } else if (rotationValue == Screen_AutoRotation) { + ewk_view_orientation_send( + m_widget->GetCurrentWebview(), + OrientationAngle::W3C::Portrait::PRIMARY); } else { ewk_view_orientation_send( m_widget->GetCurrentWebview(), - W3C_ORIENTATION_PORTRAIT_PRIMARY_ANGLE); + OrientationAngle::W3C::Portrait::PRIMARY); } } @@ -684,6 +699,9 @@ void WrtClient::shutdownStep() if (m_widget && m_widgetState) { m_widgetState = WidgetState_Stopped; m_widget->Hide(); + // AutoRotation use m_widget pointer internally. + // It must be unset before m_widget is released. + unsetOrientationWindow(); m_widget.reset(); ewk_context_delete(s_preparedEwkContext); PrepareExternalStorageSingleton::Instance().Deinitialize(); diff --git a/src/wrt-client/wrt-client.h b/src/wrt-client/wrt-client.h index a792263..773c425 100644 --- a/src/wrt-client/wrt-client.h +++ b/src/wrt-client/wrt-client.h @@ -87,6 +87,7 @@ class WrtClient : //orientation void setOrientationWindow(); + void unsetOrientationWindow(); void setOrientationEwk(); // launching steps diff --git a/wrt.manifest b/wrt.manifest index 6f9e2cd..bef73b2 100644 --- a/wrt.manifest +++ b/wrt.manifest @@ -1,9 +1,13 @@ - + + + - + -- 2.7.4