Fixed definition of the RtlMemory functions. Use macros internally and
[wine.git] / include / psdrv.h
blob2902043a97826fa36f7b34d006a83e2a9d981148
1 #ifndef __WINE_PSDRV_H
2 #define __WINE_PSDRV_H
4 /*
5 * PostScript driver definitions
7 * Copyright 1998 Huw D M Davies
8 */
9 #include "windef.h"
10 #include "wingdi.h"
11 #include "font.h"
12 #include "pen.h"
13 #include "brush.h"
14 #include "wine/wingdi16.h"
16 typedef struct {
17 float llx, lly, urx, ury;
18 } AFMBBOX;
20 typedef struct _tagAFMLIGS {
21 char *successor;
22 char *ligature;
23 struct _tagAFMLIGS *next;
24 } AFMLIGS;
26 typedef 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;
35 typedef 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 */
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) */
61 typedef struct _tagAFMLISTENTRY {
62 AFM *afm;
63 struct _tagAFMLISTENTRY *next;
64 } AFMLISTENTRY;
66 typedef struct _tagFONTFAMILY {
67 char *FamilyName; /* family name */
68 AFMLISTENTRY *afmlist; /* list of afms for this family */
69 struct _tagFONTFAMILY *next; /* next family */
70 } FONTFAMILY;
72 extern FONTFAMILY *PSDRV_AFMFontList;
74 typedef struct _tagFONTNAME {
75 char *Name;
76 struct _tagFONTNAME *next;
77 } FONTNAME;
79 typedef struct {
80 float llx, lly, urx, ury;
81 } IMAGEABLEAREA;
83 typedef struct {
84 float x, y;
85 } PAPERDIMENSION;
87 /* Solaris kludge */
88 #undef PAGESIZE
89 typedef struct _tagPAGESIZE {
90 char *Name;
91 char *FullName;
92 char *InvocationString;
93 IMAGEABLEAREA *ImageableArea;
94 PAPERDIMENSION *PaperDimension;
95 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
96 struct _tagPAGESIZE *next;
97 } PAGESIZE;
100 typedef struct _tagOPTIONENTRY {
101 char *Name; /* eg "True" */
102 char *FullName; /* eg "Installed" */
103 char *InvocationString; /* Often NULL */
104 struct _tagOPTIONENTRY *next;
105 } OPTIONENTRY;
107 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
108 char *OptionName; /* eg "*Option1" */
109 char *FullName; /* eg "Envelope Feeder" */
110 char *DefaultOption; /* eg "False" */
111 OPTIONENTRY *Options;
112 struct _tagOPTION *next;
113 } OPTION;
115 typedef struct _tagCONSTRAINT {
116 char *Feature1;
117 char *Value1;
118 char *Feature2;
119 char *Value2;
120 struct _tagCONSTRAINT *next;
121 } CONSTRAINT;
123 typedef struct _tagINPUTSLOT {
124 char *Name;
125 char *FullName;
126 char *InvocationString;
127 WORD WinBin; /* eg DMBIN_LOWER */
128 struct _tagINPUTSLOT *next;
129 } INPUTSLOT;
131 typedef struct {
132 char *NickName;
133 int LanguageLevel;
134 BOOL ColorDevice;
135 int DefaultResolution;
136 signed int LandscapeOrientation;
137 char *JCLBegin;
138 char *JCLToPSInterpreter;
139 char *JCLEnd;
140 char *DefaultFont;
141 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
142 PAGESIZE *PageSizes;
143 OPTION *InstalledOptions;
144 CONSTRAINT *Constraints;
145 INPUTSLOT *InputSlots;
146 } PPD;
148 typedef struct {
149 DEVMODEA dmPublic;
150 struct _tagdocprivate {
151 int dummy;
152 } dmDocPrivate;
153 struct _tagdrvprivate {
154 char ppdFileName[256]; /* Hack */
155 UINT numInstalledOptions; /* Options at end of struct */
156 } dmDrvPrivate;
158 /* Now comes:
160 numInstalledOptions of OPTIONs
164 } PSDRV_DEVMODEA;
166 typedef struct _tagPI {
167 char *FriendlyName;
168 PPD *ppd;
169 PSDRV_DEVMODEA *Devmode;
170 FONTFAMILY *Fonts;
171 struct _tagPI *next;
172 } PRINTERINFO;
174 typedef struct {
175 float r, g, b;
176 } PSRGB;
178 typedef struct {
179 float i;
180 } PSGRAY;
183 /* def's for PSCOLOR.type */
184 #define PSCOLOR_GRAY 0
185 #define PSCOLOR_RGB 1
187 typedef struct {
188 int type;
189 union {
190 PSRGB rgb;
191 PSGRAY gray;
192 } value;
193 } PSCOLOR;
195 typedef struct {
196 AFM *afm;
197 TEXTMETRICA tm;
198 INT size;
199 float scale;
200 INT escapement;
201 PSCOLOR color;
202 BOOL set; /* Have we done a setfont yet */
203 } PSFONT;
205 typedef struct {
206 PSCOLOR color;
207 BOOL set;
208 } PSBRUSH;
210 typedef struct {
211 INT style;
212 INT width;
213 char *dash;
214 PSCOLOR color;
215 BOOL set;
216 } PSPEN;
218 typedef struct {
219 HANDLE16 hJob;
220 LPSTR output; /* Output file/port */
221 BOOL banding; /* Have we received a NEXTBAND */
222 BOOL OutOfPage; /* Page header not sent yet */
223 INT PageNo;
224 } JOB;
226 typedef struct {
227 PSFONT font; /* Current PS font */
228 PSPEN pen;
229 PSBRUSH brush;
230 PSCOLOR bkColor;
231 PSCOLOR inkColor; /* Last colour set */
232 JOB job;
233 PSDRV_DEVMODEA *Devmode;
234 PRINTERINFO *pi;
235 } PSDRV_PDEVICE;
238 extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
239 LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
240 LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode);
242 extern HANDLE PSDRV_Heap;
243 extern char *PSDRV_ANSIVector[256];
245 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
246 PRINTERINFO *pi);
247 extern BOOL PSDRV_GetFontMetrics(void);
248 extern PPD *PSDRV_ParsePPD(char *fname);
249 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
250 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
251 extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
252 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
254 extern BOOL PSDRV_Init(void);
255 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
256 extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
257 extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
258 BRUSHOBJ * brush );
260 extern BOOL PSDRV_Brush(DC *dc, BOOL EO);
261 extern BOOL PSDRV_SetFont( DC *dc );
262 extern BOOL PSDRV_SetPen( DC *dc );
264 extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
265 extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
266 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
267 COLORREF wincolor );
268 extern char PSDRV_UnicodeToANSI(int u);
271 extern INT PSDRV_WriteHeader( DC *dc, LPCSTR title );
272 extern INT PSDRV_WriteFooter( DC *dc );
273 extern INT PSDRV_WriteNewPage( DC *dc );
274 extern INT PSDRV_WriteEndPage( DC *dc );
275 extern BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y);
276 extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
277 extern BOOL PSDRV_WriteStroke(DC *dc);
278 extern BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
279 INT height);
280 extern BOOL PSDRV_WriteRRectangle(DC *dc, INT x, INT y, INT width,
281 INT height);
282 extern BOOL PSDRV_WriteSetFont(DC *dc, BOOL UseANSI);
283 extern BOOL PSDRV_WriteShow(DC *dc, LPCWSTR str, INT count);
284 extern BOOL PSDRV_WriteReencodeFont(DC *dc);
285 extern BOOL PSDRV_WriteSetPen(DC *dc);
286 extern BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h,
287 double ang1, double ang2);
288 extern BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
289 extern BOOL PSDRV_WriteSetBrush(DC *dc);
290 extern BOOL PSDRV_WriteFill(DC *dc);
291 extern BOOL PSDRV_WriteEOFill(DC *dc);
292 extern BOOL PSDRV_WriteGSave(DC *dc);
293 extern BOOL PSDRV_WriteGRestore(DC *dc);
294 extern BOOL PSDRV_WriteNewPath(DC *dc);
295 extern BOOL PSDRV_WriteClosePath(DC *dc);
296 extern BOOL PSDRV_WriteInitClip(DC *dc);
297 extern BOOL PSDRV_WriteClip(DC *dc);
298 extern BOOL PSDRV_WriteRectClip(DC *dc, INT x, INT y, INT w, INT h);
299 extern BOOL PSDRV_WriteRectClip2(DC *dc, CHAR *pszArrayName);
300 extern BOOL PSDRV_WriteEOClip(DC *dc);
301 extern BOOL PSDRV_WriteHatch(DC *dc);
302 extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
303 extern BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size);
304 extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
305 extern BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number);
306 extern BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
307 INT widthDst, INT heightDst, INT widthSrc,
308 INT heightSrc, char *bits);
309 extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
310 extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
311 extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
312 extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
313 extern int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch);
314 extern BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits);
315 extern BOOL PSDRV_WriteArrayPut(DC *dc, CHAR *pszArrayName, INT nIndex, LONG lCoord);
316 extern BOOL PSDRV_WriteArrayDef(DC *dc, CHAR *pszArrayName, INT nSize);
318 extern BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right,
319 INT bottom, INT xstart, INT ystart,
320 INT xend, INT yend );
321 extern BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right,
322 INT bottom, INT xstart, INT ystart,
323 INT xend, INT yend );
324 extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
325 INT bottom );
326 extern INT PSDRV_EndDoc( DC *dc );
327 extern INT PSDRV_EndPage( DC *dc );
328 extern BOOL PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
329 DEVICEFONTENUMPROC proc, LPARAM lp );
330 extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
331 SEGPTR lpInData, SEGPTR lpOutData );
332 extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
333 const RECT *lprect, LPCWSTR str, UINT count,
334 const INT *lpDx );
335 extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
336 LPINT buffer );
337 extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
338 LPSIZE size );
339 extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
340 extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
341 extern BOOL PSDRV_PatBlt( DC *dc, INT x, INT y, INT width, INT height, DWORD
342 dwRop);
343 extern BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right,
344 INT bottom, INT xstart, INT ystart,
345 INT xend, INT yend );
346 extern BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count );
347 extern BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count );
348 extern BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
349 UINT polygons );
350 extern BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
351 DWORD polylines );
352 extern BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
353 INT bottom );
354 extern BOOL PSDRV_RoundRect(DC *dc, INT left, INT top, INT right,
355 INT bottom, INT ell_width, INT ell_height);
356 extern HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle );
357 extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
358 extern VOID PSDRV_SetDeviceClipping( DC *dc );
359 extern COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
360 extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
361 extern INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc );
362 extern INT PSDRV_StartPage( DC *dc );
363 extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
364 INT widthDst, INT heightDst, INT xSrc,
365 INT ySrc, INT widthSrc, INT heightSrc,
366 const void *bits, const BITMAPINFO *info,
367 UINT wUsage, DWORD dwRop );
369 extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
370 LPDEVMODEA lpdmOutput,
371 LPSTR lpszDevice, LPSTR lpszPort,
372 LPDEVMODEA lpdmInput, LPSTR lpszProfile,
373 DWORD dwMode);
374 extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
375 LPCSTR lpszPort,
376 WORD fwCapability, LPSTR lpszOutput,
377 LPDEVMODEA lpdm);
378 VOID PSDRV_DrawLine( DC *dc );
379 #endif