Fixed client resume
authorHeeJu Kang <mobum.kang@samsung.com>
Tue, 30 Apr 2013 05:49:15 +0000 (14:49 +0900)
committerHeeJu Kang <mobum.kang@samsung.com>
Tue, 30 Apr 2013 05:49:15 +0000 (14:49 +0900)
Change-Id: Ibebc399bb9209db9c3957f1ddef08760fc41f078
Signed-off-by: HeeJu Kang <mobum.kang@samsung.com>
src/FShell_AppWidgetBuffer.cpp
src/FShell_AppWidgetLayer.cpp
src/FShell_AppWidgetPopup.cpp
src/FShell_AppWidgetView.cpp
src/FShell_AppWidgetViewManager.cpp

index ed664d4..a10f64e 100644 (file)
@@ -377,57 +377,57 @@ _AppWidgetBuffer::_GemBuffer::~_GemBuffer(void)
 void
 _AppWidgetBuffer::_GemBuffer::DeleteGemBuffer(void)
 {
-       if (__pCompensateBuffer)\r
-       {\r
-               free(__pCompensateBuffer);\r
-               __pCompensateBuffer = null;\r
-       }\r
-\r
-       if (__pTbmBo)\r
-       {\r
-               tbm_bo_unref(__pTbmBo);\r
-               __pTbmBo = null;\r
-\r
-               DRI2DestroyDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);\r
+       if (__pCompensateBuffer)
+       {
+               free(__pCompensateBuffer);
+               __pCompensateBuffer = null;
+       }
+
+       if (__pTbmBo)
+       {
+               tbm_bo_unref(__pTbmBo);
+               __pTbmBo = null;
+
+               DRI2DestroyDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);
        }
 }
 
 void
 _AppWidgetBuffer::_GemBuffer::OnCreateBuffer(void)
 {
-       SysLog(NID_SHELL, "[%f %f]", __size.width, __size.height);\r
-\r
-       unsigned int pitch = 0;\r
-\r
-       DRI2CreateDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);\r
-\r
-       int width = static_cast<int>(__size.width);\r
-       int height = static_cast<int>(__size.height);\r
-\r
-       __pDri2Buffer = DRI2GetBuffers(__pAppWidgetBuffer->__pDisplay.get(), __pixmap, &width, &height, __attachments, __count, &__outCount);\r
-       SysTryCatch(NID_SHELL, __pDri2Buffer && __pDri2Buffer->name, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
-\r
-       __gemSize.width = width;\r
-       __gemSize.height = height;\r
-\r
-       SysLog(NID_SHELL, "0x%x [%d %d %d] [%d %d]", __pDri2Buffer, __outCount, __pDri2Buffer->name, __pDri2Buffer->pitch, width, height);\r
-\r
-       __pTbmBo = tbm_bo_import(__pAppWidgetBuffer->__pBufMgr.get(), __pDri2Buffer->name);\r
-       SysTryCatch(NID_SHELL, __pTbmBo, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
-       \r
-       pitch = __gemSize.width * __depth;\r
-       if (__pDri2Buffer->pitch != pitch)\r
-       {\r
-               __pCompensateBuffer = calloc(1, pitch * __gemSize.height);\r
-               SysTryCatch(NID_SHELL, __pCompensateBuffer, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
-\r
-               SysLog(NID_SHELL, "0x%x [%d %d %d]", __pCompensateBuffer, __depth, __gemSize.width, __gemSize.height);\r
-       }\r
-\r
-       return;\r
-\r
-CATCH:\r
-\r
+       SysLog(NID_SHELL, "[%f %f]", __size.width, __size.height);
+
+       unsigned int pitch = 0;
+
+       DRI2CreateDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);
+
+       int width = static_cast<int>(__size.width);
+       int height = static_cast<int>(__size.height);
+
+       __pDri2Buffer = DRI2GetBuffers(__pAppWidgetBuffer->__pDisplay.get(), __pixmap, &width, &height, __attachments, __count, &__outCount);
+       SysTryCatch(NID_SHELL, __pDri2Buffer && __pDri2Buffer->name, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+       __gemSize.width = width;
+       __gemSize.height = height;
+
+       SysLog(NID_SHELL, "0x%x [%d %d %d] [%d %d]", __pDri2Buffer, __outCount, __pDri2Buffer->name, __pDri2Buffer->pitch, width, height);
+
+       __pTbmBo = tbm_bo_import(__pAppWidgetBuffer->__pBufMgr.get(), __pDri2Buffer->name);
+       SysTryCatch(NID_SHELL, __pTbmBo, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+       
+       pitch = __gemSize.width * __depth;
+       if (__pDri2Buffer->pitch != pitch)
+       {
+               __pCompensateBuffer = calloc(1, pitch * __gemSize.height);
+               SysTryCatch(NID_SHELL, __pCompensateBuffer, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+               SysLog(NID_SHELL, "0x%x [%d %d %d]", __pCompensateBuffer, __depth, __gemSize.width, __gemSize.height);
+       }
+
+       return;
+
+CATCH:
+
        DRI2DestroyDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);
 }
 
@@ -442,8 +442,8 @@ _AppWidgetBuffer::_GemBuffer::OnLockBuffer(void)
 {
        if (!__pGemBuffer)
        {
-               tbm_bo_handle handle;\r
-               handle = tbm_bo_map(__pTbmBo, TBM_DEVICE_CPU, TBM_OPTION_READ | TBM_OPTION_WRITE);\r
+               tbm_bo_handle handle;
+               handle = tbm_bo_map(__pTbmBo, TBM_DEVICE_CPU, TBM_OPTION_READ | TBM_OPTION_WRITE);
                __pGemBuffer = handle.ptr;
        }
 
@@ -453,24 +453,24 @@ _AppWidgetBuffer::_GemBuffer::OnLockBuffer(void)
 void
 _AppWidgetBuffer::_GemBuffer::OnUnlockBuffer(void)
 {
-       if (__pCompensateBuffer)\r
-       {\r
-               int* pPixel = (int*)__pCompensateBuffer;\r
-               int* pGemPixel = (int*)__pGemBuffer;\r
-               int gap = __pDri2Buffer->pitch - (__gemSize.width * __depth);\r
-\r
-               for (int y = 0; y < __gemSize.height; y++)\r
-               {\r
-                       for (int x = 0; x < __gemSize.width; x++)\r
-                       {\r
-                               *pGemPixel++ = *pPixel++;\r
-                       }\r
-\r
-                       pGemPixel = (int*)(((char*)pGemPixel) + gap);\r
-               }\r
-       }\r
-\r
-       tbm_bo_unmap(__pTbmBo);\r
+       if (__pCompensateBuffer)
+       {
+               int* pPixel = (int*)__pCompensateBuffer;
+               int* pGemPixel = (int*)__pGemBuffer;
+               int gap = __pDri2Buffer->pitch - (__gemSize.width * __depth);
+
+               for (int y = 0; y < __gemSize.height; y++)
+               {
+                       for (int x = 0; x < __gemSize.width; x++)
+                       {
+                               *pGemPixel++ = *pPixel++;
+                       }
+
+                       pGemPixel = (int*)(((char*)pGemPixel) + gap);
+               }
+       }
+
+       tbm_bo_unmap(__pTbmBo);
        __pGemBuffer = null;
 }
 
index 6cf36a5..f31ed4e 100644 (file)
@@ -199,12 +199,12 @@ _AppWidgetLayer::AllocCanvas(int size)
 
        if (__providerId.IsEmpty())
        {
-               __pTempBuffer =  malloc(__bufferSize);\r
-               SysTryReturn(NID_SHELL, __pTempBuffer, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
-               \r
-               pBuffer = __pTempBuffer;\r
-       }\r
-       else\r
+               __pTempBuffer =  malloc(__bufferSize);
+               SysTryReturn(NID_SHELL, __pTempBuffer, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+               
+               pBuffer = __pTempBuffer;
+       }
+       else
        {
                if (__pixmapId == -1)
                {
index 4c6ff7f..78f9237 100644 (file)
@@ -183,28 +183,28 @@ _AppWidgetPopup::Initialize(const FloatDimension& size)
        r = __pAppWidgetPopupPresenter->Initialize();
        SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = CreateRootVisualElement();\r
-       SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
-       FloatRectangle bounds(0.0f, 0.0f, 1.0f, 1.0f);\r
-       r = SetBounds(bounds);\r
-       SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
-       r = __pAppWidgetPopupPresenter->Initialize();\r
-       SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
-       __pAppWidgetPopupLayer->SetLayerBounds(bounds);\r
-       __pAppWidgetPopupLayer->SetShowState(false);\r
-\r
-       __pAppWidgetPopupRootVisualElement->SetImplicitAnimationEnabled(false);\r
-       __pAppWidgetPopupRootVisualElement->SetName(L"_AppWidgetPopup");\r
-       __pAppWidgetPopupRootVisualElement->SetBounds(bounds);\r
-       __pAppWidgetPopupRootVisualElement->SetShowState(false);\r
-\r
-       SetBackgroundColor(Color(0, 0, 0, 0));\r
-\r
-       __pEventManager->RegisterTouchEventHandler(*this);\r
-       r = GetLastResult();\r
+       r = CreateRootVisualElement();
+       SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       FloatRectangle bounds(0.0f, 0.0f, 1.0f, 1.0f);
+       r = SetBounds(bounds);
+       SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = __pAppWidgetPopupPresenter->Initialize();
+       SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       __pAppWidgetPopupLayer->SetLayerBounds(bounds);
+       __pAppWidgetPopupLayer->SetShowState(false);
+
+       __pAppWidgetPopupRootVisualElement->SetImplicitAnimationEnabled(false);
+       __pAppWidgetPopupRootVisualElement->SetName(L"_AppWidgetPopup");
+       __pAppWidgetPopupRootVisualElement->SetBounds(bounds);
+       __pAppWidgetPopupRootVisualElement->SetShowState(false);
+
+       SetBackgroundColor(Color(0, 0, 0, 0));
+
+       __pEventManager->RegisterTouchEventHandler(*this);
+       r = GetLastResult();
        SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        return r;
index d87c795..0f80271 100644 (file)
@@ -117,7 +117,7 @@ _AppWidgetView::Initialize(const AppId& appId, const Tizen::Base::String& provid
 {
        SysLog(NID_SHELL, "appId [%ls]", appId.GetPointer());
        SysLog(NID_SHELL, "providerName [%ls]", providerName.GetPointer());
-       SysLog(NID_SHELL, "[%d %d %d %d]", rect.x, rect.y, rect.width, rect.height);
+       SysLog(NID_SHELL, "[%f %f %f %f]", rect.x, rect.y, rect.width, rect.height);
        SysLog(NID_SHELL, "userInfo [%ls]", userInfo.GetPointer());
 
        result r = SetBounds(rect);
index 1b36d42..23970da 100644 (file)
@@ -460,6 +460,9 @@ _AppWidgetViewManager::AddFrameEventListener(void)
                {
                        pFrame->AddFrameEventListener(*__pFrameEventListener);
                }
+
+               int ret = livebox_client_resumed();
+               SysLog(NID_SHELL, "ret (%d)", ret);
        }
 }