3 #include <win32k/region.h>
4 #include <win32k/gdiobj.h>
5 #include <include/rect.h>
8 #include <win32k/debug1.h>
10 /* FUNCTIONS *****************************************************************/
13 W32kOffsetRect(LPRECT Rect, INT x, INT y)
24 W32kUnionRect(PRECT Dest, const RECT* Src1, const RECT* Src2)
26 if (W32kIsEmptyRect(Src1))
28 if (W32kIsEmptyRect(Src2))
30 W32kSetEmptyRect(Dest);
40 if (W32kIsEmptyRect(Src2))
46 Dest->left = min(Src1->left, Src2->left);
47 Dest->top = min(Src1->top, Src2->top);
48 Dest->right = max(Src1->right, Src2->right);
49 Dest->bottom = max(Src1->bottom, Src2->bottom);
56 W32kSetEmptyRect(PRECT Rect)
58 Rect->left = Rect->right = Rect->top = Rect->bottom = 0;
63 W32kIsEmptyRect(PRECT Rect)
65 return(Rect->left >= Rect->right || Rect->top >= Rect->bottom);
69 W32kSetRect(PRECT Rect, INT left, INT top, INT right, INT bottom)
74 Rect->bottom = bottom;
79 W32kIntersectRect(PRECT Dest, const RECT* Src1, const RECT* Src2)
81 if (W32kIsEmptyRect(Src1) || W32kIsEmptyRect(Src2) ||
82 Src1->left >= Src2->right || Src2->left >= Src1->right ||
83 Src1->top >= Src2->bottom || Src2->top >= Src1->bottom)
85 W32kSetEmptyRect(Dest);
88 Dest->left = max(Src1->left, Src2->left);
89 Dest->right = min(Src1->right, Src2->right);
90 Dest->top = max(Src1->top, Src2->top);
91 Dest->bottom = min(Src1->bottom, Src2->bottom);