source: trunk/include/win/psdrv.h@ 10367

Last change on this file since 10367 was 4, checked in by ktk, 26 years ago

Import

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