Use a specific enum for image.zoom_mode values (ZoomMode) and
[geeqie.git] / src / main.h
1 /*
2  * Geeqie
3  * (C) 2006 John Ellis
4  * Copyright (C) 2008 The Geeqie Team
5  *
6  * Author: John Ellis
7  *
8  * This software is released under the GNU General Public License (GNU GPL).
9  * Please read the included file COPYING for more information.
10  * This software comes with no warranty of any kind, use at your own risk!
11  */
12
13
14 #ifndef MAIN_H
15 #define MAIN_H
16
17 #ifdef HAVE_CONFIG_H
18 #  include "config.h"
19 #endif
20
21 #ifdef HAVE_STRVERSCMP
22 #  ifndef _GNU_SOURCE
23 #    define _GNU_SOURCE
24 #  endif
25 #endif
26
27 #include "intl.h"
28 #include "debug.h"
29
30
31 /*
32  *-------------------------------------
33  * Standard library includes
34  *-------------------------------------
35  */
36
37 #include <pwd.h>
38 #include <stdio.h>
39 #include <stdlib.h>
40 #include <string.h>
41 #include <time.h>
42 #include <unistd.h>
43 #include <sys/stat.h>
44 #include <sys/time.h>
45 #include <sys/types.h>
46 #include <dirent.h>
47 #include <fcntl.h>
48
49 /*
50  *-------------------------------------
51  * includes for glib / gtk / gdk-pixbuf
52  *-------------------------------------
53  */
54
55 #include <gdk/gdk.h>
56 #include <gtk/gtk.h>
57
58 #include <gdk-pixbuf/gdk-pixbuf.h>
59 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
60
61
62 /*
63  *----------------------------------------------------------------------------
64  * defines
65  *----------------------------------------------------------------------------
66  */
67
68 #define GQ_APPNAME "Geeqie"
69 #define GQ_APPNAME_LC "geeqie"
70 #define GQ_WEBSITE "geeqie.sourceforge.net"
71 #define GQ_EMAIL_ADDRESS "geeqie-devel@lists.sourceforge.net"
72
73 #define GQ_WMCLASS GQ_APPNAME_LC
74
75 #define GQ_RC_DIR             "." GQ_APPNAME_LC
76 #define GQ_RC_DIR_COLLECTIONS GQ_RC_DIR G_DIR_SEPARATOR_S "collections"
77 #define GQ_RC_DIR_TRASH       GQ_RC_DIR G_DIR_SEPARATOR_S "trash"
78
79 #define GQ_SYSTEM_WIDE_DIR    "/etc/" GQ_APPNAME_LC
80
81 #define RC_FILE_NAME GQ_APPNAME_LC "rc"
82
83 #define GQ_COLLECTION_EXT ".gqv"
84
85 #define SCROLL_RESET_TOPLEFT 0
86 #define SCROLL_RESET_CENTER 1
87 #define SCROLL_RESET_NOCHANGE 2
88
89 #define MOUSEWHEEL_SCROLL_SIZE 20
90
91 #define GQ_EDITOR_GENERIC_SLOTS 10
92
93 #define GQ_DEFAULT_SHELL_PATH "/bin/sh"
94 #define GQ_DEFAULT_SHELL_OPTIONS "-c"
95
96 #define COLOR_PROFILE_INPUTS 4
97
98 #define DEFAULT_THUMB_WIDTH     96
99 #define DEFAULT_THUMB_HEIGHT    72
100
101 #define IMAGE_LOADER_READ_BUFFER_SIZE_DEFAULT   4096
102 #define IMAGE_LOADER_READ_BUFFER_SIZE_MIN       512
103 #define IMAGE_LOADER_READ_BUFFER_SIZE_MAX       16*1024*1024
104
105 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_DEFAULT       1
106 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_MIN           1
107 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_MAX           16
108
109 #define PANEL_MIN_WIDTH 64
110 #define PANEL_DEFAULT_WIDTH 288
111 #define PANEL_MAX_WIDTH 1200
112
113 #define DEFAULT_OVERLAY_INFO    "%collection:<i>*</i>\\n%" \
114                                 "(%number%/%total%) [%zoom%] <b>%name%</b>\n" \
115                                 "%res%|%date%|%size%\n" \
116                                 "%formatted.Aperture%|%formatted.ShutterSpeed%|%formatted.ISOSpeedRating:ISO *%|%formatted.FocalLength%|%formatted.ExposureBias:* Ev%\n" \
117                                 "%formatted.Camera:40%|%formatted.Flash%"
118
119 #include "typedefs.h"
120 #include "debug.h"
121 #include "options.h"
122
123 /*
124  *----------------------------------------------------------------------------
125  * main.c
126  *----------------------------------------------------------------------------
127  */
128
129 /*
130  * This also doubles as the main.c header.
131  */
132
133 gdouble get_zoom_increment(void);
134 gchar *utf8_validate_or_convert(const gchar *text);
135 gint utf8_compare(const gchar *s1, const gchar *s2, gboolean case_sensitive);
136 gchar *expand_tilde(const gchar *filename);
137
138 void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event);
139 gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
140
141 void exit_program(void);
142
143 #define CASE_SORT(a, b) ( (options->file_sort.case_sensitive) ? strcmp((a), (b)) : strcasecmp((a), (b)) )
144
145
146 #endif