bfc2c3ebe8a93ea627321807d3e4310e2bcac579
[reactos.git] / reactos / win32ss / gdi / ntgdi / region.h
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 _ROSRGNDATA
8 {
9 /* Header for all gdi objects in the handle table.
10 Do not (re)move this. */
11 BASEOBJECT BaseObject;
12 PRGN_ATTR prgnattr;
13 RGN_ATTR rgnattr;
14
15 RGNDATAHEADER rdh;
16 RECTL *Buffer;
17 } ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA, REGION, *PREGION;
18
19
20 /* Functions ******************************************************************/
21
22 #define REGION_FreeRgn(pRgn) GDIOBJ_FreeObj((POBJ)pRgn, GDIObjType_RGN_TYPE)
23 #define REGION_FreeRgnByHandle(hRgn) GDIOBJ_FreeObjByHandle((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)
24
25 PROSRGNDATA FASTCALL REGION_AllocRgnWithHandle(INT n);
26 PROSRGNDATA FASTCALL REGION_AllocUserRgnWithHandle(INT n);
27 VOID FASTCALL REGION_UnionRectWithRgn(ROSRGNDATA *rgn, const RECTL *rect);
28 INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, RECTL *pRect);
29 BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, const RECTL *rc);
30 BOOL FASTCALL REGION_PtInRegion(PREGION, INT, INT);
31 BOOL FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc, const RECTL *rect, const POINT *off);
32 VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
33 VOID NTAPI REGION_vCleanup(PVOID ObjectBody);
34
35 extern PROSRGNDATA prgnDefault;
36 extern HRGN hrgnDefault;
37
38 VOID FASTCALL REGION_Delete(PROSRGNDATA);
39 VOID FASTCALL IntGdiReleaseRaoRgn(PDC);
40 VOID FASTCALL IntGdiReleaseVisRgn(PDC);
41
42 INT APIENTRY IntGdiGetRgnBox(HRGN, RECTL*);
43 BOOL FASTCALL IntGdiPaintRgn(PDC, PREGION );
44 BOOL FASTCALL IntSetPolyPolygonRgn(PPOINT, PULONG, INT, INT, PREGION);
45 INT FASTCALL IntGdiOffsetRgn(PROSRGNDATA,INT,INT);
46 BOOL FASTCALL IntRectInRegion(HRGN,LPRECTL);
47
48 INT FASTCALL IntGdiCombineRgn(PROSRGNDATA, PROSRGNDATA, PROSRGNDATA, INT);
49 INT FASTCALL REGION_Complexity(PROSRGNDATA);
50 PROSRGNDATA FASTCALL RGNOBJAPI_Lock(HRGN,PRGN_ATTR *);
51 VOID FASTCALL RGNOBJAPI_Unlock(PROSRGNDATA);
52 PROSRGNDATA FASTCALL IntSysCreateRectpRgn(INT,INT,INT,INT);
53 BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD);
54
55 #define IntSysCreateRectpRgnIndirect(prc) \
56 IntSysCreateRectpRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
57
58 PROSRGNDATA
59 FASTCALL
60 IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
61
62 FORCEINLINE
63 PREGION
64 REGION_LockRgn(HRGN hrgn)
65 {
66 return GDIOBJ_LockObject(hrgn, GDIObjType_RGN_TYPE);
67 }
68
69 FORCEINLINE
70 VOID
71 REGION_UnlockRgn(PREGION prgn)
72 {
73 GDIOBJ_vUnlockObject(&prgn->BaseObject);
74 }