6 #include <win32k/driver.h>
7 #include <win32k/gdiobj.h>
8 #include <win32k/path.h>
10 /* (RJJ) Taken from WINE */
11 typedef struct _DEVICECAPS
13 WORD version
; /* 0: driver version */
14 WORD technology
; /* 2: device technology */
15 WORD horzSize
; /* 4: width of display in mm */
16 WORD vertSize
; /* 6: height of display in mm */
17 WORD horzRes
; /* 8: width of display in pixels */
18 WORD vertRes
; /* 10: width of display in pixels */
19 WORD bitsPixel
; /* 12: bits per pixel */
20 WORD planes
; /* 14: color planes */
21 WORD numBrushes
; /* 16: device-specific brushes */
22 WORD numPens
; /* 18: device-specific pens */
23 WORD numMarkers
; /* 20: device-specific markers */
24 WORD numFonts
; /* 22: device-specific fonts */
25 WORD numColors
; /* 24: size of color table */
26 WORD pdeviceSize
; /* 26: size of PDEVICE structure */
27 WORD curveCaps
; /* 28: curve capabilities */
28 WORD lineCaps
; /* 30: line capabilities */
29 WORD polygonalCaps
; /* 32: polygon capabilities */
30 WORD textCaps
; /* 34: text capabilities */
31 WORD clipCaps
; /* 36: clipping capabilities */
32 WORD rasterCaps
; /* 38: raster capabilities */
33 WORD aspectX
; /* 40: relative width of device pixel */
34 WORD aspectY
; /* 42: relative height of device pixel */
35 WORD aspectXY
; /* 44: relative diagonal width of device pixel */
36 WORD pad1
[21]; /* 46-86: reserved */
37 WORD logPixelsX
; /* 88: pixels / logical X inch */
38 WORD logPixelsY
; /* 90: pixels / logical Y inch */
39 WORD pad2
[6]; /* 92-102: reserved */
40 WORD sizePalette
; /* 104: entries in system palette */
41 WORD numReserved
; /* 106: reserved entries */
42 WORD colorRes
; /* 108: color resolution */
43 } DEVICECAPS
, *PDEVICECAPS
;
45 typedef struct _WIN_DC_INFO
48 const PDEVICECAPS devCaps
;
49 HRGN hClipRgn
; /* Clip region (may be 0) */
50 HRGN hVisRgn
; /* Visible region (must never be 0) */
51 HRGN hGCClipRgn
; /* GC clip region (ClipRgn AND VisRgn) */
56 HBITMAP hFirstBitmap
; /* Bitmap selected at creation of the DC */
70 COLORREF backgroundColor
;
76 WORD textAlign
; /* Text alignment from SetTextAlign() */
77 short charExtra
; /* Spacing from SetTextCharacterExtra() */
78 short breakTotalExtra
; /* Total extra space for justification */
79 short breakCount
; /* Break char. count */
80 short breakExtra
; /* breakTotalExtra / breakCount */
81 short breakRem
; /* breakTotalExtra % breakCount */
87 INT GraphicsMode
; /* Graphics mode */
88 INT DCOrgX
; /* DC origin */
92 FARPROC lpfnPrint
; /* AbortProc for Printing */
95 INT CursPosX
; /* Current position */
99 XFORM xformWorld2Wnd
; /* World-to-window transformation */
100 XFORM xformWorld2Vport
; /* World-to-viewport transformation */
101 XFORM xformVport2World
; /* Inverse of the above transformation */
102 BOOL vport2WorldValid
; /* Is xformVport2World valid? */
106 #define DC_MEMORY 0x0001 /* It is a memory DC */
107 #define DC_SAVED 0x0002 /* It is a saved DC */
108 #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
109 #define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
111 #define GDI_DC_TYPE (1)
119 HSURF FillPatternSurfaces
[HS_DDI_MAX
];
124 DRIVER_FUNCTIONS DriverFunctions
;
128 INT wndOrgX
; /* Window origin */
130 INT wndExtX
; /* Window extent */
132 INT vportOrgX
; /* Viewport origin */
134 INT vportExtX
; /* Viewport extent */
142 /* Internal functions */
145 #define DC_PtrToHandle(pDC) \
146 ((HDC) GDIOBJ_PtrToHandle ((PGDIOBJ) pDC, GO_DC_MAGIC))
149 #define DC_HandleToPtr(hDC) \
150 ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GO_DC_MAGIC))
151 #define DC_ReleasePtr(hDC) \
152 GDIOBJ_UnlockObj ((HGDIOBJ) hDC, GO_DC_MAGIC)
154 HDC
RetrieveDisplayHDC(VOID
);
155 HDC
DC_AllocDC(LPCWSTR Driver
);
156 void DC_InitDC(HDC DCToInit
);
157 HDC
DC_FindOpenDC(LPCWSTR Driver
);
158 void DC_FreeDC(HDC DCToFree
);
159 HDC
DC_GetNextDC (PDC pDC
);
160 void DC_SetNextDC (PDC pDC
, HDC hNextDC
);
161 BOOL
DC_InternalDeleteDC( PDC DCToDelete
);
163 void DC_UpdateXforms(PDC dc
);
164 BOOL
DC_InvertXform(const XFORM
*xformSrc
, XFORM
*xformDest
);
166 /* User entry points */
168 BOOL STDCALL
W32kCancelDC(HDC hDC
);
169 HDC STDCALL
W32kCreateCompatableDC(HDC hDC
);
170 HDC STDCALL
W32kCreateDC(LPCWSTR Driver
,
173 CONST PDEVMODEW InitData
);
174 HDC STDCALL
W32kCreateIC(LPCWSTR Driver
,
177 CONST PDEVMODEW DevMode
);
178 BOOL STDCALL
W32kDeleteDC(HDC hDC
);
179 BOOL STDCALL
W32kDeleteObject(HGDIOBJ hObject
);
180 INT STDCALL
W32kDrawEscape(HDC hDC
,
185 /* FIXME: this typedef should go somewhere else... */
186 typedef VOID (*GOBJENUMPROC
)(PVOID
, LPARAM
);
188 INT STDCALL
W32kEnumObjects(HDC hDC
,
190 GOBJENUMPROC ObjectFunc
,
193 COLORREF STDCALL
W32kGetBkColor(HDC hDC
);
194 INT STDCALL
W32kGetBkMode(HDC hDC
);
195 BOOL STDCALL
W32kGetBrushOrgEx(HDC hDC
, LPPOINT brushOrg
);
196 HRGN STDCALL
W32kGetClipRgn(HDC hDC
);
197 HGDIOBJ STDCALL
W32kGetCurrentObject(HDC hDC
, UINT ObjectType
);
198 BOOL STDCALL
W32kGetCurrentPositionEx(HDC hDC
, LPPOINT currentPosition
);
199 BOOL STDCALL
W32kGetDCOrgEx(HDC hDC
, LPPOINT Point
);
200 HDC STDCALL
W32kGetDCState16(HDC hDC
);
201 INT STDCALL
W32kGetDeviceCaps(HDC hDC
, INT Index
);
202 INT STDCALL
W32kGetMapMode(HDC hDC
);
203 INT STDCALL
W32kGetObject(HGDIOBJ hGDIObj
,
206 DWORD STDCALL
W32kGetObjectType(HGDIOBJ hGDIObj
);
207 INT STDCALL
W32kGetPolyFillMode(HDC hDC
);
208 INT STDCALL
W32kGetRelAbs(HDC hDC
);
209 INT STDCALL
W32kGetROP2(HDC hDC
);
210 HGDIOBJ STDCALL
W32kGetStockObject(INT Object
);
211 INT STDCALL
W32kGetStretchBltMode(HDC hDC
);
212 COLORREF STDCALL
W32kGetTextColor(HDC hDC
);
213 UINT STDCALL
W32kGetTextAlign(HDC hDC
);
214 BOOL STDCALL
W32kGetViewportExtEx(HDC hDC
, LPSIZE viewportExt
);
215 BOOL STDCALL
W32kGetViewportOrgEx(HDC hDC
, LPPOINT viewportOrg
);
216 BOOL STDCALL
W32kGetWindowExtEx(HDC hDC
, LPSIZE windowExt
);
217 BOOL STDCALL
W32kGetWindowOrgEx(HDC hDC
, LPPOINT windowOrg
);
218 HDC STDCALL
W32kResetDC(HDC hDC
, CONST DEVMODEW
*InitData
);
219 BOOL STDCALL
W32kRestoreDC(HDC hDC
, INT SavedDC
);
220 INT STDCALL
W32kSaveDC(HDC hDC
);
221 HGDIOBJ STDCALL
W32kSelectObject(HDC hDC
, HGDIOBJ hGDIObj
);
222 INT STDCALL
W32kSetBkMode(HDC hDC
, INT backgroundMode
);
223 INT STDCALL
W32kSetPolyFillMode(HDC hDC
, INT polyFillMode
);
224 INT STDCALL
W32kSetRelAbs(HDC hDC
, INT relAbsMode
);
225 INT STDCALL
W32kSetROP2(HDC hDC
, INT ROPmode
);
226 INT STDCALL
W32kSetStretchBltMode(HDC hDC
, INT stretchBltMode
);
227 COLORREF STDCALL
W32kSetTextColor(HDC hDC
, COLORREF color
);