Added the DFCS_{HOT,TRANSPARENT} definitions.
[wine/gsoc_dplay.git] / dlls / wineps / psdrv.h
blob675fd586693cafcaa65e1981ad304884d73b36d4
1 /*
2 * PostScript driver definitions
4 * Copyright 1998 Huw D M Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_PSDRV_H
22 #define __WINE_PSDRV_H
24 #include "windef.h"
25 #include "wingdi.h"
26 #include "gdi.h"
27 #include "wine/wingdi16.h"
28 #include "winspool.h"
30 typedef struct {
31 INT index;
32 LPCSTR sz;
33 } GLYPHNAME;
35 typedef struct {
36 LONG UV;
37 const GLYPHNAME *name;
38 } UNICODEGLYPH;
40 typedef struct {
41 float llx, lly, urx, ury;
42 } AFMBBOX;
44 typedef struct _tagAFMLIGS {
45 char *successor;
46 char *ligature;
47 struct _tagAFMLIGS *next;
48 } AFMLIGS;
50 typedef struct {
51 int C; /* character */
52 LONG UV;
53 float WX;
54 const GLYPHNAME *N; /* name */
55 AFMBBOX B;
56 const AFMLIGS *L; /* Ligatures */
57 } OLD_AFMMETRICS;
59 typedef struct {
60 INT C; /* AFM encoding (or -1) */
61 LONG UV; /* Unicode value */
62 FLOAT WX; /* Advance width */
63 const GLYPHNAME *N; /* Glyph name */
64 } AFMMETRICS;
66 typedef struct {
67 USHORT usUnitsPerEm; /* head:unitsPerEm */
68 SHORT sAscender; /* hhea:Ascender */
69 SHORT sDescender; /* hhea:Descender */
70 SHORT sLineGap; /* hhea:LineGap */
71 SHORT sAvgCharWidth; /* OS/2:xAvgCharWidth */
72 SHORT sTypoAscender; /* OS/2:sTypoAscender */
73 SHORT sTypoDescender; /* OS/2:sTypoDescender */
74 SHORT sTypoLineGap; /* OS/2:sTypeLineGap */
75 USHORT usWinAscent; /* OS/2:usWinAscent */
76 USHORT usWinDescent; /* OS/2:usWinDescent */
77 } WINMETRICS;
79 typedef struct _tagAFM {
80 LPCSTR FontName;
81 LPCSTR FullName;
82 LPCSTR FamilyName;
83 LPCSTR EncodingScheme;
84 LONG Weight; /* FW_NORMAL etc. */
85 float ItalicAngle;
86 BOOL IsFixedPitch;
87 float UnderlinePosition;
88 float UnderlineThickness;
89 AFMBBOX FontBBox;
90 float Ascender;
91 float Descender;
92 WINMETRICS WinMetrics;
93 int NumofMetrics;
94 const AFMMETRICS *Metrics;
95 } AFM;
97 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
98 one list to exist without having to reallocate the entire AFM structure. We
99 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
100 fonts for each DC (dc->physDev->Fonts) */
102 typedef struct _tagAFMLISTENTRY {
103 const AFM *afm;
104 struct _tagAFMLISTENTRY *next;
105 } AFMLISTENTRY;
107 typedef struct _tagFONTFAMILY {
108 char *FamilyName; /* family name */
109 AFMLISTENTRY *afmlist; /* list of afms for this family */
110 struct _tagFONTFAMILY *next; /* next family */
111 } FONTFAMILY;
113 extern FONTFAMILY *PSDRV_AFMFontList;
114 extern const AFM *const PSDRV_BuiltinAFMs[]; /* last element is NULL */
116 typedef struct _tagFONTNAME {
117 char *Name;
118 struct _tagFONTNAME *next;
119 } FONTNAME;
121 typedef struct {
122 float llx, lly, urx, ury;
123 } IMAGEABLEAREA;
125 typedef struct {
126 float x, y;
127 } PAPERDIMENSION;
129 /* Solaris kludge */
130 #undef PAGESIZE
131 typedef struct _tagPAGESIZE {
132 char *Name;
133 char *FullName;
134 char *InvocationString;
135 IMAGEABLEAREA *ImageableArea;
136 PAPERDIMENSION *PaperDimension;
137 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
138 struct _tagPAGESIZE *next;
139 } PAGESIZE;
142 typedef struct _tagOPTIONENTRY {
143 char *Name; /* eg "True" */
144 char *FullName; /* eg "Installed" */
145 char *InvocationString; /* Often NULL */
146 struct _tagOPTIONENTRY *next;
147 } OPTIONENTRY;
149 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
150 char *OptionName; /* eg "*Option1" */
151 char *FullName; /* eg "Envelope Feeder" */
152 char *DefaultOption; /* eg "False" */
153 OPTIONENTRY *Options;
154 struct _tagOPTION *next;
155 } OPTION;
157 typedef struct _tagCONSTRAINT {
158 char *Feature1;
159 char *Value1;
160 char *Feature2;
161 char *Value2;
162 struct _tagCONSTRAINT *next;
163 } CONSTRAINT;
165 typedef struct _tagINPUTSLOT {
166 char *Name;
167 char *FullName;
168 char *InvocationString;
169 WORD WinBin; /* eg DMBIN_LOWER */
170 struct _tagINPUTSLOT *next;
171 } INPUTSLOT;
173 typedef struct {
174 char *NickName;
175 int LanguageLevel;
176 BOOL ColorDevice;
177 int DefaultResolution;
178 signed int LandscapeOrientation;
179 char *JCLBegin;
180 char *JCLToPSInterpreter;
181 char *JCLEnd;
182 char *DefaultFont;
183 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
184 PAGESIZE *PageSizes;
185 OPTION *InstalledOptions;
186 CONSTRAINT *Constraints;
187 INPUTSLOT *InputSlots;
188 } PPD;
190 typedef struct {
191 DEVMODEA dmPublic;
192 struct _tagdocprivate {
193 int dummy;
194 } dmDocPrivate;
195 struct _tagdrvprivate {
196 UINT numInstalledOptions; /* Options at end of struct */
197 } dmDrvPrivate;
199 /* Now comes:
201 numInstalledOptions of OPTIONs
205 } PSDRV_DEVMODEA;
207 typedef struct _tagPI {
208 char *FriendlyName;
209 PPD *ppd;
210 PSDRV_DEVMODEA *Devmode;
211 FONTFAMILY *Fonts;
212 PPRINTER_ENUM_VALUESA FontSubTable;
213 DWORD FontSubTableSize;
214 struct _tagPI *next;
215 } PRINTERINFO;
217 typedef struct {
218 float r, g, b;
219 } PSRGB;
221 typedef struct {
222 float i;
223 } PSGRAY;
226 /* def's for PSCOLOR.type */
227 #define PSCOLOR_GRAY 0
228 #define PSCOLOR_RGB 1
230 typedef struct {
231 int type;
232 union {
233 PSRGB rgb;
234 PSGRAY gray;
235 } value;
236 } PSCOLOR;
238 typedef struct {
239 const AFM *afm;
240 TEXTMETRICW tm;
241 INT size;
242 float scale;
243 INT escapement;
244 PSCOLOR color;
245 BOOL set; /* Have we done a setfont yet */
246 } PSFONT;
248 typedef struct {
249 PSCOLOR color;
250 BOOL set;
251 } PSBRUSH;
253 typedef struct {
254 INT style;
255 INT width;
256 char *dash;
257 PSCOLOR color;
258 BOOL set;
259 } PSPEN;
261 typedef struct {
262 HANDLE16 hJob;
263 LPSTR output; /* Output file/port */
264 BOOL banding; /* Have we received a NEXTBAND */
265 BOOL OutOfPage; /* Page header not sent yet */
266 INT PageNo;
267 } JOB;
269 typedef struct {
270 HDC hdc;
271 DC *dc;
272 PSFONT font; /* Current PS font */
273 PSPEN pen;
274 PSBRUSH brush;
275 PSCOLOR bkColor;
276 PSCOLOR inkColor; /* Last colour set */
277 JOB job;
278 PSDRV_DEVMODEA *Devmode;
279 PRINTERINFO *pi;
280 RECT PageSize; /* Imageable area in device co-ords */
281 int horzRes; /* device caps */
282 int vertRes;
283 int horzSize;
284 int vertSize;
285 int logPixelsX;
286 int logPixelsY;
287 } PSDRV_PDEVICE;
289 typedef struct {
290 PRINTERINFO *pi;
291 PSDRV_DEVMODEA *dlgdm;
292 } PSDRV_DLGINFO;
296 * Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts
299 extern const INT PSDRV_AGLGlyphNamesSize;
300 extern GLYPHNAME PSDRV_AGLGlyphNames[];
304 * The AGL encoding vector
307 extern const INT PSDRV_AGLbyNameSize; /* sorted by name - */
308 extern const UNICODEGLYPH PSDRV_AGLbyName[]; /* duplicates omitted */
310 extern const INT PSDRV_AGLbyUVSize; /* sorted by UV - */
311 extern const UNICODEGLYPH PSDRV_AGLbyUV[]; /* duplicates included */
314 extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
315 LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
316 LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode);
318 extern HANDLE PSDRV_Heap;
319 extern char *PSDRV_ANSIVector[256];
321 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
322 PRINTERINFO *pi);
323 extern BOOL PSDRV_GetFontMetrics(void);
324 extern PPD *PSDRV_ParsePPD(char *fname);
325 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
326 extern const AFM *PSDRV_FindAFMinList(FONTFAMILY *head, LPCSTR name);
327 extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm,
328 BOOL *p_added);
329 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
331 extern BOOL WINAPI PSDRV_Init(HINSTANCE hinst, DWORD reason, LPVOID reserved);
333 extern BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO);
334 extern BOOL PSDRV_SetFont( PSDRV_PDEVICE *physDev );
335 extern BOOL PSDRV_SetPen( PSDRV_PDEVICE *physDev );
337 extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
338 extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
339 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
340 COLORREF wincolor );
341 extern char PSDRV_UnicodeToANSI(int u);
343 extern INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title );
344 extern INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev );
345 extern INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev );
346 extern INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev );
347 extern BOOL PSDRV_WriteMoveTo(PSDRV_PDEVICE *physDev, INT x, INT y);
348 extern BOOL PSDRV_WriteLineTo(PSDRV_PDEVICE *physDev, INT x, INT y);
349 extern BOOL PSDRV_WriteStroke(PSDRV_PDEVICE *physDev);
350 extern BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
351 INT height);
352 extern BOOL PSDRV_WriteRRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
353 INT height);
354 extern BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev);
355 extern BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count);
356 extern BOOL PSDRV_WriteSetPen(PSDRV_PDEVICE *physDev);
357 extern BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h,
358 double ang1, double ang2);
359 extern BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color);
360 extern BOOL PSDRV_WriteSetBrush(PSDRV_PDEVICE *physDev);
361 extern BOOL PSDRV_WriteFill(PSDRV_PDEVICE *physDev);
362 extern BOOL PSDRV_WriteEOFill(PSDRV_PDEVICE *physDev);
363 extern BOOL PSDRV_WriteGSave(PSDRV_PDEVICE *physDev);
364 extern BOOL PSDRV_WriteGRestore(PSDRV_PDEVICE *physDev);
365 extern BOOL PSDRV_WriteNewPath(PSDRV_PDEVICE *physDev);
366 extern BOOL PSDRV_WriteClosePath(PSDRV_PDEVICE *physDev);
367 extern BOOL PSDRV_WriteInitClip(PSDRV_PDEVICE *physDev);
368 extern BOOL PSDRV_WriteClip(PSDRV_PDEVICE *physDev);
369 extern BOOL PSDRV_WriteRectClip(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h);
370 extern BOOL PSDRV_WriteRectClip2(PSDRV_PDEVICE *physDev, CHAR *pszArrayName);
371 extern BOOL PSDRV_WriteEOClip(PSDRV_PDEVICE *physDev);
372 extern BOOL PSDRV_WriteHatch(PSDRV_PDEVICE *physDev);
373 extern BOOL PSDRV_WriteRotate(PSDRV_PDEVICE *physDev, float ang);
374 extern BOOL PSDRV_WriteIndexColorSpaceBegin(PSDRV_PDEVICE *physDev, int size);
375 extern BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev);
376 extern BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number);
377 extern BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst,
378 INT widthDst, INT heightDst, INT widthSrc,
379 INT heightSrc, char *bits);
380 extern BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, int number);
381 extern BOOL PSDRV_WriteDIBits16(PSDRV_PDEVICE *physDev, const WORD *words, int number);
382 extern BOOL PSDRV_WriteDIBits24(PSDRV_PDEVICE *physDev, const BYTE *bits, int number);
383 extern BOOL PSDRV_WriteDIBits32(PSDRV_PDEVICE *physDev, const BYTE *bits, int number);
384 extern int PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPSTR lpData, WORD cch);
385 extern BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits);
386 extern BOOL PSDRV_WriteArrayPut(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nIndex, LONG lCoord);
387 extern BOOL PSDRV_WriteArrayDef(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nSize);
389 extern BOOL PSDRV_Arc( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
390 INT bottom, INT xstart, INT ystart,
391 INT xend, INT yend );
392 extern BOOL PSDRV_Chord( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
393 INT bottom, INT xstart, INT ystart,
394 INT xend, INT yend );
395 extern BOOL PSDRV_Ellipse( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
396 INT bottom );
397 extern INT PSDRV_EndDoc( PSDRV_PDEVICE *physDev );
398 extern INT PSDRV_EndPage( PSDRV_PDEVICE *physDev );
399 extern BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
400 DEVICEFONTENUMPROC proc, LPARAM lp );
401 extern BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
402 const RECT *lprect, LPCWSTR str, UINT count,
403 const INT *lpDx );
404 extern BOOL PSDRV_GetCharWidth( PSDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar,
405 LPINT buffer );
406 extern BOOL PSDRV_GetTextExtentPoint( PSDRV_PDEVICE *physDev, LPCWSTR str, INT count,
407 LPSIZE size );
408 extern BOOL PSDRV_GetTextMetrics( PSDRV_PDEVICE *physDev, TEXTMETRICW *metrics );
409 extern BOOL PSDRV_LineTo( PSDRV_PDEVICE *physDev, INT x, INT y );
410 extern BOOL PSDRV_PatBlt( PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, DWORD
411 dwRop);
412 extern BOOL PSDRV_Pie( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
413 INT bottom, INT xstart, INT ystart,
414 INT xend, INT yend );
415 extern BOOL PSDRV_Polygon( PSDRV_PDEVICE *physDev, const POINT* pt, INT count );
416 extern BOOL PSDRV_Polyline( PSDRV_PDEVICE *physDev, const POINT* pt, INT count );
417 extern BOOL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const INT* counts,
418 UINT polygons );
419 extern BOOL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const DWORD* counts,
420 DWORD polylines );
421 extern BOOL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
422 INT bottom );
423 extern BOOL PSDRV_RoundRect(PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
424 INT bottom, INT ell_width, INT ell_height);
425 extern COLORREF PSDRV_SetBkColor( PSDRV_PDEVICE *physDev, COLORREF color );
426 extern VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev );
427 extern COLORREF PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color );
428 extern COLORREF PSDRV_SetTextColor( PSDRV_PDEVICE *physDev, COLORREF color );
429 extern INT PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOA *doc );
430 extern INT PSDRV_StartPage( PSDRV_PDEVICE *physDev );
431 extern INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst,
432 INT widthDst, INT heightDst, INT xSrc,
433 INT ySrc, INT widthSrc, INT heightSrc,
434 const void *bits, const BITMAPINFO *info,
435 UINT wUsage, DWORD dwRop );
437 extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
438 LPDEVMODEA lpdmOutput,
439 LPSTR lpszDevice, LPSTR lpszPort,
440 LPDEVMODEA lpdmInput, LPSTR lpszProfile,
441 DWORD dwMode);
442 extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
443 LPCSTR lpszPort,
444 WORD fwCapability, LPSTR lpszOutput,
445 LPDEVMODEA lpdm);
446 VOID PSDRV_DrawLine( PSDRV_PDEVICE *physDev );
447 INT PSDRV_GlyphListInit(void);
448 const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName);
449 VOID PSDRV_IndexGlyphList(void);
450 BOOL PSDRV_GetTrueTypeMetrics(void);
451 BOOL PSDRV_GetType1Metrics(void);
452 const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm);
453 SHORT PSDRV_CalcAvgCharWidth(const AFM *afm);
455 #endif