[WIN32K]
[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_SubtractRectFromRgn(PREGION prgnDest, PREGION prgnSrc, const RECTL *prcl);
29 INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, RECTL *pRect);
30 BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, const RECTL *rc);
31 BOOL FASTCALL REGION_PtInRegion(PREGION, INT, INT);
32 INT FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc, const RECTL *rect, const POINT *off);
33 VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
34 VOID NTAPI REGION_vCleanup(PVOID ObjectBody);
35
36 extern PROSRGNDATA prgnDefault;
37 extern HRGN hrgnDefault;
38
39 VOID FASTCALL REGION_Delete(PROSRGNDATA);
40 VOID FASTCALL IntGdiReleaseRaoRgn(PDC);
41 VOID FASTCALL IntGdiReleaseVisRgn(PDC);
42
43 INT APIENTRY IntGdiGetRgnBox(HRGN, RECTL*);
44 BOOL FASTCALL IntGdiPaintRgn(PDC, PREGION );
45 BOOL FASTCALL IntSetPolyPolygonRgn(PPOINT, PULONG, INT, INT, PREGION);
46 INT FASTCALL IntGdiOffsetRgn(PROSRGNDATA,INT,INT);
47 BOOL FASTCALL IntRectInRegion(HRGN,LPRECTL);
48
49 INT FASTCALL IntGdiCombineRgn(PROSRGNDATA, PROSRGNDATA, PROSRGNDATA, INT);
50 INT FASTCALL REGION_Complexity(PROSRGNDATA);
51 PROSRGNDATA FASTCALL RGNOBJAPI_Lock(HRGN,PRGN_ATTR *);
52 VOID FASTCALL RGNOBJAPI_Unlock(PROSRGNDATA);
53 PROSRGNDATA FASTCALL IntSysCreateRectpRgn(INT,INT,INT,INT);
54 BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD);
55
56 #define IntSysCreateRectpRgnIndirect(prc) \
57 IntSysCreateRectpRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
58
59 PROSRGNDATA
60 FASTCALL
61 IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
62
63 FORCEINLINE
64 PREGION
65 REGION_LockRgn(HRGN hrgn)
66 {
67 return GDIOBJ_LockObject(hrgn, GDIObjType_RGN_TYPE);
68 }
69
70 FORCEINLINE
71 VOID
72 REGION_UnlockRgn(PREGION prgn)
73 {
74 GDIOBJ_vUnlockObject(&prgn->BaseObject);
75 }