5 * PostScript driver definitions
7 * Copyright 1998 Huw D M Davies
14 #include "wine/wingdi16.h"
17 float llx, lly, urx, ury;
20 typedef struct _tagAFMLIGS {
23 struct _tagAFMLIGS *next;
26 typedef struct _tagAFMMETRICS {
27 int C; /* character */
29 char N[32]; /* name */
31 AFMLIGS *L; /* Ligatures */
34 typedef struct _tagAFM {
39 int Weight; /* FW_NORMAL etc. */
42 float UnderlinePosition;
43 float UnderlineThickness;
49 float FullAscender; /* Ascent of Aring character */
50 float CharWidths[256];
53 } AFM; /* CharWidths is a shortcut to the WX values of numbered glyphs */
55 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
56 one list to exist without having to reallocate the entire AFM structure. We
57 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
58 fonts for each DC (dc->physDev->Fonts) */
60 typedef struct _tagAFMLISTENTRY {
62 struct _tagAFMLISTENTRY *next;
65 typedef struct _tagFONTFAMILY {
66 char *FamilyName; /* family name */
67 AFMLISTENTRY *afmlist; /* list of afms for this family */
68 struct _tagFONTFAMILY *next; /* next family */
71 extern FONTFAMILY *PSDRV_AFMFontList;
73 typedef struct _tagFONTNAME {
75 struct _tagFONTNAME *next;
79 float llx, lly, urx, ury;
88 typedef struct _tagPAGESIZE {
91 char *InvocationString;
92 IMAGEABLEAREA *ImageableArea;
93 PAPERDIMENSION *PaperDimension;
94 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
95 struct _tagPAGESIZE *next;
99 typedef struct _tagOPTIONENTRY {
100 char *Name; /* eg "True" */
101 char *FullName; /* eg "Installed" */
102 char *InvocationString; /* Often NULL */
103 struct _tagOPTIONENTRY *next;
106 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
107 char *OptionName; /* eg "*Option1" */
108 char *FullName; /* eg "Envelope Feeder" */
109 char *DefaultOption; /* eg "False" */
110 OPTIONENTRY *Options;
111 struct _tagOPTION *next;
114 typedef struct _tagCONSTRAINT {
119 struct _tagCONSTRAINT *next;
122 typedef struct _tagINPUTSLOT {
125 char *InvocationString;
126 WORD WinBin; /* eg DMBIN_LOWER */
127 struct _tagINPUTSLOT *next;
134 int DefaultResolution;
135 signed int LandscapeOrientation;
137 char *JCLToPSInterpreter;
140 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
142 OPTION *InstalledOptions;
143 CONSTRAINT *Constraints;
144 INPUTSLOT *InputSlots;
149 struct _tagdocprivate {
152 struct _tagdrvprivate {
153 char ppdFileName[256]; /* Hack */
154 UINT numInstalledOptions; /* Options at end of struct */
159 numInstalledOptions of OPTIONs
165 typedef struct _tagPI {
168 PSDRV_DEVMODEA *Devmode;
182 /* def's for PSCOLOR.type */
183 #define PSCOLOR_GRAY 0
184 #define PSCOLOR_RGB 1
201 BOOL set; /* Have we done a setfont yet */
219 LPSTR output; /* Output file/port */
220 BOOL banding; /* Have we received a NEXTBAND */
221 BOOL OutOfPage; /* Page header not sent yet */
226 PSFONT font; /* Current PS font */
230 PSCOLOR inkColor; /* Last colour set */
232 PSDRV_DEVMODEA *Devmode;
234 RECT PageSize; /* Imageable area in device co-ords */
239 PSDRV_DEVMODEA *dlgdm;
242 extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
243 LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
244 LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode);
246 extern HANDLE PSDRV_Heap;
247 extern char *PSDRV_ANSIVector[256];
249 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
251 extern BOOL PSDRV_GetFontMetrics(void);
252 extern PPD *PSDRV_ParsePPD(char *fname);
253 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
254 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
255 extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
256 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
258 extern BOOL WINAPI PSDRV_Init(HINSTANCE hinst, DWORD reason, LPVOID reserved);
259 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
260 extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
261 extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
264 extern BOOL PSDRV_Brush(DC *dc, BOOL EO);
265 extern BOOL PSDRV_SetFont( DC *dc );
266 extern BOOL PSDRV_SetPen( DC *dc );
268 extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
269 extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
270 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
272 extern char PSDRV_UnicodeToANSI(int u);
275 extern INT PSDRV_WriteHeader( DC *dc, LPCSTR title );
276 extern INT PSDRV_WriteFooter( DC *dc );
277 extern INT PSDRV_WriteNewPage( DC *dc );
278 extern INT PSDRV_WriteEndPage( DC *dc );
279 extern BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y);
280 extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
281 extern BOOL PSDRV_WriteStroke(DC *dc);
282 extern BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
284 extern BOOL PSDRV_WriteRRectangle(DC *dc, INT x, INT y, INT width,
286 extern BOOL PSDRV_WriteSetFont(DC *dc, BOOL UseANSI);
287 extern BOOL PSDRV_WriteShow(DC *dc, LPCWSTR str, INT count);
288 extern BOOL PSDRV_WriteReencodeFont(DC *dc);
289 extern BOOL PSDRV_WriteSetPen(DC *dc);
290 extern BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h,
291 double ang1, double ang2);
292 extern BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
293 extern BOOL PSDRV_WriteSetBrush(DC *dc);
294 extern BOOL PSDRV_WriteFill(DC *dc);
295 extern BOOL PSDRV_WriteEOFill(DC *dc);
296 extern BOOL PSDRV_WriteGSave(DC *dc);
297 extern BOOL PSDRV_WriteGRestore(DC *dc);
298 extern BOOL PSDRV_WriteNewPath(DC *dc);
299 extern BOOL PSDRV_WriteClosePath(DC *dc);
300 extern BOOL PSDRV_WriteInitClip(DC *dc);
301 extern BOOL PSDRV_WriteClip(DC *dc);
302 extern BOOL PSDRV_WriteRectClip(DC *dc, INT x, INT y, INT w, INT h);
303 extern BOOL PSDRV_WriteRectClip2(DC *dc, CHAR *pszArrayName);
304 extern BOOL PSDRV_WriteEOClip(DC *dc);
305 extern BOOL PSDRV_WriteHatch(DC *dc);
306 extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
307 extern BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size);
308 extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
309 extern BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number);
310 extern BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
311 INT widthDst, INT heightDst, INT widthSrc,
312 INT heightSrc, char *bits);
313 extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
314 extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
315 extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
316 extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
317 extern int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch);
318 extern BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits);
319 extern BOOL PSDRV_WriteArrayPut(DC *dc, CHAR *pszArrayName, INT nIndex, LONG lCoord);
320 extern BOOL PSDRV_WriteArrayDef(DC *dc, CHAR *pszArrayName, INT nSize);
322 extern BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right,
323 INT bottom, INT xstart, INT ystart,
324 INT xend, INT yend );
325 extern BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right,
326 INT bottom, INT xstart, INT ystart,
327 INT xend, INT yend );
328 extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
330 extern INT PSDRV_EndDoc( DC *dc );
331 extern INT PSDRV_EndPage( DC *dc );
332 extern BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
333 DEVICEFONTENUMPROC proc, LPARAM lp );
334 extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
335 SEGPTR lpInData, SEGPTR lpOutData );
336 extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
337 const RECT *lprect, LPCWSTR str, UINT count,
339 extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
341 extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
343 extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
344 extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
345 extern BOOL PSDRV_PatBlt( DC *dc, INT x, INT y, INT width, INT height, DWORD
347 extern BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right,
348 INT bottom, INT xstart, INT ystart,
349 INT xend, INT yend );
350 extern BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count );
351 extern BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count );
352 extern BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
354 extern BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
356 extern BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
358 extern BOOL PSDRV_RoundRect(DC *dc, INT left, INT top, INT right,
359 INT bottom, INT ell_width, INT ell_height);
360 extern HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle );
361 extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
362 extern VOID PSDRV_SetDeviceClipping( DC *dc );
363 extern COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
364 extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
365 extern INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc );
366 extern INT PSDRV_StartPage( DC *dc );
367 extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
368 INT widthDst, INT heightDst, INT xSrc,
369 INT ySrc, INT widthSrc, INT heightSrc,
370 const void *bits, const BITMAPINFO *info,
371 UINT wUsage, DWORD dwRop );
373 extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
374 LPDEVMODEA lpdmOutput,
375 LPSTR lpszDevice, LPSTR lpszPort,
376 LPDEVMODEA lpdmInput, LPSTR lpszProfile,
378 extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
380 WORD fwCapability, LPSTR lpszOutput,
382 VOID PSDRV_DrawLine( DC *dc );