2 * ps.h -- Include file for PostScript routines.
3 * Copyright (C) 1992 Timothy O. Theisen
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 * Author: Tim Theisen Systems Programmer
20 * Internet: tim@cs.wisc.edu Department of Computer Sciences
21 * UUCP: uwvax!tim University of Wisconsin-Madison
22 * Phone: (608)262-0438 1210 West Dayton Street
23 * FAX: (608)262-9777 Madison, WI 53706
34 /* Constants used to index into the bounding box array. */
40 /* Constants used to store keywords that are scanned. */
41 /* NONE is not a keyword, it tells when a field was not set */
43 enum { ATEND = -1, NONE = 0, ASCEND, DESCEND, SPECIAL };
45 #define PSLINELENGTH 257 /* 255 characters + 1 newline + 1 NULL */
48 int epsf; /* Encapsulated PostScript flag. */
49 char *title; /* Title of document. */
50 char *date; /* Creation date. */
51 int pageorder; /* ASCEND, DESCEND, SPECIAL */
52 long beginheader, endheader; /* offsets into file */
53 unsigned int lenheader;
54 long beginpreview, endpreview;
55 unsigned int lenpreview;
56 long begindefaults, enddefaults;
57 unsigned int lendefaults;
58 long beginprolog, endprolog;
59 unsigned int lenprolog;
60 long beginsetup, endsetup;
61 unsigned int lensetup;
62 long begintrailer, endtrailer;
63 unsigned int lentrailer;
65 int default_page_boundingbox[4];
66 int orientation; /* GTK_GS_ORIENTATION_PORTRAIT, GTK_GS_ORIENTATION_LANDSCAPE */
67 int default_page_orientation; /* GTK_GS_ORIENTATION_PORTRAIT, GTK_GS_ORIENTATION_LANDSCAPE */
68 unsigned int numsizes;
70 GtkGSPaperSize *default_page_size;
71 unsigned int numpages;
79 int orientation; /* GTK_GS_ORIENTATION_PORTRAIT, GTK_GS_ORIENTATION_LANDSCAPE */
80 long begin, end; /* offsets into file */
84 /* scans a PostScript file and return a pointer to the document
85 structure. Returns NULL if file does not Conform to commenting
87 struct document *psscan(FILE * fileP, int respect_eof, const gchar * fname);
89 /* free data structure malloc'ed by psscan */
90 void psfree(struct document *);
92 /* Copy a portion of the PostScript file */
93 void pscopy(FILE * from, GtkGSDocSink * to, long begin, long end);
95 /* Copy a portion of the PostScript file upto a comment */
96 char *pscopyuntil(FILE * from, GtkGSDocSink * to, long begin, long end,
99 /* Copy the headers, marked pages, and trailer to fp */
100 void pscopydoc(GtkGSDocSink * dest_file, char *src_filename,
101 struct document *d, int *pagelist);
105 #endif /* __GGV_PS_H__ */