81a7bb821d6d944d0ffbfda4bbf949971908721d
[geeqie.git] / src / main.h
1 /*
2  * Copyright (C) 2006 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: John Ellis
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef MAIN_H
23 #define MAIN_H
24
25 #include <config.h>
26
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>
42 #include <sys/time.h>
43 #include <sys/types.h>
44 #include <dirent.h>
45 #include <fcntl.h>
46
47 /*
48  *-------------------------------------
49  * includes for glib / gtk / gdk-pixbuf
50  *-------------------------------------
51  */
52
53 #include <gdk/gdk.h>
54 #include <gtk/gtk.h>
55
56 #include <gdk-pixbuf/gdk-pixbuf.h>
57 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
58
59 #include "compat.h"
60
61 /*
62  *----------------------------------------------------------------------------
63  * defines
64  *----------------------------------------------------------------------------
65  */
66
67 #define USE_XDG 1
68
69 #define GQ_APPNAME "Geeqie"
70 #define GQ_APPNAME_LC "geeqie"
71 #define GQ_WEBSITE "https://www.geeqie.org/"
72 #define GQ_EMAIL_ADDRESS "geeqie@freelists.org"
73
74 #define GQ_RC_DIR               "." GQ_APPNAME_LC
75 #define GQ_COLLECTIONS_DIR      "collections"
76 #define GQ_TRASH_DIR            "trash"
77 #define GQ_WINDOW_LAYOUTS_DIR   "layouts"
78 #define GQ_ARCHIVE_DIR  "geeqie-archive"
79 #define GQ_RESOURCE_PATH_ICONS "/org/geeqie/icons"
80 #define GQ_RESOURCE_PATH_CREDITS "/org/geeqie/credits"
81 #define GQ_RESOURCE_PATH_UI "/org/geeqie/ui"
82
83 #define GQ_SYSTEM_WIDE_DIR    "/etc/" GQ_APPNAME_LC
84
85 #define RC_FILE_NAME GQ_APPNAME_LC "rc.xml"
86 #define DEFAULT_WINDOW_LAYOUT "default_window_layout.xml"
87
88 #define GQ_COLLECTION_EXT ".gqv"
89
90 #define SCROLL_RESET_TOPLEFT 0
91 #define SCROLL_RESET_CENTER 1
92 #define SCROLL_RESET_NOCHANGE 2
93
94 #define MOUSEWHEEL_SCROLL_SIZE 20
95
96
97 #define GQ_DEFAULT_SHELL_PATH "/bin/sh"
98 #define GQ_DEFAULT_SHELL_OPTIONS "-c"
99
100 #define COLOR_PROFILE_INPUTS 4
101
102 #define DEFAULT_THUMB_WIDTH     96
103 #define DEFAULT_THUMB_HEIGHT    72
104
105 #define DEFAULT_MINIMAL_WINDOW_SIZE 100
106
107 #define IMAGE_MIN_WIDTH 100
108 #define SIDEBAR_DEFAULT_WIDTH 250
109
110
111 #define DEFAULT_OVERLAY_INFO    "%collection:<i>*</i>\\n%" \
112                                 "(%number%/%total%) [%zoom%] <b>%name%</b>\n" \
113                                 "%res%|%date%|%size%\n" \
114                                 "%formatted.Aperture%|%formatted.ShutterSpeed%|%formatted.ISOSpeedRating:ISO *%|%formatted.FocalLength%|%formatted.ExposureBias:* Ev%\n" \
115                                 "%formatted.Camera:40%|%formatted.Flash%\n"            \
116                                 "%formatted.star_rating%"
117
118 #define GQ_LINK_STR "↩"
119 #include "typedefs.h"
120 #include "debug.h"
121 #include "options.h"
122
123 #define TIMEZONE_DATABASE_WEB "https://cdn.bertold.org/zonedetect/db/db.zip"
124 #define TIMEZONE_DATABASE_FILE "timezone21.bin"
125 #define TIMEZONE_DATABASE_VERSION "out_v1"
126 #define HELP_SEARCH_ENGINE "https://duckduckgo.com/?q=site:geeqie.org/help "
127
128 #define STAR_RATING_NOT_READ -12345
129 #define STAR_RATING_REJECTED 0x274C //Unicode Character 'Cross Mark'
130 #define STAR_RATING_STAR 0x2738 //Unicode Character 'Heavy Eight Pointed Rectilinear Black Star'
131
132 #define GQ_ICON_ADD "list-add"
133 #define GQ_ICON_REMOVE "list-remove"
134 #define GQ_ICON_UNDO "edit-undo"
135 #define GQ_ICON_REDO "edit-redo"
136 #define GQ_ICON_OPEN "document-open"
137 #define GQ_ICON_OPEN_WITH "open-menu"
138 #define GQ_ICON_SAVE "document-save"
139 #define GQ_ICON_SAVE_AS "document-save-as"
140 #define GQ_ICON_NEW "document-new"
141 #define GQ_ICON_EDIT "document-edit"
142 #define GQ_ICON_REVERT "document-revert"
143 #define GQ_ICON_CLOSE "window-close"
144 #define GQ_ICON_RUN "system-run"
145 #define GQ_ICON_STOP "process-stop"
146 #define GQ_ICON_FULLSCREEN "view-fullscreen"
147 #define GQ_ICON_LEAVE_FULLSCREEN "view-restore"
148 #define GQ_ICON_REFRESH "view-refresh"
149 #define GQ_ICON_ABOUT "help-about"
150 #define GQ_ICON_QUIT "application-exit"
151 #define GQ_ICON_DELETE "edit-delete"
152 #define GQ_ICON_DELETE_SHRED "edit-delete-shred"
153 #define GQ_ICON_CLEAR "edit-clear"
154 #define GQ_ICON_COPY "edit-copy"
155 #define GQ_ICON_FIND "edit-find"
156 #define GQ_ICON_REPLACE "edit-find-replace"
157 #define GQ_ICON_PRINT "document-print"
158 #define GQ_ICON_FILE_FILTER "preview-file"
159 #define GQ_ICON_USER_TRASH "user-trash"
160
161 #define GQ_ICON_GO_TOP "go-top"
162 #define GQ_ICON_GO_BOTTOM "go-bottom"
163 #define GQ_ICON_GO_UP "go-up"
164 #define GQ_ICON_GO_DOWN "go-down"
165 #define GQ_ICON_GO_FIRST "go-first"
166 #define GQ_ICON_GO_LAST "go-last"
167 #define GQ_ICON_GO_PREV "go-previous"
168 #define GQ_ICON_GO_NEXT "go-next"
169 #define GQ_ICON_GO_JUMP "go-jump"
170 #define GQ_ICON_HOME "go-home"
171
172 #define GQ_ICON_PREV_PAGE "media-skip-backward"
173 #define GQ_ICON_NEXT_PAGE "media-skip-forward"
174 #define GQ_ICON_BACK_PAGE "media-seek-backward"
175 #define GQ_ICON_FORWARD_PAGE "media-seek-forward"
176
177 #define GQ_ICON_PLAY "media-playback-start"
178 #define GQ_ICON_PAUSE "media-playback-pause"
179
180 #define GQ_ICON_ZOOM_IN "zoom-in"
181 #define GQ_ICON_ZOOM_OUT "zoom-out"
182 #define GQ_ICON_ZOOM_100 "zoom-original"
183 #define GQ_ICON_ZOOM_FIT "zoom-fit-best"
184
185 // might need replacing
186 #define GQ_ICON_PREFERENCES "preferences-system"
187 #define GQ_ICON_HELP "help-contents" // "help-browser"?
188 #define GQ_ICON_EXPORT "document-export" // use collection icon?
189
190 // not available in some themes
191 #define GQ_ICON_OK "emblem-ok"
192 #define GQ_ICON_APPLY "emblem-ok" // need something else?
193 #define GQ_ICON_CANCEL "dialog-cancel" // missing in adwaita and others, seen in breeze
194 #define GQ_ICON_PAN_DOWN "pan-down-symbolic" // adwaita, breeze, hicolor supports this
195 #define GQ_ICON_PAN_UP "pan-up-symbolic" // adwaita, breeze, hicolor supports this
196
197 #define GQ_ICON_DIALOG_ERROR "dialog-error"
198 #define GQ_ICON_DIALOG_INFO "dialog-information"
199 #define GQ_ICON_DIALOG_QUESTION "dialog-question"
200 #define GQ_ICON_DIALOG_WARNING "dialog-warning"
201
202 #define GQ_ICON_UNREADABLE "emblem-unreadable"
203 #define GQ_ICON_LINK "emblem-symbolic-link"
204 #define GQ_ICON_READONLY "emblem-readonly"
205
206 #define GQ_ICON_FLIP_HORIZONTAL "object-flip-horizontal"
207 #define GQ_ICON_FLIP_VERTICAL "object-flip-vertical"
208 #define GQ_ICON_ROTATE_LEFT "object-rotate-left"
209 #define GQ_ICON_ROTATE_RIGHT "object-rotate-right"
210
211 #define GQ_ICON_DIRECTORY "folder"
212 #define GQ_ICON_MISSING_IMAGE "image-missing"
213 #define GQ_ICON_STRIKETHROUGH "format-text-strikethrough"
214 #define GQ_ICON_FILE "text-x-generic"
215 #define GQ_ICON_GENERIC "text-x-generic"
216 #define GQ_ICON_SELECT_FONT "font-select"
217 #define GQ_ICON_SELECT_COLOR "color-select"
218 #define GQ_ICON_COLOR_MANAGEMENT "preferences-color" // breeze has nicer "color-management" icon, missing in others
219
220 // not done... plus many more
221 #define GQ_ICON_COLLECTION GTK_STOCK_INDEX
222 #define GQ_ICON_DND GTK_STOCK_DND_MULTIPLE
223 // PIXBUF_INLINE_ICON_ZOOMFILLHOR
224 // PIXBUF_INLINE_ICON_ZOOMFILLVERT
225
226 /*
227  *----------------------------------------------------------------------------
228  * main.cc
229  *----------------------------------------------------------------------------
230  */
231
232 /*
233  * This also doubles as the main.cc header.
234  */
235
236 extern gboolean thumb_format_changed;
237
238 extern gchar *gq_prefix;
239 extern gchar *gq_localedir;
240 extern gchar *gq_helpdir;
241 extern gchar *gq_htmldir;
242 extern gchar *gq_appdir;
243 extern gchar *gq_bindir;
244 extern gchar *gq_executable_path;
245 extern gchar *desktop_file_template;
246 extern gchar *instance_identifier;
247
248 void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event);
249 gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
250
251 void exit_program();
252
253 #define CASE_SORT(a, b) ( (options->file_sort.case_sensitive) ? strcmp((a), (b)) : strcasecmp((a), (b)) )
254
255
256 #endif
257 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */