1 /*
2 **
3 ** main_resources.h
4 **
5 ** Copyright (C) 1995, 1996, 1997 Johannes Plass
6 ** Copyright (C) 2004 Jose E. Marchesi
7 **
8 ** This program is free software; you can redistribute it and/or modify
9 ** it under the terms of the GNU General Public License as published by
10 ** the Free Software Foundation; either version 3 of the License, or
11 ** (at your option) any later version.
12 **
13 ** This program is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ** GNU General Public License for more details.
17 **
18 ** You should have received a copy of the GNU General Public License
19 ** along with GNU gv; see the file COPYING.  If not, write to
20 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ** Boston, MA 02111-1307, USA.
22 **
23 ** Author:   Johannes Plass (plass@thep.physik.uni-mainz.de)
24 **           Department of Physics
25 **           Johannes Gutenberg-University
26 **           Mainz, Germany
27 **
28 **           Jose E. Marchesi (jemarch@gnu.org)
29 **           GNU Project
30 **
31 */
32 
33 #ifndef _GV_MAIN_RESOURCES_H_
34 #define _GV_MAIN_RESOURCES_H_
35 
36 /* Application resources */
37 
38 typedef struct _AppResources {
39     Boolean	auto_center;		/* whether to automatically center the page */
40     int		scale;		        /* default scale */
41     int		scale_base;		/* default scale base */
42     String      default_orientation;	/* default orientation */
43     String      fallback_orientation;	/* fallback orientation */
44     String	page;			/* first page to show */
45     String	default_pagemedia;	/* default page media */
46     String	fallback_pagemedia;	/* fallback page media */
47     Boolean	swap_landscape;		/* Landscape comment maps to Seascape */
48     String	scratch_dir;		/* temporary directory */
49     String	default_save_dir;	/* default directory for saving */
50     Boolean	confirm_print;		/* popup dialog on print attempt */
51     String	version;		/* ghostview version identifier*/
52     String	maximum_width;		/* maximum width of the application*/
53     String	maximum_height;		/* maximum height of the application*/
54     int		minimum_width;		/* minimum width of the application*/
55     int		minimum_height;		/* minimum height of the application*/
56     Boolean	auto_resize;		/* should we try to fit the window size to the page size */
57     Pixmap	document_bitmap;
58     Pixmap	selected_bitmap;
59     Pixmap	mark_odd_bitmap;
60     Pixmap	mark_even_bitmap;
61     Pixmap	mark_current_bitmap;
62     Pixmap	mark_unmark_bitmap;
63     Pixmap	mark_empty_bitmap;
64     String	locator_format;
65     Boolean	antialias;
66     String	mag_menu;
67     Boolean	reverse_scrolling;
68     Boolean	scrolling_eye_guide;
69     Boolean	respect_dsc;
70     int		confirm_quit;
71     Boolean	ignore_eof;
72     Boolean	watch_file;
73     int         watch_file_frequency;
74     String      style;
75     String      ad;
76     String      misc_menu;
77     int         title_style;
78     Boolean     filename_as_title;
79     Boolean     use_bpixmap;
80 } AppResources;
81 
82 #ifdef _GV_MAIN_C_
83 #  define DECLARE_STRING(aaa) \
84       static char n_ ## aaa[] = #aaa; \
85       char * s_ ## aaa = n_ ## aaa;
86 #else
87 #  define DECLARE_STRING(aaa) \
88       extern char * s_ ## aaa;
89 #endif
90 
91 DECLARE_STRING(miscMenuEntries)
92 DECLARE_STRING(medias)
93 DECLARE_STRING(scales)
94 DECLARE_STRING(printCommand)
95 DECLARE_STRING(uncompressCommand)
96 
97 DECLARE_STRING(gsInterpreter)
98 DECLARE_STRING(gsCmdScanPDF)
99 DECLARE_STRING(gsCmdConvPDF)
100 DECLARE_STRING(gsX11Device)
101 DECLARE_STRING(gsX11AlphaDevice)
102 DECLARE_STRING(gsArguments)
103 DECLARE_STRING(gsSafeDir)
104 DECLARE_STRING(gsSafer)
105 DECLARE_STRING(gsQuiet)
106 
107 DECLARE_STRING(infoVerbose)
108 DECLARE_STRING(autoCenter)
109 DECLARE_STRING(scale)
110 DECLARE_STRING(scaleBase)
111 DECLARE_STRING(orientation)
112 DECLARE_STRING(fallbackOrientation)
113 DECLARE_STRING(page)
114 DECLARE_STRING(pageMedia)
115 DECLARE_STRING(fallbackPageMedia)
116 DECLARE_STRING(swapLandscape)
117 DECLARE_STRING(scratchDir)
118 DECLARE_STRING(defaultSaveDir)
119 DECLARE_STRING(confirmPrint)
120 DECLARE_STRING(version)
121 DECLARE_STRING(autoResize)
122 DECLARE_STRING(maximumWidth)
123 DECLARE_STRING(maximumHeight)
124 DECLARE_STRING(minimumWidth)
125 DECLARE_STRING(minimumHeight)
126 DECLARE_STRING(selectedBitmap)
127 DECLARE_STRING(documentBitmap)
128 DECLARE_STRING(toggleOddBitmap)
129 DECLARE_STRING(toggleEvenBitmap)
130 DECLARE_STRING(toggleCurrentBitmap)
131 DECLARE_STRING(unmarkAllBitmap)
132 DECLARE_STRING(markEmptyBitmap)
133 DECLARE_STRING(locatorFormat)
134 DECLARE_STRING(antialias)
135 DECLARE_STRING(magMenu)
136 DECLARE_STRING(reverseScrolling)
137 DECLARE_STRING(scrollingEyeGuide)
138 DECLARE_STRING(respectDSC)
139 DECLARE_STRING(confirmQuit)
140 DECLARE_STRING(ignoreEOF)
141 DECLARE_STRING(watchFile)
142 DECLARE_STRING(watchFileFrequency)
143 DECLARE_STRING(style)
144 DECLARE_STRING(ad)
145 DECLARE_STRING(miscMenu)
146 DECLARE_STRING(titleStyle)
147 DECLARE_STRING(useBackingPixmap)
148 
149 /*-------------------------------------------------------------*/
150 
151 #ifdef _GV_MAIN_C_
152 
153 #define GV_DEFAULT_VERSION "?"
154 
155 static XtResource resources[] = {
156   {n_autoCenter,n_autoCenter, XtRBoolean, sizeof(Boolean),
157    XtOffsetOf(AppResources, auto_center), XtRImmediate, (XtPointer)True},
158   {n_scale, n_scale, XtRInt, sizeof(int),
159    XtOffsetOf(AppResources, scale), XtRImmediate, (XtPointer)0},
160   {n_scaleBase, n_scaleBase, XtRInt, sizeof(int),
161    XtOffsetOf(AppResources, scale_base), XtRImmediate, (XtPointer)1},
162   {n_orientation, n_orientation, XtRString, sizeof(String),
163    XtOffsetOf(AppResources, default_orientation), XtRImmediate, "Automatic"},
164   {n_fallbackOrientation, n_fallbackOrientation, XtRString, sizeof(String),
165    XtOffsetOf(AppResources, fallback_orientation), XtRImmediate, "Portrait"},
166   {n_page, n_page, XtRString, sizeof(String),
167    XtOffsetOf(AppResources, page), XtRImmediate, NULL},
168   {n_pageMedia, n_pageMedia, XtRString, sizeof(String),
169    XtOffsetOf(AppResources, default_pagemedia), XtRImmediate, "Automatic"},
170   {n_fallbackPageMedia, n_fallbackPageMedia, XtRString, sizeof(String),
171    XtOffsetOf(AppResources, fallback_pagemedia), XtRImmediate, "A4"},
172   {n_swapLandscape, n_swapLandscape, XtRBoolean, sizeof(Boolean),
173    XtOffsetOf(AppResources, swap_landscape), XtRImmediate, (XtPointer)False},
174   {n_scratchDir, n_scratchDir, XtRString, sizeof(String),
175    XtOffsetOf(AppResources, scratch_dir), XtRImmediate,"?"},
176   {n_defaultSaveDir, n_defaultSaveDir, XtRString, sizeof(String),
177    XtOffsetOf(AppResources, default_save_dir), XtRImmediate,"?"},
178   {n_confirmPrint, n_confirmPrint, XtRBoolean, sizeof(Boolean),
179    XtOffsetOf(AppResources, confirm_print), XtRImmediate, (XtPointer)True},
180   {n_version, n_version, XtRString, sizeof(String),
181    XtOffsetOf(AppResources, version), XtRImmediate,GV_DEFAULT_VERSION},
182   {n_autoResize, n_autoResize, XtRBoolean, sizeof(Boolean),
183    XtOffsetOf(AppResources, auto_resize), XtRImmediate, (XtPointer)True},
184   {n_maximumWidth, n_maximumWidth, XtRString, sizeof(String),
185    XtOffsetOf(AppResources, maximum_width), XtRImmediate, (XtPointer)"screen-20"},
186   {n_maximumHeight, n_maximumHeight, XtRString, sizeof(String),
187    XtOffsetOf(AppResources, maximum_height), XtRImmediate, (XtPointer)"screen-44"},
188   {n_minimumWidth, n_minimumWidth, XtRInt, sizeof(int),
189    XtOffsetOf(AppResources, minimum_width), XtRImmediate, (XtPointer)400},
190   {n_minimumHeight, n_minimumHeight, XtRInt, sizeof(int),
191    XtOffsetOf(AppResources, minimum_height), XtRImmediate, (XtPointer)400},
192   {n_selectedBitmap, n_selectedBitmap, XtRBitmap, sizeof(Pixmap),
193    XtOffsetOf(AppResources,selected_bitmap), XtRImmediate, (XtPointer)None},
194   {n_documentBitmap, n_documentBitmap, XtRBitmap, sizeof(Pixmap),
195    XtOffsetOf(AppResources,document_bitmap), XtRImmediate, (XtPointer)None},
196   {n_toggleOddBitmap, n_toggleOddBitmap, XtRBitmap, sizeof(Pixmap),
197    XtOffsetOf(AppResources,mark_odd_bitmap), XtRImmediate, (XtPointer)None},
198   {n_toggleEvenBitmap, n_toggleEvenBitmap, XtRBitmap, sizeof(Pixmap),
199    XtOffsetOf(AppResources,mark_even_bitmap), XtRImmediate, (XtPointer)None},
200   {n_toggleCurrentBitmap, n_toggleCurrentBitmap, XtRBitmap, sizeof(Pixmap),
201    XtOffsetOf(AppResources,mark_current_bitmap), XtRImmediate, (XtPointer)None},
202   {n_unmarkAllBitmap, n_unmarkAllBitmap, XtRBitmap, sizeof(Pixmap),
203    XtOffsetOf(AppResources,mark_unmark_bitmap), XtRImmediate, (XtPointer)None},
204   {n_markEmptyBitmap, n_markEmptyBitmap, XtRBitmap, sizeof(Pixmap),
205    XtOffsetOf(AppResources,mark_empty_bitmap), XtRImmediate, (XtPointer)None},
206   {n_locatorFormat, n_locatorFormat, XtRString, sizeof(String),
207    XtOffsetOf(AppResources,locator_format),   XtRImmediate, (XtPointer)"%d x %d"},
208   {n_antialias, n_antialias, XtRBoolean, sizeof(Boolean),
209    XtOffsetOf(AppResources, antialias), XtRImmediate, (XtPointer)False},
210   {n_magMenu, n_magMenu, XtRString, sizeof(String),
211    XtOffsetOf(AppResources,mag_menu), XtRImmediate, (XtPointer)NULL},
212   {n_reverseScrolling, n_reverseScrolling, XtRBoolean, sizeof(Boolean),
213    XtOffsetOf(AppResources, reverse_scrolling), XtRImmediate, (XtPointer)False},
214   {n_scrollingEyeGuide, n_scrollingEyeGuide, XtRBoolean, sizeof(Boolean),
215    XtOffsetOf(AppResources, scrolling_eye_guide), XtRImmediate, (XtPointer)True},
216   {n_respectDSC, n_respectDSC, XtRBoolean, sizeof(Boolean),
217    XtOffsetOf(AppResources, respect_dsc), XtRImmediate, (XtPointer)True},
218   {n_confirmQuit, n_confirmQuit, XtRInt, sizeof(int),
219    XtOffsetOf(AppResources, confirm_quit), XtRImmediate, (XtPointer)1},  /* 0=never,1=when processing,2=always */
220   {n_ignoreEOF, n_ignoreEOF, XtRBoolean, sizeof(Boolean),
221    XtOffsetOf(AppResources,  ignore_eof), XtRImmediate, (XtPointer)True},
222   {n_watchFile, n_watchFile, XtRBoolean, sizeof(Boolean),
223    XtOffsetOf(AppResources,  watch_file), XtRImmediate, (XtPointer)False},
224   {n_watchFileFrequency, n_watchFileFrequency, XtRInt, sizeof(int),
225    XtOffsetOf(AppResources, watch_file_frequency), XtRImmediate, (XtPointer)1000},
226   {n_style, n_style, XtRString, sizeof(String),
227    XtOffsetOf(AppResources, style), XtRImmediate,(XtPointer)""},
228   {n_ad, n_ad, XtRString, sizeof(String),
229    XtOffsetOf(AppResources, ad), XtRImmediate,(XtPointer)""},
230   {n_miscMenu, n_miscMenu, XtRString, sizeof(String),
231    XtOffsetOf(AppResources, misc_menu), XtRImmediate,"update"},
232   {n_titleStyle, n_titleStyle, XtRInt, sizeof(int),
233    XtOffsetOf(AppResources, title_style), XtRImmediate, (XtPointer)1},
234   {n_useBackingPixmap,n_useBackingPixmap, XtRBoolean, sizeof(Boolean),
235    XtOffsetOf(AppResources, use_bpixmap), XtRImmediate, (XtPointer)True},
236 };
237 
238 #endif /* _GV_MAIN_C_ */
239 /*-------------------------------------------------------------*/
240 
241 
242 /*-------------------------------------------------------------*/
243 
244 #endif /* _GV_MAIN_RESOURCES_H_ */
245