Effectively drop empty newlines at end of files (missing from rev 535)
[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 #define IMAGE_LOADER_READ_BUFFER_SIZE_DEFAULT   4096
96 #define IMAGE_LOADER_READ_BUFFER_SIZE_MIN       512
97 #define IMAGE_LOADER_READ_BUFFER_SIZE_MAX       16*1024*1024
98
99 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_DEFAULT       1
100 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_MIN           1
101 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_MAX           16
102
103
104 #define DEFAULT_OVERLAY_INFO    "%collection%(%number%/%total%) [%zoom%] <b>%name%</b>\n" \
105                                 "%res%|%date%|%size%\n" \
106                                 "%fAperture%|%fShutterSpeed%|%fISOSpeedRating%|%fFocalLength%|%fExposureBias%\n" \
107                                 "%fCamera%|%fFlash%" \
108
109 #if 1 /* set to 0 to disable debugging code and related options */
110 # ifndef DEBUG
111 # define DEBUG 1
112 # endif
113 #endif
114 #ifndef DEBUG
115 # define debug 0
116 #endif
117
118 #include "typedefs.h"
119
120 /*
121  *----------------------------------------------------------------------------
122  * globals
123  *----------------------------------------------------------------------------
124  */
125 ConfOptions *init_options(ConfOptions *options); /* TODO: move to globals.h */
126
127 ConfOptions *options;
128
129
130
131 #ifdef DEBUG
132 extern gint debug;
133 #endif
134
135
136
137 /*
138  *----------------------------------------------------------------------------
139  * main.c
140  *----------------------------------------------------------------------------
141  */
142
143 /*
144  * This also doubles as the main.c header.
145  */
146
147 GtkWidget *window_new(GtkWindowType type, const gchar *name, const gchar *icon,
148                       const gchar *icon_file, const gchar *subtitle);
149 void window_set_icon(GtkWidget *window, const gchar *icon, const gchar *file);
150 gint window_maximized(GtkWidget *window);
151
152 gdouble get_zoom_increment(void);
153
154 const gchar *get_exec_time();
155
156 void help_window_show(const gchar *key);
157
158 void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event);
159 gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
160 void exit_program(void);
161
162 #define CASE_SORT(a, b) ( (options->file_sort.case_sensitive) ? strcmp((a), (b)) : strcasecmp((a), (b)) )
163
164
165 #endif