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