74c4d092b816d847c46eab7d14b7f5ba56910a9a
[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 WIN_DC_INFO w;
104 } DC, *PDC;
105
106 typedef struct _GDIPOINTER /* should stay private to ENG */
107 {
108 /* private GDI pointer handling information, required for software emulation */
109 BOOL Enabled;
110 POINTL Pos;
111 SIZEL Size;
112 POINTL HotSpot;
113 XLATEOBJ *XlateObject;
114 HSURF ColorSurface;
115 HSURF MaskSurface;
116 HSURF SaveSurface;
117
118 /* public pointer information */
119 RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
120 PGD_MOVEPOINTER MovePointer;
121 ULONG Status;
122 } GDIPOINTER, *PGDIPOINTER;
123
124 typedef struct
125 {
126 HANDLE Handle;
127 DHPDEV PDev;
128 DEVMODEW DMW;
129 HSURF FillPatterns[HS_DDI_MAX];
130 GDIINFO GDIInfo;
131 DEVINFO DevInfo;
132 DRIVER_FUNCTIONS DriverFunctions;
133 #ifdef NTOS_MODE_USER
134 PVOID VideoFileObject;
135 #else
136 PFILE_OBJECT VideoFileObject;
137 #endif
138 BOOLEAN PreparedDriver;
139 ULONG DisplayNumber;
140
141 GDIPOINTER Pointer;
142
143 /* Stuff to keep track of software cursors; win32k gdi part */
144 UINT SafetyRemoveLevel; /* at what level was the cursor removed?
145 0 for not removed */
146 UINT SafetyRemoveCount;
147 } GDIDEVICE;
148
149 /* Internal functions */
150
151 #ifndef NTOS_MODE_USER
152
153 #define DC_LockDc(hDC) \
154 ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC))
155 #define DC_UnlockDc(pDC) \
156 GDIOBJ_UnlockObjByPtr (pDC)
157
158 HDC FASTCALL RetrieveDisplayHDC(VOID);
159 HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver);
160 VOID FASTCALL DC_InitDC(HDC DCToInit);
161 HDC FASTCALL DC_FindOpenDC(PUNICODE_STRING Driver);
162 VOID FASTCALL DC_FreeDC(HDC DCToFree);
163 BOOL INTERNAL_CALL DC_Cleanup(PVOID ObjectBody);
164 HDC FASTCALL DC_GetNextDC (PDC pDC);
165 VOID FASTCALL DC_SetNextDC (PDC pDC, HDC hNextDC);
166 VOID FASTCALL DC_SetOwnership(HDC DC, PEPROCESS Owner);
167
168 VOID FASTCALL DC_UpdateXforms(PDC dc);
169 BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest);
170
171 #endif
172
173 /* User entry points */
174
175 BOOL STDCALL NtGdiCancelDC(HDC hDC);
176 HDC STDCALL NtGdiCreateCompatibleDC(HDC hDC);
177 HDC STDCALL NtGdiCreateDC(PUNICODE_STRING Driver,
178 PUNICODE_STRING Device,
179 PUNICODE_STRING Output,
180 CONST PDEVMODEW InitData);
181 HDC STDCALL NtGdiCreateIC(PUNICODE_STRING Driver,
182 PUNICODE_STRING Device,
183 PUNICODE_STRING Output,
184 CONST PDEVMODEW DevMode);
185 BOOL STDCALL NtGdiDeleteDC(HDC hDC);
186 BOOL STDCALL NtGdiDeleteObject(HGDIOBJ hObject);
187 INT STDCALL NtGdiDrawEscape(HDC hDC,
188 INT nEscape,
189 INT cbInput,
190 LPCSTR lpszInData);
191
192 INT STDCALL NtGdiEnumObjects(HDC hDC,
193 INT ObjectType,
194 GOBJENUMPROC ObjectFunc,
195 LPARAM lParam);
196
197 COLORREF STDCALL NtGdiGetBkColor(HDC hDC);
198 INT STDCALL NtGdiGetBkMode(HDC hDC);
199 BOOL STDCALL NtGdiGetBrushOrgEx(HDC hDC, LPPOINT brushOrg);
200 HRGN STDCALL NtGdiGetClipRgn(HDC hDC);
201 HGDIOBJ STDCALL NtGdiGetCurrentObject(HDC hDC, UINT ObjectType);
202 VOID FASTCALL IntGetCurrentPositionEx (PDC dc, LPPOINT currentPosition);
203 BOOL STDCALL NtGdiGetCurrentPositionEx(HDC hDC, LPPOINT currentPosition);
204 BOOL STDCALL NtGdiGetDCOrgEx(HDC hDC, LPPOINT Point);
205 HDC STDCALL NtGdiGetDCState(HDC hDC);
206 INT STDCALL NtGdiGetDeviceCaps(HDC hDC, INT Index);
207 INT STDCALL NtGdiGetMapMode(HDC hDC);
208 INT STDCALL NtGdiGetObject(HGDIOBJ hGDIObj,
209 INT BufSize,
210 LPVOID Object);
211 DWORD STDCALL NtGdiGetObjectType(HGDIOBJ hGDIObj);
212 INT STDCALL NtGdiGetPolyFillMode(HDC hDC);
213 INT STDCALL NtGdiGetRelAbs(HDC hDC);
214 INT STDCALL NtGdiGetROP2(HDC hDC);
215 HGDIOBJ STDCALL NtGdiGetStockObject(INT Object);
216 INT STDCALL NtGdiGetStretchBltMode(HDC hDC);
217 COLORREF STDCALL NtGdiGetTextColor(HDC hDC);
218 UINT STDCALL NtGdiGetTextAlign(HDC hDC);
219 BOOL STDCALL NtGdiGetViewportExtEx(HDC hDC, LPSIZE viewportExt);
220 BOOL STDCALL NtGdiGetViewportOrgEx(HDC hDC, LPPOINT viewportOrg);
221 BOOL STDCALL NtGdiGetWindowExtEx(HDC hDC, LPSIZE windowExt);
222 BOOL STDCALL NtGdiGetWindowOrgEx(HDC hDC, LPPOINT windowOrg);
223 HDC STDCALL NtGdiResetDC(HDC hDC, CONST DEVMODEW *InitData);
224 BOOL STDCALL NtGdiRestoreDC(HDC hDC, INT SavedDC);
225 INT STDCALL NtGdiSaveDC(HDC hDC);
226 HGDIOBJ STDCALL NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj);
227 INT STDCALL NtGdiSetBkMode(HDC hDC, INT backgroundMode);
228 VOID STDCALL NtGdiSetDCState ( HDC hDC, HDC hDCSave );
229 WORD STDCALL NtGdiSetHookFlags(HDC hDC, WORD Flags);
230 INT STDCALL NtGdiSetPolyFillMode(HDC hDC, INT polyFillMode);
231 INT STDCALL NtGdiSetRelAbs(HDC hDC, INT relAbsMode);
232 INT STDCALL NtGdiSetROP2(HDC hDC, INT ROPmode);
233 INT STDCALL NtGdiSetStretchBltMode(HDC hDC, INT stretchBltMode);
234 COLORREF STDCALL NtGdiSetTextColor(HDC hDC, COLORREF color);
235
236 #endif