efb71abf5010ae022831cba3b2588651d0136715
[reactos.git] / reactos / include / win32k / dc.h
1
2 #ifndef __WIN32K_DC_H
3 #define __WIN32K_DC_H
4
5 typedef struct _WIN_DC_INFO
6 {
7 int flags;
8 HRGN hClipRgn; /* Clip region (may be 0) */
9 HRGN hVisRgn; /* Visible region (must never be 0) */
10 HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
11 HPEN hPen;
12 HBRUSH hBrush;
13 HFONT hFont;
14 HBITMAP hBitmap;
15 HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */
16
17 /* #if 0 */
18 HANDLE hDevice;
19 HPALETTE hPalette;
20
21 GdiPath path;
22 /* #endif */
23
24 WORD ROPmode;
25 WORD polyFillMode;
26 WORD stretchBltMode;
27 WORD relAbsMode;
28 WORD backgroundMode;
29 COLORREF backgroundColor;
30 COLORREF textColor;
31
32 short brushOrgX;
33 short brushOrgY;
34
35 WORD textAlign; /* Text alignment from SetTextAlign() */
36 short charExtra; /* Spacing from SetTextCharacterExtra() */
37 short breakTotalExtra; /* Total extra space for justification */
38 short breakCount; /* Break char. count */
39 short breakExtra; /* breakTotalExtra / breakCount */
40 short breakRem; /* breakTotalExtra % breakCount */
41
42 RECT totalExtent;
43 BYTE bitsPerPixel;
44
45 INT MapMode;
46 INT GraphicsMode; /* Graphics mode */
47 INT DCOrgX; /* DC origin */
48 INT DCOrgY;
49
50 #if 0
51 FARPROC lpfnPrint; /* AbortProc for Printing */
52 #endif
53
54 INT CursPosX; /* Current position */
55 INT CursPosY;
56 INT ArcDirection;
57
58 XFORM xformWorld2Wnd; /* World-to-window transformation */
59 XFORM xformWorld2Vport; /* World-to-viewport transformation */
60 XFORM xformVport2World; /* Inverse of the above transformation */
61 BOOL vport2WorldValid; /* Is xformVport2World valid? */
62 } WIN_DC_INFO;
63
64 /* DC flags */
65 #define DC_MEMORY 0x0001 /* It is a memory DC */
66 #define DC_SAVED 0x0002 /* It is a saved DC */
67 #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
68 #define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
69
70 #define GDI_DC_TYPE (1)
71
72 typedef struct _DC
73 {
74 HDC hSelf;
75 HDC hNext;
76 DHPDEV PDev;
77 HSURF FillPatternSurfaces[HS_DDI_MAX];
78 PGDIINFO GDIInfo;
79 PDEVINFO DevInfo;
80 HDEV GDIDevice;
81
82 DRIVER_FUNCTIONS DriverFunctions;
83 UNICODE_STRING DriverName;
84 HANDLE DeviceDriver;
85
86 INT wndOrgX; /* Window origin */
87 INT wndOrgY;
88 INT wndExtX; /* Window extent */
89 INT wndExtY;
90 INT vportOrgX; /* Viewport origin */
91 INT vportOrgY;
92 INT vportExtX; /* Viewport extent */
93 INT vportExtY;
94
95 CLIPOBJ *CombinedClip;
96
97 XLATEOBJ *XlateBrush;
98 XLATEOBJ *XlatePen;
99
100 INT saveLevel;
101 BOOL IsIC;
102
103 HPALETTE PalIndexed;
104
105 WIN_DC_INFO w;
106 } DC, *PDC;
107
108 typedef struct _GDIPOINTER /* should stay private to ENG */
109 {
110 /* private GDI pointer handling information, required for software emulation */
111 BOOL Enabled;
112 POINTL Pos;
113 SIZEL Size;
114 POINTL HotSpot;
115 XLATEOBJ *XlateObject;
116 HSURF ColorSurface;
117 HSURF MaskSurface;
118 HSURF SaveSurface;
119
120 /* public pointer information */
121 RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
122 PGD_MOVEPOINTER MovePointer;
123 ULONG Status;
124 } GDIPOINTER, *PGDIPOINTER;
125
126 typedef struct
127 {
128 HANDLE Handle;
129 DHPDEV PDev;
130 DEVMODEW DMW;
131 HSURF FillPatterns[HS_DDI_MAX];
132 GDIINFO GDIInfo;
133 DEVINFO DevInfo;
134 DRIVER_FUNCTIONS DriverFunctions;
135 #ifdef NTOS_MODE_USER
136 PVOID VideoFileObject;
137 #else
138 PFILE_OBJECT VideoFileObject;
139 #endif
140 BOOLEAN PreparedDriver;
141 ULONG DisplayNumber;
142
143 GDIPOINTER Pointer;
144
145 /* Stuff to keep track of software cursors; win32k gdi part */
146 UINT SafetyRemoveLevel; /* at what level was the cursor removed?
147 0 for not removed */
148 UINT SafetyRemoveCount;
149 } GDIDEVICE;
150
151 /* Internal functions */
152
153 #ifndef NTOS_MODE_USER
154
155 #define DC_LockDc(hDC) \
156 ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC))
157 #define DC_UnlockDc(pDC) \
158 GDIOBJ_UnlockObjByPtr (pDC)
159
160 HDC FASTCALL RetrieveDisplayHDC(VOID);
161 HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver);
162 VOID FASTCALL DC_InitDC(HDC DCToInit);
163 HDC FASTCALL DC_FindOpenDC(PUNICODE_STRING Driver);
164 VOID FASTCALL DC_FreeDC(HDC DCToFree);
165 BOOL INTERNAL_CALL DC_Cleanup(PVOID ObjectBody);
166 HDC FASTCALL DC_GetNextDC (PDC pDC);
167 VOID FASTCALL DC_SetNextDC (PDC pDC, HDC hNextDC);
168 VOID FASTCALL DC_SetOwnership(HDC DC, PEPROCESS Owner);
169
170 VOID FASTCALL DC_UpdateXforms(PDC dc);
171 BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest);
172
173 #endif
174
175 /* User entry points */
176
177 BOOL STDCALL NtGdiCancelDC(HDC hDC);
178 HDC STDCALL NtGdiCreateCompatibleDC(HDC hDC);
179 HDC STDCALL NtGdiCreateDC(PUNICODE_STRING Driver,
180 PUNICODE_STRING Device,
181 PUNICODE_STRING Output,
182 CONST PDEVMODEW InitData);
183 HDC STDCALL NtGdiCreateIC(PUNICODE_STRING Driver,
184 PUNICODE_STRING Device,
185 PUNICODE_STRING Output,
186 CONST PDEVMODEW DevMode);
187 BOOL STDCALL NtGdiDeleteDC(HDC hDC);
188 BOOL STDCALL NtGdiDeleteObject(HGDIOBJ hObject);
189 INT STDCALL NtGdiDrawEscape(HDC hDC,
190 INT nEscape,
191 INT cbInput,
192 LPCSTR lpszInData);
193
194 INT STDCALL NtGdiEnumObjects(HDC hDC,
195 INT ObjectType,
196 GOBJENUMPROC ObjectFunc,
197 LPARAM lParam);
198
199 COLORREF STDCALL NtGdiGetBkColor(HDC hDC);
200 INT STDCALL NtGdiGetBkMode(HDC hDC);
201 BOOL STDCALL NtGdiGetBrushOrgEx(HDC hDC, LPPOINT brushOrg);
202 HRGN STDCALL NtGdiGetClipRgn(HDC hDC);
203 HGDIOBJ STDCALL NtGdiGetCurrentObject(HDC hDC, UINT ObjectType);
204 VOID FASTCALL IntGetCurrentPositionEx (PDC dc, LPPOINT currentPosition);
205 BOOL STDCALL NtGdiGetCurrentPositionEx(HDC hDC, LPPOINT currentPosition);
206 BOOL STDCALL NtGdiGetDCOrgEx(HDC hDC, LPPOINT Point);
207 HDC STDCALL NtGdiGetDCState(HDC hDC);
208 INT STDCALL NtGdiGetDeviceCaps(HDC hDC, INT Index);
209 INT STDCALL NtGdiGetMapMode(HDC hDC);
210 INT STDCALL NtGdiGetObject(HGDIOBJ hGDIObj,
211 INT BufSize,
212 LPVOID Object);
213 DWORD STDCALL NtGdiGetObjectType(HGDIOBJ hGDIObj);
214 INT STDCALL NtGdiGetPolyFillMode(HDC hDC);
215 INT STDCALL NtGdiGetRelAbs(HDC hDC);
216 INT STDCALL NtGdiGetROP2(HDC hDC);
217 HGDIOBJ STDCALL NtGdiGetStockObject(INT Object);
218 INT STDCALL NtGdiGetStretchBltMode(HDC hDC);
219 COLORREF STDCALL NtGdiGetTextColor(HDC hDC);
220 UINT STDCALL NtGdiGetTextAlign(HDC hDC);
221 BOOL STDCALL NtGdiGetViewportExtEx(HDC hDC, LPSIZE viewportExt);
222 BOOL STDCALL NtGdiGetViewportOrgEx(HDC hDC, LPPOINT viewportOrg);
223 BOOL STDCALL NtGdiGetWindowExtEx(HDC hDC, LPSIZE windowExt);
224 BOOL STDCALL NtGdiGetWindowOrgEx(HDC hDC, LPPOINT windowOrg);
225 HDC STDCALL NtGdiResetDC(HDC hDC, CONST DEVMODEW *InitData);
226 BOOL STDCALL NtGdiRestoreDC(HDC hDC, INT SavedDC);
227 INT STDCALL NtGdiSaveDC(HDC hDC);
228 HGDIOBJ STDCALL NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj);
229 INT STDCALL NtGdiSetBkMode(HDC hDC, INT backgroundMode);
230 VOID STDCALL NtGdiSetDCState ( HDC hDC, HDC hDCSave );
231 WORD STDCALL NtGdiSetHookFlags(HDC hDC, WORD Flags);
232 INT STDCALL NtGdiSetPolyFillMode(HDC hDC, INT polyFillMode);
233 INT STDCALL NtGdiSetRelAbs(HDC hDC, INT relAbsMode);
234 INT STDCALL NtGdiSetROP2(HDC hDC, INT ROPmode);
235 INT STDCALL NtGdiSetStretchBltMode(HDC hDC, INT stretchBltMode);
236 COLORREF STDCALL NtGdiSetTextColor(HDC hDC, COLORREF color);
237
238 #endif