Avoid list corruption when linking window with HWND_BOTTOM (thanks to
[wine/multimedia.git] / include / win16drv.h
blob231a738c5d3db24afb601dc4b1fdaa81a7910779
1 /*
2 * Win16 printer driver definitions
3 */
5 #ifndef __WINE_WIN16DRV_H
6 #define __WINE_WIN16DRV_H
8 #include "windef.h"
9 #include "wingdi.h"
10 #include "gdi.h"
12 #define SETHIGHBIT
13 #undef SETHIGHBIT
14 #ifdef SETHIGHBIT
15 #define GETGDIINFO 0x8001
16 #define INITPDEVICE 0x8000
17 #else
18 #define GETGDIINFO 0x0001
19 #define INITPDEVICE 0x0000
20 #endif
22 #define OS_ARC 3
23 #define OS_SCANLINES 4
24 #define OS_RECTANGLE 6
25 #define OS_ELLIPSE 7
26 #define OS_MARKER 8
27 #define OS_POLYLINE 18
28 #define OS_ALTPOLYGON 22
29 #define OS_WINDPOLYGON 20
30 #define OS_PIE 23
31 #define OS_POLYMARKER 24
32 #define OS_CHORD 39
33 #define OS_CIRCLE 55
34 #define OS_ROUNDRECT 72
36 /* Internal Data */
37 #define ORD_BITBLT 1
38 #define ORD_COLORINFO 2
39 #define ORD_CONTROL 3
40 #define ORD_DISABLE 4
41 #define ORD_ENABLE 5
42 #define ORD_ENUMDFONTS 6
43 #define ORD_ENUMOBJ 7
44 #define ORD_OUTPUT 8
45 #define ORD_PIXEL 9
46 #define ORD_REALIZEOBJECT 10
47 #define ORD_STRBLT 11
48 #define ORD_SCANLR 12
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
68 enum {
69 FUNC_BITBLT = 0,
70 FUNC_COLORINFO,
71 FUNC_CONTROL,
72 FUNC_DISABLE,
73 FUNC_ENABLE,
74 FUNC_ENUMDFONTS,
75 FUNC_ENUMOBJ,
76 FUNC_OUTPUT,
77 FUNC_PIXEL,
78 FUNC_REALIZEOBJECT,
79 FUNC_STRBLT,
80 FUNC_SCANLR,
81 FUNC_DEVICEMODE,
82 FUNC_EXTTEXTOUT,
83 FUNC_GETCHARWIDTH,
84 FUNC_DEVICEBITMAP,
85 FUNC_FASTBORDER,
86 FUNC_SETATTRIBUTE,
87 FUNC_STRETCHBLT,
88 FUNC_STRETCHDIBITS,
89 FUNC_SELECTBITMAP,
90 FUNC_BITMAPBITS,
91 FUNC_EXTDEVICEMODE,
92 FUNC_DEVICECAPABILITIES,
93 FUNC_ADVANCEDSETUPDIALOG,
94 FUNC_DIALOGFN,
95 FUNC_PSEUDOEDIT,
96 TOTAL_PRINTER_DRIVER_FUNCTIONS /* insert functions before here */
99 typedef struct
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 */
112 } PDEVICE_HEADER;
114 #include "pshpack1.h"
115 #define PCOLOR DWORD
116 typedef struct DRAWMODE
118 SHORT Rop2;
119 SHORT bkMode;
120 PCOLOR bkColor;
121 PCOLOR TextColor;
122 SHORT TBreakExtra;
123 SHORT BreakExtra;
124 SHORT BreakErr;
125 SHORT BreakRem;
126 SHORT BreakCount;
127 SHORT CharExtra;
128 COLORREF LbkColor;
129 COLORREF LTextColor;
130 DWORD ICMCXform;
131 SHORT StretchBltMode;
132 DWORD eMiterLimit;
133 } DRAWMODE, *LPDRAWMODE;
136 #include "poppack.h"
138 typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK
140 DEVICEFONTENUMPROC proc;
141 LPARAM lp;
142 } WEPFC;
144 #define DRVOBJ_PEN 1
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 */
181 } DeviceCaps;
183 /* Win16 printer driver physical DC */
184 typedef struct
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 */
193 } WIN16DRV_PDEVICE;
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,
208 SEGPTR lpTextXForm);
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,
218 WORD wStyle,
219 WORD wCount,
220 POINT16 *points,
221 LPLOGPEN16 lpPen,
222 LPLOGBRUSH16 lpBrush,
223 SEGPTR lpDrawMode,
224 HRGN hClipRgn);
226 DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
227 WORD wDestX, WORD wDestY,
228 WORD wDestXext, WORD wDestYext,
229 LPPDEVICE lpSrcDev,
230 WORD wSrcX, WORD wSrcY,
231 WORD wSrcXext, WORD wSrcYext,
232 DWORD Rop3,
233 LPLOGBRUSH16 lpBrush,
234 SEGPTR lpDrawMode,
235 RECT16 *lpClipRect);
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 const DC_FUNCTIONS *WIN16DRV_Init(void);
244 extern BOOL WIN16DRV_GetCharWidth( struct tagDC *dc, UINT firstChar, UINT lastChar,
245 LPINT buffer );
247 extern BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
248 LPSIZE size );
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,
253 const INT *lpDx );
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,
267 LPSTR lpszDevice,
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 */