File: utilPs.h

package info (click to toggle)
ted 2.16-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,944 kB
  • ctags: 20,273
  • sloc: ansic: 167,980; makefile: 12,518; sh: 263
file content (140 lines) | stat: -rw-r--r-- 3,777 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#   ifndef	UTIL_PS_H
#   define	UTIL_PS_H

#   include	<stdio.h>
#   include	<sioGeneral.h>
#   include	<geo2DInteger.h>
#   include	<utilDocumentGeometry.h>
#   include	<psFont.h>
#   include	<utilFontEncoding.h>
#   include	<utilPostscriptFace.h>
#   include	<utilAffineTransform.h>
#   include	<utilNup.h>

/************************************************************************/
/*									*/
/*  The state of a printing job.					*/
/*									*/
/************************************************************************/

typedef struct PrintingState
    {
    SimpleOutputStream *	psSos;

    int				psPagesPrinted;
    int				psSheetsPrinted;

    PrintGeometry		psPrintGeometry;
    NupSchema			psNupSchema;
    int				psRotateSheetGrid;

    AffineTransform2D		psCurrentTransform;
    char *			psOrientation;

    DocumentRectangle		psSheetBoundingBox;

    int				psInsideLink;
    int				psLinkParticulesDone;
    int				psLinkRectLeft;

    const char *		psLinkFile;
    int				psLinkFileSize;
    const char *		psLinkMark;
    int				psLinkMarkSize;

    int				psUsePostScriptFilters;
    int				psUsePostScriptIndexedImages;
    } PrintingState;

/************************************************************************/
/*									*/
/*  Routine declarations.						*/
/*									*/
/************************************************************************/

extern void utilPsStartDSCDocument(
			const PrintingState *		ps,
			const PostScriptTypeList *	psfl,
			const char *			title,
			const char *			creatorName,
			const char *			creatorReference );

extern void utilPsRefreshNupSchema(
			PrintingState *			ps,
			const DocumentGeometry *	dgPage );

extern int utilPsSetNupSchema(
			PrintingState *			ps,
			const DocumentGeometry *	dgPage,
			const PrintGeometry *		pg,
			int				hasPageHeader,
			int				hasPageFooter );

extern void appPsPrintString(	SimpleOutputStream *	sos,
				const unsigned char *	s,
				int			len );

extern void utilPsSetFont(	SimpleOutputStream *	sos,
				const char *		prefix,
				const TextAttribute *	ta );

extern void appPsInitPrintingState(	PrintingState *	ps );
extern void appPsCleanPrintingState(	PrintingState *	ps );

extern void utilPsSetRgbColor(	PrintingState *		ps,
				double			r,
				double			g,
				double			b );

extern void utilPsStartPage(	PrintingState *			ps,
				int				documentPage );

extern void utilPsFinishPage(	PrintingState *		ps,
				int			documentPage,
				int			asLast );

extern int utilPsGetNupFactor(	AffineTransform2D *		pAt1Page,
				int *				pRotate,
				const DocumentGeometry *	dgPage,
				const PrintGeometry *		pg );

extern void appPsFontNames(	PrintingState *			ps,
				const PostScriptTypeList *	psfl,
				int				allFonts );

extern int appPsIncludeFonts(	PrintingState *			ps,
				const PostScriptTypeList *	psfl );

extern void appPsWriteEpsHeader(	SimpleOutputStream *	sos,
					const char *		creator,
					const char *		title,
					int			pointsWide,
					int			pointsHigh );

extern void appPsSetPdfmarkEmulation(		SimpleOutputStream *	sos );
extern void appPsSetRectfillEmulation(		SimpleOutputStream *	sos );
extern void appPsSetSelectfontEmulation(	SimpleOutputStream *	sos );

extern void utilPsDefineProcedure(	SimpleOutputStream *	sos,
					const char **		lines,
					int			count );

extern void appPsDefineEpsProcs(	SimpleOutputStream *	sos );

extern void appPsBeginEpsObject(	PrintingState *		ps,
					int			x0Twips,
					int			y0Twips,
					int			llxTwips,
					int			llyTwips,
					int			urxTwips,
					int			uryTwips,
					const unsigned char *	file );

extern void appPsEndEpsObject(		PrintingState *		ps );

extern int utilPsDestPdfmark(		PrintingState *		ps,
					int			lineTop,
					const char *		refName,
					int			refSize );

#   endif	/*  UTIL_PS_H  */