#include "FGrp_CoordinateSystem.h"
#include "FGrp_Screen.h"
-
+#ifdef USE_RESOLUTION_ENUM_VALUE
namespace // unnamed
{
}
}
-
+#endif
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
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
{
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()
{
}
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();
}
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;
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
{
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
{
}
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);
namespace Tizen { namespace Graphics
{
+#ifdef USE_RESOLUTION_ENUM_VALUE
+
template<_LogicalResolution LogRes>
struct LogResTraits
{
}
}
-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
{
}; // 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
}; // _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)
}
}
+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)
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
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
bool __usingDefault;
}; // _CoordinateSystem
+
+#ifdef USE_RESOLUTION_ENUM_VALUE
+
_LogicalResolution
_CoordinateSystem::_CoordinateSystemImpl::GetNativeLogicalResolution(void) const
{
return __nativeLogicalBaseScreenSize;
}
-_BaseScreenSize
-_CoordinateSystem::_CoordinateSystemImpl::GetLogicalBaseScreenSize(void) const
-{
- return __logicalBaseScreenSize;
-}
-
-int
-_CoordinateSystem::_CoordinateSystemImpl::GetLogicalResolutionInt(void) const
-{
- return __logicalResolutionInt;
-}
-
_LogicalResolution
_CoordinateSystem::_CoordinateSystemImpl::GetLogicalResolution(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)
{
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)
{
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)
{
_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)
{
}
_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);
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
#include <FGrpFloatDimension.h>
#include <FGrpFloatRectangle.h>
+
+#ifdef USE_RESOLUTION_ENUM_VALUE
namespace Tizen { namespace Graphics
{
-
enum _LogicalResolution
{
RESOLUTION_LOGICAL_NONE,
RESOLUTION_PHYSICAL_WQXGA
};
+}} // Tizen::Graphics
+#endif
+
+
+
+namespace Tizen { namespace Graphics
+{
+
enum _BaseScreenSize
{
BASE_SCREEN_SIZE_NONE,
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);
_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);
}
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");
}
//
/**
* @file FUi_UiBuilderXmlHandler.cpp
-* @brief This is the implementation file for _UiBuilderXmlHandler class.
+* @brief This is the implementation file for _UiBuilderXmlHandler class.
*/
#include <string.h>
{
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;
_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);