Enabled indicator control
authorBongjoo Seo <bongjoo.seo@samsung.com>
Fri, 19 Jul 2013 07:45:00 +0000 (16:45 +0900)
committerBongjoo Seo <bongjoo.seo@samsung.com>
Fri, 19 Jul 2013 07:59:23 +0000 (16:59 +0900)
Change-Id: I7dd740982750cb20c862f7736ef8b0f7dc2fe98c
Signed-off-by: Bongjoo Seo <bongjoo.seo@samsung.com>
src/ui/FUi_ControlManager.cpp
src/ui/FUi_XUiEventManager.cpp
src/ui/controls/FUiCtrl_Form.cpp
src/ui/controls/FUiCtrl_Frame.cpp
src/ui/controls/FUiCtrl_Indicator.cpp
src/ui/controls/FUiCtrl_IndicatorManager.cpp
src/ui/controls/FUiCtrl_OverlayAgent.cpp
src/ui/inc/FUiCtrl_Indicator.h
src/ui/inc/FUiCtrl_IndicatorManager.h
src/ui/inc/FUi_Colorf.h

index 089eab7..6e217cc 100644 (file)
@@ -795,9 +795,7 @@ _ControlManager::AttachWindow(_Window& window)
        }
 
        if (window.GetWindowType() != _WINDOW_TYPE_VE)
-       {
-               _IndicatorManager::GetInstance()->AddWindow(&window);
-
+    {
                if (window.IsDimmingEnabled())
                {
                        _DimmingManager::GetInstance()->RegisterWindow(&window);
@@ -806,10 +804,9 @@ _ControlManager::AttachWindow(_Window& window)
                _RootVisualElement* pRootVE = window.GetRootVisualElement();
                if (pRootVE)
                {
-#ifdef VE_EFL
-                       _DisplayManager::GetInstance()->UnregisterRoot(*pRootVE);
-                       _DisplayManager::GetInstance()->RegisterRoot(*pRootVE);
-#endif
+            _NativeLayer* pLayer = pRootVE->GetNativeLayer();
+            _GlDisplayManager::GetInstance()->UnregisterLayer(*pLayer);
+            _GlDisplayManager::GetInstance()->RegisterLayer(*pLayer);
                }
        }
 
@@ -852,9 +849,7 @@ _ControlManager::InsertWindowBefore(const _Window& targetWindow, _Window& window
 result
 _ControlManager::DetachWindow(_Window& window)
 {
-       result r = E_SUCCESS;
-
-       _IndicatorManager::GetInstance()->DeleteWindow(&window);
+    result r = E_SUCCESS;
 
        if (window.IsDimmingEnabled())
        {
index 562f1a3..94064fd 100644 (file)
@@ -517,9 +517,7 @@ private:
                else
                {
                        _Window* pWindow = null;
-
-                       pWindow = pControlManager->GetTopVisibleWindowAt(Point(x, y));
-
+            pWindow = pControlManager->GetTopVisibleWindowAt(Point(x, y));
                        SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
                        Tizen::Graphics::Rectangle winBounds = pWindow->GetBounds();
 
@@ -529,7 +527,7 @@ private:
                        _Window* pTouchedWindow = pControlManager->GetTopVisibleWindowAt(Point(x, y));
                        SysTryReturn(NID_UI, pTouchedWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
-                       pRootControlElement = dynamic_cast <_ControlVisualElement*>(pTouchedWindow->GetVisualElement());
+            pRootControlElement = dynamic_cast <_ControlVisualElement*>(pTouchedWindow->GetVisualElement());
                }
 
                SysTryReturn(NID_UI, pRootControlElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
@@ -550,23 +548,26 @@ private:
                _ControlManager* pControlManager = _ControlManager::GetInstance();
                SysTryReturn(NID_UI, pControlManager, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
-//             _Window* pTouchedWindow = pControlManager->GetTopWindowAt(_CoordinateSystemUtils::InverseTransform(Point(x, y)), false);
-//             SysTryReturn(NID_UI, pTouchedWindow, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+               Dimension dimension = pControlManager->GetScreenSize();
+               Point output(_CoordinateSystemUtils::InverseTransform(point));
 
-//             _RootVisualElement* pRootVE = pTouchedWindow->GetRootVisualElement();
-//             _EflLayer* pLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer());
+#ifdef VE_EFL
+               _Window* pTouchedWindow = pControlManager->GetTopWindowAt(_CoordinateSystemUtils::InverseTransform(Point(x, y)), false);
+               SysTryReturn(NID_UI, pTouchedWindow, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
-//             Ecore_Evas* pEE = pLayer->GetEcoreEvas();
+               _RootVisualElement* pRootVE = pTouchedWindow->GetRootVisualElement();
+               _EflLayer* pLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer());
 
-               const int PORTRAIT = 0;
-               const int LANDSCAPE = 270;
-               const int PORTRAIT_REVERSE = 180;
-               const int LANDSCAPE_REVERSE = 90;
+               Ecore_Evas* pEE = pLayer->GetEcoreEvas();
 
-               Dimension dimension = pControlManager->GetScreenSize();
-               Point output(_CoordinateSystemUtils::InverseTransform(point));
-//             int rotation = ecore_evas_rotation_get(pEE);
+               int rotation = ecore_evas_rotation_get(pEE);
+#else
+        const int PORTRAIT = 0;
+        const int LANDSCAPE = 270;
+        const int PORTRAIT_REVERSE = 180;
+        const int LANDSCAPE_REVERSE = 90;
                int rotation = PORTRAIT;
+#endif
 
                switch (rotation)
                {
index f6cad67..2c798b0 100644 (file)
@@ -282,11 +282,9 @@ _Form::~_Form(void)
 
        if (__pIndicator)
        {
-       #ifdef VE_EFL
                __pIndicator->DeleteIndicatorObject();
                __pIndicator->Destroy();
                __pIndicator = null;
-       #endif
        }
 
        ClearLastResult();
@@ -1467,7 +1465,7 @@ _Form::SetFormStyle(unsigned long formStyle)
                GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
 
                __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, indicatorwidth, indicatorheight));
-#ifdef VE_EFL
+
                r = GetVisualElement()->AttachChild(*__pIndicator);
                SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1477,8 +1475,8 @@ _Form::SetFormStyle(unsigned long formStyle)
 
                r = GetLastResult();
                SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-        #endif
-       }
+
+    }
 }
 
 result
@@ -1525,7 +1523,6 @@ _Form::SetActionBarsTranslucent(unsigned long actionBars, bool translucent)
        Color bgColor(0, 0, 0, 0);
        if (actionBars & FORM_ACTION_BAR_INDICATOR)
        {
-#ifdef VE_EFL
                if (translucent)
                {
 
@@ -1538,7 +1535,6 @@ _Form::SetActionBarsTranslucent(unsigned long actionBars, bool translucent)
                }
         
                SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-        #endif
        }
 
        if (actionBars & FORM_ACTION_BAR_HEADER)
@@ -2046,9 +2042,7 @@ _Form::IsIndicatorAutoHide(void) const
 
        if (pFrame && IsAttachedToMainTree())
        {
-       #ifdef VE_EFL
                autohide = __pIndicator->GetIndicatorAutoHide();
-       #endif
        }
 
        return autohide;
@@ -2272,14 +2266,10 @@ _Form::CreateTabN(void)
 _Indicator*
 _Form::CreateIndicatorN(void)
 {
-#ifdef VE_EFL
        _Indicator* pIndicator = _Indicator::CreateIndicator();
        SysTryReturn(NID_UI_CTRL, pIndicator, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
-       return pIndicator;
-#else
-       return null;
-#endif
+    return pIndicator;
 }
 
 int
@@ -2451,11 +2441,9 @@ _Form::RemoveIndicator(void)
        result r = E_SUCCESS;
        if (__pIndicator)
        {
-#ifdef VE_EFL
                r = GetVisualElement()->DetachChild(*__pIndicator);
                SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
                __pIndicator = null;
-#endif
        }
        else
        {
@@ -3064,12 +3052,11 @@ result
 _Form::AddIndicatorObject(void)
 {
        result r = E_SUCCESS;
-#ifdef VE_EFL
+
        if (__pIndicator)
        {
                r = __pIndicator->AddIndicatorObject(this, GetRootWindow());
        }
-#endif
 
        return r;
 }
@@ -3080,10 +3067,8 @@ _Form::DeleteIndicatorObject(void)
        result r = E_SUCCESS;
        if (__pIndicator)
        {
-#ifdef VE_EFL
                r = __pIndicator->DeleteIndicatorObject();
-#endif
-    }
+       }
 
        return r;
 }
@@ -3140,7 +3125,6 @@ _Form::AttachedToMainTree(void)
 
                if (__transparentIndicator != IsIndicatorTranslucent())
                {
-#ifdef VE_EFL
                        if (__transparentIndicator == true)
                        {
                                SetIndicatorOpacity(_INDICATOR_OPACITY_TRANSLUCENT);
@@ -3149,7 +3133,6 @@ _Form::AttachedToMainTree(void)
                        {
                                SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE);
                        }
-#endif
                }
 
                if (__indicatorShowState != IsIndicatorVisible())
index e50b19b..4922a13 100644 (file)
@@ -117,9 +117,10 @@ _Frame::CreateFrameN(void)
        result r = E_SUCCESS;
        _RootVisualElement* pRootVE = null;
 
-       _GlLayer* pLayer = null;
 #ifdef VE_EFL
        _EflLayer* pLayer = null;
+#else
+       _GlLayer* pLayer = null;
 #endif
        int appType = _AppInfo::GetAppType();
 
index ad5880c..e9ba4ba 100644 (file)
  */
 
 #include <FGrpRectangle.h>
+#include <FGrp_CoordinateSystem.h>
 #include <FUiAnimVisualElementSurface.h>
-#include "FGrp_CoordinateSystem.h"
+#include "FUi_CoordinateSystemUtils.h"
 #include "FUi_Window.h"
-#include "FUiAnim_VisualElement.h"
+#include "FUiCtrl_Form.h"
 #include "FUiCtrl_Indicator.h"
+#include "FUiAnim_ControlVisualElement.h"
 
 using namespace Tizen::Base::Runtime;
 using namespace Tizen::Graphics;
@@ -34,52 +36,151 @@ using namespace Tizen::Ui::Animations;
 
 namespace Tizen { namespace Ui { namespace Controls {
 
+
+_Indicator*
+_Indicator::CreateIndicator(void)
+{
+       result r = E_SUCCESS;
+       Color bgColor(0xff343432);
+
+       _Indicator* pIndicator = new (std::nothrow) _Indicator;
+       SysTryReturn(NID_UI_CTRL, pIndicator, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+       SysTryCatch(NID_UI_CTRL, GetLastResult() == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+       r = pIndicator->ConstructControlVisualElement();
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       pIndicator->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+
+       return pIndicator;
+
+CATCH:
+       delete pIndicator;
+       return null;
+}
 _Indicator::_Indicator(void)
-       : __showstate(false)
+       : __pPortraitVisualElement(null)
+       , __pLandscapeVisualElement(null)
+       , __pCurrentVisualElement(null)
+       , __pWindow(null)
+       , __showstate(false)
+       , __portraitautohide(false)
+       , __landscapeautohide(false)
        , __opacity(_INDICATOR_OPACITY_OPAQUE)
-       , __pPortraitIndicatorElement(null)
-       , __pLandscapeIndicatorElement(null)
+       , __orientation(_CONTROL_ORIENTATION_PORTRAIT)
 {
-       SetBackgroundColor(0xff343432);
-       AcquireHandle();
 }
 
 _Indicator::~_Indicator(void)
 {
-       if (__pPortraitIndicatorElement != null)
+}
+
+result
+_Indicator::AddIndicatorObject(_Control* pControl, _Window* pWindow)
+{
+       result r = E_SUCCESS;
+
+       __pWindow = pWindow;
+
+    __pPortraitVisualElement = new (std::nothrow) _ControlVisualElement();
+    __pPortraitVisualElement->ConstructControlVisualElement();
+    __pPortraitVisualElement->SetImplicitAnimationEnabled(false);
+    __pPortraitVisualElement->SetShowState(true);
+    __pPortraitVisualElement->SetBackgroundColor(0xFFFF0000);
+       SysTryReturn(NID_UI_CTRL, __pPortraitVisualElement, null,  E_SYSTEM, "[E_SYSTEM] Indicator can not create the surface.");
+    __pLandscapeVisualElement = new (std::nothrow) _ControlVisualElement();
+    __pLandscapeVisualElement->ConstructControlVisualElement();
+    __pLandscapeVisualElement->SetBackgroundColor(0xFF0000FF);
+    __pLandscapeVisualElement->SetImplicitAnimationEnabled(false);
+    __pLandscapeVisualElement->SetShowState(true);
+    SysTryReturn(NID_UI_CTRL, __pLandscapeVisualElement, null,  E_SYSTEM, "[E_SYSTEM] Indicator can not create the surface.");
+
+       _ControlOrientation orientation = pControl->GetOrientation();
+       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+       {
+               r = ChangeCurrentVisualElement(__pPortraitVisualElement);
+       }
+       else
        {
-               __pPortraitIndicatorElement->Destroy();
-               __pPortraitIndicatorElement = null;
+               r = ChangeCurrentVisualElement(__pLandscapeVisualElement);
        }
+
+    if (__pWindow != null)
+    {
+        Dimension imageSize = _IndicatorManager::GetInstance()->GetPortraitImageSize();
+        const void* pImageBuffer = _IndicatorManager::GetInstance()->GetPortraitImageBuffer();
+
+        if(pImageBuffer)
+        {
+            VisualElementSurface surface;
+            surface.Construct(*(__pWindow->GetDisplayContext()), FloatDimension(imageSize.width, imageSize.height));
+
+            BufferInfo bufferInfo;
+            surface.GetBufferInfo(bufferInfo);
+            memcpy(bufferInfo.pPixels, pImageBuffer, imageSize.width * imageSize.height * 4);
+
+            if (__pCurrentVisualElement)
+                __pCurrentVisualElement->SetSurface(&surface);
+
+        }
+        _IndicatorManager::GetInstance()->AddIndicatorSurfaceEventListener(this);
+    }
+
+       return r;
 }
 
 result
-_Indicator::SetIndicatorOpacity(_IndicatorOpacity opacity)
+_Indicator::DeleteIndicatorObject(void)
 {
        result r = E_SUCCESS;
 
-       switch (opacity)
+       if (__pPortraitVisualElement)
        {
-       case _INDICATOR_OPACITY_OPAQUE:
-               SetBackgroundColor(0xff343432);
-               break;
-
-       case _INDICATOR_OPACITY_TRANSLUCENT:
-               if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
+               if (__pPortraitVisualElement == __pCurrentVisualElement)
                {
-                       SetBackgroundColor(0x7f000000);
+                       r = DetachChild(*__pPortraitVisualElement);
+                       __pPortraitVisualElement->Destroy();                    
+                       __pPortraitVisualElement = null;
                }
-               else
+       }
+       if (__pLandscapeVisualElement)
+       {
+               if (__pLandscapeVisualElement == __pCurrentVisualElement)
                {
-                       SetBackgroundColor(0x00000000);
+                       r = DetachChild(*__pLandscapeVisualElement);
+                       __pLandscapeVisualElement->Destroy();
+                       __pLandscapeVisualElement = null;
                }
-               break;
+       }
+
+       
+       __pCurrentVisualElement = null;
 
-       case _INDICATOR_OPACITY_TRANSPARENT:
-               break;
+       return r;
+}
 
-       default:
-               break;
+result
+_Indicator::SetIndicatorOpacity(_IndicatorOpacity opacity)
+{
+       result r = E_SUCCESS;
+
+       if (opacity == _INDICATOR_OPACITY_OPAQUE)
+       {
+               Color bgColor(0xff1e1e1e);
+               SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+       }
+       else if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
+       {
+        if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
+               {
+                       Color bgColor(0x7f000000);
+                       SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+               }
+        else
+        {
+            Color bgColor(0x00000000);
+            SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+        }
        }
 
        __opacity = opacity;
@@ -90,17 +191,33 @@ _Indicator::SetIndicatorOpacity(_IndicatorOpacity opacity)
 _IndicatorOpacity
 _Indicator::GetIndicatorOpacity(void) const
 {
+       if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
+       {
+               if (__portraitautohide)
+               {
+                       return _INDICATOR_OPACITY_TRANSPARENT;
+               }
+       }
+       else
+       {
+               if (__landscapeautohide)
+               {
+                       return _INDICATOR_OPACITY_TRANSPARENT;
+               }
+       }
+
        return __opacity;
 }
 
 result
-_Indicator::SetIndicatorShowState(bool state, bool hide)
+_Indicator::SetIndicatorShowState(bool state)
 {
        result r = E_SUCCESS;
 
        __showstate = state;
 
-       SetVisibleState(state);
+       SetShowState(state);
+
        if (state)
        {
                SetIndicatorOpacity(__opacity);
@@ -116,55 +233,72 @@ _Indicator::GetIndicatorShowState(void) const
 }
 
 result
-_Indicator::OnAttachedToMainTree(void)
+_Indicator::ChangeCurrentVisualElement(Tizen::Ui::Animations::_ControlVisualElement* pVisualElement)
 {
        result r = E_SUCCESS;
 
-       _Window* pWindow = GetRootWindow();
-       if (pWindow != null)
+       if (!(__pCurrentVisualElement == pVisualElement))
        {
-               Dimension imageSize = _IndicatorManager::GetInstance()->GetPortraitImageSize();
-               const void* pImageBuffer = _IndicatorManager::GetInstance()->GetPortraitImageBuffer();
-
-               if(pImageBuffer)
+               r = AttachChild(*pVisualElement);
+               if (__pCurrentVisualElement)
                {
-                       VisualElementSurface surface;
-                       surface.Construct(*(pWindow->GetDisplayContext()), FloatDimension(imageSize.width, imageSize.height));
-
-                       BufferInfo bufferInfo;
-                       surface.GetBufferInfo(bufferInfo);
-                       memcpy(bufferInfo.pPixels, pImageBuffer, imageSize.width * imageSize.height * 4);
-
-                       __pPortraitIndicatorElement = new _VisualElement();
-                       __pPortraitIndicatorElement->Construct();
-                       __pPortraitIndicatorElement->SetShowState(true);
-                       __pPortraitIndicatorElement->SetImplicitAnimationEnabled(false);
-                       __pPortraitIndicatorElement->SetBounds(FloatRectangle(0.0f, 0.0f,  imageSize.width, imageSize.height));
-                       __pPortraitIndicatorElement->SetSurface(&surface);
-                       GetVisualElement()->AttachChild(__pPortraitIndicatorElement);
-
-                       _IndicatorManager::GetInstance()->AddIndicatorSurfaceEventListener(this);
+                       r = DetachChild(*__pCurrentVisualElement);
                }
+               __pCurrentVisualElement = pVisualElement;
        }
 
        return r;
 }
 
-result
-_Indicator::OnDetachingFromMainTree(void)
+void
+_Indicator::OnChangeLayout(_ControlOrientation orientation)
 {
-       result r = E_SUCCESS;
+       __orientation = orientation;
 
-       _Window* pWindow = GetRootWindow();
-       if (pWindow != null)
+       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
        {
-               if (__pPortraitIndicatorElement)
+               ChangeCurrentVisualElement(__pPortraitVisualElement);
+               SetClipChildrenEnabled(true);
+
+               if (__portraitautohide)
+        {
+            SetBackgroundColor(0x00000000);
+//                     ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+               }
+               else
                {
-                       __pPortraitIndicatorElement->Destroy();
-                       __pPortraitIndicatorElement = null;
+                       SetIndicatorOpacity(__opacity);
+//                     ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
                }
 
-               _IndicatorManager::GetInstance()->RemoveIndicatorSurfaceEventListener(this);
+       }
+       else
+       {
+               ChangeCurrentVisualElement(__pLandscapeVisualElement);
+               SetClipChildrenEnabled(false);
+
+               if (__landscapeautohide)
+        {
+            SetBackgroundColor(0x00000000);
+//                     ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+               }
+               else
+               {
+                       SetIndicatorOpacity(__opacity);
+//                     ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
+               }
+       }
+
+}
+
+result
+_Indicator::OnAttachedToMainTree(void)
+{
+    result r = E_SUCCESS;
+
+       if (__pCurrentVisualElement)
+       {
+               r = ChangeCurrentVisualElement(__pCurrentVisualElement);
        }
 
        return r;
@@ -174,54 +308,63 @@ bool
 _Indicator::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
        _IndicatorManager::GetInstance()->SendTouchEvent(touchinfo);
+    return true;
 }
 
 bool
 _Indicator::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
 {
        _IndicatorManager::GetInstance()->SendTouchEvent(touchinfo);
+    return true;
 }
 
 bool
 _Indicator::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
 {
        _IndicatorManager::GetInstance()->SendTouchEvent(touchinfo);
+    return true;
 }
 
 bool
 _Indicator::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
 {
        _IndicatorManager::GetInstance()->SendTouchEvent(touchinfo);
+    return true;
 }
 
 bool
 _Indicator::OnFocusGained(const _Control& source)
 {
+    return true;
 }
 
 bool
 _Indicator::OnFocusLost(const _Control& source)
 {
+    return true;
 }
 
 void
 _Indicator::OnPortraitSurfaceContentUpdated(void)
 {
-       _Window* pWindow = GetRootWindow();
-       if (pWindow != null)
+    if (__pWindow != null)
        {
                Dimension imageSize = _IndicatorManager::GetInstance()->GetPortraitImageSize();
                const void* pImageBuffer = _IndicatorManager::GetInstance()->GetPortraitImageBuffer();
 
-               VisualElementSurface surface;
-               surface.Construct(*(pWindow->GetDisplayContext()), FloatDimension(imageSize.width, imageSize.height));
+        if (pImageBuffer)
+        {
+            VisualElementSurface surface;
+            surface.Construct(*(__pWindow->GetDisplayContext()), FloatDimension(imageSize.width, imageSize.height));
 
-               BufferInfo bufferInfo;
-               surface.GetBufferInfo(bufferInfo);
-               memcpy(bufferInfo.pPixels, pImageBuffer, imageSize.width * imageSize.height * 4);
+            BufferInfo bufferInfo;
+            surface.GetBufferInfo(bufferInfo);
+            memcpy(bufferInfo.pPixels, pImageBuffer, imageSize.width * imageSize.height * 4);
 
-               __pPortraitIndicatorElement->SetSurface(&surface);
-               __pPortraitIndicatorElement->Flush();
+            __pPortraitVisualElement->SetBounds(FloatRectangle(0,0,imageSize.width, imageSize.height));
+            __pPortraitVisualElement->SetSurface(&surface);
+            __pPortraitVisualElement->Flush();
+        }
        }
 }
 
@@ -231,17 +374,60 @@ _Indicator::OnLandscapeSurfaceContentUpdated(void)
 }
 
 void
-_Indicator::OnChangeLayout(_ControlOrientation orientation)
+_Indicator::SetIndicatorAutoHide(bool portrait, bool landscape)
 {
-       // Temporary. cannot get current rotation info
-       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+#ifdef BUILD_BREAK
+       Ecore_X_Window win = 0;
+       if (__pWindow)
+       {
+               win = (Ecore_X_Window)__pWindow->GetNativeHandle();
+       }
+
+       if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
+       {
+               if (portrait)
+               {
+                       Color bgColor(0x00000000);
+                       SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+                       ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+               }
+               else
+               {
+                       SetIndicatorOpacity(__opacity);
+                       ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
+               }
+       }
+       else
+       {
+               if (landscape)
+               {
+                       Color bgColor(0x00000000);
+                       SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+                       ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+               }
+               else
+               {
+                       SetIndicatorOpacity(__opacity);
+                       ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
+               }
+       }
+       __portraitautohide = portrait;
+       __landscapeautohide = landscape;
+#endif
+}
+
+bool
+_Indicator::GetIndicatorAutoHide(void) const
+{
+       if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
        {
-               _IndicatorManager::GetInstance()->SendRotationInfo(90);
+               return __portraitautohide;
        }
        else
        {
-               _IndicatorManager::GetInstance()->SendRotationInfo(180);
+               return __landscapeautohide;
        }
+
 }
 
 result
index 8ca13c6..34f1e91 100644 (file)
  * @brief      This is the implementation file for the _IndicatorManager class.
  */
 
+#include <FBaseColHashMapT.h>
 #include <FGrpBufferInfo.h>
 #include <FGrpDimension.h>
 #include <FUiAnimVisualElementSurface.h>
 #include "FUi_Window.h"
+
+#include "FUiCtrl_Form.h"
+#include "FUiCtrl_Frame.h"
+#include "FUiCtrl_Popup.h"
+#include "FUiCtrl_Keypad.h"
 #include "FUiCtrl_IndicatorManager.h"
 
 #include <sys/mman.h>
@@ -40,18 +46,19 @@ using namespace Tizen::Graphics;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Animations;
 
-const char* pPortraitServiceName = "elm_indicator_portrait";
-const char* pLandscapeServiceName = "elm_indicator_landscape";
 
 namespace Tizen { namespace Ui { namespace Controls {
 
+static const char* pPortraitSvcName = "elm_indicator_portrait";
+static const char* pLandScapeSvcName = "elm_indicator_landscape";
+const int NUMBER_OF_OBJECT = 2;
 _IndicatorManager* _IndicatorManager::__pInstance = null;
 
 _IndicatorManager::_IndicatorManager(void)
 {
        memset(&__portraitImageData, 0x0,sizeof(_PortraitImageData));
        memset(&__landscapeImageData, 0x0,sizeof(_LandscapeImageData));
-       __portraitSocket.Connect(pPortraitServiceName);
+    __portraitSocket.Connect(pPortraitSvcName);
        __portraitSocket.SetEcoreIpcSocketEventListener(this);
        __portraitSocket.Read();
 
@@ -59,7 +66,7 @@ _IndicatorManager::_IndicatorManager(void)
        //__portraitSocket.Send(_MESSAGE_TYPE_MSG, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, 0, &rotation, sizeof(int));
 
        //__landsacpeSocket.Construct();
-       //__landsacpeSocket.Connect(pLandscapeServiceName);
+    //__landsacpeSocket.Connect(pLandscapeSvcName);
        //__landsacpeSocket.SetEcoreIpcSocketEventListener(this);
        //__landsacpeSocket.Read();
 
@@ -71,10 +78,10 @@ _IndicatorManager::_IndicatorManager(void)
 
 _IndicatorManager::~_IndicatorManager(void)
 {
-       munmap(__portraitImageData.pImageBuffer, __portraitImageData.pitch);
+    //munmap(__portraitImageData.pImageBuffer, __portraitImageData.pitch);
        close(__portraitImageData.lockFileDescriptor);
        close(__portraitImageData.sharedFileDescriptor);
-       shm_unlink(__portraitImageData.pSharedFileName);
+    shm_unlink(__portraitImageData.pSharedFileName);
 
        //munmap(__landscapeImageData.pImageBuffer, __landscapeImageData.pitch);
        //close(__landscapeImageData.sharedFileDescriptor);
@@ -319,44 +326,6 @@ _IndicatorManager::OnSurfaceContentUpdated(int socketId)
        }
 }
 
-result
-_IndicatorManager::AddWindow(_Window* pWindow)
-{
-       result r = E_SUCCESS;
-
-#ifdef VE_EFL
-       IndicatorComponent* pIndicatorComponentArray = MakeIndicatorComponentArrayN(pWindow);
-
-       r = __indicatorMap.Add(pWindow, pIndicatorComponentArray);
-#endif
-       return r;
-}
-
-result
-_IndicatorManager::DeleteWindow(_Window* pWindow)
-{
-       result r = E_SUCCESS;
-#ifdef VE_EFL
-       IndicatorComponent* pIndicatorComponentArray = null;
-
-
-       r = __indicatorMap.GetValue(pWindow, pIndicatorComponentArray);
-       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS && pIndicatorComponentArray, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       delete pIndicatorComponentArray[0].pPortraitSurface;
-       delete pIndicatorComponentArray[0].pLandscapeSurface;
-       delete pIndicatorComponentArray[1].pPortraitSurface;
-       delete pIndicatorComponentArray[1].pLandscapeSurface;
-       pIndicatorComponentArray[0].pPortraitVisualElement->Destroy();
-       pIndicatorComponentArray[0].pLandscapeVisualElement->Destroy();
-       pIndicatorComponentArray[1].pPortraitVisualElement->Destroy();
-       pIndicatorComponentArray[1].pLandscapeVisualElement->Destroy();
-
-       delete [] pIndicatorComponentArray;
-       __indicatorMap.Remove(pWindow);
-#endif
-       return r;
-}
 void
 _IndicatorManager::OnLockFileRequested(int socketId, const char* pLockFileName)
 {
index d81ac8d..3e9dcf1 100644 (file)
@@ -178,10 +178,14 @@ OnEvasImageDamaged(void* pData, Evas_Object* pImageObject)
        }
 
        Dimension newImageSize(0,0);
-       evas_object_image_size_get(pImageObject, &newImageSize.width, &newImageSize.height);
+#ifdef VE_EFL
+    evas_object_image_size_get(pImageObject, &newImageSize.width, &newImageSize.height);
+#endif
 
-       Dimension rendererImageSize(0,0);
-       evas_object_image_size_get(pRendererImageObject, &rendererImageSize.width, &rendererImageSize.height);
+    Dimension rendererImageSize(0,0);
+#ifdef VE_EFL
+    evas_object_image_size_get(pRendererImageObject, &rendererImageSize.width, &rendererImageSize.height);
+#endif
 
        if (!newImageSize.Equals(rendererImageSize))
        {
index fd36930..8e7a0bb 100644 (file)
 #include "FUi_Control.h"
 #include "FUi_Types.h"
 #include "FUi_UiTouchEvent.h"
+#include "FUiAnim_ControlVisualElement.h"
 #include "FUiCtrl_IndicatorManager.h"
 
-namespace Tizen { namespace Ui { namespace Animations {
-class _VisualElement;
-}}}
-
 namespace Tizen { namespace Ui { namespace Controls {
 enum _IndicatorOpacity
 {
-       _INDICATOR_OPACITY_UNKNOWN,
-       _INDICATOR_OPACITY_OPAQUE,
-       _INDICATOR_OPACITY_TRANSLUCENT,
-       _INDICATOR_OPACITY_TRANSPARENT
+    _INDICATOR_OPACITY_UNKNOWN,
+    _INDICATOR_OPACITY_OPAQUE,
+    _INDICATOR_OPACITY_TRANSLUCENT,
+    _INDICATOR_OPACITY_TRANSPARENT
 };
+
 class _Indicator
-       : public Tizen::Ui::_Control
+       : public Tizen::Ui::Animations::_ControlVisualElement
        , public _IIndicatorSurfaceEventListener
 {
 public:
        _Indicator(void);
        virtual ~_Indicator(void);
 
+       static _Indicator* CreateIndicator(void);
+       result SetIndicatorShowState(bool state);
        result SetIndicatorOpacity(_IndicatorOpacity opacity);
+       bool GetIndicatorShowState(void) const;
        _IndicatorOpacity GetIndicatorOpacity(void) const;
 
-       result SetIndicatorShowState(bool state, bool hide = false);
-       bool GetIndicatorShowState(void) const;
+       result AddIndicatorObject(_Control* pControl, _Window* pWindow);
+       result DeleteIndicatorObject(void);
+    result ChangeCurrentVisualElement(Animations::_ControlVisualElement *pVisualElement);
+       
+       void SetIndicatorAutoHide(bool portrait, bool landscape);
+       bool GetIndicatorAutoHide(void) const;
 
        result SetNotificationTrayOpenEnabled(bool enable);
        bool IsNotificationTrayOpenEnabled(void) const;
 
-       virtual result OnAttachedToMainTree(void);
-       virtual result OnDetachingFromMainTree(void);
 
        virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
        virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
@@ -69,21 +72,27 @@ public:
        virtual bool OnFocusGained(const _Control& source);
        virtual bool OnFocusLost(const _Control& source);
 
+       void OnChangeLayout(_ControlOrientation orientation);
+    result OnAttachedToMainTree(void);
+       
        virtual void OnPortraitSurfaceContentUpdated(void);
        virtual void OnLandscapeSurfaceContentUpdated(void);
 
-       virtual void OnChangeLayout(_ControlOrientation orientation);
 
 private:
        _Indicator(const _Indicator& value);
        _Indicator& operator =(const _Indicator& value);
 
 private:
+    Tizen::Ui::Animations::_ControlVisualElement* __pPortraitVisualElement;
+    Tizen::Ui::Animations::_ControlVisualElement* __pLandscapeVisualElement;
+    Tizen::Ui::Animations::_ControlVisualElement* __pCurrentVisualElement;
+       _Window* __pWindow;
        bool __showstate;
+       bool __portraitautohide;
+       bool __landscapeautohide;
        _IndicatorOpacity __opacity;
-
-       Tizen::Ui::Animations::_VisualElement* __pPortraitIndicatorElement;
-       Tizen::Ui::Animations::_VisualElement* __pLandscapeIndicatorElement;
+    Tizen::Ui::_ControlOrientation __orientation;
 }; // _Indicator
 
 }}} // Tizen::Ui::Controls
index d3bc161..d710488 100644 (file)
 namespace Tizen { namespace Ui {
 class _Window;
 class _TouchInfo;
-}}
+class _Control;
+}};
+
+namespace Tizen { namespace Ui { namespace Animations {
+class VisualElementSurface;
+}}};
 
 namespace Tizen { namespace Ui { namespace Controls {
 
@@ -67,6 +72,13 @@ typedef struct LandscapeImageData
        void* pImageBuffer;
 } _LandscapeImageData;
 
+
+enum _IndicatorOrientation
+{
+       _INDICATOR_ORIENTATION_PORTRAIT,
+       _INDICATOR_ORIENTATION_LANDSCAPE
+};
+
 class _IIndicatorSurfaceEventListener
        : public Tizen::Base::Object
 {
@@ -95,13 +107,10 @@ public:
        void RemoveIndicatorSurfaceEventListener(_IIndicatorSurfaceEventListener* pListener);
 
        const Tizen::Graphics::Dimension GetPortraitImageSize(void) const;
-       const void* GetPortraitImageBuffer(void) const;
-
-       result AddWindow(_Window* pWindow);
-       result DeleteWindow(_Window* pWindow);
+    const void* GetPortraitImageBuffer(void) const;
        
        const Tizen::Graphics::Dimension GetLandscapeImageSize(void) const;
-       const void* GetLandscapeImageBuffer(void) const;
+    const void* GetLandscapeImageBuffer(void) const;
 
        virtual bool ProduceRawEvents(int fd);
        virtual void OnSurfaceBoundsChanging(int socketId, int width, int height);
index 5e0f085..8e3ab47 100644 (file)
@@ -34,6 +34,14 @@ class _Colorf
 {
 public:
        _Colorf(void) { __r = __g = __b = 0.0f;__a = 1.0f;}
+    _Colorf(unsigned int rgba)
+    {
+        __r = rgba >> 6 & 0xff;
+        __g = rgba >> 4 & 0xff;
+        __b = rgba >> 2 & 0xff;
+        __a = rgba & 0xff;
+    }
+
        _Colorf(float red, float green, float blue, float alpha)
                : __r(red)
                , __g(green)