2 * Win16 printer driver definitions
5 #ifndef __WINE_WIN16DRV_H
6 #define __WINE_WIN16DRV_H
15 #define GETGDIINFO 0x8001
16 #define INITPDEVICE 0x8000
18 #define GETGDIINFO 0x0001
19 #define INITPDEVICE 0x0000
23 #define OS_SCANLINES 4
24 #define OS_RECTANGLE 6
27 #define OS_POLYLINE 18
28 #define OS_ALTPOLYGON 22
29 #define OS_WINDPOLYGON 20
31 #define OS_POLYMARKER 24
34 #define OS_ROUNDRECT 72
38 #define ORD_COLORINFO 2
42 #define ORD_ENUMDFONTS 6
46 #define ORD_REALIZEOBJECT 10
49 #define ORD_DEVICEMODE 13
50 #define ORD_EXTTEXTOUT 14
51 #define ORD_GETCHARWIDTH 15
52 #define ORD_DEVICEBITMAP 16
53 #define ORD_FASTBORDER 17
54 #define ORD_SETATTRIBUTE 18
56 #define ORD_STRETCHBLT 27
57 #define ORD_STRETCHDIBITS 28
58 #define ORD_SELECTBITMAP 29
59 #define ORD_BITMAPBITS 30
61 #define ORD_EXTDEVICEMODE 90
62 #define ORD_DEVICECAPABILITIES 91
63 #define ORD_ADVANCEDSETUPDIALOG 93
65 #define ORD_DIALOGFN 100
66 #define ORD_PSEUDOEDIT 101
92 FUNC_DEVICECAPABILITIES
,
93 FUNC_ADVANCEDSETUPDIALOG
,
96 TOTAL_PRINTER_DRIVER_FUNCTIONS
/* insert functions before here */
101 LPSTR szDriver
; /* Driver name eg EPSON */
102 HINSTANCE16 hInst
; /* Handle for driver */
103 WORD ds_reg
; /* DS of driver */
104 FARPROC16 fn
[TOTAL_PRINTER_DRIVER_FUNCTIONS
]; /* Printer functions */
105 int nUsageCount
; /* Usage count, unload == 0 */
106 int nIndex
; /* Index in global driver array */
107 } LOADED_PRINTER_DRIVER
;
109 typedef struct PDEVICE_HEADER
111 LOADED_PRINTER_DRIVER
*pLPD
; /* Associated printer driver */
114 #include "pshpack1.h"
116 typedef struct DRAWMODE
131 SHORT StretchBltMode
;
133 } DRAWMODE
, *LPDRAWMODE
;
138 typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK
140 DEVICEFONTENUMPROC proc
;
145 #define DRVOBJ_BRUSH 2
146 #define DRVOBJ_FONT 3
147 #define DRVOBJ_PBITMAP 5
149 typedef struct tagDeviceCaps
151 WORD version
; /* 0: driver version */
152 WORD technology
; /* 2: device technology */
153 WORD horzSize
; /* 4: width of display in mm */
154 WORD vertSize
; /* 6: height of display in mm */
155 WORD horzRes
; /* 8: width of display in pixels */
156 WORD vertRes
; /* 10: width of display in pixels */
157 WORD bitsPixel
; /* 12: bits per pixel */
158 WORD planes
; /* 14: color planes */
159 WORD numBrushes
; /* 16: device-specific brushes */
160 WORD numPens
; /* 18: device-specific pens */
161 WORD numMarkers
; /* 20: device-specific markers */
162 WORD numFonts
; /* 22: device-specific fonts */
163 WORD numColors
; /* 24: size of color table */
164 WORD pdeviceSize
; /* 26: size of PDEVICE structure */
165 WORD curveCaps
; /* 28: curve capabilities */
166 WORD lineCaps
; /* 30: line capabilities */
167 WORD polygonalCaps
; /* 32: polygon capabilities */
168 WORD textCaps
; /* 34: text capabilities */
169 WORD clipCaps
; /* 36: clipping capabilities */
170 WORD rasterCaps
; /* 38: raster capabilities */
171 WORD aspectX
; /* 40: relative width of device pixel */
172 WORD aspectY
; /* 42: relative height of device pixel */
173 WORD aspectXY
; /* 44: relative diagonal width of device pixel */
174 WORD pad1
[21]; /* 46-86: reserved */
175 WORD logPixelsX
; /* 88: pixels / logical X inch */
176 WORD logPixelsY
; /* 90: pixels / logical Y inch */
177 WORD pad2
[6]; /* 92-102: reserved */
178 WORD sizePalette
; /* 104: entries in system palette */
179 WORD numReserved
; /* 106: reserved entries */
180 WORD colorRes
; /* 108: color resolution */
183 /* Win16 printer driver physical DC */
186 SEGPTR segptrPDEVICE
; /* PDEVICE used by 16 bit printer drivers */
187 LOGFONT16 lf
; /* Current font details */
188 TEXTMETRIC16 tm
; /* Current font metrics */
189 LPFONTINFO16 FontInfo
; /* Current font realized by printer driver */
190 LPLOGBRUSH16 BrushInfo
; /* Current brush realized by printer driver */
191 LPLOGPEN16 PenInfo
; /* Current pen realized by printer driver */
192 DeviceCaps DevCaps
; /* Device caps */
196 * Printer driver functions
198 typedef SEGPTR LPPDEVICE
;
199 LOADED_PRINTER_DRIVER
*LoadPrinterDriver(const char *pszDriver
);
201 extern INT16
PRTDRV_Control(LPPDEVICE lpDestDev
, WORD wfunction
, SEGPTR lpInData
, SEGPTR lpOutData
);
202 extern WORD
PRTDRV_Enable(LPVOID lpDevInfo
, WORD wStyle
, LPCSTR lpDestDevType
,
203 LPCSTR lpDeviceName
, LPCSTR lpOutputFile
, LPVOID lpData
);
204 extern WORD
PRTDRV_EnumDFonts(LPPDEVICE lpDestDev
, LPSTR lpFaceName
,
205 FARPROC16 lpCallbackFunc
, LPVOID lpClientData
);
206 extern DWORD
PRTDRV_RealizeObject(LPPDEVICE lpDestDev
, WORD wStyle
,
207 LPVOID lpInObj
, LPVOID lpOutObj
,
210 extern BOOL16
PRTDRV_EnumObj(LPPDEVICE lpDestDev
, WORD iStyle
, FARPROC16 lpfn
, LPVOID lpb
);
211 extern DWORD
PRTDRV_ExtTextOut(LPPDEVICE lpDestDev
, WORD wDestXOrg
, WORD wDestYOrg
,
212 RECT16
*lpClipRect
, LPCSTR lpString
, WORD wCount
,
213 LPFONTINFO16 lpFontInfo
, SEGPTR lpDrawMode
,
214 SEGPTR lpTextXForm
, SHORT
*lpCharWidths
,
215 RECT16
* lpOpaqueRect
, WORD wOptions
);
217 extern WORD
PRTDRV_Output(LPPDEVICE lpDestDev
,
222 LPLOGBRUSH16 lpBrush
,
226 DWORD
PRTDRV_StretchBlt(LPPDEVICE lpDestDev
,
227 WORD wDestX
, WORD wDestY
,
228 WORD wDestXext
, WORD wDestYext
,
230 WORD wSrcX
, WORD wSrcY
,
231 WORD wSrcXext
, WORD wSrcYext
,
233 LPLOGBRUSH16 lpBrush
,
237 extern WORD
PRTDRV_GetCharWidth(LPPDEVICE lpDestDev
, LPINT lpBuffer
,
238 WORD wFirstChar
, WORD wLastChar
, LPFONTINFO16 lpFontInfo
,
239 SEGPTR lpDrawMode
, SEGPTR lpTextXForm
);
241 /* Wine driver functions */
243 extern BOOL
WIN16DRV_Init(void);
244 extern BOOL
WIN16DRV_GetCharWidth( struct tagDC
*dc
, UINT firstChar
, UINT lastChar
,
247 extern BOOL
WIN16DRV_GetTextExtentPoint( DC
*dc
, LPCWSTR str
, INT count
,
249 extern BOOL
WIN16DRV_GetTextMetrics( DC
*dc
, TEXTMETRICW
*metrics
);
251 extern BOOL
WIN16DRV_ExtTextOut( DC
*dc
, INT x
, INT y
, UINT flags
,
252 const RECT
*lprect
, LPCWSTR str
, UINT count
,
254 extern BOOL
WIN16DRV_LineTo( DC
*dc
, INT x
, INT y
);
255 extern BOOL
WIN16DRV_Polygon(DC
*dc
, const POINT
* pt
, INT count
);
256 extern BOOL
WIN16DRV_Polyline(DC
*dc
, const POINT
* pt
, INT count
);
257 extern BOOL
WIN16DRV_Rectangle(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
);
258 extern HGDIOBJ
WIN16DRV_SelectObject( DC
*dc
, HGDIOBJ handle
);
259 extern BOOL
WIN16DRV_PatBlt( struct tagDC
*dc
, INT left
, INT top
,
260 INT width
, INT height
, DWORD rop
);
261 extern BOOL
WIN16DRV_Ellipse(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
);
262 extern BOOL
WIN16DRV_EnumDeviceFonts( HDC hdc
, LPLOGFONTW plf
,
263 DEVICEFONTENUMPROC proc
, LPARAM lp
);
265 extern INT
WIN16DRV_ExtDeviceMode(LPSTR lpszDriver
, HWND hwnd
,
266 LPDEVMODEA lpdmOutput
,
268 LPSTR lpszPort
, LPDEVMODEA lpdmInput
,
269 LPSTR lpszProfile
, DWORD dwMode
);
270 extern DWORD
WIN16DRV_DeviceCapabilities(LPSTR lpszDriver
, LPCSTR lpszDevice
,
271 LPCSTR lpszPort
, WORD fwCapability
,
272 LPSTR lpszOutput
, LPDEVMODEA lpdm
);
274 extern HBRUSH
WIN16DRV_BRUSH_SelectObject( DC
* dc
, HBRUSH hbrush
);
275 extern HFONT
WIN16DRV_FONT_SelectObject( DC
* dc
, HFONT hfont
);
276 extern HPEN
WIN16DRV_PEN_SelectObject( DC
* dc
, HPEN hpen
);
279 * Wine 16bit driver global variables
281 extern SEGPTR win16drv_SegPtr_TextXForm
;
282 extern LPTEXTXFORM16 win16drv_TextXFormP
;
283 extern SEGPTR win16drv_SegPtr_DrawMode
;
284 extern LPDRAWMODE win16drv_DrawModeP
;
286 #endif /* __WINE_WIN16DRV_H */