// check 1. is width/height less or equal than 0?
if (rtSrc.width <= 0 || rtSrc.height <= 0 || rtDest.width <= 0 || rtDest.height <= 0)
{
- SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
- SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(w:%d,h:%d), dst(w:%d,h:%d)).\n", rtSrc.width, rtSrc.height, rtDest.width, rtDest.height);
+ SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE, "The argument is out of range. (src(w:%d,h:%d), dst(w:%d,h:%d)).\n",
+ rtSrc.width, rtSrc.height, rtDest.width,
+ rtDest.height);
}
// check 2. is src exiting outside of dest entirely?
if (rtSrc.x > rtDest.x + rtDest.width - 1 ||
rtSrc.x + rtSrc.width - 1 < rtDest.x)
{
- SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
- SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%d,y:%d,w:%d,h:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",rtSrc.x, rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width, rtDest.height);
+ SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE,
+ "The argument is out of range. (src(x:%d,y:%d,w:%d,h:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",
+ rtSrc.x,
+ rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width,
+ rtDest.height);
}
if (rtSrc.y > rtDest.y + rtDest.height - 1 ||
rtSrc.y + rtSrc.height - 1 < rtDest.y)
{
- SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
- SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%d,y:%d,w:%d,h:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",rtSrc.x, rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width, rtDest.height);
+ SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE,
+ "The argument is out of range. (src(x:%d,y:%d,w:%d,h:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",
+ rtSrc.x,
+ rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width,
+ rtDest.height);
}
return E_SUCCESS;
// check 1. is width/height less or equal than 0?
if (rtSrcF.width <= 0.0f || rtSrcF.height <= 0.0f || rtDestF.width <= 0.0f || rtDestF.height <= 0.0f)
{
- SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
- SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(w:%f,h:%f), dst(w:%f,h:%f)).\n", rtSrcF.width, rtSrcF.height, rtDestF.width, rtDestF.height);
+ SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE, "The argument is out of range. (src(w:%f,h:%f), dst(w:%f,h:%f)).",
+ rtSrcF.width, rtSrcF.height, rtDestF.width, rtDestF.height);
}
// check 2. is src exiting outside of dest entirely?
if (rtSrcF.x >= rtDestF.x + rtDestF.width || rtSrcF.x + rtSrcF.width <= rtDestF.x)
{
- SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
- SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).\n", rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
-
+ SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE,
+ "The argument is out of range. (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).",
+ rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
}
if (rtSrcF.y >= rtDestF.y + rtDestF.height || rtSrcF.y + rtSrcF.height <= rtDestF.y)
{
- SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
- SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).\n", rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
+ SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE,
+ "The argument is out of range. (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).",
+ rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
}
return E_SUCCESS;
result
_Util::Validate(const ::Tizen::Graphics::Point& ptSrc, const ::Tizen::Graphics::Rectangle& rtDest)
{
- if (rtDest.x <= ptSrc.x && ptSrc.x < rtDest.x + rtDest.width && rtDest.y <= ptSrc.y && ptSrc.y < rtDest.y + rtDest.height)
- {
- return E_SUCCESS;
- }
+ SysTryReturnResult(NID_GRP, rtDest.x <= ptSrc.x &&
+ ptSrc.x < rtDest.x + rtDest.width &&
+ rtDest.y <= ptSrc.y &&
+ ptSrc.y < rtDest.y + rtDest.height,
+ E_OUT_OF_RANGE, "The argument is out of range. (src(x:%d,y:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",
+ ptSrc.x, ptSrc.y, rtDest.x, rtDest.y, rtDest.width,
+ rtDest.height);
- SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
- SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%d,y:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n", ptSrc.x, ptSrc.y, rtDest.x, rtDest.y, rtDest.width, rtDest.height);
+ return E_SUCCESS;
}
result
_Util::Validate(const ::Tizen::Graphics::FloatPoint& ptSrcF, const ::Tizen::Graphics::FloatRectangle& rtDestF)
{
- if (rtDestF.x <= ptSrcF.x && ptSrcF.x < rtDestF.x + rtDestF.width && rtDestF.y <= ptSrcF.y && ptSrcF.y < rtDestF.y + rtDestF.height)
- {
- return E_SUCCESS;
- }
+ SysTryReturnResult(NID_GRP, rtDestF.x <= ptSrcF.x &&
+ ptSrcF.x < rtDestF.x + rtDestF.width &&
+ rtDestF.y <= ptSrcF.y &&
+ ptSrcF.y < rtDestF.y + rtDestF.height,
+ E_OUT_OF_RANGE, "The argument is out of range. (src(x:%f,y:%f), dst(x:%f,y:%f,w:%f,h:%f)).\n",
+ ptSrcF.x, ptSrcF.y, rtDestF.x, rtDestF.y, rtDestF.width,
+ rtDestF.height);
- SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
- SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%f,y:%f), dst(x:%f,y:%f,w:%f,h:%f)).\n", ptSrcF.x, ptSrcF.y, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
+ return E_SUCCESS;
}
bool