File: main.h

package info (click to toggle)
qiv 2.3.2-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 512 kB
  • sloc: ansic: 4,551; makefile: 99; sh: 67; python: 45
file content (246 lines) | stat: -rw-r--r-- 7,775 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#ifndef MAIN_H
#define MAIN_H

int		first = 1; /* TRUE if this is first image or after fullscreen or iconifying */
char		infotext[BUF_LEN];
GMainLoop	*qiv_main_loop;
gint		screen_x, screen_y; /* Size of the screen in pixels */
gint            num_monitors;
GdkScreen       *screen;
GdkRectangle    *monitor;

GdkColormap	*cmap; /* global colormap */
char		*image_bg_spec = IMAGE_BG;
GdkColor	image_bg; /* default background */
GdkColor	text_bg; /* statusbar and help background */
GdkColor	error_bg; /* for the error window/screen */
GdkColor	comment_bg; /* comment background */
int		images;	/* Number of images in current collection */
char		**image_names = NULL; /* Filenames of the images */
int		image_idx = 0; /* Index of current image displayed. 0 = 1st image */
int		max_image_cnt = 0; /* # images currently allocated into arrays */
time_t          current_mtime; /* modification time of file currently loaded */
qiv_deletedfile *deleted_files;
int		delete_idx;
char    select_dir[FILENAME_LEN];
char    *comment=NULL;
gint    jpeg_prog=0;
off_t   file_size;

/* stuff for rendering statusbar, infotext, etc ... */
PangoLayout     *layout;
PangoFontMetrics *metrics;
PangoFontDescription *fontdesc;
PangoLayout     *layoutComment;
PangoFontMetrics *metricsComment;
PangoFontDescription *fontdescComment;

/* Options and such */

int	filter = FILTER;
gint	center = CENTER;
gint	cycle = 0; /* TRUE if cycle between images */
gint	default_brightness = DEFAULT_BRIGHTNESS;
gint	default_contrast = DEFAULT_CONTRAST;
gint	default_gamma = DEFAULT_GAMMA;
gint	delay = SLIDE_DELAY; /* delay in slideshow mode in seconds */
int	readonly = 0; /* TRUE if (un)deletion of images should be impossible */
int	random_order; /* TRUE if random delay in slideshow */
int	random_replace = 1; /* random with replacement by default */
int	fullscreen; /* TRUE if fullscreen mode */
int	maxpect; /* TRUE if autozoom (fit-to-screen) mode */
int	statusbar_fullscreen = 1; /* TRUE if statusbar in fullscreen is turned on (default) */
int	statusbar_window = 0; /* FALSE if statusbar in window is turned off (default) */
int	comment_window = 0; /* FALSE if comment in window is turned off (default) */
int	slide; /* 1=slide show running */
int	scale_down; /* resize down if image x/y > screen */
int	recursive; /* descend recursively */
int	followlinks; /* follow symlinks to dirs */
int	to_root; /* display on root (centered) */
int	to_root_t; /* display on root (tiled) */
int	to_root_s; /* display on root (stretched) */
int	transparency; /* transparency on/off */
int	do_grab; /* grab keboard/pointer (default off) */
int	disable_grab; /* disable keyboard/mouse grabbing in fullscreen mode */
int	max_rand_num; /* the largest random number range we will ask for */
int	fixed_window_size = 0; /* window width fixed size/off */
int	fixed_zoom_factor = 0; /* window fixed zoom factor (percentage)/off */
int zoom_factor = 0; /* zoom factor/off */
int watch_file = 0; /* watch current files Timestamp, reload if changed */
int magnify = 0; /* [lc] */
int user_screen = 0; /* preferred (by user) monitor */
int browse = 0; /* scan directory of file for browsing */
int autorotate = 1; /* autorotate JPEGs according to EXIF tag */
int rotation = 0; /* rotation x degrees clockwise, 1=90degrees 2=180degrees 3=270degrees */
int vikeys = 0; /* option to give us some vi-like keys (for movement) */
int trashbin = 0; /* option to use users trash bin instead of local .qiv_trash when deleting image */

#ifdef SUPPORT_LCMS
const char* source_profile = NULL;
const char* display_profile = NULL;
cmsHPROFILE h_source_profile;
cmsHPROFILE h_display_profile;
cmsHTRANSFORM h_cms_transform;
int cms_transform = 0;
#endif


/* Used for the ? key */

const char *helpstrs[] =
{
    VERSION_FULL,
    "",
    "space/left mouse/wheel down      next picture",
    "backspace/right mouse/wheel up   previous picture",
    "PgDn                             5 pictures forward",
    "PgUp                             5 pictures backward",
    "q/ESC/middle mouse               exit",
    "",
    "0-9                  Run 'qiv-command <key> <current-img>'",
    "^<string><return>    Run 'qiv-command ^<string> <current-img>'",
    "?/F1                 show keys (in fullscreen mode)",
    "F11/F12              in/decrease slideshow delay (1 second)",
    "a/A                  copy current image to .qiv-select",
    "d/D/del              move picture to .qiv-trash (to trash bin with --trashbin option)",
    "u                    undelete the previously trashed image",
    "+/=/wheel r/btn fwd  zoom in (10%)",
    "-/wheel l/btn back   zoom out (10%)",
    "e                    center mode on/off",
    "f                    fullscreen mode on/off",
    "m                    scale to screen size on/off",
    "t                    scale down on/off",
    "X                    cycle through monitors",
    "s                    slide show on/off",
    "p                    transparency on/off",
    "r                    random order on/off",
    "b                    - brightness",
    "B                    + brightness",
    "c                    - contrast",
    "C                    + contrast",
    "g                    - gamma",
    "G                    + gamma",
    "o                    reset brightness, contrast, gamma",
    "h                    flip horizontal",
    "v                    flip vertical",
    "k                    rotate right",
    "l                    rotate left",
    "jtx<return>          jump to image number x",
    "jfx<return>          jump forward x images",
    "jbx<return>          jump backward x images",
    "enter/return         reset zoom, rotation and color settings",
#ifdef HAVE_EXIF
    "E                    display Exif information",
#endif
    "i                    statusbar on/off",
    "J                    JPEG comments on/off",
    "I                    iconify window",
    "w                    watch file on/off",
    "x                    center image on background",
    "y                    tile image on background",
    "z                    stretch image on background",
    ",                    grab on/off",
    "<                    turn on/off magnifying window",
    "arrow keys                 move image (in fullscreen mode)",
    "arrow keys+Shift           move image faster (in fullscreen mode)",
    "NumPad-arrow keys+NumLock  move image faster (in fullscreen mode)",
    NULL
};

/* For --help output, we'll skip the first two lines. */

const char **helpkeys = helpstrs+2;

/* Used for filtering */

const char *image_extensions[] = {
#ifdef EXTN_JPEG
    ".jpg",".jpeg", ".jpe",
#endif
#ifdef EXTN_GIF
    ".gif",
#endif
#ifdef EXTN_TIFF
    ".tif",".tiff",
#endif
#ifdef EXTN_XPM
    ".xpm",
#endif
#ifdef EXTN_PNG
    ".png",".pjpeg",
#endif
#ifdef EXTN_PPM
    ".ppm",
#endif
#ifdef EXTN_PNM
    ".pnm",
#endif
#ifdef EXTN_PGM
    ".pgm",  ".pbm",
#endif
#ifdef EXTN_PCX
    ".pcx",
#endif
#ifdef EXTN_BMP
    ".bmp",
#endif
#ifdef EXTN_EIM
    ".eim",
#endif
#ifdef EXTN_TGA
    ".tga",
#endif
#ifdef EXTN_ICO
    ".ico",
#endif
#ifdef EXTN_WMF
    ".wmf",
#endif
#ifdef EXTN_SVG
    ".svg",
#endif
    NULL
};

#ifdef HAVE_MAGIC
const char *image_magic[] = {
#ifdef EXTN_JPEG
  "JPEG image data",
#endif
#ifdef EXTN_GIF
  "GIF image data",
#endif
#ifdef EXTN_TIFF
  "TIFF image data",
#endif
#ifdef EXTN_XPM
  "X pixmap image",
#endif
#ifdef EXTN_PNG
  "PNG image data",
#endif
#ifdef EXTN_PGM
  "Netpbm PBM",
  "Netpbm PPM",
#endif
#ifdef EXTN_BMP
  "PC bitmap data",
#endif
#ifdef EXTN_TGA
  "Targa image data",
#endif
#ifdef EXTN_PCX
  "PCX ver. 3.0 image",
#endif
#ifdef EXTN_SVG
  "SVG Scalable Vector",
#endif
#ifdef EXTN_ICO
  "MS Windows icon resource",
#endif
 NULL
};
#endif


#endif /* MAIN_H */