Fix #314: Remote commands for thumbnail maintenance
[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 #ifdef HAVE_CONFIG_H
26 #  include "config.h"
27 #endif
28
29 #ifdef HAVE_STRVERSCMP
30 #  ifndef _GNU_SOURCE
31 #    define _GNU_SOURCE
32 #  endif
33 #endif
34
35 #include "intl.h"
36
37
38 /*
39  *-------------------------------------
40  * Standard library includes
41  *-------------------------------------
42  */
43
44 #include <pwd.h>
45 #include <stdio.h>
46 #include <stdlib.h>
47 #include <string.h>
48 #include <time.h>
49 #include <unistd.h>
50 #include <sys/stat.h>
51 #include <sys/time.h>
52 #include <sys/types.h>
53 #include <dirent.h>
54 #include <fcntl.h>
55
56 /*
57  *-------------------------------------
58  * includes for glib / gtk / gdk-pixbuf
59  *-------------------------------------
60  */
61
62 #include <gdk/gdk.h>
63 #include <gtk/gtk.h>
64
65 #include <gdk-pixbuf/gdk-pixbuf.h>
66 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
67
68 #include "compat.h"
69
70 /*
71  *----------------------------------------------------------------------------
72  * defines
73  *----------------------------------------------------------------------------
74  */
75
76 #define USE_XDG 1
77
78 #define GQ_APPNAME "Geeqie"
79 #define GQ_APPNAME_LC "geeqie"
80 #define GQ_WEBSITE "www.geeqie.org"
81 #define GQ_EMAIL_ADDRESS "geeqie-devel@lists.sourceforge.net"
82
83 #define GQ_RC_DIR               "." GQ_APPNAME_LC
84 #define GQ_COLLECTIONS_DIR      "collections"
85 #define GQ_TRASH_DIR            "trash"
86
87 #define GQ_SYSTEM_WIDE_DIR    "/etc/" GQ_APPNAME_LC
88
89 #define RC_FILE_NAME GQ_APPNAME_LC "rc.xml"
90
91 #define GQ_COLLECTION_EXT ".gqv"
92
93 #define SCROLL_RESET_TOPLEFT 0
94 #define SCROLL_RESET_CENTER 1
95 #define SCROLL_RESET_NOCHANGE 2
96
97 #define MOUSEWHEEL_SCROLL_SIZE 20
98
99
100 #define GQ_DEFAULT_SHELL_PATH "/bin/sh"
101 #define GQ_DEFAULT_SHELL_OPTIONS "-c"
102
103 #define COLOR_PROFILE_INPUTS 4
104
105 #define DEFAULT_THUMB_WIDTH     96
106 #define DEFAULT_THUMB_HEIGHT    72
107
108 #define DEFAULT_MINIMAL_WINDOW_SIZE 100
109
110 #define IMAGE_MIN_WIDTH 100
111 #define SIDEBAR_DEFAULT_WIDTH 250
112
113
114 #define DEFAULT_OVERLAY_INFO    "%collection:<i>*</i>\\n%" \
115                                 "(%number%/%total%) [%zoom%] <b>%name%</b>\n" \
116                                 "%res%|%date%|%size%\n" \
117                                 "%formatted.Aperture%|%formatted.ShutterSpeed%|%formatted.ISOSpeedRating:ISO *%|%formatted.FocalLength%|%formatted.ExposureBias:* Ev%\n" \
118                                 "%formatted.Camera:40%|%formatted.Flash%"
119
120 #define GQ_LINK_STR "↗"
121 #include "typedefs.h"
122 #include "debug.h"
123 #include "options.h"
124
125 #define DESKTOP_FILE_TEMPLATE GQ_APP_DIR "/template.desktop"
126 /*
127  *----------------------------------------------------------------------------
128  * main.c
129  *----------------------------------------------------------------------------
130  */
131
132 /*
133  * This also doubles as the main.c header.
134  */
135
136 extern gboolean thumb_format_changed;
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
147 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */