Release 980822
[wine/multimedia.git] / include / psdrv.h
blob171e0858c19c31561d53efca5c8a18ca20b42ae6
2 /*
3 * PostScript driver definitions
5 * Copyright 1998 Huw D M Davies
6 */
7 #include "windows.h"
8 #include "font.h"
10 typedef struct {
11 float llx, lly, urx, ury;
12 } AFMBBOX;
14 typedef struct _tagAFMLIGS {
15 char *successor;
16 char *ligature;
17 struct _tagAFMLIGS *next;
18 } AFMLIGS;
20 typedef struct _tagAFMMETRICS {
21 int C; /* character */
22 float WX;
23 char *N; /* name */
24 AFMBBOX B;
25 AFMLIGS *L; /* Ligatures */
26 struct _tagAFMMETRICS *next;
27 } AFMMETRICS;
29 typedef struct _tagAFM {
30 char *FontName;
31 char *FullName;
32 char *FamilyName;
33 int Weight; /* FW_NORMAL etc. */
34 float ItalicAngle;
35 BOOL32 IsFixedPitch;
36 float UnderlinePosition;
37 float UnderlineThickness;
38 AFMBBOX FontBBox;
39 float CapHeight;
40 float XHeight;
41 float Ascender;
42 float Descender;
43 float FullAscender; /* Ascent of Aring character */
44 float CharWidths[256];
45 int NumofMetrics;
46 AFMMETRICS *Metrics;
47 } AFM; /* CharWidths is a shortcut to the WX values of numbered glyphs */
49 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
50 one list to exist without having to reallocate the entire AFM structure. We
51 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
52 fonts for each DC (dc->physDev->Fonts) */
54 typedef struct _tagAFMLISTENTRY {
55 AFM *afm;
56 struct _tagAFMLISTENTRY *next;
57 } AFMLISTENTRY;
59 typedef struct _tagFONTFAMILY {
60 char *FamilyName; /* family name */
61 AFMLISTENTRY *afmlist; /* list of afms for this family */
62 struct _tagFONTFAMILY *next; /* next family */
63 } FONTFAMILY;
65 extern FONTFAMILY *PSDRV_AFMFontList;
67 typedef struct _tagFONTNAME {
68 char *Name;
69 struct _tagFONTNAME *next;
70 } FONTNAME;
72 typedef struct {
73 float llx, lly, urx, ury;
74 } IMAGEABLEAREA;
76 typedef struct {
77 float x, y;
78 } PAPERDIMENSION;
80 typedef struct _tagPAGESIZE {
81 char *Name;
82 char *FullName;
83 char *InvocationString;
84 IMAGEABLEAREA *ImageableArea;
85 PAPERDIMENSION *PaperDimension;
86 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
87 struct _tagPAGESIZE *next;
88 } PAGESIZE;
91 typedef struct _tagOPTIONENTRY {
92 char *Name; /* eg "True" */
93 char *FullName; /* eg "Installed" */
94 char *InvocationString; /* Often NULL */
95 struct _tagOPTIONENTRY *next;
96 } OPTIONENTRY;
98 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
99 char *OptionName; /* eg "*Option1" */
100 char *FullName; /* eg "Envelope Feeder" */
101 char *DefaultOption; /* eg "False" */
102 OPTIONENTRY *Options;
103 struct _tagOPTION *next;
104 } OPTION;
106 typedef struct _tagCONSTRAINT {
107 char *Feature1;
108 char *Value1;
109 char *Feature2;
110 char *Value2;
111 struct _tagCONSTRAINT *next;
112 } CONSTRAINT;
114 typedef struct _tagINPUTSLOT {
115 char *Name;
116 char *FullName;
117 char *InvocationString;
118 WORD WinBin; /* eg DMBIN_LOWER */
119 struct _tagINPUTSLOT *next;
120 } INPUTSLOT;
122 typedef struct {
123 char *NickName;
124 int LanguageLevel;
125 BOOL32 ColorDevice;
126 int DefaultResolution;
127 int LandscapeOrientation;
128 char *JCLBegin;
129 char *JCLToPSInterpreter;
130 char *JCLEnd;
131 char *DefaultFont;
132 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
133 PAGESIZE *PageSizes;
134 OPTION *InstalledOptions;
135 CONSTRAINT *Constraints;
136 INPUTSLOT *InputSlots;
137 } PPD;
139 typedef struct {
140 DEVMODE16 dmPublic;
141 struct _tagdocprivate {
142 } dmDocPrivate;
143 struct _tagdrvprivate {
144 char ppdFileName[100]; /* Hack */
145 UINT32 numInstalledOptions; /* Options at end of struct */
146 } dmDrvPrivate;
148 /* Now comes:
150 numInstalledOptions of OPTIONs
154 } PSDRV_DEVMODE16;
156 typedef struct _tagPI {
157 char *FriendlyName;
158 PPD *ppd;
159 PSDRV_DEVMODE16 *Devmode;
160 FONTFAMILY *Fonts;
161 struct _tagPI *next;
162 } PRINTERINFO;
164 typedef struct {
165 AFM *afm;
166 TEXTMETRIC32A tm;
167 INT32 size;
168 float scale;
169 INT32 escapement;
170 BOOL32 set; /* Have we done a setfont yet */
171 } PSFONT;
173 typedef struct {
174 HANDLE16 hJob;
175 LPSTR output; /* Output file/port */
176 BOOL32 banding; /* Have we received a NEXTBAND */
177 BOOL32 NeedPageHeader; /* Page header not sent yet */
178 INT32 PageNo;
179 } JOB;
181 typedef struct
183 PSFONT font; /* Current PS font */
184 JOB job;
185 PSDRV_DEVMODE16 *Devmode;
186 PRINTERINFO *pi;
187 } PSDRV_PDEVICE;
189 extern HANDLE32 PSDRV_Heap;
191 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
192 PRINTERINFO *pi);
193 extern BOOL32 PSDRV_GetFontMetrics(void);
194 extern PPD *PSDRV_ParsePPD(char *fname);
195 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
196 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
197 extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
198 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
200 extern BOOL32 PSDRV_Init(void);
201 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
202 extern BOOL32 PSDRV_SetFont( DC *dc );
204 extern INT32 PSDRV_WriteHeader( DC *dc, char *title, int len );
205 extern INT32 PSDRV_WriteFooter( DC *dc );
206 extern INT32 PSDRV_WriteNewPage( DC *dc );
207 extern INT32 PSDRV_WriteEndPage( DC *dc );
208 extern BOOL32 PSDRV_WriteMoveTo(DC *dc, INT32 x, INT32 y);
209 extern BOOL32 PSDRV_WriteLineTo(DC *dc, INT32 x, INT32 y);
210 extern BOOL32 PSDRV_WriteStroke(DC *dc);
211 extern BOOL32 PSDRV_WriteRectangle(DC *dc, INT32 x, INT32 y, INT32 width,
212 INT32 height);
213 extern BOOL32 PSDRV_WriteSetFont(DC *dc);
214 extern BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count);
215 extern BOOL32 PSDRV_WriteReencodeFont(DC *dc);
224 extern BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
225 DEVICEFONTENUMPROC proc, LPARAM lp );
226 extern INT32 PSDRV_Escape( DC *dc, INT32 nEscape, INT32 cbInput,
227 SEGPTR lpInData, SEGPTR lpOutData );
228 extern BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
229 const RECT32 *lprect, LPCSTR str, UINT32 count,
230 const INT32 *lpDx );
231 extern BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
232 LPSIZE32 size );
233 extern BOOL32 PSDRV_GetTextMetrics( DC *dc, TEXTMETRIC32A *metrics );
234 extern BOOL32 PSDRV_LineTo( DC *dc, INT32 x, INT32 y );
235 extern BOOL32 PSDRV_MoveToEx( DC *dc, INT32 x, INT32 y, LPPOINT32 pt );
236 extern BOOL32 PSDRV_Polyline( DC *dc, const LPPOINT32 pt, INT32 count );
237 extern BOOL32 PSDRV_Polygon( DC *dc, LPPOINT32 pt, INT32 count );
238 extern HGDIOBJ32 PSDRV_SelectObject( DC *dc, HGDIOBJ32 handle );
240 extern BOOL32 PSDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right,
241 INT32 bottom);
242 extern BOOL32 PSDRV_Ellipse(DC *dc, INT32 left, INT32 top, INT32 right,
243 INT32 bottom);