Resolve N_SE-40548 & N_SE-40478 : issue for UiBuilder of OverlayPanel
authorwoo <s-w.woo@samsung.com>
Fri, 7 Jun 2013 05:49:48 +0000 (14:49 +0900)
committerwoo <s-w.woo@samsung.com>
Fri, 7 Jun 2013 05:58:27 +0000 (14:58 +0900)
Change-Id: I974f1c6ca07c3da920eedffcf58391edb2c0a558
Signed-off-by: woo <s-w.woo@samsung.com>
inc/FUiCtrlOverlayPanel.h
src/ui/controls/FUiCtrl_OverlayPanel.cpp
src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp

index e95ad22..c0b171b 100644 (file)
@@ -516,7 +516,7 @@ public:
         * @exception           E_OPERATION_FAILED              The operation has failed.
         * @remarks
         *                              - Due to the hardware accelerated rendering, there are limitations for an overlay panel.
-        *                              - The hardware capability for an overlay region is checked by using the GetWidthUnit(), GetHeightUnit() and GetMaxCount().
+        *                              - The hardware capability for an overlay panel is checked by using the GetWidthUnit(), GetHeightUnit() and GetMaxCount().
         *                              - If the application runs on multi-screen resolutions, the specified bounds may not meet the hardware limitations of the overlay
         *                              panel. In such cases, Construct() will return @c E_INVALID_ARG. @n
         *                              To prevent this kind of problem, the application must the this method to get a validated bounds
@@ -540,7 +540,7 @@ public:
         * @exception           E_OPERATION_FAILED              The operation has failed.
         * @remarks
         *                              - Due to the hardware accelerated rendering, there are limitations for an overlay panel.
-        *                              - The hardware capability for an overlay region is checked by using the GetWidthUnit(), GetHeightUnit() and GetMaxCount().
+        *                              - The hardware capability for an overlay panel is checked by using the GetWidthUnit(), GetHeightUnit() and GetMaxCount().
         *                              - If the application runs on multi-screen resolutions, the specified bounds may not meet the hardware limitations of the overlay
         *                              panel. In such cases, Construct() will return E_INVALID_ARG. @n
         *                              To prevent this kind of problem, the application must use this method to get a validated bounds
index 79c9cff..8cd8eab 100644 (file)
@@ -291,13 +291,29 @@ _OverlayPanel::OnAttachedToMainTree(void)
                __pOverlayAgent->SetEvasImageDirtyCallback();
        }
 
+       // raise up childs
+       _Control* pChild = null;
+       for (int idx = 0 ; idx < GetChildCount(); idx++)
+       {
+               pChild = dynamic_cast <_Control*>(GetChild(idx));
+               if(pChild != null)
+               {
+                       __pOverlayAgent->MoveChildToTop(*pChild);
+               }
+       }
+
        return E_SUCCESS;
 }
 
 void
 _OverlayPanel::OnBoundsChanged(void)
 {
-       SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null.");
+       ClearLastResult();
+
+       if (__pOverlayAgent == null)
+       {
+               return;
+       }
 }
 
 void
@@ -309,7 +325,13 @@ _OverlayPanel::OnChildDetached(const _Control& child)
 void
 _OverlayPanel::OnChildAttached(const _Control& child)
 {
-       SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null.");
+       ClearLastResult();
+
+       if (__pOverlayAgent == null)
+       {
+               return;
+       }
+
        __pOverlayAgent->MoveChildToTop(child);
 }
 
index 8f120bb..839ffe5 100644 (file)
@@ -392,15 +392,20 @@ protected:
                _UiBuilderControlLayout* pControlProperty = null;
 
                GetProperty(pControl, &pControlProperty);
-               SysTryReturn(NID_UI, pControlProperty != null, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+               SysTryReturn(NID_UI_CTRL, pControlProperty != null, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
                std::unique_ptr<OverlayPanel> pOverlayPanel(new (std::nothrow) OverlayPanel());
-               SysTryReturn(NID_UI, pOverlayPanel != null, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+               SysTryReturn(NID_UI_CTRL, pOverlayPanel != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
-               Rectangle rect = pControlProperty->GetRect();
+               FloatRectangle overlayPanelBounds = pControlProperty->GetRectF();
+               bool modified = false;
 
-               result r = pOverlayPanel->Construct(rect);
-               SysTryReturn(NID_UI, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+               OverlayPanel::EvaluateBounds(OVERLAY_PANEL_EVAL_OPT_LESS_THAN, overlayPanelBounds, modified);
+               SysTryLog(NID_UI_CTRL, modified, "The bounds of OverlayPanel is modified into [%.3f, %.3f, %.3f, %.3f]"
+                       , overlayPanelBounds.x, overlayPanelBounds.y, overlayPanelBounds.width, overlayPanelBounds.height);
+
+               result r = pOverlayPanel->Construct(overlayPanelBounds);
+               SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
                return pOverlayPanel.release();
        }