Merge freeldr from amd64 branch:
[reactos.git] / reactos / subsystems / win32 / win32k / include / region.h
1
2 #ifndef __WIN32K_REGION_H
3 #define __WIN32K_REGION_H
4
5 #include "gdiobj.h"
6
7 /* Type definitions ***********************************************************/
8
9 /* Internal region data.
10 Can't use RGNDATA structure because buffer is allocated statically */
11 typedef struct _ROSRGNDATA
12 {
13 /* Header for all gdi objects in the handle table.
14 Do not (re)move this. */
15 BASEOBJECT BaseObject;
16
17 RGNDATAHEADER rdh;
18 PRECT Buffer;
19 } ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA;
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 #define REGION_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION))
27 #define REGION_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr((POBJ)pRgn)
28
29 PROSRGNDATA FASTCALL REGION_AllocRgnWithHandle(INT n);
30 VOID FASTCALL REGION_UnionRectWithRgn(ROSRGNDATA *rgn, CONST RECT *rect);
31 INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, LPRECT pRect);
32 BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, CONST LPRECT rc);
33 BOOL FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc, const PRECT rect, const PPOINT off);
34 VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
35 BOOL INTERNAL_CALL REGION_Cleanup(PVOID ObjectBody);
36
37 extern PROSRGNDATA prgnDefault;
38 extern HRGN hrgnDefault;
39
40 VOID FASTCALL REGION_Delete(PROSRGNDATA);
41 VOID FASTCALL IntGdiReleaseRaoRgn(PDC);
42 VOID FASTCALL IntGdiReleaseVisRgn(PDC);
43
44 INT APIENTRY IntGdiGetRgnBox(HRGN, LPRECT);
45 BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN );
46 HRGN FASTCALL IntCreatePolyPolygonRgn(PPOINT, PULONG, INT, INT);
47
48 INT FASTCALL IntGdiCombineRgn(PROSRGNDATA, PROSRGNDATA, PROSRGNDATA, INT);
49 INT FASTCALL REGION_Complexity(PROSRGNDATA);
50 PROSRGNDATA FASTCALL IntGdiCreateRectRgn(INT, INT, INT, INT);
51
52 #define UnsafeIntCreateRectRgnIndirect(prc) \
53 NtGdiCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
54
55 #endif /* not __WIN32K_REGION_H */