xref: /reactos/win32ss/gdi/ntgdi/region.h (revision 8a978a17)
1 #pragma once
2 
3 /* Type definitions ***********************************************************/
4 
5 /* Internal region data.
6    Can't use RGNDATA structure because buffer is allocated statically */
7 typedef struct _REGION
8 {
9   /* Header for all gdi objects in the handle table.
10      Do not (re)move this. */
11   BASEOBJECT BaseObject;
12   _Notnull_ PRGN_ATTR prgnattr;
13   RGN_ATTR rgnattr;
14 
15   RGNDATAHEADER rdh;
16   RECTL *Buffer;
17 } REGION, *PREGION;
18 
19 /* Globals ********************************************************************/
20 
21 extern PREGION prgnDefault;
22 extern HRGN hrgnDefault;
23 
24 /* Functions ******************************************************************/
25 
26 PREGION FASTCALL REGION_AllocRgnWithHandle(INT n);
27 PREGION FASTCALL REGION_AllocUserRgnWithHandle(INT n);
28 BOOL FASTCALL REGION_UnionRectWithRgn(PREGION rgn, const RECTL *rect);
29 INT FASTCALL REGION_SubtractRectFromRgn(PREGION prgnDest, PREGION prgnSrc, const RECTL *prcl);
30 INT FASTCALL REGION_GetRgnBox(PREGION Rgn, RECTL *pRect);
31 BOOL FASTCALL REGION_RectInRegion(PREGION Rgn, const RECTL *rc);
32 BOOL FASTCALL REGION_PtInRegion(PREGION, INT, INT);
33 INT FASTCALL REGION_CropRegion(PREGION rgnDst, PREGION rgnSrc, const RECTL *rect);
34 VOID FASTCALL REGION_SetRectRgn(PREGION pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
35 VOID NTAPI REGION_vCleanup(PVOID ObjectBody);
36 VOID FASTCALL REGION_Delete(PREGION);
37 INT APIENTRY IntGdiGetRgnBox(HRGN, RECTL*);
38 
39 PREGION
40 FASTCALL
41 REGION_LockRgn(
42     _In_ HRGN hrgn);
43 
44 VOID
45 FASTCALL
46 REGION_UnlockRgn(
47     _In_ PREGION prgn);
48 
49 BOOL
50 FASTCALL
51 REGION_bXformRgn(
52     _Inout_ PREGION prgn,
53     _In_ PMATRIX pmx);
54 
55 BOOL
56 FASTCALL
57 REGION_SetPolyPolygonRgn(
58     _Inout_ PREGION prgn,
59     _In_ const POINT *ppt,
60     _In_ const ULONG *pcPoints,
61     _In_ ULONG cPolygons,
62     _In_ INT iMode);
63 
64 HRGN
65 NTAPI
66 GreCreatePolyPolygonRgn(
67     _In_ const POINT *ppt,
68     _In_ const ULONG *pcPoints,
69     _In_ ULONG cPolygons,
70     _In_ INT iMode);
71 
72 BOOL
73 FASTCALL
74 REGION_bOffsetRgn(
75     _Inout_ PREGION prgn,
76     _In_ INT cx,
77     _In_ INT cy);
78 
79 BOOL FASTCALL IntRectInRegion(HRGN,LPRECTL);
80 
81 INT FASTCALL IntGdiCombineRgn(PREGION, PREGION, PREGION, INT);
82 INT FASTCALL REGION_Complexity(PREGION);
83 PREGION FASTCALL IntSysCreateRectpRgn(INT,INT,INT,INT);
84 BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD);
85 
86 HRGN
87 FASTCALL
88 GreCreateFrameRgn(
89     HRGN hrgn,
90     INT x,
91     INT y);
92 
93 #define IntSysCreateRectpRgnIndirect(prc) \
94   IntSysCreateRectpRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
95 
96 #define GreCreateRectRgnIndirect(prc) \
97   NtGdiCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
98 
99 #define GreSetRectRgnIndirect(hRgn, prc) \
100   NtGdiSetRectRgn(hRgn, (prc)->left, (prc)->top, (prc)->right, (prc)->bottom);
101 
102 PREGION
103 FASTCALL
104 IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
105