5 * PostScript driver definitions
7 * Copyright 1998 Huw D M Davies
14 #include "wine/wingdi16.h"
17 float llx
, lly
, urx
, ury
;
20 typedef struct _tagAFMLIGS
{
23 struct _tagAFMLIGS
*next
;
26 typedef struct _tagAFMMETRICS
{
27 int C
; /* character */
31 AFMLIGS
*L
; /* Ligatures */
32 struct _tagAFMMETRICS
*next
;
35 typedef struct _tagAFM
{
40 int Weight
; /* FW_NORMAL etc. */
43 float UnderlinePosition
;
44 float UnderlineThickness
;
50 float FullAscender
; /* Ascent of Aring character */
51 float CharWidths
[256];
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
{
63 struct _tagAFMLISTENTRY
*next
;
66 typedef struct _tagFONTFAMILY
{
67 char *FamilyName
; /* family name */
68 AFMLISTENTRY
*afmlist
; /* list of afms for this family */
69 struct _tagFONTFAMILY
*next
; /* next family */
72 extern FONTFAMILY
*PSDRV_AFMFontList
;
74 typedef struct _tagFONTNAME
{
76 struct _tagFONTNAME
*next
;
80 float llx
, lly
, urx
, ury
;
89 typedef struct _tagPAGESIZE
{
92 char *InvocationString
;
93 IMAGEABLEAREA
*ImageableArea
;
94 PAPERDIMENSION
*PaperDimension
;
95 WORD WinPage
; /*eg DMPAPER_A4. Doesn't really belong here */
96 struct _tagPAGESIZE
*next
;
100 typedef struct _tagOPTIONENTRY
{
101 char *Name
; /* eg "True" */
102 char *FullName
; /* eg "Installed" */
103 char *InvocationString
; /* Often NULL */
104 struct _tagOPTIONENTRY
*next
;
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
;
115 typedef struct _tagCONSTRAINT
{
120 struct _tagCONSTRAINT
*next
;
123 typedef struct _tagINPUTSLOT
{
126 char *InvocationString
;
127 WORD WinBin
; /* eg DMBIN_LOWER */
128 struct _tagINPUTSLOT
*next
;
135 int DefaultResolution
;
136 signed int LandscapeOrientation
;
138 char *JCLToPSInterpreter
;
141 FONTNAME
*InstalledFonts
; /* ptr to a list of FontNames */
143 OPTION
*InstalledOptions
;
144 CONSTRAINT
*Constraints
;
145 INPUTSLOT
*InputSlots
;
150 struct _tagdocprivate
{
153 struct _tagdrvprivate
{
154 char ppdFileName
[256]; /* Hack */
155 UINT numInstalledOptions
; /* Options at end of struct */
160 numInstalledOptions of OPTIONs
166 typedef struct _tagPI
{
169 PSDRV_DEVMODEA
*Devmode
;
183 /* def's for PSCOLOR.type */
184 #define PSCOLOR_GRAY 0
185 #define PSCOLOR_RGB 1
202 BOOL set
; /* Have we done a setfont yet */
220 LPSTR output
; /* Output file/port */
221 BOOL banding
; /* Have we received a NEXTBAND */
222 BOOL OutOfPage
; /* Page header not sent yet */
227 PSFONT font
; /* Current PS font */
231 PSCOLOR inkColor
; /* Last colour set */
233 PSDRV_DEVMODEA
*Devmode
;
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
,
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
,
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
,
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
,
280 extern BOOL
PSDRV_WriteRRectangle(DC
*dc
, INT x
, INT y
, INT width
,
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
,
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
,
335 extern BOOL
PSDRV_GetCharWidth( DC
*dc
, UINT firstChar
, UINT lastChar
,
337 extern BOOL
PSDRV_GetTextExtentPoint( DC
*dc
, LPCWSTR str
, INT count
,
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
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
,
350 extern BOOL
PSDRV_PolyPolyline( DC
*dc
, const POINT
* pts
, const DWORD
* counts
,
352 extern BOOL
PSDRV_Rectangle( DC
*dc
, INT left
, INT top
, INT right
,
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
,
374 extern DWORD
PSDRV_DeviceCapabilities(LPSTR lpszDriver
, LPCSTR lpszDevice
,
376 WORD fwCapability
, LPSTR lpszOutput
,
378 VOID
PSDRV_DrawLine( DC
*dc
);