5 * PostScript driver definitions
7 * Copyright 1998 Huw D M Davies
15 float llx
, lly
, urx
, ury
;
18 typedef struct _tagAFMLIGS
{
21 struct _tagAFMLIGS
*next
;
24 typedef struct _tagAFMMETRICS
{
25 int C
; /* character */
29 AFMLIGS
*L
; /* Ligatures */
30 struct _tagAFMMETRICS
*next
;
33 typedef struct _tagAFM
{
38 int Weight
; /* FW_NORMAL etc. */
41 float UnderlinePosition
;
42 float UnderlineThickness
;
48 float FullAscender
; /* Ascent of Aring character */
49 float CharWidths
[256];
52 } AFM
; /* CharWidths is a shortcut to the WX values of numbered glyphs */
54 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
55 one list to exist without having to reallocate the entire AFM structure. We
56 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
57 fonts for each DC (dc->physDev->Fonts) */
59 typedef struct _tagAFMLISTENTRY
{
61 struct _tagAFMLISTENTRY
*next
;
64 typedef struct _tagFONTFAMILY
{
65 char *FamilyName
; /* family name */
66 AFMLISTENTRY
*afmlist
; /* list of afms for this family */
67 struct _tagFONTFAMILY
*next
; /* next family */
70 extern FONTFAMILY
*PSDRV_AFMFontList
;
72 typedef struct _tagFONTNAME
{
74 struct _tagFONTNAME
*next
;
78 float llx
, lly
, urx
, ury
;
85 typedef struct _tagPAGESIZE
{
88 char *InvocationString
;
89 IMAGEABLEAREA
*ImageableArea
;
90 PAPERDIMENSION
*PaperDimension
;
91 WORD WinPage
; /*eg DMPAPER_A4. Doesn't really belong here */
92 struct _tagPAGESIZE
*next
;
96 typedef struct _tagOPTIONENTRY
{
97 char *Name
; /* eg "True" */
98 char *FullName
; /* eg "Installed" */
99 char *InvocationString
; /* Often NULL */
100 struct _tagOPTIONENTRY
*next
;
103 typedef struct _tagOPTION
{ /* Treat bool as a special case of pickone */
104 char *OptionName
; /* eg "*Option1" */
105 char *FullName
; /* eg "Envelope Feeder" */
106 char *DefaultOption
; /* eg "False" */
107 OPTIONENTRY
*Options
;
108 struct _tagOPTION
*next
;
111 typedef struct _tagCONSTRAINT
{
116 struct _tagCONSTRAINT
*next
;
119 typedef struct _tagINPUTSLOT
{
122 char *InvocationString
;
123 WORD WinBin
; /* eg DMBIN_LOWER */
124 struct _tagINPUTSLOT
*next
;
131 int DefaultResolution
;
132 signed int LandscapeOrientation
;
134 char *JCLToPSInterpreter
;
137 FONTNAME
*InstalledFonts
; /* ptr to a list of FontNames */
139 OPTION
*InstalledOptions
;
140 CONSTRAINT
*Constraints
;
141 INPUTSLOT
*InputSlots
;
146 struct _tagdocprivate
{
148 struct _tagdrvprivate
{
149 char ppdFileName
[100]; /* Hack */
150 UINT32 numInstalledOptions
; /* Options at end of struct */
155 numInstalledOptions of OPTIONs
161 typedef struct _tagPI
{
164 PSDRV_DEVMODE16
*Devmode
;
178 /* def's for PSCOLOR.type */
179 #define PSCOLOR_GRAY 0
180 #define PSCOLOR_RGB 1
197 BOOL32 set
; /* Have we done a setfont yet */
214 LPSTR output
; /* Output file/port */
215 BOOL32 banding
; /* Have we received a NEXTBAND */
216 BOOL32 NeedPageHeader
; /* Page header not sent yet */
221 PSFONT font
; /* Current PS font */
225 PSCOLOR inkColor
; /* Last colour set */
227 PSDRV_DEVMODE16
*Devmode
;
231 extern HANDLE32 PSDRV_Heap
;
232 extern char *PSDRV_ANSIVector
[256];
234 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16
*dm1
, PSDRV_DEVMODE16
*dm2
,
236 extern BOOL32
PSDRV_GetFontMetrics(void);
237 extern PPD
*PSDRV_ParsePPD(char *fname
);
238 extern PRINTERINFO
*PSDRV_FindPrinterInfo(LPCSTR name
);
239 extern AFM
*PSDRV_FindAFMinList(FONTFAMILY
*head
, char *name
);
240 extern void PSDRV_AddAFMtoList(FONTFAMILY
**head
, AFM
*afm
);
241 extern void PSDRV_FreeAFMList( FONTFAMILY
*head
);
243 extern BOOL32
PSDRV_Init(void);
244 extern HFONT16
PSDRV_FONT_SelectObject( DC
*dc
, HFONT16 hfont
, FONTOBJ
*font
);
245 extern HPEN32
PSDRV_PEN_SelectObject( DC
* dc
, HPEN32 hpen
, PENOBJ
* pen
);
246 extern HBRUSH32
PSDRV_BRUSH_SelectObject( DC
* dc
, HBRUSH32 hbrush
,
249 extern BOOL32
PSDRV_Brush(DC
*dc
, BOOL32 EO
);
250 extern BOOL32
PSDRV_SetFont( DC
*dc
);
251 extern BOOL32
PSDRV_SetPen( DC
*dc
);
253 extern BOOL32
PSDRV_CmpColor(PSCOLOR
*col1
, PSCOLOR
*col2
);
254 extern BOOL32
PSDRV_CopyColor(PSCOLOR
*col1
, PSCOLOR
*col2
);
255 extern void PSDRV_CreateColor( PSDRV_PDEVICE
*physDev
, PSCOLOR
*pscolor
,
259 extern INT32
PSDRV_WriteHeader( DC
*dc
, char *title
, int len
);
260 extern INT32
PSDRV_WriteFooter( DC
*dc
);
261 extern INT32
PSDRV_WriteNewPage( DC
*dc
);
262 extern INT32
PSDRV_WriteEndPage( DC
*dc
);
263 extern BOOL32
PSDRV_WriteMoveTo(DC
*dc
, INT32 x
, INT32 y
);
264 extern BOOL32
PSDRV_WriteLineTo(DC
*dc
, INT32 x
, INT32 y
);
265 extern BOOL32
PSDRV_WriteStroke(DC
*dc
);
266 extern BOOL32
PSDRV_WriteRectangle(DC
*dc
, INT32 x
, INT32 y
, INT32 width
,
268 extern BOOL32
PSDRV_WriteSetFont(DC
*dc
, BOOL32 UseANSI
);
269 extern BOOL32
PSDRV_WriteShow(DC
*dc
, char *str
, INT32 count
);
270 extern BOOL32
PSDRV_WriteReencodeFont(DC
*dc
);
271 extern BOOL32
PSDRV_WriteSetPen(DC
*dc
);
272 extern BOOL32
PSDRV_WriteArc(DC
*dc
, INT32 x
, INT32 y
, INT32 w
, INT32 h
,
273 double ang1
, double ang2
);
274 extern BOOL32
PSDRV_WriteSetColor(DC
*dc
, PSCOLOR
*color
);
275 extern BOOL32
PSDRV_WriteSetBrush(DC
*dc
);
276 extern BOOL32
PSDRV_WriteFill(DC
*dc
);
277 extern BOOL32
PSDRV_WriteEOFill(DC
*dc
);
278 extern BOOL32
PSDRV_WriteGSave(DC
*dc
);
279 extern BOOL32
PSDRV_WriteGRestore(DC
*dc
);
280 extern BOOL32
PSDRV_WriteClosePath(DC
*dc
);
281 extern BOOL32
PSDRV_WriteClip(DC
*dc
);
282 extern BOOL32
PSDRV_WriteEOClip(DC
*dc
);
283 extern BOOL32
PSDRV_WriteHatch(DC
*dc
);
284 extern BOOL32
PSDRV_WriteRotate(DC
*dc
, float ang
);
290 extern BOOL32
PSDRV_Arc( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
291 INT32 bottom
, INT32 xstart
, INT32 ystart
,
292 INT32 xend
, INT32 yend
);
293 extern BOOL32
PSDRV_Chord( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
294 INT32 bottom
, INT32 xstart
, INT32 ystart
,
295 INT32 xend
, INT32 yend
);
296 extern BOOL32
PSDRV_Ellipse( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
298 extern BOOL32
PSDRV_EnumDeviceFonts( DC
* dc
, LPLOGFONT16 plf
,
299 DEVICEFONTENUMPROC proc
, LPARAM lp
);
300 extern INT32
PSDRV_Escape( DC
*dc
, INT32 nEscape
, INT32 cbInput
,
301 SEGPTR lpInData
, SEGPTR lpOutData
);
302 extern BOOL32
PSDRV_ExtTextOut( DC
*dc
, INT32 x
, INT32 y
, UINT32 flags
,
303 const RECT32
*lprect
, LPCSTR str
, UINT32 count
,
305 extern BOOL32
PSDRV_GetCharWidth( DC
*dc
, UINT32 firstChar
, UINT32 lastChar
,
307 extern BOOL32
PSDRV_GetTextExtentPoint( DC
*dc
, LPCSTR str
, INT32 count
,
309 extern BOOL32
PSDRV_GetTextMetrics( DC
*dc
, TEXTMETRIC32A
*metrics
);
310 extern BOOL32
PSDRV_LineTo( DC
*dc
, INT32 x
, INT32 y
);
311 extern BOOL32
PSDRV_MoveToEx( DC
*dc
, INT32 x
, INT32 y
, LPPOINT32 pt
);
312 extern BOOL32
PSDRV_Pie( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
313 INT32 bottom
, INT32 xstart
, INT32 ystart
,
314 INT32 xend
, INT32 yend
);
315 extern BOOL32
PSDRV_Polygon( DC
*dc
, const POINT32
* pt
, INT32 count
);
316 extern BOOL32
PSDRV_Polyline( DC
*dc
, const POINT32
* pt
, INT32 count
);
317 extern BOOL32
PSDRV_PolyPolygon( DC
*dc
, const POINT32
* pts
, const INT32
* counts
,
319 extern BOOL32
PSDRV_PolyPolyline( DC
*dc
, const POINT32
* pts
, const DWORD
* counts
,
321 extern BOOL32
PSDRV_Rectangle( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
323 extern BOOL32
PSDRV_RoundRect(DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
324 INT32 bottom
, INT32 ell_width
, INT32 ell_height
);
325 extern HGDIOBJ32
PSDRV_SelectObject( DC
*dc
, HGDIOBJ32 handle
);
326 extern COLORREF
PSDRV_SetBkColor( DC
*dc
, COLORREF color
);
327 extern COLORREF
PSDRV_SetPixel( DC
*dc
, INT32 x
, INT32 y
, COLORREF color
);
328 extern COLORREF
PSDRV_SetTextColor( DC
*dc
, COLORREF color
);
329 extern INT32
PSDRV_StretchDIBits( DC
*dc
, INT32 xDst
, INT32 yDst
,
330 INT32 widthDst
, INT32 heightDst
, INT32 xSrc
,
331 INT32 ySrc
, INT32 widthSrc
, INT32 heightSrc
,
332 const void *bits
, const BITMAPINFO
*info
,
333 UINT32 wUsage
, DWORD dwRop
);