3 * PostScript driver definitions
5 * Copyright 1998 Huw D M Davies
13 float llx, lly, urx, ury;
16 typedef struct _tagAFMLIGS {
19 struct _tagAFMLIGS *next;
22 typedef struct _tagAFMMETRICS {
23 int C; /* character */
27 AFMLIGS *L; /* Ligatures */
28 struct _tagAFMMETRICS *next;
31 typedef struct _tagAFM {
36 int Weight; /* FW_NORMAL etc. */
39 float UnderlinePosition;
40 float UnderlineThickness;
46 float FullAscender; /* Ascent of Aring character */
47 float CharWidths[256];
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 {
59 struct _tagAFMLISTENTRY *next;
62 typedef struct _tagFONTFAMILY {
63 char *FamilyName; /* family name */
64 AFMLISTENTRY *afmlist; /* list of afms for this family */
65 struct _tagFONTFAMILY *next; /* next family */
68 extern FONTFAMILY *PSDRV_AFMFontList;
70 typedef struct _tagFONTNAME {
72 struct _tagFONTNAME *next;
76 float llx, lly, urx, ury;
83 typedef struct _tagPAGESIZE {
86 char *InvocationString;
87 IMAGEABLEAREA *ImageableArea;
88 PAPERDIMENSION *PaperDimension;
89 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
90 struct _tagPAGESIZE *next;
94 typedef struct _tagOPTIONENTRY {
95 char *Name; /* eg "True" */
96 char *FullName; /* eg "Installed" */
97 char *InvocationString; /* Often NULL */
98 struct _tagOPTIONENTRY *next;
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;
109 typedef struct _tagCONSTRAINT {
114 struct _tagCONSTRAINT *next;
117 typedef struct _tagINPUTSLOT {
120 char *InvocationString;
121 WORD WinBin; /* eg DMBIN_LOWER */
122 struct _tagINPUTSLOT *next;
129 int DefaultResolution;
130 signed int LandscapeOrientation;
132 char *JCLToPSInterpreter;
135 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
137 OPTION *InstalledOptions;
138 CONSTRAINT *Constraints;
139 INPUTSLOT *InputSlots;
144 struct _tagdocprivate {
146 struct _tagdrvprivate {
147 char ppdFileName[100]; /* Hack */
148 UINT32 numInstalledOptions; /* Options at end of struct */
153 numInstalledOptions of OPTIONs
159 typedef struct _tagPI {
162 PSDRV_DEVMODE16 *Devmode;
176 /* def's for PSCOLOR.type */
177 #define PSCOLOR_GRAY 0
178 #define PSCOLOR_RGB 1
195 BOOL32 set; /* Have we done a setfont yet */
213 LPSTR output; /* Output file/port */
214 BOOL32 banding; /* Have we received a NEXTBAND */
215 BOOL32 NeedPageHeader; /* Page header not sent yet */
220 PSFONT font; /* Current PS font */
224 PSCOLOR inkColor; /* Last colour set */
226 PSDRV_DEVMODE16 *Devmode;
230 extern HANDLE32 PSDRV_Heap;
231 extern char *PSDRV_ANSIVector[256];
233 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
235 extern BOOL32 PSDRV_GetFontMetrics(void);
236 extern PPD *PSDRV_ParsePPD(char *fname);
237 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
238 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
239 extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
240 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
242 extern BOOL32 PSDRV_Init(void);
243 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
244 extern HPEN32 PSDRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen );
245 extern HBRUSH32 PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
248 extern BOOL32 PSDRV_SetBrush(DC *dc);
249 extern BOOL32 PSDRV_SetFont( DC *dc );
250 extern BOOL32 PSDRV_SetPen( DC *dc );
252 extern BOOL32 PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
253 extern BOOL32 PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
254 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
258 extern INT32 PSDRV_WriteHeader( DC *dc, char *title, int len );
259 extern INT32 PSDRV_WriteFooter( DC *dc );
260 extern INT32 PSDRV_WriteNewPage( DC *dc );
261 extern INT32 PSDRV_WriteEndPage( DC *dc );
262 extern BOOL32 PSDRV_WriteMoveTo(DC *dc, INT32 x, INT32 y);
263 extern BOOL32 PSDRV_WriteLineTo(DC *dc, INT32 x, INT32 y);
264 extern BOOL32 PSDRV_WriteStroke(DC *dc);
265 extern BOOL32 PSDRV_WriteRectangle(DC *dc, INT32 x, INT32 y, INT32 width,
267 extern BOOL32 PSDRV_WriteSetFont(DC *dc, BOOL32 UseANSI);
268 extern BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count);
269 extern BOOL32 PSDRV_WriteReencodeFont(DC *dc);
270 extern BOOL32 PSDRV_WriteSetPen(DC *dc);
271 extern BOOL32 PSDRV_WriteEllispe(DC *dc, INT32 x, INT32 y, INT32 a, INT32 b);
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_Writegsave(DC *dc);
276 extern BOOL32 PSDRV_Writegrestore(DC *dc);
283 extern BOOL32 PSDRV_Ellipse(DC *dc, INT32 left, INT32 top, INT32 right,
285 extern BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
286 DEVICEFONTENUMPROC proc, LPARAM lp );
287 extern INT32 PSDRV_Escape( DC *dc, INT32 nEscape, INT32 cbInput,
288 SEGPTR lpInData, SEGPTR lpOutData );
289 extern BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
290 const RECT32 *lprect, LPCSTR str, UINT32 count,
292 extern BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
294 extern BOOL32 PSDRV_GetTextMetrics( DC *dc, TEXTMETRIC32A *metrics );
295 extern BOOL32 PSDRV_LineTo( DC *dc, INT32 x, INT32 y );
296 extern BOOL32 PSDRV_MoveToEx( DC *dc, INT32 x, INT32 y, LPPOINT32 pt );
297 extern BOOL32 PSDRV_Polygon( DC *dc, LPPOINT32 pt, INT32 count );
298 extern BOOL32 PSDRV_Polyline( DC *dc, const LPPOINT32 pt, INT32 count );
299 extern BOOL32 PSDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right,
301 extern HGDIOBJ32 PSDRV_SelectObject( DC *dc, HGDIOBJ32 handle );
302 extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
303 extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );