1 /******************************************************************************
2   Constants.h
3 
4   Change Control:                                                      DDMMYYYY
5     Michael Still    File created                                      08062000
6 
7   Purpose:
8     This file defines some constants that are used in various places
9     throughout the code. If the value GLOBALS is defined, then we are in
10     the one source file which owns the variables
11 ******************************************************************************/
12 
13 // This might cause problems with other people's applications... Email
14 // mikal@stillhq.com and let me know if you have pain...
15 #ifdef HAVE_CONFIG_H
16 #include "config.h"
17 #endif
18 
19 #ifndef PANDA_CONSTANTS_H
20 #define PANDA_CONSTANTS_H 1
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 // The text that we make binary to display in the first 100 bytes or so of the
28 // PDF (forces some FTP clients into binary mode). The function inipanda
29 // actually generates the gBinaryHeaderString string value.
30 #define  panda_magicheaderstring    "%PDF-1.3 "
31 #define  panda_headerstring         "Panda, 2000"
32 #define  panda_binarychar(x)        256 - x
33 
34 #ifndef VERSION
35 #define VERSION "0.5.2d"
36 #endif
37 
38 #if defined GLOBALS
39   char panda_binaryheaderstring[14];
40 #else
41   extern char panda_binaryheaderstring[12];
42 #endif
43 
44   // General values
45   enum
46   {
47     // True and false
48     panda_true = 0,
49     panda_false,
50 
51     // We sometimes need to specify what type of value we are passing to a
52     // function. These are the supported types.
53     panda_brackettedtextvalue,
54     panda_dictionaryvalue,
55     panda_integervalue,
56     panda_textvalue,
57     panda_literaltextvalue,
58     panda_objectvalue,
59     panda_objectarrayvalue,
60     panda_booleanvalue,
61     panda_doublevalue,
62 
63     // Up and down movement for the traversal functions
64     panda_up,
65     panda_down,
66 
67     // File modes for the PDF object
68     panda_write,
69     panda_writelinear,
70 
71     // We have the concept of placeholder objects, that do not get written out to
72     // the PDF
73     panda_placeholder,
74     panda_normal
75   };
76 
77 // Standard page sizes -- these are expressed in inches, with 72 dots per inch
78 // with no fractional values shown. As many values as needed can be added here
79 #define  panda_pagesize_a4                "[0 0 594 841]"
80 #define  panda_pagesize_usletter          "[0 0 612 792]"
81 
82 // The text drawing modes (p 343 v 1.3)
83   enum
84   {
85     panda_textmode_normal = 0,
86     panda_textmode_outline,
87     panda_textmode_filledoutline,
88     panda_textmode_invisible,
89     panda_textmode_filledclipped,
90     panda_textmode_strokedclipped,
91     panda_textmode_filledstrokedclipped,
92     panda_textmode_clipped
93   };
94 
95 // The line cap styles (p 139 v 1.3 II)
96   enum
97   {
98     panda_linecap_butt = 0,
99     panda_linecap_round,
100     panda_linecap_projectedsquare,
101     panda_linecap_max		// Not in the spec!
102   };
103 
104 // The line join styles (p 140 v 1.3 II)
105   enum
106   {
107     panda_linejoin_miter = 0,
108     panda_linejoin_round,
109     panda_linejoin_bevel,
110     panda_linejoin_max		// Not in the spec!
111   };
112 
113 // The image types supported
114   enum
115   {
116     panda_image_tiff = 0,
117     panda_image_jpeg,
118     panda_image_png
119   };
120 
121 // The display modes that the viewer window can be asked to conform to
122   enum
123   {
124     panda_window_usenone = 0,
125     panda_window_useoutlines,
126     panda_window_usethumbs
127   };
128 
129 // Possible text directions (for reading the document)
130   enum
131   {
132     panda_textdirection_l2r = 0,
133     panda_textdirection_r2l
134   };
135 
136 // Possible page transition effects
137   enum
138   {
139     panda_pagetrans_split_yi = 0,
140     panda_pagetrans_split_yo,
141     panda_pagetrans_split_xi,
142     panda_pagetrans_split_xo,
143     panda_pagetrans_blinds_y,
144     panda_pagetrans_blinds_x,
145     panda_pagetrans_box_i,
146     panda_pagetrans_box_o,
147     panda_pagetrans_wipe_0,
148     panda_pagetrans_wipe_90,
149     panda_pagetrans_wipe_180,
150     panda_pagetrans_wipe_270,
151     panda_pagetrans_dissolve,
152     panda_pagetrans_glitter_0,
153     panda_pagetrans_glitter_270,
154     panda_pagetrans_glitter_315,
155     panda_pagetrans_none
156   };
157 
158 // Possible annotation icons
159   enum
160   {
161     panda_icon_comment = 0,
162     panda_icon_help,
163     panda_icon_insert,
164     panda_icon_key,
165     panda_icon_newparagraph,
166     panda_icon_note,
167     panda_icon_paragraph
168   };
169 
170 // Flags on annotation objects (these are bit fields to be OR'ed)
171   enum
172   {
173     panda_annotationflag_invisible = 1,
174     panda_annotationflag_hidden = 2,
175     panda_annotationflag_print = 4,
176     panda_annotationflag_nozoom = 8,
177     panda_annotationflag_norotate = 16,
178     panda_annotationflag_noview = 32,
179     panda_annotationflag_readonly = 64
180   };
181 
182 // Properties that might be held by objects -- panda_const_properties
183   enum
184   {
185     panda_object_property_compress = 0,
186     panda_object_property_compress_level,
187     panda_object_property_ignorepageerrors,
188     panda_object_property_binarystreamfile,
189     panda_object_property_layoutstreamfile,
190     panda_object_property_max
191   };
192 
193 // Scopes of properties
194   enum
195   {
196     panda_scope_cascade = 0,
197     panda_scope_local
198   };
199 
200   // Justifcation/Horiz Alignment Types
201   enum
202   {
203     panda_halign_left = 1,
204     panda_halign_right,
205     panda_halign_center,
206     panda_halign_justify
207   };
208 
209   // Vertical alignment types
210   enum
211   {
212     panda_valign_top = 1,
213     panda_valign_bottom,
214     panda_valign_middle
215   };
216 
217 #if defined _WINDOWS
218   // The abstraction types that we use
219   enum
220   {
221     windows_panda_abs_pdf = 0,
222     windows_panda_abs_page,
223     windows_panda_abs_font,
224 
225     windows_panda_abs_max
226   };
227 
228 #endif				/*
229 				 */
230   // Sometimes we need PI
231 #define panda_pi 3.1415926535
232 // The default compression level
233 #define panda_default_compress_level 6
234 #ifdef __cplusplus
235 }
236 #endif
237 
238 #endif				/* PANDA_CONSTANTS_H */
239