Fix for launching Web control on Popup
authorHyun Lee <hyunn.lee@samsung.com>
Thu, 18 Apr 2013 13:05:58 +0000 (22:05 +0900)
committerHyun Lee <hyunn.lee@samsung.com>
Thu, 18 Apr 2013 13:37:55 +0000 (22:37 +0900)
Change-Id: I9cb83e8f7012003880534a4a78c1803036e65b61
Signed-off-by: Hyun Lee <hyunn.lee@samsung.com>
packaging/osp-web.spec
src/controls/FWebCtrl_EflWebkit.cpp
src/controls/FWebCtrl_EflWebkit.h
src/controls/FWebCtrl_Web.cpp
src/controls/FWebCtrl_WebImpl.cpp
src/controls/FWebCtrl_WebImpl.h

index 6dbe7ff..056c343 100755 (executable)
@@ -73,9 +73,9 @@ osp web library (DEV)
 %build 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 %ifarch %{ix86}
-CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_SECURE_LOG -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
 %else
-CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_SECURE_LOG -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
 %endif
 
 # Call make instruction with smp support
index 1b51a80..2a2c6f6 100755 (executable)
 #include <FIo_FileImpl.h>
 #include <FSecCert_CertService.h>
 #include <FSys_VibratorImpl.h>
+#include <FUi_Control.h>
+#include <FUi_Window.h>
 #include "FUiAnim_EflNode.h"
 #include "FUiAnim_VisualElementImpl.h"
+#include "FUiAnim_VisualElementSurfaceImpl.h"
 #include "FWebCtrl_EflWebkit.h"
 #include "FWebCtrl_Utility.h"
 #include "FWebCtrl_WebImpl.h"
@@ -73,12 +76,19 @@ static const int CUSTOM_DB_TABLE_COUNT= 3;
 
 _EflWebkit::_EflWebkit(void)
        : __pWebFrame(null)
+       , __pContainerVisualElement(null)
+       , __pSurface(null)
 {
 }
 
 
 _EflWebkit::~_EflWebkit(void)
 {
+       if (__pContainerVisualElement)
+       {
+               __pContainerVisualElement->SetSurface(null);
+       }
+       delete __pSurface;
 //     evas_object_smart_member_del(__pWebFrame);
        evas_object_del(__pWebFrame);
        __pWebFrame = null;
@@ -86,7 +96,7 @@ _EflWebkit::~_EflWebkit(void)
 
 
 result
-_EflWebkit::Construct(const Rectangle& rect, VisualElement& containerVisualElement)
+_EflWebkit::Construct(const Rectangle& rect, VisualElement& containerVisualElement, _Control* pControl)
 {
        result r = E_SUCCESS;
 
@@ -113,7 +123,19 @@ _EflWebkit::Construct(const Rectangle& rect, VisualElement& containerVisualEleme
        evas_object_resize(__pWebFrame, pXformer->TransformHorizontal(rect.width), pXformer->TransformVertical(rect.height));
        evas_object_move(__pWebFrame, pXformer->TransformHorizontal(rect.x), pXformer->TransformVertical(rect.y));
 
+#if 0
        pEflNode->AddNativeSmartObject(containerVisualElement, __pWebFrame);
+#else
+       __pContainerVisualElement = &containerVisualElement;
+
+       DisplayContext* pDisplayContext = pControl->GetRootWindow()->GetDisplayContext();
+       SysTryReturn(NID_WEB_CTRL, pDisplayContext, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       __pSurface = _VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN(*pDisplayContext, (Handle)__pWebFrame, Dimension(rect.width, rect.height));
+       SysTryReturn(NID_WEB_CTRL, __pSurface, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       containerVisualElement.SetSurface(__pSurface);
+#endif
 
        return E_SUCCESS;
 }
index 4721589..79a28d9 100755 (executable)
@@ -32,9 +32,15 @@ namespace Tizen { namespace Graphics
 class Rectangle;
 }} // Tizen::Graphics
 
+namespace Tizen { namespace Ui
+{
+class _Control;
+}} // Tizen::Ui
+
 namespace Tizen { namespace Ui { namespace Animations
 {
 class VisualElement;
+class VisualElementSurface;
 }}} // Tizen::Ui::Animations
 
 
@@ -55,7 +61,7 @@ public:
 
        virtual ~_EflWebkit(void);
 
-       result Construct(const Tizen::Graphics::Rectangle& rect, Tizen::Ui::Animations::VisualElement& containerVisualElement);
+       result Construct(const Tizen::Graphics::Rectangle& rect, Tizen::Ui::Animations::VisualElement& containerVisualElement, Tizen::Ui::_Control* pControl);
 
        Evas_Object* GetWebEvasObject(void) const;
 
@@ -76,6 +82,8 @@ private:
 
 private:
        Evas_Object* __pWebFrame;
+       Tizen::Ui::Animations::VisualElement* __pContainerVisualElement;
+       Tizen::Ui::Animations::VisualElementSurface* __pSurface;
 }; // _EflWebkit
 
 }}} // Tizen::Web::Controls
index cbe0d02..c5f7f8c 100755 (executable)
@@ -179,7 +179,7 @@ _Web::CreateWebkitEvasObject(void)
        std::unique_ptr<_EflWebkit> pEflWebkit(new (std::nothrow) _EflWebkit());
        SysTryReturnResult(NID_WEB_CTRL, pEflWebkit.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       r = pEflWebkit->Construct(GetAbsoluteBounds(), *GetVisualElement());
+       r = pEflWebkit->Construct(GetAbsoluteBounds(), *GetVisualElement(), this);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        __pEflWebkit = std::move(pEflWebkit);
index 5df7d6d..a7bd357 100755 (executable)
@@ -4435,7 +4435,7 @@ _WebImpl::HasValidNativeNode(void) const
 
 
 result
-_WebImpl::OnAttachedToMainTree(void)
+_WebImpl::OnPreAttachedToMainTree(void)
 {
        result r = E_SUCCESS;
 
@@ -4445,7 +4445,7 @@ _WebImpl::OnAttachedToMainTree(void)
        r = InitializeSetting();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = _ContainerImpl::OnAttachedToMainTree();
+       r = _ContainerImpl::OnPreAttachedToMainTree();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        return E_SUCCESS;
index 6355ef1..ee9a88b 100755 (executable)
@@ -364,7 +364,7 @@ public:
 
        virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
 
-       virtual result OnAttachedToMainTree(void);
+       virtual result OnPreAttachedToMainTree(void);
 
        virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);