* Sync the recent cmake branch changes.
[reactos.git] / subsystems / win32 / win32k / include / region.h
1 #pragma once
2
3 #include "gdiobj.h"
4
5 /* Type definitions ***********************************************************/
6
7 /* Internal region data.
8 Can't use RGNDATA structure because buffer is allocated statically */
9 typedef struct _ROSRGNDATA
10 {
11 /* Header for all gdi objects in the handle table.
12 Do not (re)move this. */
13 BASEOBJECT BaseObject;
14 PRGN_ATTR prgnattr;
15 RGN_ATTR rgnattr;
16
17 RGNDATAHEADER rdh;
18 RECTL *Buffer;
19 } ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA, REGION, *PREGION;
20
21
22 /* Functions ******************************************************************/
23
24 #define REGION_FreeRgn(pRgn) GDIOBJ_FreeObj((POBJ)pRgn, GDIObjType_RGN_TYPE)
25 #define REGION_FreeRgnByHandle(hRgn) GDIOBJ_FreeObjByHandle((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)
26
27 PROSRGNDATA FASTCALL REGION_AllocRgnWithHandle(INT n);
28 PROSRGNDATA FASTCALL REGION_AllocUserRgnWithHandle(INT n);
29 VOID FASTCALL REGION_UnionRectWithRgn(ROSRGNDATA *rgn, const RECTL *rect);
30 INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, RECTL *pRect);
31 BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, const RECTL *rc);
32 BOOL 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 BOOL INTERNAL_CALL REGION_Cleanup(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, HRGN );
45 HRGN FASTCALL IntCreatePolyPolygonRgn(PPOINT, PULONG, INT, INT);
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 HRGN FASTCALL IntSysCreateRectRgn(INT,INT,INT,INT);
54 PROSRGNDATA FASTCALL IntSysCreateRectpRgn(INT,INT,INT,INT);
55 BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD);
56
57 #define IntSysCreateRectRgnIndirect(prc) \
58 IntSysCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
59
60 #define IntSysCreateRectpRgnIndirect(prc) \
61 IntSysCreateRectpRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
62
63 PROSRGNDATA
64 FASTCALL
65 IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
66
67 FORCEINLINE
68 PREGION
69 REGION_LockRgn(HRGN hrgn)
70 {
71 return GDIOBJ_LockObject(hrgn, GDIObjType_RGN_TYPE);
72 }
73
74 FORCEINLINE
75 VOID
76 REGION_UnlockRgn(PREGION prgn)
77 {
78 GDIOBJ_vUnlockObject(&prgn->BaseObject);
79 }