1 #pragma once 2 3 FORCEINLINE 4 VOID 5 RECTL_vSetRect( 6 _Out_ RECTL *prcl, 7 _In_ LONG left, 8 _In_ LONG top, 9 _In_ LONG right, 10 _In_ LONG bottom) 11 { 12 prcl->left = left; 13 prcl->top = top; 14 prcl->right = right; 15 prcl->bottom = bottom; 16 } 17 18 FORCEINLINE 19 VOID 20 RECTL_vSetEmptyRect( 21 _Out_ RECTL *prcl) 22 { 23 prcl->left = 0; 24 prcl->top = 0; 25 prcl->right = 0; 26 prcl->bottom = 0; 27 } 28 29 FORCEINLINE 30 VOID 31 RECTL_vOffsetRect( 32 _Inout_ RECTL *prcl, 33 _In_ INT cx, 34 _In_ INT cy) 35 { 36 prcl->left += cx; 37 prcl->right += cx; 38 prcl->top += cy; 39 prcl->bottom += cy; 40 } 41 42 FORCEINLINE 43 BOOL 44 RECTL_bIsEmptyRect( 45 _In_ const RECTL *prcl) 46 { 47 return (prcl->left >= prcl->right || prcl->top >= prcl->bottom); 48 } 49 50 FORCEINLINE 51 BOOL 52 RECTL_bPointInRect( 53 _In_ const RECTL *prcl, 54 _In_ INT x, 55 _In_ INT y) 56 { 57 return (x >= prcl->left && x < prcl->right && 58 y >= prcl->top && y < prcl->bottom); 59 } 60 61 FORCEINLINE 62 BOOL 63 RECTL_bIsWellOrdered( 64 _In_ const RECTL *prcl) 65 { 66 return ((prcl->left <= prcl->right) && 67 (prcl->top <= prcl->bottom)); 68 } 69 70 FORCEINLINE 71 BOOL 72 RECTL_bClipRectBySize( 73 _Out_ RECTL *prclDst, 74 _In_ const RECTL *prclSrc, 75 _In_ const SIZEL *pszl) 76 { 77 prclDst->left = max(prclSrc->left, 0); 78 prclDst->top = max(prclSrc->top, 0); 79 prclDst->right = min(prclSrc->right, pszl->cx); 80 prclDst->bottom = min(prclSrc->bottom, pszl->cy); 81 return !RECTL_bIsEmptyRect(prclDst); 82 } 83 84 BOOL 85 FASTCALL 86 RECTL_bUnionRect( 87 _Out_ RECTL *prclDst, 88 _In_ const RECTL *prcl1, 89 _In_ const RECTL *prcl2); 90 91 BOOL 92 FASTCALL 93 RECTL_bIntersectRect( 94 _Out_ RECTL* prclDst, 95 _In_ const RECTL* prcl1, 96 _In_ const RECTL* prcl2); 97 98 VOID 99 FASTCALL 100 RECTL_vMakeWellOrdered( 101 _Inout_ RECTL *prcl); 102 103 VOID 104 FASTCALL 105 RECTL_vInflateRect( 106 _Inout_ RECTL *rect, 107 _In_ INT dx, 108 _In_ INT dy); 109