Added stub for CreateBindCtx() and added missing CoGetClassObject()
[wine/multimedia.git] / include / psdrv.h
blob4126601b6f605a47d71470ffa78f6ad588232c8a
2 /*
3 * PostScript driver definitions
5 * Copyright 1998 Huw D M Davies
6 */
7 #include "windows.h"
8 #include "font.h"
9 #include "pen.h"
10 #include "brush.h"
12 typedef struct {
13 float llx, lly, urx, ury;
14 } AFMBBOX;
16 typedef struct _tagAFMLIGS {
17 char *successor;
18 char *ligature;
19 struct _tagAFMLIGS *next;
20 } AFMLIGS;
22 typedef struct _tagAFMMETRICS {
23 int C; /* character */
24 float WX;
25 char *N; /* name */
26 AFMBBOX B;
27 AFMLIGS *L; /* Ligatures */
28 struct _tagAFMMETRICS *next;
29 } AFMMETRICS;
31 typedef struct _tagAFM {
32 char *FontName;
33 char *FullName;
34 char *FamilyName;
35 char *EncodingScheme;
36 int Weight; /* FW_NORMAL etc. */
37 float ItalicAngle;
38 BOOL32 IsFixedPitch;
39 float UnderlinePosition;
40 float UnderlineThickness;
41 AFMBBOX FontBBox;
42 float CapHeight;
43 float XHeight;
44 float Ascender;
45 float Descender;
46 float FullAscender; /* Ascent of Aring character */
47 float CharWidths[256];
48 int NumofMetrics;
49 AFMMETRICS *Metrics;
50 } AFM; /* CharWidths is a shortcut to the WX values of numbered glyphs */
52 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
53 one list to exist without having to reallocate the entire AFM structure. We
54 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
55 fonts for each DC (dc->physDev->Fonts) */
57 typedef struct _tagAFMLISTENTRY {
58 AFM *afm;
59 struct _tagAFMLISTENTRY *next;
60 } AFMLISTENTRY;
62 typedef struct _tagFONTFAMILY {
63 char *FamilyName; /* family name */
64 AFMLISTENTRY *afmlist; /* list of afms for this family */
65 struct _tagFONTFAMILY *next; /* next family */
66 } FONTFAMILY;
68 extern FONTFAMILY *PSDRV_AFMFontList;
70 typedef struct _tagFONTNAME {
71 char *Name;
72 struct _tagFONTNAME *next;
73 } FONTNAME;
75 typedef struct {
76 float llx, lly, urx, ury;
77 } IMAGEABLEAREA;
79 typedef struct {
80 float x, y;
81 } PAPERDIMENSION;
83 typedef struct _tagPAGESIZE {
84 char *Name;
85 char *FullName;
86 char *InvocationString;
87 IMAGEABLEAREA *ImageableArea;
88 PAPERDIMENSION *PaperDimension;
89 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
90 struct _tagPAGESIZE *next;
91 } PAGESIZE;
94 typedef struct _tagOPTIONENTRY {
95 char *Name; /* eg "True" */
96 char *FullName; /* eg "Installed" */
97 char *InvocationString; /* Often NULL */
98 struct _tagOPTIONENTRY *next;
99 } OPTIONENTRY;
101 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
102 char *OptionName; /* eg "*Option1" */
103 char *FullName; /* eg "Envelope Feeder" */
104 char *DefaultOption; /* eg "False" */
105 OPTIONENTRY *Options;
106 struct _tagOPTION *next;
107 } OPTION;
109 typedef struct _tagCONSTRAINT {
110 char *Feature1;
111 char *Value1;
112 char *Feature2;
113 char *Value2;
114 struct _tagCONSTRAINT *next;
115 } CONSTRAINT;
117 typedef struct _tagINPUTSLOT {
118 char *Name;
119 char *FullName;
120 char *InvocationString;
121 WORD WinBin; /* eg DMBIN_LOWER */
122 struct _tagINPUTSLOT *next;
123 } INPUTSLOT;
125 typedef struct {
126 char *NickName;
127 int LanguageLevel;
128 BOOL32 ColorDevice;
129 int DefaultResolution;
130 signed int LandscapeOrientation;
131 char *JCLBegin;
132 char *JCLToPSInterpreter;
133 char *JCLEnd;
134 char *DefaultFont;
135 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
136 PAGESIZE *PageSizes;
137 OPTION *InstalledOptions;
138 CONSTRAINT *Constraints;
139 INPUTSLOT *InputSlots;
140 } PPD;
142 typedef struct {
143 DEVMODE16 dmPublic;
144 struct _tagdocprivate {
145 } dmDocPrivate;
146 struct _tagdrvprivate {
147 char ppdFileName[100]; /* Hack */
148 UINT32 numInstalledOptions; /* Options at end of struct */
149 } dmDrvPrivate;
151 /* Now comes:
153 numInstalledOptions of OPTIONs
157 } PSDRV_DEVMODE16;
159 typedef struct _tagPI {
160 char *FriendlyName;
161 PPD *ppd;
162 PSDRV_DEVMODE16 *Devmode;
163 FONTFAMILY *Fonts;
164 struct _tagPI *next;
165 } PRINTERINFO;
167 typedef struct {
168 float r, g, b;
169 } PSRGB;
171 typedef struct {
172 float i;
173 } PSGRAY;
176 /* def's for PSCOLOR.type */
177 #define PSCOLOR_GRAY 0
178 #define PSCOLOR_RGB 1
180 typedef struct {
181 int type;
182 union {
183 PSRGB rgb;
184 PSGRAY gray;
185 } value;
186 } PSCOLOR;
188 typedef struct {
189 AFM *afm;
190 TEXTMETRIC32A tm;
191 INT32 size;
192 float scale;
193 INT32 escapement;
194 PSCOLOR color;
195 BOOL32 set; /* Have we done a setfont yet */
196 } PSFONT;
198 typedef struct {
199 PSCOLOR color;
200 BOOL32 set;
201 } PSBRUSH;
203 typedef struct {
204 INT32 width;
205 char *dash;
206 PSCOLOR color;
207 BOOL32 set;
208 } PSPEN;
210 typedef struct {
211 HANDLE16 hJob;
212 LPSTR output; /* Output file/port */
213 BOOL32 banding; /* Have we received a NEXTBAND */
214 BOOL32 NeedPageHeader; /* Page header not sent yet */
215 INT32 PageNo;
216 } JOB;
218 typedef struct {
219 PSFONT font; /* Current PS font */
220 PSPEN pen;
221 PSBRUSH brush;
222 PSCOLOR bkColor;
223 PSCOLOR inkColor; /* Last colour set */
224 JOB job;
225 PSDRV_DEVMODE16 *Devmode;
226 PRINTERINFO *pi;
227 } PSDRV_PDEVICE;
229 extern HANDLE32 PSDRV_Heap;
230 extern char *PSDRV_ANSIVector[256];
232 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
233 PRINTERINFO *pi);
234 extern BOOL32 PSDRV_GetFontMetrics(void);
235 extern PPD *PSDRV_ParsePPD(char *fname);
236 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
237 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
238 extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
239 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
241 extern BOOL32 PSDRV_Init(void);
242 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
243 extern HPEN32 PSDRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen );
244 extern HBRUSH32 PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
245 BRUSHOBJ * brush );
247 extern BOOL32 PSDRV_Brush(DC *dc, BOOL32 EO);
248 extern BOOL32 PSDRV_SetFont( DC *dc );
249 extern BOOL32 PSDRV_SetPen( DC *dc );
251 extern BOOL32 PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
252 extern BOOL32 PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
253 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
254 COLORREF wincolor );
257 extern INT32 PSDRV_WriteHeader( DC *dc, char *title, int len );
258 extern INT32 PSDRV_WriteFooter( DC *dc );
259 extern INT32 PSDRV_WriteNewPage( DC *dc );
260 extern INT32 PSDRV_WriteEndPage( DC *dc );
261 extern BOOL32 PSDRV_WriteMoveTo(DC *dc, INT32 x, INT32 y);
262 extern BOOL32 PSDRV_WriteLineTo(DC *dc, INT32 x, INT32 y);
263 extern BOOL32 PSDRV_WriteStroke(DC *dc);
264 extern BOOL32 PSDRV_WriteRectangle(DC *dc, INT32 x, INT32 y, INT32 width,
265 INT32 height);
266 extern BOOL32 PSDRV_WriteSetFont(DC *dc, BOOL32 UseANSI);
267 extern BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count);
268 extern BOOL32 PSDRV_WriteReencodeFont(DC *dc);
269 extern BOOL32 PSDRV_WriteSetPen(DC *dc);
270 extern BOOL32 PSDRV_WriteArc(DC *dc, INT32 x, INT32 y, INT32 w, INT32 h,
271 double ang1, double ang2);
272 extern BOOL32 PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
273 extern BOOL32 PSDRV_WriteSetBrush(DC *dc);
274 extern BOOL32 PSDRV_WriteFill(DC *dc);
275 extern BOOL32 PSDRV_WriteEOFill(DC *dc);
276 extern BOOL32 PSDRV_WriteGSave(DC *dc);
277 extern BOOL32 PSDRV_WriteGRestore(DC *dc);
278 extern BOOL32 PSDRV_WriteClosePath(DC *dc);
279 extern BOOL32 PSDRV_WriteClip(DC *dc);
280 extern BOOL32 PSDRV_WriteEOClip(DC *dc);
281 extern BOOL32 PSDRV_WriteHatch(DC *dc);
282 extern BOOL32 PSDRV_WriteRotate(DC *dc, float ang);
288 extern BOOL32 PSDRV_Arc( DC *dc, INT32 left, INT32 top, INT32 right,
289 INT32 bottom, INT32 xstart, INT32 ystart,
290 INT32 xend, INT32 yend );
291 extern BOOL32 PSDRV_Chord( DC *dc, INT32 left, INT32 top, INT32 right,
292 INT32 bottom, INT32 xstart, INT32 ystart,
293 INT32 xend, INT32 yend );
294 extern BOOL32 PSDRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right,
295 INT32 bottom );
296 extern BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
297 DEVICEFONTENUMPROC proc, LPARAM lp );
298 extern INT32 PSDRV_Escape( DC *dc, INT32 nEscape, INT32 cbInput,
299 SEGPTR lpInData, SEGPTR lpOutData );
300 extern BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
301 const RECT32 *lprect, LPCSTR str, UINT32 count,
302 const INT32 *lpDx );
303 extern BOOL32 PSDRV_GetCharWidth( DC *dc, UINT32 firstChar, UINT32 lastChar,
304 LPINT32 buffer );
305 extern BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
306 LPSIZE32 size );
307 extern BOOL32 PSDRV_GetTextMetrics( DC *dc, TEXTMETRIC32A *metrics );
308 extern BOOL32 PSDRV_LineTo( DC *dc, INT32 x, INT32 y );
309 extern BOOL32 PSDRV_MoveToEx( DC *dc, INT32 x, INT32 y, LPPOINT32 pt );
310 extern BOOL32 PSDRV_Pie( DC *dc, INT32 left, INT32 top, INT32 right,
311 INT32 bottom, INT32 xstart, INT32 ystart,
312 INT32 xend, INT32 yend );
313 extern BOOL32 PSDRV_Polygon( DC *dc, const POINT32* pt, INT32 count );
314 extern BOOL32 PSDRV_Polyline( DC *dc, const POINT32* pt, INT32 count );
315 extern BOOL32 PSDRV_PolyPolygon( DC *dc, const POINT32* pts, const INT32* counts,
316 UINT32 polygons );
317 extern BOOL32 PSDRV_PolyPolyline( DC *dc, const POINT32* pts, const DWORD* counts,
318 DWORD polylines );
319 extern BOOL32 PSDRV_Rectangle( DC *dc, INT32 left, INT32 top, INT32 right,
320 INT32 bottom );
321 extern BOOL32 PSDRV_RoundRect(DC *dc, INT32 left, INT32 top, INT32 right,
322 INT32 bottom, INT32 ell_width, INT32 ell_height);
323 extern HGDIOBJ32 PSDRV_SelectObject( DC *dc, HGDIOBJ32 handle );
324 extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
325 extern COLORREF PSDRV_SetPixel( DC *dc, INT32 x, INT32 y, COLORREF color );
326 extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
327 extern INT32 PSDRV_StretchDIBits( DC *dc, INT32 xDst, INT32 yDst,
328 INT32 widthDst, INT32 heightDst, INT32 xSrc,
329 INT32 ySrc, INT32 widthSrc, INT32 heightSrc,
330 const void *bits, const BITMAPINFO *info,
331 UINT32 wUsage, DWORD dwRop );