}
if (window.GetWindowType() != _WINDOW_TYPE_VE)
- {
- _IndicatorManager::GetInstance()->AddWindow(&window);
-
+ {
if (window.IsDimmingEnabled())
{
_DimmingManager::GetInstance()->RegisterWindow(&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);
}
}
result
_ControlManager::DetachWindow(_Window& window)
{
- result r = E_SUCCESS;
-
- _IndicatorManager::GetInstance()->DeleteWindow(&window);
+ result r = E_SUCCESS;
if (window.IsDimmingEnabled())
{
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();
_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.");
_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)
{
if (__pIndicator)
{
- #ifdef VE_EFL
__pIndicator->DeleteIndicatorObject();
__pIndicator->Destroy();
__pIndicator = null;
- #endif
}
ClearLastResult();
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));
r = GetLastResult();
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- #endif
- }
+
+ }
}
result
Color bgColor(0, 0, 0, 0);
if (actionBars & FORM_ACTION_BAR_INDICATOR)
{
-#ifdef VE_EFL
if (translucent)
{
}
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- #endif
}
if (actionBars & FORM_ACTION_BAR_HEADER)
if (pFrame && IsAttachedToMainTree())
{
- #ifdef VE_EFL
autohide = __pIndicator->GetIndicatorAutoHide();
- #endif
}
return autohide;
_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
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
{
_Form::AddIndicatorObject(void)
{
result r = E_SUCCESS;
-#ifdef VE_EFL
+
if (__pIndicator)
{
r = __pIndicator->AddIndicatorObject(this, GetRootWindow());
}
-#endif
return r;
}
result r = E_SUCCESS;
if (__pIndicator)
{
-#ifdef VE_EFL
r = __pIndicator->DeleteIndicatorObject();
-#endif
- }
+ }
return r;
}
if (__transparentIndicator != IsIndicatorTranslucent())
{
-#ifdef VE_EFL
if (__transparentIndicator == true)
{
SetIndicatorOpacity(_INDICATOR_OPACITY_TRANSLUCENT);
{
SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE);
}
-#endif
}
if (__indicatorShowState != IsIndicatorVisible())
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();
*/
#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;
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;
_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);
}
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;
_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();
+ }
}
}
}
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
* @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>
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();
//__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();
_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);
}
}
-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)
{
}
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))
{
#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);
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
namespace Tizen { namespace Ui {
class _Window;
class _TouchInfo;
-}}
+class _Control;
+}};
+
+namespace Tizen { namespace Ui { namespace Animations {
+class VisualElementSurface;
+}}};
namespace Tizen { namespace Ui { namespace Controls {
void* pImageBuffer;
} _LandscapeImageData;
+
+enum _IndicatorOrientation
+{
+ _INDICATOR_ORIENTATION_PORTRAIT,
+ _INDICATOR_ORIENTATION_LANDSCAPE
+};
+
class _IIndicatorSurfaceEventListener
: public Tizen::Base::Object
{
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);
{
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)