Added some missing enums.
[wine] / include / win16drv.h
1 /*
2  * Win16 printer driver definitions
3  *
4  * Copyright (C) the Wine project
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #ifndef __WINE_WIN16DRV_H
22 #define __WINE_WIN16DRV_H
23
24 #include "windef.h"
25 #include "wingdi.h"
26 #include "gdi.h"
27
28 #define SETHIGHBIT 
29 #undef SETHIGHBIT
30 #ifdef SETHIGHBIT
31 #define GETGDIINFO  0x8001
32 #define INITPDEVICE 0x8000
33 #else
34 #define GETGDIINFO  0x0001
35 #define INITPDEVICE 0x0000
36 #endif
37
38 #define     OS_ARC              3
39 #define     OS_SCANLINES        4
40 #define     OS_RECTANGLE        6
41 #define     OS_ELLIPSE          7
42 #define     OS_MARKER           8
43 #define     OS_POLYLINE         18
44 #define     OS_ALTPOLYGON       22
45 #define     OS_WINDPOLYGON      20
46 #define     OS_PIE              23
47 #define     OS_POLYMARKER       24
48 #define     OS_CHORD            39
49 #define     OS_CIRCLE           55
50 #define     OS_ROUNDRECT        72
51
52 /* Internal Data */
53 #define ORD_BITBLT              1
54 #define ORD_COLORINFO           2               
55 #define ORD_CONTROL             3
56 #define ORD_DISABLE             4
57 #define ORD_ENABLE              5
58 #define ORD_ENUMDFONTS          6
59 #define ORD_ENUMOBJ             7
60 #define ORD_OUTPUT              8
61 #define ORD_PIXEL               9       
62 #define ORD_REALIZEOBJECT       10
63 #define ORD_STRBLT              11
64 #define ORD_SCANLR              12
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
71
72 #define ORD_STRETCHBLT          27
73 #define ORD_STRETCHDIBITS       28
74 #define ORD_SELECTBITMAP        29
75 #define ORD_BITMAPBITS          30
76
77 #define ORD_EXTDEVICEMODE       90
78 #define ORD_DEVICECAPABILITIES  91
79 #define ORD_ADVANCEDSETUPDIALOG 93
80
81 #define ORD_DIALOGFN            100
82 #define ORD_PSEUDOEDIT          101
83                         
84 enum {
85     FUNC_BITBLT = 0,             
86     FUNC_COLORINFO,      
87     FUNC_CONTROL,       
88     FUNC_DISABLE,       
89     FUNC_ENABLE,                
90     FUNC_ENUMDFONTS,            
91     FUNC_ENUMOBJ,       
92     FUNC_OUTPUT,                
93     FUNC_PIXEL,                         
94     FUNC_REALIZEOBJECT,         
95     FUNC_STRBLT,                
96     FUNC_SCANLR,                
97     FUNC_DEVICEMODE,            
98     FUNC_EXTTEXTOUT,            
99     FUNC_GETCHARWIDTH,          
100     FUNC_DEVICEBITMAP,          
101     FUNC_FASTBORDER,         
102     FUNC_SETATTRIBUTE,                                  
103     FUNC_STRETCHBLT,            
104     FUNC_STRETCHDIBITS,         
105     FUNC_SELECTBITMAP,          
106     FUNC_BITMAPBITS,                                   
107     FUNC_EXTDEVICEMODE,         
108     FUNC_DEVICECAPABILITIES,    
109     FUNC_ADVANCEDSETUPDIALOG,                   
110     FUNC_DIALOGFN,              
111     FUNC_PSEUDOEDIT,
112     TOTAL_PRINTER_DRIVER_FUNCTIONS /* insert functions before here */
113 };
114
115 typedef struct
116 {
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;
124
125 typedef struct PDEVICE_HEADER
126 {
127     LOADED_PRINTER_DRIVER *pLPD;        /* Associated printer driver */
128 } PDEVICE_HEADER;
129
130 #include "pshpack1.h"
131 #define PCOLOR DWORD
132 typedef struct DRAWMODE 
133 {
134     SHORT    Rop2;       
135     SHORT    bkMode;     
136     PCOLOR   bkColor;    
137     PCOLOR   TextColor;  
138     SHORT    TBreakExtra;
139     SHORT    BreakExtra; 
140     SHORT    BreakErr;   
141     SHORT    BreakRem;   
142     SHORT    BreakCount; 
143     SHORT    CharExtra;  
144     COLORREF LbkColor;   
145     COLORREF LTextColor;
146     DWORD    ICMCXform;
147     SHORT    StretchBltMode;
148     DWORD    eMiterLimit;
149 } DRAWMODE, *LPDRAWMODE;
150
151
152 #include "poppack.h"
153
154 typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK
155 {
156     DEVICEFONTENUMPROC proc;
157     LPARAM lp;
158 } WEPFC;
159
160 #define DRVOBJ_PEN      1       
161 #define DRVOBJ_BRUSH    2  
162 #define DRVOBJ_FONT     3   
163 #define DRVOBJ_PBITMAP  5
164
165 typedef struct tagDeviceCaps
166 {
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 */
197 } DeviceCaps;
198
199 /* Win16 printer driver physical DC */
200 typedef struct
201 {
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 */
209 } WIN16DRV_PDEVICE;
210
211 /*
212  * Printer driver functions
213  */
214 typedef SEGPTR LPPDEVICE;
215 LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver);
216
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,
224                                   SEGPTR lpTextXForm);
225
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);
232
233 extern WORD PRTDRV_Output(LPPDEVICE      lpDestDev,
234                           WORD   wStyle, 
235                           WORD   wCount,
236                           POINT16       *points, 
237                           LPLOGPEN16     lpPen,
238                           LPLOGBRUSH16   lpBrush,
239                           SEGPTR         lpDrawMode,
240                           HRGN   hClipRgn);
241
242 DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
243                         WORD wDestX, WORD wDestY,
244                         WORD wDestXext, WORD wDestYext, 
245                         LPPDEVICE lpSrcDev,
246                         WORD wSrcX, WORD wSrcY,
247                         WORD wSrcXext, WORD wSrcYext, 
248                         DWORD Rop3,
249                         LPLOGBRUSH16 lpBrush,
250                         SEGPTR lpDrawMode,
251                         RECT16 *lpClipRect);
252
253 extern WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer, 
254                       WORD wFirstChar, WORD wLastChar, LPFONTINFO16 lpFontInfo,
255                       SEGPTR lpDrawMode, SEGPTR lpTextXForm );
256
257 /* Wine driver functions */
258
259 extern const DC_FUNCTIONS *WIN16DRV_Init(void);
260 extern BOOL WIN16DRV_GetCharWidth( struct tagDC *dc, UINT firstChar, UINT lastChar,
261                                    LPINT buffer );
262
263 extern BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
264                                            LPSIZE size );
265 extern BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics );
266
267 extern BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
268                                   const RECT *lprect, LPCWSTR str, UINT count,
269                                   const INT *lpDx );
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 );
280
281 extern INT WIN16DRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
282                                   LPDEVMODEA lpdmOutput,
283                                   LPSTR lpszDevice,
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);
289
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 );
293
294 /*
295  * Wine 16bit driver global variables
296  */
297 extern SEGPTR           win16drv_SegPtr_TextXForm;
298 extern LPTEXTXFORM16    win16drv_TextXFormP;
299 extern SEGPTR           win16drv_SegPtr_DrawMode;
300 extern LPDRAWMODE       win16drv_DrawModeP;
301
302 #endif  /* __WINE_WIN16DRV_H */
303