Thu, 13 Mar 2003 07:59:10 +0000
don't use page mode USE_OUTLINES if there are no outline entries.
1 /*
2 * t2p: Create a PDF file from the contents of one or more TIFF
3 * bilevel image files. The images in the resulting PDF file
4 * will be compressed using ITU-T T.6 (G4) fax encoding.
5 *
6 * Semantic routines for spec file parser
7 * $Id: semantics.h,v 1.12 2003/03/12 00:38:04 eric Exp $
8 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. Note that permission is
13 * not granted to redistribute this program under the terms of any
14 * other version of the General Public License.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
24 */
27 typedef struct
28 {
29 double width;
30 double height;
31 } page_size_t;
33 typedef struct
34 {
35 int first;
36 int last;
37 } range_t;
39 typedef struct
40 {
41 double left;
42 double right;
43 double top;
44 double bottom;
45 } crop_t;
47 typedef struct
48 {
49 char *prefix;
50 char style;
51 } page_label_t;
54 typedef enum
55 {
56 INPUT_MODIFIER_ALL,
57 INPUT_MODIFIER_ODD,
58 INPUT_MODIFIER_EVEN,
59 INPUT_MODIFIER_TYPE_COUNT /* must be last */
60 } input_modifier_type_t;
63 typedef struct bookmark_t
64 {
65 struct bookmark_t *next;
66 int level; /* 1 is outermost */
67 char *name;
68 } bookmark_t;
71 extern int line; /* line number in spec file */
72 extern int bookmark_level;
75 /* semantic routines for input statements */
76 void input_push_context (void);
77 void input_pop_context (void);
78 void input_set_modifier_context (input_modifier_type_t type);
79 void input_set_file (char *name);
80 void input_set_rotation (int rotation);
81 void input_set_page_size (page_size_t size);
82 void input_images (range_t range);
84 /* semantic routines for output statements */
85 void output_push_context (void);
86 void output_pop_context (void);
88 void output_set_file (char *name);
89 void output_set_author (char *author);
90 void output_set_creator (char *creator);
91 void output_set_title (char *title);
92 void output_set_subject (char *subject);
93 void output_set_keywords (char *keywords);
95 void output_set_bookmark (char *name);
96 void output_set_page_label (page_label_t label);
97 void output_pages (range_t range);
100 /* functions to be called from main program: */
101 bool parse_spec_file (char *fn);
102 bool process_specs (void);