2 * Win16 printer driver definitions
4 * Copyright (C) the Wine project
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_WIN16DRV_H
22 #define __WINE_WIN16DRV_H
31 #define GETGDIINFO 0x8001
32 #define INITPDEVICE 0x8000
34 #define GETGDIINFO 0x0001
35 #define INITPDEVICE 0x0000
39 #define OS_SCANLINES 4
40 #define OS_RECTANGLE 6
43 #define OS_POLYLINE 18
44 #define OS_ALTPOLYGON 22
45 #define OS_WINDPOLYGON 20
47 #define OS_POLYMARKER 24
50 #define OS_ROUNDRECT 72
54 #define ORD_COLORINFO 2
58 #define ORD_ENUMDFONTS 6
62 #define ORD_REALIZEOBJECT 10
65 #define ORD_DEVICEMODE 13
66 #define ORD_EXTTEXTOUT 14
67 #define ORD_GETCHARWIDTH 15
68 #define ORD_DEVICEBITMAP 16
69 #define ORD_FASTBORDER 17
70 #define ORD_SETATTRIBUTE 18
72 #define ORD_STRETCHBLT 27
73 #define ORD_STRETCHDIBITS 28
74 #define ORD_SELECTBITMAP 29
75 #define ORD_BITMAPBITS 30
77 #define ORD_EXTDEVICEMODE 90
78 #define ORD_DEVICECAPABILITIES 91
79 #define ORD_ADVANCEDSETUPDIALOG 93
81 #define ORD_DIALOGFN 100
82 #define ORD_PSEUDOEDIT 101
108 FUNC_DEVICECAPABILITIES
,
109 FUNC_ADVANCEDSETUPDIALOG
,
112 TOTAL_PRINTER_DRIVER_FUNCTIONS
/* insert functions before here */
117 LPSTR szDriver
; /* Driver name eg EPSON */
118 HINSTANCE16 hInst
; /* Handle for driver */
119 WORD ds_reg
; /* DS of driver */
120 FARPROC16 fn
[TOTAL_PRINTER_DRIVER_FUNCTIONS
]; /* Printer functions */
121 int nUsageCount
; /* Usage count, unload == 0 */
122 int nIndex
; /* Index in global driver array */
123 } LOADED_PRINTER_DRIVER
;
125 typedef struct PDEVICE_HEADER
127 LOADED_PRINTER_DRIVER
*pLPD
; /* Associated printer driver */
130 #include "pshpack1.h"
132 typedef struct DRAWMODE
147 SHORT StretchBltMode
;
149 } DRAWMODE
, *LPDRAWMODE
;
154 typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK
156 DEVICEFONTENUMPROC proc
;
161 #define DRVOBJ_BRUSH 2
162 #define DRVOBJ_FONT 3
163 #define DRVOBJ_PBITMAP 5
165 typedef struct tagDeviceCaps
167 WORD version
; /* 0: driver version */
168 WORD technology
; /* 2: device technology */
169 WORD horzSize
; /* 4: width of display in mm */
170 WORD vertSize
; /* 6: height of display in mm */
171 WORD horzRes
; /* 8: width of display in pixels */
172 WORD vertRes
; /* 10: width of display in pixels */
173 WORD bitsPixel
; /* 12: bits per pixel */
174 WORD planes
; /* 14: color planes */
175 WORD numBrushes
; /* 16: device-specific brushes */
176 WORD numPens
; /* 18: device-specific pens */
177 WORD numMarkers
; /* 20: device-specific markers */
178 WORD numFonts
; /* 22: device-specific fonts */
179 WORD numColors
; /* 24: size of color table */
180 WORD pdeviceSize
; /* 26: size of PDEVICE structure */
181 WORD curveCaps
; /* 28: curve capabilities */
182 WORD lineCaps
; /* 30: line capabilities */
183 WORD polygonalCaps
; /* 32: polygon capabilities */
184 WORD textCaps
; /* 34: text capabilities */
185 WORD clipCaps
; /* 36: clipping capabilities */
186 WORD rasterCaps
; /* 38: raster capabilities */
187 WORD aspectX
; /* 40: relative width of device pixel */
188 WORD aspectY
; /* 42: relative height of device pixel */
189 WORD aspectXY
; /* 44: relative diagonal width of device pixel */
190 WORD pad1
[21]; /* 46-86: reserved */
191 WORD logPixelsX
; /* 88: pixels / logical X inch */
192 WORD logPixelsY
; /* 90: pixels / logical Y inch */
193 WORD pad2
[6]; /* 92-102: reserved */
194 WORD sizePalette
; /* 104: entries in system palette */
195 WORD numReserved
; /* 106: reserved entries */
196 WORD colorRes
; /* 108: color resolution */
199 /* Win16 printer driver physical DC */
202 SEGPTR segptrPDEVICE
; /* PDEVICE used by 16 bit printer drivers */
203 LOGFONT16 lf
; /* Current font details */
204 TEXTMETRIC16 tm
; /* Current font metrics */
205 LPFONTINFO16 FontInfo
; /* Current font realized by printer driver */
206 LPLOGBRUSH16 BrushInfo
; /* Current brush realized by printer driver */
207 LPLOGPEN16 PenInfo
; /* Current pen realized by printer driver */
208 DeviceCaps DevCaps
; /* Device caps */
212 * Printer driver functions
214 typedef SEGPTR LPPDEVICE
;
215 LOADED_PRINTER_DRIVER
*LoadPrinterDriver(const char *pszDriver
);
217 extern INT16
PRTDRV_Control(LPPDEVICE lpDestDev
, WORD wfunction
, SEGPTR lpInData
, SEGPTR lpOutData
);
218 extern WORD
PRTDRV_Enable(LPVOID lpDevInfo
, WORD wStyle
, LPCSTR lpDestDevType
,
219 LPCSTR lpDeviceName
, LPCSTR lpOutputFile
, LPVOID lpData
);
220 extern WORD
PRTDRV_EnumDFonts(LPPDEVICE lpDestDev
, LPSTR lpFaceName
,
221 FARPROC16 lpCallbackFunc
, LPVOID lpClientData
);
222 extern DWORD
PRTDRV_RealizeObject(LPPDEVICE lpDestDev
, WORD wStyle
,
223 LPVOID lpInObj
, LPVOID lpOutObj
,
226 extern BOOL16
PRTDRV_EnumObj(LPPDEVICE lpDestDev
, WORD iStyle
, FARPROC16 lpfn
, LPVOID lpb
);
227 extern DWORD
PRTDRV_ExtTextOut(LPPDEVICE lpDestDev
, WORD wDestXOrg
, WORD wDestYOrg
,
228 RECT16
*lpClipRect
, LPCSTR lpString
, WORD wCount
,
229 LPFONTINFO16 lpFontInfo
, SEGPTR lpDrawMode
,
230 SEGPTR lpTextXForm
, SHORT
*lpCharWidths
,
231 RECT16
* lpOpaqueRect
, WORD wOptions
);
233 extern WORD
PRTDRV_Output(LPPDEVICE lpDestDev
,
238 LPLOGBRUSH16 lpBrush
,
242 DWORD
PRTDRV_StretchBlt(LPPDEVICE lpDestDev
,
243 WORD wDestX
, WORD wDestY
,
244 WORD wDestXext
, WORD wDestYext
,
246 WORD wSrcX
, WORD wSrcY
,
247 WORD wSrcXext
, WORD wSrcYext
,
249 LPLOGBRUSH16 lpBrush
,
253 extern WORD
PRTDRV_GetCharWidth(LPPDEVICE lpDestDev
, LPINT lpBuffer
,
254 WORD wFirstChar
, WORD wLastChar
, LPFONTINFO16 lpFontInfo
,
255 SEGPTR lpDrawMode
, SEGPTR lpTextXForm
);
257 /* Wine driver functions */
259 extern const DC_FUNCTIONS
*WIN16DRV_Init(void);
260 extern BOOL
WIN16DRV_GetCharWidth( struct tagDC
*dc
, UINT firstChar
, UINT lastChar
,
263 extern BOOL
WIN16DRV_GetTextExtentPoint( DC
*dc
, LPCWSTR str
, INT count
,
265 extern BOOL
WIN16DRV_GetTextMetrics( DC
*dc
, TEXTMETRICW
*metrics
);
267 extern BOOL
WIN16DRV_ExtTextOut( DC
*dc
, INT x
, INT y
, UINT flags
,
268 const RECT
*lprect
, LPCWSTR str
, UINT count
,
270 extern BOOL
WIN16DRV_LineTo( DC
*dc
, INT x
, INT y
);
271 extern BOOL
WIN16DRV_Polygon(DC
*dc
, const POINT
* pt
, INT count
);
272 extern BOOL
WIN16DRV_Polyline(DC
*dc
, const POINT
* pt
, INT count
);
273 extern BOOL
WIN16DRV_Rectangle(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
);
274 extern HGDIOBJ
WIN16DRV_SelectObject( DC
*dc
, HGDIOBJ handle
);
275 extern BOOL
WIN16DRV_PatBlt( struct tagDC
*dc
, INT left
, INT top
,
276 INT width
, INT height
, DWORD rop
);
277 extern BOOL
WIN16DRV_Ellipse(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
);
278 extern BOOL
WIN16DRV_EnumDeviceFonts( HDC hdc
, LPLOGFONTW plf
,
279 DEVICEFONTENUMPROC proc
, LPARAM lp
);
281 extern INT
WIN16DRV_ExtDeviceMode(LPSTR lpszDriver
, HWND hwnd
,
282 LPDEVMODEA lpdmOutput
,
284 LPSTR lpszPort
, LPDEVMODEA lpdmInput
,
285 LPSTR lpszProfile
, DWORD dwMode
);
286 extern DWORD
WIN16DRV_DeviceCapabilities(LPSTR lpszDriver
, LPCSTR lpszDevice
,
287 LPCSTR lpszPort
, WORD fwCapability
,
288 LPSTR lpszOutput
, LPDEVMODEA lpdm
);
290 extern HBRUSH
WIN16DRV_BRUSH_SelectObject( DC
* dc
, HBRUSH hbrush
);
291 extern HFONT
WIN16DRV_FONT_SelectObject( DC
* dc
, HFONT hfont
);
292 extern HPEN
WIN16DRV_PEN_SelectObject( DC
* dc
, HPEN hpen
);
295 * Wine 16bit driver global variables
297 extern SEGPTR win16drv_SegPtr_TextXForm
;
298 extern LPTEXTXFORM16 win16drv_TextXFormP
;
299 extern SEGPTR win16drv_SegPtr_DrawMode
;
300 extern LPDRAWMODE win16drv_DrawModeP
;
302 #endif /* __WINE_WIN16DRV_H */