Rename file sorting options.
[geeqie.git] / src / main.h
1 /*
2  * Geeqie
3  * (C) 2006 John Ellis
4  *
5  * Author: John Ellis
6  *
7  * This software is released under the GNU General Public License (GNU GPL).
8  * Please read the included file COPYING for more information.
9  * This software comes with no warranty of any kind, use at your own risk!
10  */
11
12
13 #ifndef MAIN_H
14 #define MAIN_H
15
16 #ifdef HAVE_CONFIG_H
17 #  include "config.h"
18 #endif
19
20 #ifdef HAVE_STRVERSCMP
21 #  ifndef _GNU_SOURCE
22 #    define _GNU_SOURCE
23 #  endif
24 #endif
25
26 #include "intl.h"
27
28 /*
29  *-------------------------------------
30  * Standard library includes
31  *-------------------------------------
32  */
33
34 #include <pwd.h>
35 #include <stdio.h>
36 #include <stdlib.h>
37 #include <string.h>
38 #include <time.h>
39 #include <unistd.h>
40 #include <sys/stat.h>
41 #include <sys/time.h>
42 #include <sys/types.h>
43 #include <dirent.h>
44 #include <fcntl.h>
45
46 /*
47  *-------------------------------------
48  * includes for glib / gtk / gdk-pixbuf
49  *-------------------------------------
50  */
51
52 #include <gdk/gdk.h>
53 #include <gtk/gtk.h>
54
55 #include <gdk-pixbuf/gdk-pixbuf.h>
56 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
57
58
59 /*
60  *----------------------------------------------------------------------------
61  * defines
62  *----------------------------------------------------------------------------
63  */
64
65 #define GQ_APPNAME "Geeqie"
66 #define GQ_APPNAME_LC "geeqie"
67 #define GQ_WEBSITE "geeqie.sourceforge.net"
68 #define GQ_EMAIL_ADDRESS "geeqie-devel@lists.sourceforge.net"
69
70 #define GQ_WMCLASS GQ_APPNAME_LC
71
72 #define GQ_RC_DIR             "." GQ_APPNAME_LC
73 #define GQ_RC_DIR_COLLECTIONS GQ_RC_DIR"/collections"
74 #define GQ_RC_DIR_TRASH       GQ_RC_DIR"/trash"
75
76 #define RC_FILE_NAME GQ_APPNAME_LC "rc"
77
78 #define ZOOM_RESET_ORIGINAL 0
79 #define ZOOM_RESET_FIT_WINDOW 1
80 #define ZOOM_RESET_NONE 2
81
82 #define SCROLL_RESET_TOPLEFT 0
83 #define SCROLL_RESET_CENTER 1
84 #define SCROLL_RESET_NOCHANGE 2
85
86 #define MOUSEWHEEL_SCROLL_SIZE 20
87
88 #define GQ_EDITOR_GENERIC_SLOTS 10
89
90 #define COLOR_PROFILE_INPUTS 4
91
92 #define DEFAULT_THUMB_WIDTH     96
93 #define DEFAULT_THUMB_HEIGHT    72
94
95 #if 1 /* set to 0 to disable debugging code and related options */
96 # ifndef DEBUG
97 # define DEBUG 1
98 # endif
99 #endif
100 #ifndef DEBUG
101 # define debug 0
102 #endif
103
104 #include "typedefs.h"
105
106 /*
107  *----------------------------------------------------------------------------
108  * globals
109  *----------------------------------------------------------------------------
110  */
111 ConfOptions *init_options(ConfOptions *options); /* TODO: move to globals.h */
112
113 ConfOptions *options;
114
115
116
117 #ifdef DEBUG
118 extern gint debug;
119 #endif
120
121
122
123 /*
124  *----------------------------------------------------------------------------
125  * main.c
126  *----------------------------------------------------------------------------
127  */
128
129 /*
130  * This also doubles as the main.c header.
131  */
132
133 GtkWidget *window_new(GtkWindowType type, const gchar *name, const gchar *icon,
134                       const gchar *icon_file, const gchar *subtitle);
135 void window_set_icon(GtkWidget *window, const gchar *icon, const gchar *file);
136 gint window_maximized(GtkWidget *window);
137
138 gdouble get_zoom_increment(void);
139
140 void help_window_show(const gchar *key);
141
142 void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event);
143 gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
144 void exit_program(void);
145
146 #define CASE_SORT(a, b) ( (options->file_sort.case_sensitive) ? strcmp((a), (b)) : strcasecmp((a), (b)) )
147
148
149 #endif
150
151
152