Mercurial > geeqie
annotate src/main.h @ 496:a1f13fab6686
fixed a bug in opening files with non-utf8 locales in exiv2.cc
author | nadvornik |
---|---|
date | Wed, 23 Apr 2008 21:08:29 +0000 |
parents | c7a2471e5c4e |
children | 2c6558663b52 |
rev | line source |
---|---|
1 | 1 /* |
196 | 2 * Geeqie |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
14
diff
changeset
|
3 * (C) 2006 John Ellis |
475 | 4 * Copyright (C) 2008 The Geeqie Team |
1 | 5 * |
6 * Author: John Ellis | |
7 * | |
9 | 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! | |
1 | 11 */ |
12 | |
9 | 13 |
282 | 14 #ifndef MAIN_H |
15 #define MAIN_H | |
9 | 16 |
1 | 17 #ifdef HAVE_CONFIG_H |
18 # include "config.h" | |
19 #endif | |
20 | |
9 | 21 #ifdef HAVE_STRVERSCMP |
213 | 22 # ifndef _GNU_SOURCE |
23 # define _GNU_SOURCE | |
24 # endif | |
9 | 25 #endif |
26 | |
1 | 27 #include "intl.h" |
28 | |
29 /* | |
30 *------------------------------------- | |
31 * Standard library includes | |
32 *------------------------------------- | |
33 */ | |
34 | |
35 #include <pwd.h> | |
36 #include <stdio.h> | |
37 #include <stdlib.h> | |
38 #include <string.h> | |
39 #include <time.h> | |
40 #include <unistd.h> | |
41 #include <sys/stat.h> | |
9 | 42 #include <sys/time.h> |
43 #include <sys/types.h> | |
1 | 44 #include <dirent.h> |
9 | 45 #include <fcntl.h> |
1 | 46 |
47 /* | |
48 *------------------------------------- | |
9 | 49 * includes for glib / gtk / gdk-pixbuf |
1 | 50 *------------------------------------- |
51 */ | |
52 | |
53 #include <gdk/gdk.h> | |
54 #include <gtk/gtk.h> | |
9 | 55 |
56 #include <gdk-pixbuf/gdk-pixbuf.h> | |
57 #include <gdk-pixbuf/gdk-pixbuf-loader.h> | |
58 | |
1 | 59 |
60 /* | |
61 *---------------------------------------------------------------------------- | |
62 * defines | |
63 *---------------------------------------------------------------------------- | |
64 */ | |
65 | |
288
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
66 #define GQ_APPNAME "Geeqie" |
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
67 #define GQ_APPNAME_LC "geeqie" |
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
68 #define GQ_WEBSITE "geeqie.sourceforge.net" |
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
69 #define GQ_EMAIL_ADDRESS "geeqie-devel@lists.sourceforge.net" |
254
9faf34f047b1
Make the wmclass value unique among the code by defining
zas_
parents:
243
diff
changeset
|
70 |
288
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
71 #define GQ_WMCLASS GQ_APPNAME_LC |
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
72 |
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
73 #define GQ_RC_DIR "." GQ_APPNAME_LC |
283 | 74 #define GQ_RC_DIR_COLLECTIONS GQ_RC_DIR"/collections" |
75 #define GQ_RC_DIR_TRASH GQ_RC_DIR"/trash" | |
9 | 76 |
288
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
77 #define RC_FILE_NAME GQ_APPNAME_LC "rc" |
1 | 78 |
79 #define ZOOM_RESET_ORIGINAL 0 | |
80 #define ZOOM_RESET_FIT_WINDOW 1 | |
81 #define ZOOM_RESET_NONE 2 | |
82 | |
9 | 83 #define SCROLL_RESET_TOPLEFT 0 |
84 #define SCROLL_RESET_CENTER 1 | |
85 #define SCROLL_RESET_NOCHANGE 2 | |
86 | |
4 | 87 #define MOUSEWHEEL_SCROLL_SIZE 20 |
88 | |
283 | 89 #define GQ_EDITOR_GENERIC_SLOTS 10 |
1 | 90 |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
91 #define COLOR_PROFILE_INPUTS 4 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
92 |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
218
diff
changeset
|
93 #define DEFAULT_THUMB_WIDTH 96 |
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
218
diff
changeset
|
94 #define DEFAULT_THUMB_HEIGHT 72 |
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
218
diff
changeset
|
95 |
413
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
386
diff
changeset
|
96 #define IMAGE_LOADER_READ_BUFFER_SIZE_DEFAULT 4096 |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
386
diff
changeset
|
97 #define IMAGE_LOADER_READ_BUFFER_SIZE_MIN 512 |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
386
diff
changeset
|
98 #define IMAGE_LOADER_READ_BUFFER_SIZE_MAX 16*1024*1024 |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
386
diff
changeset
|
99 |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
386
diff
changeset
|
100 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_DEFAULT 1 |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
386
diff
changeset
|
101 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_MIN 1 |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
386
diff
changeset
|
102 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_MAX 16 |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
386
diff
changeset
|
103 |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
104 #define PANEL_MIN_WIDTH 64 |
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
105 #define PANEL_DEFAULT_WIDTH 288 |
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
106 #define PANEL_MAX_WIDTH 1200 |
415 | 107 |
108 #define DEFAULT_OVERLAY_INFO "%collection%(%number%/%total%) [%zoom%] <b>%name%</b>\n" \ | |
442 | 109 "%res%|%date%|%size%\n" \ |
415 | 110 "%fAperture%|%fShutterSpeed%|%fISOSpeedRating%|%fFocalLength%|%fExposureBias%\n" \ |
111 "%fCamera%|%fFlash%" \ | |
112 | |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
113 #if 1 /* set to 0 to disable debugging code and related options */ |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
114 # ifndef DEBUG |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
115 # define DEBUG 1 |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
116 # endif |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
117 #endif |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
118 #ifndef DEBUG |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
119 # define debug 0 |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
120 #endif |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
218
diff
changeset
|
121 |
495 | 122 #ifdef DEBUG |
123 #define DEBUG_N(n, ...) do { if (debug >= (n)) printf(__VA_ARGS__); } while (0) | |
124 #else | |
125 #define DEBUG_N(n, ...) do { } while(0) | |
126 #endif | |
127 | |
128 #define DEBUG_1(...) DEBUG_N(1, __VA_ARGS__) | |
129 #define DEBUG_2(...) DEBUG_N(2, __VA_ARGS__) | |
130 #define DEBUG_3(...) DEBUG_N(3, __VA_ARGS__) | |
131 #define DEBUG_4(...) DEBUG_N(4, __VA_ARGS__) | |
132 | |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
133 #include "typedefs.h" |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
134 |
9 | 135 /* |
136 *---------------------------------------------------------------------------- | |
137 * globals | |
138 *---------------------------------------------------------------------------- | |
139 */ | |
318 | 140 ConfOptions *init_options(ConfOptions *options); /* TODO: move to globals.h */ |
141 | |
142 ConfOptions *options; | |
1 | 143 |
144 | |
4 | 145 |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
146 #ifdef DEBUG |
1 | 147 extern gint debug; |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
148 #endif |
1 | 149 |
9 | 150 |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
151 |
9 | 152 /* |
153 *---------------------------------------------------------------------------- | |
154 * main.c | |
155 *---------------------------------------------------------------------------- | |
156 */ | |
1 | 157 |
9 | 158 /* |
159 * This also doubles as the main.c header. | |
160 */ | |
1 | 161 |
289
6a7298988a7a
Simplify and unify gtk_window creation with the help of
zas_
parents:
288
diff
changeset
|
162 GtkWidget *window_new(GtkWindowType type, const gchar *name, const gchar *icon, |
6a7298988a7a
Simplify and unify gtk_window creation with the help of
zas_
parents:
288
diff
changeset
|
163 const gchar *icon_file, const gchar *subtitle); |
91
d063f97503b7
Wed Nov 1 11:39:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
67
diff
changeset
|
164 void window_set_icon(GtkWidget *window, const gchar *icon, const gchar *file); |
9 | 165 gint window_maximized(GtkWidget *window); |
1 | 166 |
9 | 167 gdouble get_zoom_increment(void); |
1 | 168 |
386
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
329
diff
changeset
|
169 const gchar *get_exec_time(); |
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
329
diff
changeset
|
170 |
9 | 171 void help_window_show(const gchar *key); |
1 | 172 |
9 | 173 void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event); |
174 gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data); | |
278 | 175 void exit_program(void); |
1 | 176 |
329 | 177 #define CASE_SORT(a, b) ( (options->file_sort.case_sensitive) ? strcmp((a), (b)) : strcasecmp((a), (b)) ) |
319 | 178 |
1 | 179 |
9 | 180 #endif |