blob: 04fbe4621b606386a4e0351004d11349e15687c9 [file] [log] [blame]
Alexandre Julliard0e270f41996-08-24 18:26:35 +00001/*
2 * Win16 printer driver definitions
3 */
4
5#ifndef __WINE_WIN16DRV_H
6#define __WINE_WIN16DRV_H
7
Marcus Meissner317af321999-02-17 13:51:06 +00008#include "wingdi.h"
Alexandre Julliard0e270f41996-08-24 18:26:35 +00009#include "gdi.h"
10
11#define SETHIGHBIT
12#undef SETHIGHBIT
13#ifdef SETHIGHBIT
14#define GETGDIINFO 0x8001
15#define INITPDEVICE 0x8000
16#else
17#define GETGDIINFO 0x0001
18#define INITPDEVICE 0x0000
19#endif
20
Alexandre Julliard17216f51997-10-12 16:30:17 +000021#define OS_ARC 3
22#define OS_SCANLINES 4
23#define OS_RECTANGLE 6
24#define OS_ELLIPSE 7
25#define OS_MARKER 8
26#define OS_POLYLINE 18
27#define OS_ALTPOLYGON 22
28#define OS_WINDPOLYGON 20
29#define OS_PIE 23
30#define OS_POLYMARKER 24
31#define OS_CHORD 39
32#define OS_CIRCLE 55
33#define OS_ROUNDRECT 72
34
Alexandre Julliard0e270f41996-08-24 18:26:35 +000035/* Internal Data */
36#define ORD_BITBLT 1
37#define ORD_COLORINFO 2
38#define ORD_CONTROL 3
39#define ORD_DISABLE 4
40#define ORD_ENABLE 5
41#define ORD_ENUMDFONTS 6
42#define ORD_ENUMOBJ 7
43#define ORD_OUTPUT 8
44#define ORD_PIXEL 9
45#define ORD_REALIZEOBJECT 10
46#define ORD_STRBLT 11
47#define ORD_SCANLR 12
48#define ORD_DEVICEMODE 13
49#define ORD_EXTTEXTOUT 14
50#define ORD_GETCHARWIDTH 15
51#define ORD_DEVICEBITMAP 16
52#define ORD_FASTBORDER 17
53#define ORD_SETATTRIBUTE 18
54
55#define ORD_STRETCHBLT 27
56#define ORD_STRETCHDIBITS 28
57#define ORD_SELECTBITMAP 29
58#define ORD_BITMAPBITS 30
59
60#define ORD_EXTDEVICEMODE 90
61#define ORD_DEVICECAPABILITIES 91
62#define ORD_ADVANCEDSETUPDIALOG 93
63
64#define ORD_DIALOGFN 100
65#define ORD_PSEUDOEDIT 101
66
67enum {
68 FUNC_BITBLT = 0,
69 FUNC_COLORINFO,
70 FUNC_CONTROL,
71 FUNC_DISABLE,
72 FUNC_ENABLE,
73 FUNC_ENUMDFONTS,
74 FUNC_ENUMOBJ,
75 FUNC_OUTPUT,
76 FUNC_PIXEL,
77 FUNC_REALIZEOBJECT,
78 FUNC_STRBLT,
79 FUNC_SCANLR,
80 FUNC_DEVICEMODE,
81 FUNC_EXTTEXTOUT,
82 FUNC_GETCHARWIDTH,
83 FUNC_DEVICEBITMAP,
84 FUNC_FASTBORDER,
85 FUNC_SETATTRIBUTE,
86 FUNC_STRETCHBLT,
87 FUNC_STRETCHDIBITS,
88 FUNC_SELECTBITMAP,
89 FUNC_BITMAPBITS,
90 FUNC_EXTDEVICEMODE,
91 FUNC_DEVICECAPABILITIES,
92 FUNC_ADVANCEDSETUPDIALOG,
93 FUNC_DIALOGFN,
94 FUNC_PSEUDOEDIT,
95 TOTAL_PRINTER_DRIVER_FUNCTIONS /* insert functions before here */
96};
97
Alexandre Julliard0e270f41996-08-24 18:26:35 +000098typedef struct
99{
Alexandre Julliard17216f51997-10-12 16:30:17 +0000100 LPSTR szDriver; /* Driver name eg EPSON */
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000101 HINSTANCE16 hInst; /* Handle for driver */
102 WORD ds_reg; /* DS of driver */
103 FARPROC16 fn[TOTAL_PRINTER_DRIVER_FUNCTIONS]; /* Printer functions */
104 int nUsageCount; /* Usage count, unload == 0 */
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000105 int nIndex; /* Index in global driver array */
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000106} LOADED_PRINTER_DRIVER;
107
108typedef struct PDEVICE_HEADER
109{
110 LOADED_PRINTER_DRIVER *pLPD; /* Associated printer driver */
111} PDEVICE_HEADER;
112
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000113#pragma pack(1)
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000114#define PCOLOR DWORD
115typedef struct DRAWMODE
116{
117 SHORT Rop2;
118 SHORT bkMode;
119 PCOLOR bkColor;
120 PCOLOR TextColor;
121 SHORT TBreakExtra;
122 SHORT BreakExtra;
123 SHORT BreakErr;
124 SHORT BreakRem;
125 SHORT BreakCount;
126 SHORT CharExtra;
127 COLORREF LbkColor;
128 COLORREF LTextColor;
129} DRAWMODE, *LPDRAWMODE;
130
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000131
132#pragma pack(4)
133
134typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK
135{
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000136 int (*proc)(LPENUMLOGFONT16, LPNEWTEXTMETRIC16, UINT16, LPARAM);
137 LPARAM lp;
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000138} WEPFC;
139
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000140#define DRVOBJ_PEN 1
141#define DRVOBJ_BRUSH 2
142#define DRVOBJ_FONT 3
143#define DRVOBJ_PBITMAP 5
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000144
145/* Win16 printer driver physical DC */
146typedef struct
147{
Alexandre Julliard17216f51997-10-12 16:30:17 +0000148 SEGPTR segptrPDEVICE; /* PDEVICE used by 16 bit printer drivers */
149 LOGFONT16 lf; /* Current font details */
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000150 TEXTMETRIC16 tm; /* Current font metrics */
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000151 LPFONTINFO16 FontInfo; /* Current font realized by printer driver */
152 LPLOGBRUSH16 BrushInfo; /* Current brush realized by printer driver */
153 LPLOGPEN16 PenInfo; /* Current pen realized by printer driver */
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000154} WIN16DRV_PDEVICE;
155
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000156/*
157 * Printer driver functions
158 */
159typedef SEGPTR LPPDEVICE;
160LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver);
161
162extern INT16 PRTDRV_Control(LPPDEVICE lpDestDev, WORD wfunction, SEGPTR lpInData, SEGPTR lpOutData);
163extern WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
164 LPCSTR lpDeviceName, LPCSTR lpOutputFile, LPVOID lpData);
165extern WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
166 FARPROC16 lpCallbackFunc, LPVOID lpClientData);
167extern DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
168 LPVOID lpInObj, LPVOID lpOutObj,
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000169 SEGPTR lpTextXForm);
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000170
171extern BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, FARPROC16 lpfn, LPVOID lpb);
172extern DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
173 RECT16 *lpClipRect, LPCSTR lpString, WORD wCount,
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000174 LPFONTINFO16 lpFontInfo, SEGPTR lpDrawMode,
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000175 SEGPTR lpTextXForm, SHORT *lpCharWidths,
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000176 RECT16 * lpOpaqueRect, WORD wOptions);
177
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000178extern WORD PRTDRV_Output(LPPDEVICE lpDestDev,
179 WORD wStyle,
180 WORD wCount,
181 POINT16 *points,
182 LPLOGPEN16 lpPen,
183 LPLOGBRUSH16 lpBrush,
184 SEGPTR lpDrawMode,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000185 HRGN hClipRgn);
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000186
187DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
188 WORD wDestX, WORD wDestY,
189 WORD wDestXext, WORD wDestYext,
190 LPPDEVICE lpSrcDev,
191 WORD wSrcX, WORD wSrcY,
192 WORD wSrcXext, WORD wSrcYext,
193 DWORD Rop3,
194 LPLOGBRUSH16 lpBrush,
195 SEGPTR lpDrawMode,
196 RECT16 *lpClipRect);
197
Alexandre Julliarda3960291999-02-26 11:11:13 +0000198extern WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer,
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000199 WORD wFirstChar, WORD wLastChar, LPFONTINFO16 lpFontInfo,
200 SEGPTR lpDrawMode, SEGPTR lpTextXForm );
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000201
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000202/* Wine driver functions */
203
Alexandre Julliarda3960291999-02-26 11:11:13 +0000204extern BOOL WIN16DRV_Init(void);
205extern BOOL WIN16DRV_GetCharWidth( struct tagDC *dc, UINT firstChar, UINT lastChar,
206 LPINT buffer );
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000207
Alexandre Julliarda3960291999-02-26 11:11:13 +0000208extern BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT count,
209 LPSIZE size );
210extern BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000211
Alexandre Julliarda3960291999-02-26 11:11:13 +0000212extern BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
213 const RECT *lprect, LPCSTR str, UINT count,
214 const INT *lpDx );
215extern BOOL WIN16DRV_LineTo( DC *dc, INT x, INT y );
216extern BOOL WIN16DRV_MoveToEx(DC *dc,INT x,INT y,LPPOINT pt);
217extern BOOL WIN16DRV_Polygon(DC *dc, const POINT* pt, INT count );
218extern BOOL WIN16DRV_Polyline(DC *dc, const POINT* pt, INT count );
219extern BOOL WIN16DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom);
220extern HGDIOBJ WIN16DRV_SelectObject( DC *dc, HGDIOBJ handle );
221extern BOOL WIN16DRV_PatBlt( struct tagDC *dc, INT left, INT top,
222 INT width, INT height, DWORD rop );
223extern BOOL WIN16DRV_Ellipse(DC *dc, INT left, INT top, INT right, INT bottom);
224extern BOOL WIN16DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000225 DEVICEFONTENUMPROC proc, LPARAM lp );
Alexandre Julliard21979011997-03-05 08:22:35 +0000226
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000227
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000228/*
229 * Wine 16bit driver global variables
230 */
231extern SEGPTR win16drv_SegPtr_TextXForm;
232extern LPTEXTXFORM16 win16drv_TextXFormP;
233extern SEGPTR win16drv_SegPtr_DrawMode;
234extern LPDRAWMODE win16drv_DrawModeP;
235
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000236#endif /* __WINE_WIN16DRV_H */
Alexandre Julliard17216f51997-10-12 16:30:17 +0000237