mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
[WIN32K]
Annotate rect.c svn path=/trunk/; revision=66648
This commit is contained in:
parent
b673073aa1
commit
af94181e04
2 changed files with 51 additions and 18 deletions
|
@ -15,7 +15,10 @@
|
|||
|
||||
BOOL
|
||||
FASTCALL
|
||||
RECTL_bUnionRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2)
|
||||
RECTL_bUnionRect(
|
||||
_Out_ RECTL *prclDst,
|
||||
_In_ const RECTL *prcl1,
|
||||
_In_ const RECTL *prcl2)
|
||||
{
|
||||
if (RECTL_bIsEmptyRect(prcl1))
|
||||
{
|
||||
|
@ -47,10 +50,12 @@ RECTL_bUnionRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
FASTCALL
|
||||
RECTL_bIntersectRect(RECTL* prclDst, const RECTL* prcl1, const RECTL* prcl2)
|
||||
RECTL_bIntersectRect(
|
||||
_Out_ RECTL* prclDst,
|
||||
_In_ const RECTL* prcl1,
|
||||
_In_ const RECTL* prcl2)
|
||||
{
|
||||
prclDst->left = max(prcl1->left, prcl2->left);
|
||||
prclDst->right = min(prcl1->right, prcl2->right);
|
||||
|
@ -73,26 +78,30 @@ RECTL_bIntersectRect(RECTL* prclDst, const RECTL* prcl1, const RECTL* prcl2)
|
|||
|
||||
VOID
|
||||
FASTCALL
|
||||
RECTL_vMakeWellOrdered(RECTL *prcl)
|
||||
RECTL_vMakeWellOrdered(
|
||||
_Inout_ RECTL *prcl)
|
||||
{
|
||||
LONG lTmp;
|
||||
if (prcl->left > prcl->right)
|
||||
{
|
||||
lTmp = prcl->left;
|
||||
prcl->left = prcl->right;
|
||||
prcl->right = lTmp;
|
||||
prcl->right = lTmp;
|
||||
}
|
||||
if (prcl->top > prcl->bottom)
|
||||
{
|
||||
lTmp = prcl->top;
|
||||
prcl->top = prcl->bottom;
|
||||
prcl->bottom = lTmp;
|
||||
prcl->bottom = lTmp;
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
VOID
|
||||
FASTCALL
|
||||
RECTL_vInflateRect(RECTL *rect, INT dx, INT dy)
|
||||
RECTL_vInflateRect(
|
||||
_Inout_ RECTL *rect,
|
||||
_In_ INT dx,
|
||||
_In_ INT dy)
|
||||
{
|
||||
rect->left -= dx;
|
||||
rect->top -= dy;
|
||||
|
|
|
@ -2,7 +2,12 @@
|
|||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
RECTL_vSetRect(RECTL *prcl, LONG left, LONG top, LONG right, LONG bottom)
|
||||
RECTL_vSetRect(
|
||||
_Out_ RECTL *prcl,
|
||||
_In_ LONG left,
|
||||
_In_ LONG top,
|
||||
_In_ LONG right,
|
||||
_In_ LONG bottom)
|
||||
{
|
||||
prcl->left = left;
|
||||
prcl->top = top;
|
||||
|
@ -12,7 +17,8 @@ RECTL_vSetRect(RECTL *prcl, LONG left, LONG top, LONG right, LONG bottom)
|
|||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
RECTL_vSetEmptyRect(RECTL *prcl)
|
||||
RECTL_vSetEmptyRect(
|
||||
_Out_ RECTL *prcl)
|
||||
{
|
||||
prcl->left = 0;
|
||||
prcl->top = 0;
|
||||
|
@ -22,7 +28,10 @@ RECTL_vSetEmptyRect(RECTL *prcl)
|
|||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
RECTL_vOffsetRect(RECTL *prcl, INT cx, INT cy)
|
||||
RECTL_vOffsetRect(
|
||||
_Inout_ RECTL *prcl,
|
||||
_In_ INT cx,
|
||||
_In_ INT cy)
|
||||
{
|
||||
prcl->left += cx;
|
||||
prcl->right += cx;
|
||||
|
@ -32,14 +41,18 @@ RECTL_vOffsetRect(RECTL *prcl, INT cx, INT cy)
|
|||
|
||||
FORCEINLINE
|
||||
BOOL
|
||||
RECTL_bIsEmptyRect(const RECTL *prcl)
|
||||
RECTL_bIsEmptyRect(
|
||||
_In_ const RECTL *prcl)
|
||||
{
|
||||
return (prcl->left >= prcl->right || prcl->top >= prcl->bottom);
|
||||
}
|
||||
|
||||
FORCEINLINE
|
||||
BOOL
|
||||
RECTL_bPointInRect(const RECTL *prcl, INT x, INT y)
|
||||
RECTL_bPointInRect(
|
||||
_In_ const RECTL *prcl,
|
||||
_In_ INT x,
|
||||
_In_ INT y)
|
||||
{
|
||||
return (x >= prcl->left && x < prcl->right &&
|
||||
y >= prcl->top && y < prcl->bottom);
|
||||
|
@ -47,7 +60,8 @@ RECTL_bPointInRect(const RECTL *prcl, INT x, INT y)
|
|||
|
||||
FORCEINLINE
|
||||
BOOL
|
||||
RECTL_bIsWellOrdered(const RECTL *prcl)
|
||||
RECTL_bIsWellOrdered(
|
||||
_In_ const RECTL *prcl)
|
||||
{
|
||||
return ((prcl->left <= prcl->right) &&
|
||||
(prcl->top <= prcl->bottom));
|
||||
|
@ -55,16 +69,26 @@ RECTL_bIsWellOrdered(const RECTL *prcl)
|
|||
|
||||
BOOL
|
||||
FASTCALL
|
||||
RECTL_bUnionRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2);
|
||||
RECTL_bUnionRect(
|
||||
_Out_ RECTL *prclDst,
|
||||
_In_ const RECTL *prcl1,
|
||||
_In_ const RECTL *prcl2);
|
||||
|
||||
BOOL
|
||||
FASTCALL
|
||||
RECTL_bIntersectRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2);
|
||||
RECTL_bIntersectRect(
|
||||
_Out_ RECTL* prclDst,
|
||||
_In_ const RECTL* prcl1,
|
||||
_In_ const RECTL* prcl2);
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
RECTL_vMakeWellOrdered(RECTL *prcl);
|
||||
RECTL_vMakeWellOrdered(
|
||||
_Inout_ RECTL *prcl);
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
RECTL_vInflateRect(RECTL *rect, INT dx, INT dy);
|
||||
RECTL_vInflateRect(
|
||||
_Inout_ RECTL *rect,
|
||||
_In_ INT dx,
|
||||
_In_ INT dy);
|
||||
|
|
Loading…
Reference in a new issue