1 #ifndef MAIN_H
2 #define MAIN_H
3 
4 int		first = 1; /* TRUE if this is first image or after fullscreen or iconifying */
5 char		infotext[BUF_LEN];
6 GMainLoop	*qiv_main_loop;
7 gint		screen_x, screen_y; /* Size of the screen in pixels */
8 gint            num_monitors;
9 GdkScreen       *screen;
10 GdkRectangle    *monitor;
11 
12 GdkColormap	*cmap; /* global colormap */
13 char		*image_bg_spec = IMAGE_BG;
14 GdkColor	image_bg; /* default background */
15 GdkColor	text_bg; /* statusbar and help background */
16 GdkColor	error_bg; /* for the error window/screen */
17 GdkColor	comment_bg; /* comment background */
18 int		images;	/* Number of images in current collection */
19 char		**image_names = NULL; /* Filenames of the images */
20 int		image_idx = 0; /* Index of current image displayed. 0 = 1st image */
21 int		max_image_cnt = 0; /* # images currently allocated into arrays */
22 time_t          current_mtime; /* modification time of file currently loaded */
23 qiv_deletedfile *deleted_files;
24 int		delete_idx;
25 char    select_dir[FILENAME_LEN];
26 char    *comment=NULL;
27 gint    jpeg_prog=0;
28 off_t   file_size;
29 
30 /* stuff for rendering statusbar, infotext, etc ... */
31 PangoLayout     *layout;
32 PangoFontMetrics *metrics;
33 PangoFontDescription *fontdesc;
34 PangoLayout     *layoutComment;
35 PangoFontMetrics *metricsComment;
36 PangoFontDescription *fontdescComment;
37 
38 /* Options and such */
39 
40 int	filter = FILTER;
41 gint	center = CENTER;
42 gint	cycle = 0; /* TRUE if cycle between images */
43 gint	default_brightness = DEFAULT_BRIGHTNESS;
44 gint	default_contrast = DEFAULT_CONTRAST;
45 gint	default_gamma = DEFAULT_GAMMA;
46 gint	delay = SLIDE_DELAY; /* delay in slideshow mode in seconds */
47 int	readonly = 0; /* TRUE if (un)deletion of images should be impossible */
48 int	random_order; /* TRUE if random delay in slideshow */
49 int	random_replace = 1; /* random with replacement by default */
50 int	fullscreen; /* TRUE if fullscreen mode */
51 int	maxpect; /* TRUE if autozoom (fit-to-screen) mode */
52 int	statusbar_fullscreen = 1; /* TRUE if statusbar in fullscreen is turned on (default) */
53 int	statusbar_window = 0; /* FALSE if statusbar in window is turned off (default) */
54 int	comment_window = 0; /* FALSE if comment in window is turned off (default) */
55 int	slide; /* 1=slide show running */
56 int	scale_down; /* resize down if image x/y > screen */
57 int	recursive; /* descend recursively */
58 int	followlinks; /* follow symlinks to dirs */
59 int	to_root; /* display on root (centered) */
60 int	to_root_t; /* display on root (tiled) */
61 int	to_root_s; /* display on root (stretched) */
62 int	transparency; /* transparency on/off */
63 int	do_grab; /* grab keboard/pointer (default off) */
64 int	disable_grab; /* disable keyboard/mouse grabbing in fullscreen mode */
65 int	max_rand_num; /* the largest random number range we will ask for */
66 int	fixed_window_size = 0; /* window width fixed size/off */
67 int	fixed_zoom_factor = 0; /* window fixed zoom factor (percentage)/off */
68 int zoom_factor = 0; /* zoom factor/off */
69 int watch_file = 0; /* watch current files Timestamp, reload if changed */
70 int magnify = 0; /* [lc] */
71 int user_screen = 0; /* preferred (by user) monitor */
72 int browse = 0; /* scan directory of file for browsing */
73 int autorotate = 1; /* autorotate JPEGs according to EXIF tag */
74 int rotation = 0; /* rotation x degrees clockwise, 1=90degrees 2=180degrees 3=270degrees */
75 int vikeys = 0; /* option to give us some vi-like keys (for movement) */
76 int trashbin = 0; /* option to use users trash bin instead of local .qiv_trash when deleting image */
77 
78 #ifdef SUPPORT_LCMS
79 const char* source_profile = NULL;
80 const char* display_profile = NULL;
81 cmsHPROFILE h_source_profile;
82 cmsHPROFILE h_display_profile;
83 cmsHTRANSFORM h_cms_transform;
84 int cms_transform = 0;
85 #endif
86 
87 
88 /* Used for the ? key */
89 
90 const char *helpstrs[] =
91 {
92     VERSION_FULL,
93     "",
94     "space/left mouse/wheel down      next picture",
95     "backspace/right mouse/wheel up   previous picture",
96     "PgDn                             5 pictures forward",
97     "PgUp                             5 pictures backward",
98     "q/ESC/middle mouse               exit",
99     "",
100     "0-9                  Run 'qiv-command <key> <current-img>'",
101     "^<string><return>    Run 'qiv-command ^<string> <current-img>'",
102     "?/F1                 show keys (in fullscreen mode)",
103     "F11/F12              in/decrease slideshow delay (1 second)",
104     "a/A                  copy current image to .qiv-select",
105     "d/D/del              move picture to .qiv-trash (to trash bin with --trashbin option)",
106     "u                    undelete the previously trashed image",
107     "+/=/wheel r/btn fwd  zoom in (10%)",
108     "-/wheel l/btn back   zoom out (10%)",
109     "e                    center mode on/off",
110     "f                    fullscreen mode on/off",
111     "m                    scale to screen size on/off",
112     "t                    scale down on/off",
113     "X                    cycle through monitors",
114     "s                    slide show on/off",
115     "p                    transparency on/off",
116     "r                    random order on/off",
117     "b                    - brightness",
118     "B                    + brightness",
119     "c                    - contrast",
120     "C                    + contrast",
121     "g                    - gamma",
122     "G                    + gamma",
123     "o                    reset brightness, contrast, gamma",
124     "h                    flip horizontal",
125     "v                    flip vertical",
126     "k                    rotate right",
127     "l                    rotate left",
128     "jtx<return>          jump to image number x",
129     "jfx<return>          jump forward x images",
130     "jbx<return>          jump backward x images",
131     "enter/return         reset zoom, rotation and color settings",
132 #ifdef HAVE_EXIF
133     "E                    display Exif information",
134 #endif
135     "i                    statusbar on/off",
136     "J                    JPEG comments on/off",
137     "I                    iconify window",
138     "w                    watch file on/off",
139     "x                    center image on background",
140     "y                    tile image on background",
141     "z                    stretch image on background",
142     ",                    grab on/off",
143     "<                    turn on/off magnifying window",
144     "arrow keys                 move image (in fullscreen mode)",
145     "arrow keys+Shift           move image faster (in fullscreen mode)",
146     "NumPad-arrow keys+NumLock  move image faster (in fullscreen mode)",
147     NULL
148 };
149 
150 /* For --help output, we'll skip the first two lines. */
151 
152 const char **helpkeys = helpstrs+2;
153 
154 /* Used for filtering */
155 
156 const char *image_extensions[] = {
157 #ifdef EXTN_JPEG
158     ".jpg",".jpeg", ".jpe",
159 #endif
160 #ifdef EXTN_GIF
161     ".gif",
162 #endif
163 #ifdef EXTN_TIFF
164     ".tif",".tiff",
165 #endif
166 #ifdef EXTN_XPM
167     ".xpm",
168 #endif
169 #ifdef EXTN_PNG
170     ".png",".pjpeg",
171 #endif
172 #ifdef EXTN_PPM
173     ".ppm",
174 #endif
175 #ifdef EXTN_PNM
176     ".pnm",
177 #endif
178 #ifdef EXTN_PGM
179     ".pgm",  ".pbm",
180 #endif
181 #ifdef EXTN_PCX
182     ".pcx",
183 #endif
184 #ifdef EXTN_BMP
185     ".bmp",
186 #endif
187 #ifdef EXTN_EIM
188     ".eim",
189 #endif
190 #ifdef EXTN_TGA
191     ".tga",
192 #endif
193 #ifdef EXTN_ICO
194     ".ico",
195 #endif
196 #ifdef EXTN_WMF
197     ".wmf",
198 #endif
199 #ifdef EXTN_SVG
200     ".svg",
201 #endif
202     NULL
203 };
204 
205 #ifdef HAVE_MAGIC
206 const char *image_magic[] = {
207 #ifdef EXTN_JPEG
208   "JPEG image data",
209 #endif
210 #ifdef EXTN_GIF
211   "GIF image data",
212 #endif
213 #ifdef EXTN_TIFF
214   "TIFF image data",
215 #endif
216 #ifdef EXTN_XPM
217   "X pixmap image",
218 #endif
219 #ifdef EXTN_PNG
220   "PNG image data",
221 #endif
222 #ifdef EXTN_PGM
223   "Netpbm PBM",
224   "Netpbm PPM",
225 #endif
226 #ifdef EXTN_BMP
227   "PC bitmap data",
228 #endif
229 #ifdef EXTN_TGA
230   "Targa image data",
231 #endif
232 #ifdef EXTN_PCX
233   "PCX ver. 3.0 image",
234 #endif
235 #ifdef EXTN_SVG
236   "SVG Scalable Vector",
237 #endif
238 #ifdef EXTN_ICO
239   "MS Windows icon resource",
240 #endif
241  NULL
242 };
243 #endif
244 
245 
246 #endif /* MAIN_H */
247