Fix #1061: meson fails to detect strverscmp
[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  *-------------------------------------
32  * Standard library includes
33  *-------------------------------------
34  */
35
36 #include <pwd.h>
37 #include <stdio.h>
38 #include <stdlib.h>
39 #include <string.h>
40 #include <time.h>
41 #include <unistd.h>
42 #include <sys/stat.h>
43 #include <sys/time.h>
44 #include <sys/types.h>
45 #include <dirent.h>
46 #include <fcntl.h>
47
48 /*
49  *-------------------------------------
50  * includes for glib / gtk / gdk-pixbuf
51  *-------------------------------------
52  */
53
54 #include <gdk/gdk.h>
55 #include <gtk/gtk.h>
56
57 #include <gdk-pixbuf/gdk-pixbuf.h>
58 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
59
60 #include "compat.h"
61
62 /*
63  *----------------------------------------------------------------------------
64  * defines
65  *----------------------------------------------------------------------------
66  */
67
68 #define USE_XDG 1
69
70 #define GQ_APPNAME "Geeqie"
71 #define GQ_APPNAME_LC "geeqie"
72 #define GQ_WEBSITE "https://www.geeqie.org/"
73 #define GQ_EMAIL_ADDRESS "geeqie@freelists.org"
74
75 #define GQ_RC_DIR               "." GQ_APPNAME_LC
76 #define GQ_COLLECTIONS_DIR      "collections"
77 #define GQ_TRASH_DIR            "trash"
78 #define GQ_WINDOW_LAYOUTS_DIR   "layouts"
79 #define GQ_ARCHIVE_DIR  "geeqie-archive"
80
81 #define GQ_SYSTEM_WIDE_DIR    "/etc/" GQ_APPNAME_LC
82
83 #define RC_FILE_NAME GQ_APPNAME_LC "rc.xml"
84 #define DEFAULT_WINDOW_LAYOUT "default_window_layout.xml"
85
86 #define GQ_COLLECTION_EXT ".gqv"
87
88 #define SCROLL_RESET_TOPLEFT 0
89 #define SCROLL_RESET_CENTER 1
90 #define SCROLL_RESET_NOCHANGE 2
91
92 #define MOUSEWHEEL_SCROLL_SIZE 20
93
94
95 #define GQ_DEFAULT_SHELL_PATH "/bin/sh"
96 #define GQ_DEFAULT_SHELL_OPTIONS "-c"
97
98 #define COLOR_PROFILE_INPUTS 4
99
100 #define DEFAULT_THUMB_WIDTH     96
101 #define DEFAULT_THUMB_HEIGHT    72
102
103 #define DEFAULT_MINIMAL_WINDOW_SIZE 100
104
105 #define IMAGE_MIN_WIDTH 100
106 #define SIDEBAR_DEFAULT_WIDTH 250
107
108
109 #define DEFAULT_OVERLAY_INFO    "%collection:<i>*</i>\\n%" \
110                                 "(%number%/%total%) [%zoom%] <b>%name%</b>\n" \
111                                 "%res%|%date%|%size%\n" \
112                                 "%formatted.Aperture%|%formatted.ShutterSpeed%|%formatted.ISOSpeedRating:ISO *%|%formatted.FocalLength%|%formatted.ExposureBias:* Ev%\n" \
113                                 "%formatted.Camera:40%|%formatted.Flash%\n"            \
114                                 "%formatted.star_rating%"
115
116 #define GQ_LINK_STR "↗"
117 #include "typedefs.h"
118 #include "debug.h"
119 #include "options.h"
120
121 #define APPIMAGE_VERSION_FILE "https://raw.githubusercontent.com/geeqie/geeqie.github.io/master/AppImage/appimages.txt"
122 #define TIMEZONE_DATABASE_WEB "https://cdn.bertold.org/zonedetect/db/db.zip"
123 #define TIMEZONE_DATABASE_FILE "timezone21.bin"
124 #define TIMEZONE_DATABASE_VERSION "out_v1"
125 #define HELP_SEARCH_ENGINE "https://duckduckgo.com/?q=site:geeqie.org/help "
126
127 #define STAR_RATING_NOT_READ -12345
128 #define STAR_RATING_REJECTED 0x274C //Unicode Character 'Cross Mark'
129 #define STAR_RATING_STAR 0x2738 //Unicode Character 'Heavy Eight Pointed Rectilinear Black Star'
130
131 /* From http://stackoverflow.com/questions/3417837/ */
132 #ifdef UNUSED
133 #elif defined(__GNUC__)
134 # define UNUSED(x) UNUSED_ ## x __attribute__((unused))
135 #elif defined(__LCLINT__)
136 # define UNUSED(x) /*@unused@*/ x
137 #else
138 # define UNUSED(x) x
139 #endif
140
141 /*
142  *----------------------------------------------------------------------------
143  * main.cc
144  *----------------------------------------------------------------------------
145  */
146
147 /*
148  * This also doubles as the main.cc header.
149  */
150
151 extern gboolean thumb_format_changed;
152
153 extern gchar *gq_prefix;
154 extern gchar *gq_localedir;
155 extern gchar *gq_helpdir;
156 extern gchar *gq_htmldir;
157 extern gchar *gq_appdir;
158 extern gchar *gq_bindir;
159 extern gchar *gq_executable_path;
160 extern gchar *desktop_file_template;
161 extern gchar *instance_identifier;
162
163 void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event);
164 gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
165
166 void exit_program(void);
167
168 #define CASE_SORT(a, b) ( (options->file_sort.case_sensitive) ? strcmp((a), (b)) : strcasecmp((a), (b)) )
169
170
171 #endif
172 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */