- Rename GDIOBJ_AllocObj to GDIOBJ_allocObjWithHandle and make it return a pointer...
[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 INT STDCALL IntGdiGetRgnBox(HRGN, LPRECT);
38 BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN );
39 HRGN FASTCALL GdiCreatePolyPolygonRgn(CONST PPOINT, CONST PINT, INT, INT );
40 int FASTCALL IntGdiGetClipBox(HDC hDC, LPRECT rc);
41 INT STDCALL IntGdiSelectVisRgn(HDC hdc, HRGN hrgn);
42
43
44 #define UnsafeIntCreateRectRgnIndirect(prc) \
45 NtGdiCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
46
47 #endif /* not __WIN32K_REGION_H */