Quick Image Viewer (qiv) http://qiv.spiegl.de/ http://qiv.spiegl.de/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

250 lines
7.6 KiB

#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 error_bg; /* for the error window/screen */
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 */
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;
/* Used for the ? key */
const char *helpstrs[] =
"space/left mouse/wheel right next picture",
"backspace/right mouse/wheel left previous picture",
"PgDn/wheel down 5 pictures forward",
"PgUp/wheel up 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",
"+/=/mouse btn 9 zoom in (10% / +50% if above 100%)",
"-/mouse btn 8 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",
"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/wheel move image (in fullscreen mode)",
"arrow keys/wheel+Shift move image faster (in fullscreen mode)",
"NumPad-arrow keys+NumLock move image faster (in fullscreen mode)",
/* 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",
#ifdef EXTN_GIF
#ifdef EXTN_TIFF
#ifdef EXTN_XPM
#ifdef EXTN_PNG
#ifdef EXTN_PPM
#ifdef EXTN_PNM
#ifdef EXTN_PGM
".pgm", ".pbm",
#ifdef EXTN_PCX
#ifdef EXTN_BMP
#ifdef EXTN_EIM
#ifdef EXTN_TGA
#ifdef EXTN_ICO
#ifdef EXTN_WMF
#ifdef EXTN_SVG
#ifdef EXTN_WEBP
const char *image_magic[] = {
#ifdef EXTN_JPEG
"JPEG image data",
#ifdef EXTN_GIF
"GIF image data",
#ifdef EXTN_TIFF
"TIFF image data",
#ifdef EXTN_XPM
"X pixmap image",
#ifdef EXTN_PNG
"PNG image data",
#ifdef EXTN_PGM
"Netpbm PBM",
"Netpbm PPM",
#ifdef EXTN_BMP
"PC bitmap data",
#ifdef EXTN_TGA
"Targa image data",
#ifdef EXTN_PCX
"PCX ver. 3.0 image",
#ifdef EXTN_SVG
"SVG Scalable Vector",
#ifdef EXTN_ICO
"MS Windows icon resource",
#ifdef EXTN_WEBP
"RIFF (little-endian) data, Web/P image",
#endif /* MAIN_H */