2010-02-26 11:43:19 +00:00
|
|
|
#pragma once
|
2003-11-18 20:49:39 +00:00
|
|
|
|
2009-03-19 01:42:34 +00:00
|
|
|
FORCEINLINE
|
2014-05-04 09:45:42 +00:00
|
|
|
VOID
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_vSetRect(
|
|
|
|
_Out_ RECTL *prcl,
|
|
|
|
_In_ LONG left,
|
|
|
|
_In_ LONG top,
|
|
|
|
_In_ LONG right,
|
|
|
|
_In_ LONG bottom)
|
2009-03-19 01:42:34 +00:00
|
|
|
{
|
|
|
|
prcl->left = left;
|
|
|
|
prcl->top = top;
|
|
|
|
prcl->right = right;
|
|
|
|
prcl->bottom = bottom;
|
|
|
|
}
|
|
|
|
|
|
|
|
FORCEINLINE
|
2014-05-04 09:45:42 +00:00
|
|
|
VOID
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_vSetEmptyRect(
|
|
|
|
_Out_ RECTL *prcl)
|
2009-03-19 01:42:34 +00:00
|
|
|
{
|
|
|
|
prcl->left = 0;
|
|
|
|
prcl->top = 0;
|
|
|
|
prcl->right = 0;
|
|
|
|
prcl->bottom = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
FORCEINLINE
|
2014-05-04 09:45:42 +00:00
|
|
|
VOID
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_vOffsetRect(
|
|
|
|
_Inout_ RECTL *prcl,
|
|
|
|
_In_ INT cx,
|
|
|
|
_In_ INT cy)
|
2009-03-19 01:42:34 +00:00
|
|
|
{
|
|
|
|
prcl->left += cx;
|
|
|
|
prcl->right += cx;
|
|
|
|
prcl->top += cy;
|
|
|
|
prcl->bottom += cy;
|
|
|
|
}
|
|
|
|
|
|
|
|
FORCEINLINE
|
2014-05-04 09:45:42 +00:00
|
|
|
BOOL
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_bIsEmptyRect(
|
|
|
|
_In_ const RECTL *prcl)
|
2009-03-19 01:42:34 +00:00
|
|
|
{
|
|
|
|
return (prcl->left >= prcl->right || prcl->top >= prcl->bottom);
|
|
|
|
}
|
|
|
|
|
|
|
|
FORCEINLINE
|
2014-05-04 09:45:42 +00:00
|
|
|
BOOL
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_bPointInRect(
|
|
|
|
_In_ const RECTL *prcl,
|
|
|
|
_In_ INT x,
|
|
|
|
_In_ INT y)
|
2009-03-19 01:42:34 +00:00
|
|
|
{
|
2011-10-02 23:09:03 +00:00
|
|
|
return (x >= prcl->left && x < prcl->right &&
|
|
|
|
y >= prcl->top && y < prcl->bottom);
|
2009-03-19 01:42:34 +00:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:50:04 +00:00
|
|
|
FORCEINLINE
|
2014-05-04 09:45:42 +00:00
|
|
|
BOOL
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_bIsWellOrdered(
|
|
|
|
_In_ const RECTL *prcl)
|
2012-03-21 20:50:04 +00:00
|
|
|
{
|
|
|
|
return ((prcl->left <= prcl->right) &&
|
|
|
|
(prcl->top <= prcl->bottom));
|
|
|
|
}
|
|
|
|
|
2018-03-11 22:03:38 +00:00
|
|
|
FORCEINLINE
|
|
|
|
BOOL
|
|
|
|
RECTL_bClipRectBySize(
|
|
|
|
_Out_ RECTL *prclDst,
|
|
|
|
_In_ const RECTL *prclSrc,
|
|
|
|
_In_ const SIZEL *pszl)
|
|
|
|
{
|
|
|
|
prclDst->left = max(prclSrc->left, 0);
|
|
|
|
prclDst->top = max(prclSrc->top, 0);
|
|
|
|
prclDst->right = min(prclSrc->right, pszl->cx);
|
|
|
|
prclDst->bottom = min(prclSrc->bottom, pszl->cy);
|
|
|
|
return !RECTL_bIsEmptyRect(prclDst);
|
|
|
|
}
|
|
|
|
|
2021-03-22 14:59:15 +00:00
|
|
|
FORCEINLINE
|
|
|
|
LONG
|
|
|
|
RECTL_lGetHeight(_In_ const RECTL* prcl)
|
|
|
|
{
|
|
|
|
return prcl->bottom - prcl->top;
|
|
|
|
}
|
|
|
|
|
|
|
|
FORCEINLINE
|
|
|
|
LONG
|
|
|
|
RECTL_lGetWidth(_In_ const RECTL* prcl)
|
|
|
|
{
|
|
|
|
return prcl->right - prcl->left;
|
|
|
|
}
|
|
|
|
|
2009-03-19 01:42:34 +00:00
|
|
|
BOOL
|
|
|
|
FASTCALL
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_bUnionRect(
|
|
|
|
_Out_ RECTL *prclDst,
|
|
|
|
_In_ const RECTL *prcl1,
|
|
|
|
_In_ const RECTL *prcl2);
|
2009-03-19 01:42:34 +00:00
|
|
|
|
|
|
|
BOOL
|
|
|
|
FASTCALL
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_bIntersectRect(
|
|
|
|
_Out_ RECTL* prclDst,
|
|
|
|
_In_ const RECTL* prcl1,
|
|
|
|
_In_ const RECTL* prcl2);
|
2009-03-19 01:42:34 +00:00
|
|
|
|
2009-04-13 21:38:37 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_vMakeWellOrdered(
|
|
|
|
_Inout_ RECTL *prcl);
|
2010-05-18 09:01:08 +00:00
|
|
|
|
2012-03-21 20:50:04 +00:00
|
|
|
VOID
|
2010-05-18 09:01:08 +00:00
|
|
|
FASTCALL
|
2015-03-10 00:13:17 +00:00
|
|
|
RECTL_vInflateRect(
|
|
|
|
_Inout_ RECTL *rect,
|
|
|
|
_In_ INT dx,
|
|
|
|
_In_ INT dy);
|