From f9a4f851d610c02d344f96cf99fe9b0da3134d6a Mon Sep 17 00:00:00 2001 From: Sungyeon Woo Date: Fri, 5 Apr 2013 16:21:12 +0900 Subject: [PATCH] remove CoordinateSystem enum resolution value Change-Id: I80ef333efb853449f1153a3a9abaf01a36c7615b Signed-off-by: Sungyeon Woo --- src/graphics/FGrpCoordinateSystem.cpp | 11 +- src/graphics/FGrp_CoordinateSystem.cpp | 342 ++++++++++++----------- src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp | 165 +++++------ src/graphics/FGrp_CoordinateSystemImpl.cpp | 251 +++++++++-------- src/graphics/FGrp_CoordinateSystemImpl.h | 22 +- src/graphics/inc/FGrp_CoordinateSystem.h | 33 ++- src/ui/FUi_UiBuilder.cpp | 12 +- src/ui/FUi_UiBuilderXmlHandler.cpp | 9 +- src/ui/inc/FUi_UiBuilder.h | 2 +- 9 files changed, 452 insertions(+), 395 deletions(-) diff --git a/src/graphics/FGrpCoordinateSystem.cpp b/src/graphics/FGrpCoordinateSystem.cpp index 973219d..0db76c5 100644 --- a/src/graphics/FGrpCoordinateSystem.cpp +++ b/src/graphics/FGrpCoordinateSystem.cpp @@ -28,7 +28,7 @@ #include "FGrp_CoordinateSystem.h" #include "FGrp_Screen.h" - +#ifdef USE_RESOLUTION_ENUM_VALUE namespace // unnamed { @@ -66,7 +66,7 @@ ConvertToDimension(Tizen::Graphics::_LogicalResolution logicalResolution) } } - +#endif namespace Tizen { namespace Graphics { @@ -74,9 +74,16 @@ namespace Tizen { namespace Graphics Dimension CoordinateSystem::GetLogicalResolution(void) { +#ifdef USE_RESOLUTION_ENUM_VALUE _LogicalResolution logicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetLogicalResolution(); return ConvertToDimension(logicalResolution); +#else + int width = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetLogicalResolutionInt(); + int height = Tizen::Graphics::CoordinateSystem::ConvertToLogicalY(Tizen::Graphics::_Screen::GetHeight()); + + return Tizen::Graphics::Dimension(width,height); +#endif } Dimension diff --git a/src/graphics/FGrp_CoordinateSystem.cpp b/src/graphics/FGrp_CoordinateSystem.cpp index 46fbd2a..1eb9c51 100644 --- a/src/graphics/FGrp_CoordinateSystem.cpp +++ b/src/graphics/FGrp_CoordinateSystem.cpp @@ -38,6 +38,180 @@ using namespace Tizen::Base; +#ifdef USE_RESOLUTION_ENUM_VALUE +namespace Tizen { namespace Graphics +{ +_ICoordinateSystemTransformer* +_CoordinateSystem::GetTransformerN(_LogicalResolution logicalResolution, _PhysicalResolution physicalResolution) +{ + _ICoordinateSystemTransformer* pXformer = _CoordinateSystemImpl::GetTransformerN(logicalResolution, BASE_SCREEN_SIZE_NORMAL, physicalResolution, BASE_SCREEN_SIZE_NORMAL); + + if (pXformer == null) + { + result r = GetLastResult(); + + SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); + } + + return pXformer; +} + +_ICoordinateSystemTransformer* +_CoordinateSystem::GetTransformerN(_LogicalResolution sourceLogicalResolution, _LogicalResolution destLogicalResolution) +{ + _PhysicalResolution physicalResolution = RESOLUTION_PHYSICAL_DEFAULT; + + switch (destLogicalResolution) + { + case RESOLUTION_LOGICAL_240: + physicalResolution = RESOLUTION_PHYSICAL_WQVGA; + break; + case RESOLUTION_LOGICAL_320: + physicalResolution = RESOLUTION_PHYSICAL_HVGA; + break; + case RESOLUTION_LOGICAL_480: + physicalResolution = RESOLUTION_PHYSICAL_WVGA; + break; + case RESOLUTION_LOGICAL_720: + physicalResolution = RESOLUTION_PHYSICAL_HD; + break; + case RESOLUTION_LOGICAL_800: + physicalResolution = RESOLUTION_PHYSICAL_WXGA; + break; + case RESOLUTION_LOGICAL_1080: + physicalResolution = RESOLUTION_PHYSICAL_HD1080; + break; + case RESOLUTION_LOGICAL_1600: + physicalResolution = RESOLUTION_PHYSICAL_WQXGA; + break; + default: + physicalResolution = RESOLUTION_PHYSICAL_NONE; + break; + } + + return _CoordinateSystem::GetTransformerN(sourceLogicalResolution, physicalResolution); +} + +_ICoordinateSystemTransformer* +_CoordinateSystem::GetTransformerN(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize) +{ + _ICoordinateSystemTransformer* pXformer = _CoordinateSystemImpl::GetTransformerN(logicalResolution, logicalBaseScreenSize, physicalResolution, physicalBaseScreenSize); + + if (pXformer == null) + { + result r = GetLastResult(); + + SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); + } + + return pXformer; +} + +result +_CoordinateSystem::Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize) +{ + _CoordinateSystem* pInstance = _CoordinateSystem::GetInstance(); + + result r = pInstance->__Initialize(logicalResolution, logicalBaseScreenSize); + + SysTryReturn(NID_GRP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +_CoordinateSystem::Reset(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize) +{ + result r = E_SUCCESS; + + std::auto_ptr<_CoordinateSystemImpl> pImpl(new _CoordinateSystemImpl()); + + SysTryReturnResult(NID_GRP, pImpl.get() != null, E_OUT_OF_MEMORY, "Insufficient memory."); + + r = pImpl->Initialize(logicalResolution, logicalBaseScreenSize); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + delete __pImpl; + __pImpl = pImpl.release(); + + return E_SUCCESS; +} + +_LogicalResolution +_CoordinateSystem::GetNativeLogicalResolution(void) const +{ + result r = E_SUCCESS; + + SysTryCatch(NID_GRP, __pImpl, r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance has not been initialized yet."); + + return __pImpl->GetNativeLogicalResolution(); + +CATCH: + SetLastResult(r); + + return RESOLUTION_LOGICAL_NONE; +} + +_BaseScreenSize +_CoordinateSystem::GetNativeLogicalBaseScreenSize(void) const +{ + result r = E_SUCCESS; + + SysTryCatch(NID_GRP, __pImpl, r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance has not been initialized yet."); + + return __pImpl->GetNativeLogicalBaseScreenSize(); + +CATCH: + SetLastResult(r); + + return BASE_SCREEN_SIZE_NONE; +} + +_LogicalResolution +_CoordinateSystem::GetLogicalResolution(void) const +{ + result r = E_SUCCESS; + + SysTryCatch(NID_GRP, __pImpl, r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance has not been initialized yet."); + + return __pImpl->GetLogicalResolution(); + +CATCH: + SetLastResult(r); + + return RESOLUTION_LOGICAL_NONE; +} + +_PhysicalResolution +_CoordinateSystem::GetPhysicalResolution(void) const +{ + result r = E_SUCCESS; + + SysTryCatch(NID_GRP, __pImpl, r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance has not been initialized yet."); + + return __pImpl->GetPhysicalResolution(); + +CATCH: + SetLastResult(r); + + return RESOLUTION_PHYSICAL_NONE; +} + +result +_CoordinateSystem::__Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize) +{ + result r = Reset(logicalResolution, logicalBaseScreenSize); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +}} // Tizen::Graphics + +#endif + namespace Tizen { namespace Graphics { @@ -159,73 +333,6 @@ _CoordinateSystem::GetTransformerN(int srcResolution, _BaseScreenSize srcBaseScr return pXformer; } - -_ICoordinateSystemTransformer* -_CoordinateSystem::GetTransformerN(_LogicalResolution logicalResolution, _PhysicalResolution physicalResolution) -{ - _ICoordinateSystemTransformer* pXformer = _CoordinateSystemImpl::GetTransformerN(logicalResolution, BASE_SCREEN_SIZE_NORMAL, physicalResolution, BASE_SCREEN_SIZE_NORMAL); - - if (pXformer == null) - { - result r = GetLastResult(); - - SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); - } - - return pXformer; -} - -_ICoordinateSystemTransformer* -_CoordinateSystem::GetTransformerN(_LogicalResolution sourceLogicalResolution, _LogicalResolution destLogicalResolution) -{ - _PhysicalResolution physicalResolution = RESOLUTION_PHYSICAL_DEFAULT; - - switch (destLogicalResolution) - { - case RESOLUTION_LOGICAL_240: - physicalResolution = RESOLUTION_PHYSICAL_WQVGA; - break; - case RESOLUTION_LOGICAL_320: - physicalResolution = RESOLUTION_PHYSICAL_HVGA; - break; - case RESOLUTION_LOGICAL_480: - physicalResolution = RESOLUTION_PHYSICAL_WVGA; - break; - case RESOLUTION_LOGICAL_720: - physicalResolution = RESOLUTION_PHYSICAL_HD; - break; - case RESOLUTION_LOGICAL_800: - physicalResolution = RESOLUTION_PHYSICAL_WXGA; - break; - case RESOLUTION_LOGICAL_1080: - physicalResolution = RESOLUTION_PHYSICAL_HD1080; - break; - case RESOLUTION_LOGICAL_1600: - physicalResolution = RESOLUTION_PHYSICAL_WQXGA; - break; - default: - physicalResolution = RESOLUTION_PHYSICAL_NONE; - break; - } - - return _CoordinateSystem::GetTransformerN(sourceLogicalResolution, physicalResolution); -} - -_ICoordinateSystemTransformer* -_CoordinateSystem::GetTransformerN(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize) -{ - _ICoordinateSystemTransformer* pXformer = _CoordinateSystemImpl::GetTransformerN(logicalResolution, logicalBaseScreenSize, physicalResolution, physicalBaseScreenSize); - - if (pXformer == null) - { - result r = GetLastResult(); - - SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); - } - - return pXformer; -} - double _CoordinateSystem::GetAppBaseScaleFactor() { @@ -281,18 +388,6 @@ _CoordinateSystem::~_CoordinateSystem(void) } result -_CoordinateSystem::Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize) -{ - _CoordinateSystem* pInstance = _CoordinateSystem::GetInstance(); - - result r = pInstance->__Initialize(logicalResolution, logicalBaseScreenSize); - - SysTryReturn(NID_GRP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r)); - - return r; -} - -result _CoordinateSystem::Initialize(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) { _CoordinateSystem* pInstance = _CoordinateSystem::GetInstance(); @@ -305,25 +400,6 @@ _CoordinateSystem::Initialize(int srcResolution, _BaseScreenSize srcBaseScreenSi } result -_CoordinateSystem::Reset(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize) -{ - result r = E_SUCCESS; - - std::auto_ptr<_CoordinateSystemImpl> pImpl(new _CoordinateSystemImpl()); - - SysTryReturnResult(NID_GRP, pImpl.get() != null, E_OUT_OF_MEMORY, "Insufficient memory."); - - r = pImpl->Initialize(logicalResolution, logicalBaseScreenSize); - - SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - delete __pImpl; - __pImpl = pImpl.release(); - - return E_SUCCESS; -} - -result _CoordinateSystem::Reset(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) { result r = E_SUCCESS; @@ -342,36 +418,6 @@ _CoordinateSystem::Reset(int srcResolution, _BaseScreenSize srcBaseScreenSize, D return E_SUCCESS; } -_LogicalResolution -_CoordinateSystem::GetNativeLogicalResolution(void) const -{ - result r = E_SUCCESS; - - SysTryCatch(NID_GRP, __pImpl, r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance has not been initialized yet."); - - return __pImpl->GetNativeLogicalResolution(); - -CATCH: - SetLastResult(r); - - return RESOLUTION_LOGICAL_NONE; -} - -_BaseScreenSize -_CoordinateSystem::GetNativeLogicalBaseScreenSize(void) const -{ - result r = E_SUCCESS; - - SysTryCatch(NID_GRP, __pImpl, r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance has not been initialized yet."); - - return __pImpl->GetNativeLogicalBaseScreenSize(); - -CATCH: - SetLastResult(r); - - return BASE_SCREEN_SIZE_NONE; -} - _BaseScreenSize _CoordinateSystem::GetLogicalBaseScreenSize(void) const { @@ -402,36 +448,6 @@ CATCH: return 0; } -_LogicalResolution -_CoordinateSystem::GetLogicalResolution(void) const -{ - result r = E_SUCCESS; - - SysTryCatch(NID_GRP, __pImpl, r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance has not been initialized yet."); - - return __pImpl->GetLogicalResolution(); - -CATCH: - SetLastResult(r); - - return RESOLUTION_LOGICAL_NONE; -} - -_PhysicalResolution -_CoordinateSystem::GetPhysicalResolution(void) const -{ - result r = E_SUCCESS; - - SysTryCatch(NID_GRP, __pImpl, r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance has not been initialized yet."); - - return __pImpl->GetPhysicalResolution(); - -CATCH: - SetLastResult(r); - - return RESOLUTION_PHYSICAL_NONE; -} - Dimension _CoordinateSystem::GetPhysicalResolutionDim(void) const { @@ -463,16 +479,6 @@ CATCH: } result -_CoordinateSystem::__Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize) -{ - result r = Reset(logicalResolution, logicalBaseScreenSize); - - SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - return E_SUCCESS; -} - -result _CoordinateSystem::__Initialize(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) { result r = Reset(srcResolution, srcBaseScreenSize, destResolution, destBaseScreenSize); diff --git a/src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp b/src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp index 705992f..5a3dea2 100644 --- a/src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp +++ b/src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp @@ -665,6 +665,8 @@ _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, const namespace Tizen { namespace Graphics { +#ifdef USE_RESOLUTION_ENUM_VALUE + template<_LogicalResolution LogRes> struct LogResTraits { @@ -875,20 +877,6 @@ _GetIntegerResolution(_PhysicalResolution res) } } -const int -_GetIntegerResolution(_BaseScreenSize res) -{ - switch (res) - { - case BASE_SCREEN_SIZE_NORMAL: - return 1; - case BASE_SCREEN_SIZE_LARGE: - return 2; - default: - return -1; - } -} - /***************************************************************************************** * Supported transformations @@ -1288,6 +1276,40 @@ class TransformerNormalHvgaToNormal720 { }; // TransformerNormalHvgaToNormal720 +bool +_WillNotTransform(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize) +{ + return ((logicalResolution == RESOLUTION_LOGICAL_240 && physicalResolution == RESOLUTION_PHYSICAL_WQVGA) || + (logicalResolution == RESOLUTION_LOGICAL_320 && physicalResolution == RESOLUTION_PHYSICAL_HVGA) || + (logicalResolution == RESOLUTION_LOGICAL_480 && physicalResolution == RESOLUTION_PHYSICAL_WVGA) || + (logicalResolution == RESOLUTION_LOGICAL_720 && physicalResolution == RESOLUTION_PHYSICAL_HD) || + (logicalResolution == RESOLUTION_LOGICAL_800 && physicalResolution == RESOLUTION_PHYSICAL_WXGA) || + (logicalResolution == RESOLUTION_LOGICAL_1080 && physicalResolution == RESOLUTION_PHYSICAL_HD1080) || + (logicalResolution == RESOLUTION_LOGICAL_1600 && physicalResolution == RESOLUTION_PHYSICAL_WQXGA)) && + (logicalBaseScreenSize == physicalBaseScreenSize); +} + +#endif + +const int +_GetIntegerResolution(_BaseScreenSize res) +{ + switch (res) + { + case BASE_SCREEN_SIZE_NORMAL: + return 1; + case BASE_SCREEN_SIZE_LARGE: + return 2; + default: + return -1; + } +} + +bool +_WillNotTransform(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) +{ + return ((srcResolution == destResolution.width) && (srcBaseScreenSize == destBaseScreenSize)); +} class _TransformerGeneral : public _ICoordinateSystemTransformer @@ -1446,24 +1468,8 @@ private: }; // _TransformerGeneral -bool -_WillNotTransform(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize) -{ - return ((logicalResolution == RESOLUTION_LOGICAL_240 && physicalResolution == RESOLUTION_PHYSICAL_WQVGA) || - (logicalResolution == RESOLUTION_LOGICAL_320 && physicalResolution == RESOLUTION_PHYSICAL_HVGA) || - (logicalResolution == RESOLUTION_LOGICAL_480 && physicalResolution == RESOLUTION_PHYSICAL_WVGA) || - (logicalResolution == RESOLUTION_LOGICAL_720 && physicalResolution == RESOLUTION_PHYSICAL_HD) || - (logicalResolution == RESOLUTION_LOGICAL_800 && physicalResolution == RESOLUTION_PHYSICAL_WXGA) || - (logicalResolution == RESOLUTION_LOGICAL_1080 && physicalResolution == RESOLUTION_PHYSICAL_HD1080) || - (logicalResolution == RESOLUTION_LOGICAL_1600 && physicalResolution == RESOLUTION_PHYSICAL_WQXGA)) && - (logicalBaseScreenSize == physicalBaseScreenSize); -} -bool -_WillNotTransform(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) -{ - return ((srcResolution == destResolution.width) && (srcBaseScreenSize == destBaseScreenSize)); -} +#ifdef USE_RESOLUTION_ENUM_VALUE result _CoordinateTransformerCore(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize, bool isInverse = false) @@ -1663,6 +1669,55 @@ _CoordinateTransformerCore(_ICoordinateSystemTransformer*& pTransformer, _Logica } } +result +_CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution sourceLogicalResolution, _BaseScreenSize sourceLogicalBaseScreenSize, _PhysicalResolution destPhysicalResolution, _BaseScreenSize destPhysicalBaseScreenSize) +{ + return _CoordinateTransformerCore(pTransformer, sourceLogicalResolution, sourceLogicalBaseScreenSize, destPhysicalResolution, destPhysicalBaseScreenSize, false); +} + +result +_CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _PhysicalResolution sourcePhysicalResolution, _BaseScreenSize sourcePhysicalBaseScreenSize,_LogicalResolution destLogicalResolution, _BaseScreenSize destLogicalBaseScreenSize) +{ + return _CoordinateTransformerCore(pTransformer, destLogicalResolution, destLogicalBaseScreenSize, sourcePhysicalResolution, sourcePhysicalBaseScreenSize, true); +} + +result +_CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution sourceLogicalResolution, _BaseScreenSize sourceLogicalBaseScreenSize, _LogicalResolution destLogicalResolution, _BaseScreenSize destLogicalBaseScreenSize) +{ + _PhysicalResolution physicalResolution = RESOLUTION_PHYSICAL_DEFAULT; + + switch (destLogicalResolution) + { + case RESOLUTION_LOGICAL_240: + physicalResolution = RESOLUTION_PHYSICAL_WQVGA; + break; + case RESOLUTION_LOGICAL_320: + physicalResolution = RESOLUTION_PHYSICAL_HVGA; + break; + case RESOLUTION_LOGICAL_480: + physicalResolution = RESOLUTION_PHYSICAL_WVGA; + break; + case RESOLUTION_LOGICAL_720: + physicalResolution = RESOLUTION_PHYSICAL_HD; + break; + case RESOLUTION_LOGICAL_800: + physicalResolution = RESOLUTION_PHYSICAL_WXGA; + break; + case RESOLUTION_LOGICAL_1080: + physicalResolution = RESOLUTION_PHYSICAL_HD1080; + break; + case RESOLUTION_LOGICAL_1600: + physicalResolution = RESOLUTION_PHYSICAL_WQXGA; + break; + default: + physicalResolution = RESOLUTION_PHYSICAL_NONE; + break; + } + + return _CoordinateTransformerCore(pTransformer, sourceLogicalResolution, sourceLogicalBaseScreenSize, physicalResolution, destLogicalBaseScreenSize, false); +} + +#endif result _CoordinateTransformerCore(_ICoordinateSystemTransformer*& pTransformer, int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) @@ -1716,53 +1771,5 @@ _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, int s return _CoordinateTransformerCore(pTransformer, srcResolution, srcBaseScreenSize, destResolution, destBaseScreenSize); } -result -_CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution sourceLogicalResolution, _BaseScreenSize sourceLogicalBaseScreenSize, _PhysicalResolution destPhysicalResolution, _BaseScreenSize destPhysicalBaseScreenSize) -{ - return _CoordinateTransformerCore(pTransformer, sourceLogicalResolution, sourceLogicalBaseScreenSize, destPhysicalResolution, destPhysicalBaseScreenSize, false); -} - -result -_CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _PhysicalResolution sourcePhysicalResolution, _BaseScreenSize sourcePhysicalBaseScreenSize,_LogicalResolution destLogicalResolution, _BaseScreenSize destLogicalBaseScreenSize) -{ - return _CoordinateTransformerCore(pTransformer, destLogicalResolution, destLogicalBaseScreenSize, sourcePhysicalResolution, sourcePhysicalBaseScreenSize, true); -} - -result -_CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution sourceLogicalResolution, _BaseScreenSize sourceLogicalBaseScreenSize, _LogicalResolution destLogicalResolution, _BaseScreenSize destLogicalBaseScreenSize) -{ - _PhysicalResolution physicalResolution = RESOLUTION_PHYSICAL_DEFAULT; - - switch (destLogicalResolution) - { - case RESOLUTION_LOGICAL_240: - physicalResolution = RESOLUTION_PHYSICAL_WQVGA; - break; - case RESOLUTION_LOGICAL_320: - physicalResolution = RESOLUTION_PHYSICAL_HVGA; - break; - case RESOLUTION_LOGICAL_480: - physicalResolution = RESOLUTION_PHYSICAL_WVGA; - break; - case RESOLUTION_LOGICAL_720: - physicalResolution = RESOLUTION_PHYSICAL_HD; - break; - case RESOLUTION_LOGICAL_800: - physicalResolution = RESOLUTION_PHYSICAL_WXGA; - break; - case RESOLUTION_LOGICAL_1080: - physicalResolution = RESOLUTION_PHYSICAL_HD1080; - break; - case RESOLUTION_LOGICAL_1600: - physicalResolution = RESOLUTION_PHYSICAL_WQXGA; - break; - default: - physicalResolution = RESOLUTION_PHYSICAL_NONE; - break; - } - - return _CoordinateTransformerCore(pTransformer, sourceLogicalResolution, sourceLogicalBaseScreenSize, physicalResolution, destLogicalBaseScreenSize, false); -} - }} // Tizen::Graphics diff --git a/src/graphics/FGrp_CoordinateSystemImpl.cpp b/src/graphics/FGrp_CoordinateSystemImpl.cpp index c7942fc..a3d80c3 100644 --- a/src/graphics/FGrp_CoordinateSystemImpl.cpp +++ b/src/graphics/FGrp_CoordinateSystemImpl.cpp @@ -41,16 +41,22 @@ using namespace Tizen::Base; namespace Tizen { namespace Graphics { -result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, const Dimension& srcDim, const Dimension& trgDim); -result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution sourceLogicalResolution, _BaseScreenSize sourceLogicalBaseScreenSize, _PhysicalResolution destPhysicalResolution, _BaseScreenSize destPhysicalBaseScreenSize); -result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _PhysicalResolution sourcePhysicalResolution, _BaseScreenSize sourcePhysicalBaseScreenSize, _LogicalResolution destLogicalResolution, _BaseScreenSize destLogicalBaseScreenSize); -result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution sourceLogicalResolution, _BaseScreenSize sourceLogicalBaseScreenSize, _LogicalResolution destLogicalResolution, _BaseScreenSize destLogicalBaseScreenSize); -result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize); -bool _WillNotTransform(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize); -bool _WillNotTransform(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize); -const char* _GetStringResolution(_LogicalResolution res); -const char* _GetStringResolution(_PhysicalResolution res); +#ifdef USE_RESOLUTION_ENUM_VALUE + result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution sourceLogicalResolution, _BaseScreenSize sourceLogicalBaseScreenSize, _PhysicalResolution destPhysicalResolution, _BaseScreenSize destPhysicalBaseScreenSize); + result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _PhysicalResolution sourcePhysicalResolution, _BaseScreenSize sourcePhysicalBaseScreenSize, _LogicalResolution destLogicalResolution, _BaseScreenSize destLogicalBaseScreenSize); + result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, _LogicalResolution sourceLogicalResolution, _BaseScreenSize sourceLogicalBaseScreenSize, _LogicalResolution destLogicalResolution, _BaseScreenSize destLogicalBaseScreenSize); + + bool _WillNotTransform(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize); + + const char* _GetStringResolution(_LogicalResolution res); + const char* _GetStringResolution(_PhysicalResolution res); +#endif + + result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, const Dimension& srcDim, const Dimension& trgDim); + result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize); + + bool _WillNotTransform(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize); }} // Tizen::Graphics @@ -190,6 +196,9 @@ private: bool __usingDefault; }; // _CoordinateSystem + +#ifdef USE_RESOLUTION_ENUM_VALUE + _LogicalResolution _CoordinateSystem::_CoordinateSystemImpl::GetNativeLogicalResolution(void) const { @@ -202,18 +211,6 @@ _CoordinateSystem::_CoordinateSystemImpl::GetNativeLogicalBaseScreenSize(void) c return __nativeLogicalBaseScreenSize; } -_BaseScreenSize -_CoordinateSystem::_CoordinateSystemImpl::GetLogicalBaseScreenSize(void) const -{ - return __logicalBaseScreenSize; -} - -int -_CoordinateSystem::_CoordinateSystemImpl::GetLogicalResolutionInt(void) const -{ - return __logicalResolutionInt; -} - _LogicalResolution _CoordinateSystem::_CoordinateSystemImpl::GetLogicalResolution(void) const { @@ -272,83 +269,6 @@ _CoordinateSystem::_CoordinateSystemImpl::GetPhysicalResolution(void) const return __physicalResolution; } -Dimension -_CoordinateSystem::_CoordinateSystemImpl::GetPhysicalResolutionDim(void) const -{ - return __physicalResolutionDim; -} - -_BaseScreenSize -_CoordinateSystem::_CoordinateSystemImpl::GetPhysicalBaseScreenSize(void) const -{ - if (__physicalBaseScreenSize == BASE_SCREEN_SIZE_NONE || __physicalBaseScreenSize == BASE_SCREEN_SIZE_DEFAULT) - { - static Tizen::Graphics::_BaseScreenSize physicalBaseScreenSize = BASE_SCREEN_SIZE_NONE; - - bool isLargeDeviceScreenSize = false; - - Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.size.large", isLargeDeviceScreenSize); - - if (isLargeDeviceScreenSize) - { - physicalBaseScreenSize = BASE_SCREEN_SIZE_LARGE; - } - else - { - physicalBaseScreenSize = BASE_SCREEN_SIZE_NORMAL; - } - - return physicalBaseScreenSize; - } - - return __physicalBaseScreenSize; -} - -void -_CoordinateSystem::_CoordinateSystemImpl::SetTransformEnabled(bool enabled) -{ - __pTransformer->SetEnabled(enabled); - __pInverseTransformer->SetEnabled(enabled); -} - -bool -_CoordinateSystem::_CoordinateSystemImpl::IsTransformEnabled(void) const -{ - return __pTransformer->IsEnabled(); -} - - -_ICoordinateSystemTransformer* -_CoordinateSystem::_CoordinateSystemImpl::GetTransformer(void) -{ - return __pTransformer; -} - -_ICoordinateSystemTransformer* -_CoordinateSystem::_CoordinateSystemImpl::GetInverseTransformer(void) -{ - return __pInverseTransformer; -} - -_ICoordinateSystemTransformer* -_CoordinateSystem::_CoordinateSystemImpl::GetTransformerN(const Dimension& srcDim, const Dimension& trgDim) -{ - ClearLastResult(); - - _ICoordinateSystemTransformer* pXFormer = null; - - result r = _CreateCoordinateTransformer(pXFormer, srcDim, trgDim); - - if (IsFailed(r)) - { - SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); - - SetLastResult(r); - } - - return pXFormer; -} - _ICoordinateSystemTransformer* _CoordinateSystem::_CoordinateSystemImpl::GetTransformerN(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize) { @@ -368,25 +288,6 @@ _CoordinateSystem::_CoordinateSystemImpl::GetTransformerN(_LogicalResolution log return pXFormer; } -_ICoordinateSystemTransformer* -_CoordinateSystem::_CoordinateSystemImpl::GetTransformerN(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) -{ - ClearLastResult(); - - _ICoordinateSystemTransformer* pXFormer = null; - - result r = _CreateCoordinateTransformer(pXFormer, srcResolution, srcBaseScreenSize, destResolution, destBaseScreenSize); - - if (IsFailed(r)) - { - SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); - - SetLastResult(r); - } - - return pXFormer; -} - result _CoordinateSystem::_CoordinateSystemImpl::Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize) { @@ -557,6 +458,116 @@ CATCH: return r; } +#endif + +_BaseScreenSize +_CoordinateSystem::_CoordinateSystemImpl::GetLogicalBaseScreenSize(void) const +{ + return __logicalBaseScreenSize; +} + +int +_CoordinateSystem::_CoordinateSystemImpl::GetLogicalResolutionInt(void) const +{ + return __logicalResolutionInt; +} + +Dimension +_CoordinateSystem::_CoordinateSystemImpl::GetPhysicalResolutionDim(void) const +{ + return __physicalResolutionDim; +} + +_BaseScreenSize +_CoordinateSystem::_CoordinateSystemImpl::GetPhysicalBaseScreenSize(void) const +{ + if (__physicalBaseScreenSize == BASE_SCREEN_SIZE_NONE || __physicalBaseScreenSize == BASE_SCREEN_SIZE_DEFAULT) + { + static Tizen::Graphics::_BaseScreenSize physicalBaseScreenSize = BASE_SCREEN_SIZE_NONE; + + bool isLargeDeviceScreenSize = false; + + Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.size.large", isLargeDeviceScreenSize); + + if (isLargeDeviceScreenSize) + { + physicalBaseScreenSize = BASE_SCREEN_SIZE_LARGE; + } + else + { + physicalBaseScreenSize = BASE_SCREEN_SIZE_NORMAL; + } + + return physicalBaseScreenSize; + } + + return __physicalBaseScreenSize; +} + +void +_CoordinateSystem::_CoordinateSystemImpl::SetTransformEnabled(bool enabled) +{ + __pTransformer->SetEnabled(enabled); + __pInverseTransformer->SetEnabled(enabled); +} + +bool +_CoordinateSystem::_CoordinateSystemImpl::IsTransformEnabled(void) const +{ + return __pTransformer->IsEnabled(); +} + + +_ICoordinateSystemTransformer* +_CoordinateSystem::_CoordinateSystemImpl::GetTransformer(void) +{ + return __pTransformer; +} + +_ICoordinateSystemTransformer* +_CoordinateSystem::_CoordinateSystemImpl::GetInverseTransformer(void) +{ + return __pInverseTransformer; +} + +_ICoordinateSystemTransformer* +_CoordinateSystem::_CoordinateSystemImpl::GetTransformerN(const Dimension& srcDim, const Dimension& trgDim) +{ + ClearLastResult(); + + _ICoordinateSystemTransformer* pXFormer = null; + + result r = _CreateCoordinateTransformer(pXFormer, srcDim, trgDim); + + if (IsFailed(r)) + { + SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); + + SetLastResult(r); + } + + return pXFormer; +} + +_ICoordinateSystemTransformer* +_CoordinateSystem::_CoordinateSystemImpl::GetTransformerN(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) +{ + ClearLastResult(); + + _ICoordinateSystemTransformer* pXFormer = null; + + result r = _CreateCoordinateTransformer(pXFormer, srcResolution, srcBaseScreenSize, destResolution, destBaseScreenSize); + + if (IsFailed(r)) + { + SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); + + SetLastResult(r); + } + + return pXFormer; +} + result _CoordinateSystem::_CoordinateSystemImpl::Initialize(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize) { @@ -694,14 +705,16 @@ CATCH: _CoordinateSystem::_CoordinateSystemImpl::_CoordinateSystemImpl(void) : __pTransformer(null) , __pInverseTransformer(null) +#ifdef USE_RESOLUTION_ENUM_VALUE , __nativeLogicalResolution(RESOLUTION_LOGICAL_NONE) , __nativeLogicalBaseScreenSize(BASE_SCREEN_SIZE_NONE) , __logicalResolution(RESOLUTION_LOGICAL_NONE) - , __logicalBaseScreenSize(BASE_SCREEN_SIZE_NONE) , __physicalResolution(RESOLUTION_PHYSICAL_NONE) - , __physicalBaseScreenSize(BASE_SCREEN_SIZE_NONE) +#endif , __logicalResolutionInt(0) , __physicalResolutionDim(0, 0) + , __logicalBaseScreenSize(BASE_SCREEN_SIZE_NONE) + , __physicalBaseScreenSize(BASE_SCREEN_SIZE_NONE) { } diff --git a/src/graphics/FGrp_CoordinateSystemImpl.h b/src/graphics/FGrp_CoordinateSystemImpl.h index dd33760..4f7b05e 100644 --- a/src/graphics/FGrp_CoordinateSystemImpl.h +++ b/src/graphics/FGrp_CoordinateSystemImpl.h @@ -37,26 +37,30 @@ public: _CoordinateSystemImpl(void); ~_CoordinateSystemImpl(void); +#ifdef USE_RESOLUTION_ENUM_VALUE _LogicalResolution GetNativeLogicalResolution(void) const; _BaseScreenSize GetNativeLogicalBaseScreenSize(void) const; _LogicalResolution GetLogicalResolution(void) const; - int GetLogicalResolutionInt(void) const; - _PhysicalResolution GetPhysicalResolution(void) const; + + result Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize); + + static _ICoordinateSystemTransformer* GetTransformerN(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize); +#endif + + int GetLogicalResolutionInt(void) const; Dimension GetPhysicalResolutionDim(void) const; _BaseScreenSize GetLogicalBaseScreenSize(void) const; _BaseScreenSize GetPhysicalBaseScreenSize(void) const; - result Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize); result Initialize(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize); _ICoordinateSystemTransformer* GetTransformer(void); _ICoordinateSystemTransformer* GetInverseTransformer(void); static _ICoordinateSystemTransformer* GetTransformerN(const Dimension& srcDim, const Dimension& trgDim); - static _ICoordinateSystemTransformer* GetTransformerN(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize); static _ICoordinateSystemTransformer* GetTransformerN(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize); void SetTransformEnabled(bool enabled); @@ -68,21 +72,23 @@ private: private: class __CoordinateTransformer; + __CoordinateTransformer* __pTransformer; __CoordinateTransformer* __pInverseTransformer; +#ifdef USE_RESOLUTION_ENUM_VALUE _LogicalResolution __nativeLogicalResolution; _BaseScreenSize __nativeLogicalBaseScreenSize; - _LogicalResolution __logicalResolution; - _BaseScreenSize __logicalBaseScreenSize; - _PhysicalResolution __physicalResolution; - _BaseScreenSize __physicalBaseScreenSize; +#endif int __logicalResolutionInt; Dimension __physicalResolutionDim; + _BaseScreenSize __logicalBaseScreenSize; + _BaseScreenSize __physicalBaseScreenSize; + }; // _CoordinateSystemImpl }} // Tizen::Graphics diff --git a/src/graphics/inc/FGrp_CoordinateSystem.h b/src/graphics/inc/FGrp_CoordinateSystem.h index ae50a73..b01cb8a 100644 --- a/src/graphics/inc/FGrp_CoordinateSystem.h +++ b/src/graphics/inc/FGrp_CoordinateSystem.h @@ -32,9 +32,10 @@ #include #include + +#ifdef USE_RESOLUTION_ENUM_VALUE namespace Tizen { namespace Graphics { - enum _LogicalResolution { RESOLUTION_LOGICAL_NONE, @@ -67,6 +68,14 @@ enum _PhysicalResolution RESOLUTION_PHYSICAL_WQXGA }; +}} // Tizen::Graphics +#endif + + + +namespace Tizen { namespace Graphics +{ + enum _BaseScreenSize { BASE_SCREEN_SIZE_NONE, @@ -207,30 +216,35 @@ class _OSP_EXPORT_ _CoordinateSystem public: static _CoordinateSystem* GetInstance(void); +#ifdef USE_RESOLUTION_ENUM_VALUE _LogicalResolution GetNativeLogicalResolution(void) const; _BaseScreenSize GetNativeLogicalBaseScreenSize(void) const; _LogicalResolution GetLogicalResolution(void) const; - int GetLogicalResolutionInt(void) const; - _PhysicalResolution GetPhysicalResolution(void) const; + + static result Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize); + result Reset(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize); + + static _ICoordinateSystemTransformer* GetTransformerN(_LogicalResolution logicalResolution, _PhysicalResolution physicalResolution); + static _ICoordinateSystemTransformer* GetTransformerN(_LogicalResolution sourceLogicalResolution, _LogicalResolution destLogicalResolution); + static _ICoordinateSystemTransformer* GetTransformerN(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize); +#endif + + int GetLogicalResolutionInt(void) const; Dimension GetPhysicalResolutionDim(void) const; _BaseScreenSize GetLogicalBaseScreenSize(void) const; _BaseScreenSize GetPhysicalBaseScreenSize(void) const; - static result Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize); static result Initialize(int srcRes, _BaseScreenSize srcBaseScreenSize, Dimension destRes, _BaseScreenSize destBaseScreenSize); - result Reset(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize); + result Reset(int srcRes, _BaseScreenSize srcBaseScreenSize, Dimension destRes, _BaseScreenSize destBaseScreenSize); _ICoordinateSystemTransformer* GetTransformer(void); _ICoordinateSystemTransformer* GetInverseTransformer(void); static _ICoordinateSystemTransformer* GetTransformerN(const Dimension& srcDim, const Dimension& trgDim); - static _ICoordinateSystemTransformer* GetTransformerN(_LogicalResolution logicalResolution, _PhysicalResolution physicalResolution); - static _ICoordinateSystemTransformer* GetTransformerN(_LogicalResolution sourceLogicalResolution, _LogicalResolution destLogicalResolution); - static _ICoordinateSystemTransformer* GetTransformerN(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize); static _ICoordinateSystemTransformer* GetTransformerN(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize); void SetTransformEnabled(bool enabled); @@ -246,7 +260,10 @@ private: _CoordinateSystem(const _CoordinateSystem&); _CoordinateSystem& operator =(const _CoordinateSystem&); +#ifdef USE_RESOLUTION_ENUM_VALUE result __Initialize(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize); +#endif + result __Initialize(int srcResolution, _BaseScreenSize srcBaseScreenSize, Dimension destResolution, _BaseScreenSize destBaseScreenSize); static void __InitCoordinateSystem(void); diff --git a/src/ui/FUi_UiBuilder.cpp b/src/ui/FUi_UiBuilder.cpp index b97047b..4e648ec 100644 --- a/src/ui/FUi_UiBuilder.cpp +++ b/src/ui/FUi_UiBuilder.cpp @@ -414,21 +414,21 @@ _UiBuilder::GetUiBuilderRotateState() const } result -_UiBuilder::SetFormXmlResolution(_LogicalResolution formXmlResoluton) +_UiBuilder::SetFormXmlResolution(int formXmlResoluton) { result r = E_SUCCESS; if (__pTransform == null) { - if (formXmlResoluton == RESOLUTION_LOGICAL_720 && __logicalResolution == 480) + if (formXmlResoluton == 720 && __logicalResolution == 480) { - __pTransform = _CoordinateSystem::GetTransformerN(RESOLUTION_LOGICAL_720, RESOLUTION_LOGICAL_480); - SysTryReturn(NID_UI, __pTransform != null, null, GetLastResult(), + __pTransform = _CoordinateSystem::GetTransformerN(720, _CoordinateSystem::GetInstance()->GetLogicalBaseScreenSize(), Dimension(480, 800), _CoordinateSystem::GetInstance()->GetPhysicalBaseScreenSize()); + SysTryReturn(NID_UI, __pTransform != null, null, GetLastResult(), "Failed to get Transformer"); } - if (formXmlResoluton == RESOLUTION_LOGICAL_480 && __logicalResolution == 720) + if (formXmlResoluton == 480 && __logicalResolution == 720) { - __pTransform = _CoordinateSystem::GetTransformerN(RESOLUTION_LOGICAL_480, RESOLUTION_LOGICAL_720); + __pTransform = _CoordinateSystem::GetTransformerN(480, _CoordinateSystem::GetInstance()->GetLogicalBaseScreenSize(), Dimension(720, 1280), _CoordinateSystem::GetInstance()->GetPhysicalBaseScreenSize()); SysTryReturn(NID_UI, __pTransform != null, GetLastResult(), GetLastResult(), "Failed to get Transformer"); } diff --git a/src/ui/FUi_UiBuilderXmlHandler.cpp b/src/ui/FUi_UiBuilderXmlHandler.cpp index fc0a856..d06a7e9 100644 --- a/src/ui/FUi_UiBuilderXmlHandler.cpp +++ b/src/ui/FUi_UiBuilderXmlHandler.cpp @@ -16,7 +16,7 @@ // /** * @file FUi_UiBuilderXmlHandler.cpp -* @brief This is the implementation file for _UiBuilderXmlHandler class. +* @brief This is the implementation file for _UiBuilderXmlHandler class. */ #include @@ -93,15 +93,16 @@ ParseCharactersSaxFunc(void*ctx, const xmlChar*ch, int len) { if (XMLHandler->__formXmlResolutionExists == true) { - Tizen::Graphics::_LogicalResolution formXmlResolution; + int formXmlResolution = 0; + if (xmlStrncmp( ch, (xmlChar*)"720", len) == 0) { - formXmlResolution = Tizen::Graphics::RESOLUTION_LOGICAL_720; + formXmlResolution = 720; XMLHandler->__errorResult = XMLHandler->__pGenerator->SetFormXmlResolution(formXmlResolution); } else { - formXmlResolution = Tizen::Graphics::RESOLUTION_LOGICAL_480; + formXmlResolution = 480; XMLHandler->__errorResult = XMLHandler->__pGenerator->SetFormXmlResolution(formXmlResolution); } XMLHandler->__formXmlResolutionExists = false; diff --git a/src/ui/inc/FUi_UiBuilder.h b/src/ui/inc/FUi_UiBuilder.h index 4a65dcf..795a5f6 100644 --- a/src/ui/inc/FUi_UiBuilder.h +++ b/src/ui/inc/FUi_UiBuilder.h @@ -64,7 +64,7 @@ public: _UiBuilderScreenRotate GetUiBuilderRotateState(void) const; _UiBuilderControl* GetControl(int index) const; _UiBuilderControl* GetControl(const Tizen::Base::String& id) const; - result SetFormXmlResolution(Tizen::Graphics::_LogicalResolution formXmlResoluton); + result SetFormXmlResolution(int formXmlResoluton); Tizen::Graphics::_ICoordinateSystemTransformer* GetTransformer(void) const; private: _UiBuilder(const _UiBuilder& rhs); -- 2.7.4