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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
# ifndef APP_PS_H
# define APP_PS_H
# include <stdio.h>
# include <appGeo.h>
# include <docFont.h>
# include <psFont.h>
# include <utilFontEncoding.h>
# include <utilPostscriptFace.h>
/************************************************************************/
/* */
/* The state of a printing job. */
/* */
/************************************************************************/
typedef struct NupTransform
{
double ntAxx;
double ntAxy;
double ntAyx;
double ntAyy;
double ntTx;
double ntTy;
} NupTransform;
# define NUP_X( x, y, nt ) \
( (nt)->ntAxx* (x)+ (nt)->ntAyx* (y)+ (nt)->ntTx )
# define NUP_Y( x, y, nt ) \
( (nt)->ntAxy* (x)+ (nt)->ntAyy* (y)+ (nt)->ntTy )
typedef struct PrintingState
{
FILE * psFile;
int psCurrentPhysicalFont;
int psPagesPrinted;
int psSheetsPrinted;
NupTransform psTransform;
NupTransform psCurrentTransform;
DocumentGeometry psPrinterGeometry;
char * psOrientation;
int psRotated;
DocumentRectangle psSheetBoundingBox;
int psNup;
NupTransform * psNupTransforms;
int psInsideLink;
int psUseLinkColor;
int psLinkParticulesDone;
int psLinkRectLeft;
int psCurrentColor;
# define PScolorNONE -1
# define PScolorTEXT 1
# define PScolorLINK 2
const char * psLinkFile;
int psLinkFileSize;
const char * psLinkMark;
int psLinkMarkSize;
int psEncodingDefined[ENCODINGps_COUNT];
} PrintingState;
/************************************************************************/
/* */
/* Geometry specifications for a print job. */
/* */
/************************************************************************/
typedef struct PrintGeometry
{
DocumentGeometry pgSheetGeometry;
int pgRotate90;
int pgCenterHorizontally;
int pgNup;
int pgHorizontal;
} PrintGeometry;
/************************************************************************/
/* */
/* Routine declarations. */
/* */
/************************************************************************/
extern void utilPsInitPrintGeometry( PrintGeometry * pg );
extern void utilPsStartDSCDocument(
const PrintingState * ps,
const PostScriptFaceList * psfl,
const char * title,
const char * creatorName,
const char * creatorReference );
extern int appPsSetNup( PrintingState * ps,
const DocumentGeometry * dgPage,
const PrintGeometry * pg,
int hasPageHeader,
int hasPageFooter );
extern void appPsPrintString( FILE * f,
const unsigned char * s,
int len );
extern void appPsSetFont( FILE * f,
const char * prefix,
TextAttribute ta );
extern void appPsInitPrintingState( PrintingState * ps );
extern void appPsCleanPrintingState( PrintingState * ps );
extern void utilPsSetLinkColor( PrintingState * ps );
extern void utilPsSetTextColor( PrintingState * ps );
extern void appPsStartPage( PrintingState * ps,
int documentPage );
extern void utilPsFinishPage( PrintingState * ps,
int documentPage,
int asLast );
extern int utilPsGetNupFactor( double * pFac,
int * pRotate,
int * pXShift,
int * pYShift,
const DocumentGeometry * dgPage,
const PrintGeometry * pg );
extern void appPsFontNames( FILE * f,
const PostScriptFaceList * psfl,
int * encodingDefined,
int allFonts );
extern void appPsListFontNames( FILE * f,
const PostScriptFaceList * psfl );
extern void appPsDefineFontEncoding( FILE * f,
const char * name,
const char * const * glyphNames );
extern void appPsWriteEpsHeader( FILE * f,
const char * creator,
const char * title,
int pointsWide,
int pointsHigh );
extern void appPsSetPdfmarkEmulation( FILE * f );
extern void appPsSetRectfillEmulation( FILE * f );
extern void appPsSetSelectfontEmulation( FILE * f );
extern void utilPsDefineProcedure( FILE * f,
const char ** lines,
int count );
extern void appPsDefineEpsProcs( FILE * f );
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 void utilPsFoldComment( FILE * f,
const char * name,
const char * value );
extern int utilPsDestPdfmark( PrintingState * ps,
int lineTop,
const char * refName,
int refSize );
# endif /* APP_PS_H */
|