From a4a92cff6d7af442e10e565d6ec15d5942e0e307 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Fri, 12 Jul 2013 03:36:50 +0900 Subject: [PATCH] fix bug for rotation Change-Id: I56e58ab293614700ae4fc664a126f12f385c6477 Signed-off-by: Seongjun Yim --- src/controls/FWebCtrl_WebImpl.cpp | 91 ++++++++++++------------------------- src/controls/inc/FWebCtrl_WebImpl.h | 10 ++-- 2 files changed, 36 insertions(+), 65 deletions(-) diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 2e5d672..30f8ae5 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -132,7 +132,7 @@ namespace Tizen { namespace Web { namespace Controls { -static const char WEB_CTRL[] = "webcontrol"; +extern const char WEB_CTRL[] = "webcontrol"; static const char PARENT_WEB_CTRL[] = "parentwebcontrol"; @@ -1571,7 +1571,7 @@ OnWebPageBlockSelected(void* pUserData, Evas_Object* pView, void* pEventInfo) { _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData); SysAssertf(pImpl, "Failed to request"); - + AppLogDebug("sssssssssssssssssss1"); if (pImpl->GetUiEventListener()) { result r = E_SUCCESS; @@ -1589,44 +1589,6 @@ OnWebPageBlockSelected(void* pUserData, Evas_Object* pView, void* pEventInfo) } -void -OnWebPageBlockSelectedByOrientation(void* pUserData, Evas_Object* pView, void* pEventInfo) -{ - _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData); - SysAssertf(pImpl, "Failed to request"); - - if (!pImpl->IsOrientationChanged()) - { - return; - } - - pImpl->SetOrientationChanged(false); - - int orientation = 0; - _ControlRotation rotation = _ControlManager::GetInstance()->GetOrientationStatus(); - switch (rotation) - { - case _CONTROL_ROTATION_0: - orientation = 0; - break; - case _CONTROL_ROTATION_90: - orientation = 90; - break; - case _CONTROL_ROTATION_180: - orientation = 180; - break; - case _CONTROL_ROTATION_270: - orientation = -90; - break; - } - ewk_view_orientation_send(pView, orientation); - - OnWebPageBlockSelected(pUserData, pView, pEventInfo); - - SysLog(NID_WEB_CTRL, "Enter."); -} - - Eina_Bool OnSelectUploadFile(Evas_Object* pView, Eina_Bool multipleFile, Eina_List* pAcceptTypes, const char* pCapture, void* pUserData) { @@ -2224,7 +2186,6 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore) , __isRedirectRequested(false) , __isCertificateRequested(false) , __isCertificateConfirmed(false) - , __isOrientationChanged(false) , __isFormDataVisible(false) , __keypadBounds(0, 0, 0, 0) , __pWebCore(null) @@ -3686,7 +3647,6 @@ _WebImpl::SetEventListenerCallback(void) const evas_object_smart_callback_add(pWebNativeNode, "icon,received", OnFaviconReceived, this); evas_object_smart_callback_add(pWebNativeNode, "text,selected", OnWebPageBlockSelected, this); - evas_object_smart_callback_add(pWebNativeNode, "frame,rendered", OnWebPageBlockSelectedByOrientation, this); evas_object_smart_callback_add(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered, this); evas_object_smart_callback_add(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited, this); @@ -3771,7 +3731,6 @@ _WebImpl::RemoveEventListenerCallback(void) const evas_object_smart_callback_del(pWebNativeNode, "icon,received", OnFaviconReceived); evas_object_smart_callback_del(pWebNativeNode, "text,selected", OnWebPageBlockSelected); - evas_object_smart_callback_del(pWebNativeNode, "frame,rendered", OnWebPageBlockSelectedByOrientation); evas_object_smart_callback_del(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered); evas_object_smart_callback_del(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited); @@ -3989,7 +3948,7 @@ _WebImpl::GetPageSize(void) const result -_WebImpl::AddCustomHeader(const String& name, const String& value) +_WebImpl::AddHttpHeaderField(const String& name, const String& value) { SysTryReturnResult(NID_WEB_CTRL, name.GetLength() > 0, E_INVALID_ARG, "Invalid argument(s) is used. name key is missing."); @@ -4005,7 +3964,7 @@ _WebImpl::AddCustomHeader(const String& name, const String& value) result -_WebImpl::RemoveCustomHeader(const String& name) +_WebImpl::RemoveHttpHeaderField(const String& name) { SysTryReturnResult(NID_WEB_CTRL, name.GetLength() > 0, E_INVALID_ARG, "Invalid argument(s) is used. name key is missing."); @@ -4088,20 +4047,6 @@ _WebImpl::IsCertificateConfirmed(void) const } -void -_WebImpl::SetOrientationChanged(bool arg) -{ - __isOrientationChanged = arg; -} - - -bool -_WebImpl::IsOrientationChanged(void) const -{ - return __isOrientationChanged; -} - - result _WebImpl::SetFullScreenKeypad(void) { @@ -4932,12 +4877,36 @@ _WebImpl::OnPreAttachedToMainTree(void) void +_WebImpl::OnChangeLayout(_ControlRotation rotation) +{ + int degree = 0; + + switch (rotation) + { + case _CONTROL_ROTATION_0: + degree = 0; + break; + case _CONTROL_ROTATION_90: + degree = 90; + break; + case _CONTROL_ROTATION_180: + degree = 180; + break; + case _CONTROL_ROTATION_270: + degree = -90; + break; + default: + SysAssert(false); + } + ewk_view_orientation_send(__pWebCore->GetWebNativeNode(), degree); +} + + +void _WebImpl::OnChangeLayout(_ControlOrientation orientation) { _ContainerImpl::OnChangeLayout(orientation); - __isOrientationChanged = true; - if (__pColorPicker.get()) { __pColorPicker->ChangeLayout(orientation); diff --git a/src/controls/inc/FWebCtrl_WebImpl.h b/src/controls/inc/FWebCtrl_WebImpl.h index cc719a3..1ed0c01 100755 --- a/src/controls/inc/FWebCtrl_WebImpl.h +++ b/src/controls/inc/FWebCtrl_WebImpl.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include "FWebCtrl_CertificateConfirmPopup.h" @@ -85,6 +84,8 @@ class IJsonValue; namespace Tizen { namespace Web { namespace Controls { +_OSP_EXPORT_ extern const char WEB_CTRL[]; + class IJavaScriptBridge; class ILoadingListener; class ITextSearchListener; @@ -296,9 +297,9 @@ public: Tizen::Graphics::Dimension GetPageSize(void) const; - result AddCustomHeader(const Tizen::Base::String& name, const Tizen::Base::String& value); + result AddHttpHeaderField(const Tizen::Base::String& name, const Tizen::Base::String& value); - result RemoveCustomHeader(const Tizen::Base::String& name); + result RemoveHttpHeaderField(const Tizen::Base::String& name); virtual bool IsLayoutable(void) const; @@ -390,6 +391,8 @@ public: virtual result OnPreAttachedToMainTree(void); + virtual void OnChangeLayout(Tizen::Ui::_ControlRotation rotation); + virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); virtual void OnAncestorVisibleStateChanged(const Tizen::Ui::_Control& control); @@ -456,7 +459,6 @@ private: bool __isRedirectRequested; bool __isCertificateRequested; bool __isCertificateConfirmed; - bool __isOrientationChanged; bool __isFormDataVisible; Tizen::Graphics::Rectangle __keypadBounds; -- 2.7.4