completely separated global and layout window options
[geeqie.git] / src / options.h
1 /*
2  * Geeqie
3  * Copyright (C) 2008 - 2009 The Geeqie Team
4  *
5  * Authors: Vladimir Nadvornik, Laurent Monin
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 #ifndef OPTIONS_H
13 #define OPTIONS_H
14
15 typedef struct _ConfOptions ConfOptions;
16
17 struct _ConfOptions
18 {
19         /* ui */
20         gboolean progressive_key_scrolling;
21         gboolean place_dialogs_under_mouse;
22         gboolean mousewheel_scrolls;
23         gboolean show_icon_names;
24         gboolean show_copy_path;
25
26         /* various */
27         gboolean tree_descend_subdirs;
28
29         gboolean lazy_image_sync;
30         gboolean update_on_time_change;
31
32         guint duplicates_similarity_threshold;
33
34         gint open_recent_list_maxsize;
35         gint dnd_icon_size;
36
37         gboolean save_window_positions;
38         gboolean tools_restore_state;
39
40         /* start up */
41         struct {
42                 gboolean restore_path;
43                 gboolean use_last_path;
44                 gchar *path;
45         } startup;
46
47         /* file ops */
48         struct {
49                 gboolean enable_in_place_rename;
50
51                 gboolean confirm_delete;
52                 gboolean enable_delete_key;
53                 gboolean safe_delete_enable;
54                 gchar *safe_delete_path;
55                 gint safe_delete_folder_maxsize;
56         } file_ops;
57
58         /* image */
59         struct {
60                 gboolean exif_rotate_enable;
61                 guint scroll_reset_method;
62                 gboolean fit_window_to_image;
63                 gboolean limit_window_size;
64                 gint max_window_size;
65                 gboolean limit_autofit_size;
66                 gint max_autofit_size;
67
68                 gint tile_cache_max;    /* in megabytes */
69                 gint image_cache_max;   /* in megabytes */
70                 guint dither_quality;
71                 gboolean enable_read_ahead;
72
73                 ZoomMode zoom_mode;
74                 gboolean zoom_2pass;
75                 gboolean zoom_to_fit_allow_expand;
76                 guint zoom_quality;
77                 gint zoom_increment;    /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */
78
79                 gint use_custom_border_color;
80                 GdkColor border_color;
81
82                 gint read_buffer_size; /* bytes to read from file per read() */
83                 gint idle_read_loop_count; /* the number of bytes to read per idle call (define x image.read_buffer_size) */
84         } image;
85
86         /* thumbnails */
87         struct {
88                 gint max_width;
89                 gint max_height;
90                 gboolean enable_caching;
91                 gboolean cache_into_dirs;
92                 gboolean fast;
93                 gboolean use_xvpics;
94                 gboolean spec_standard;
95                 guint quality;
96                 gboolean use_exif;
97         } thumbnails;
98
99         /* file filtering */
100         struct {
101                 gboolean show_hidden_files;
102                 gboolean show_dot_directory;
103                 gboolean disable;
104         } file_filter;
105
106         struct {
107                 gchar *ext;
108         } sidecar;
109         
110         /* collections */
111         struct {
112                 gboolean rectangular_selection;
113         } collections;
114
115         /* shell */
116         struct {
117                 gchar *path;
118                 gchar *options;
119         } shell;
120         
121         /* file sorting */
122         struct {
123                 SortType method;
124                 gboolean ascending;
125                 gboolean case_sensitive; /* file sorting method (case) */
126         } file_sort;
127
128         /* slideshow */
129         struct {
130                 gint delay;     /* in tenths of a second */
131                 gboolean random;
132                 gboolean repeat;
133         } slideshow;
134
135         /* fullscreen */
136         struct {
137                 gint screen;
138                 gboolean clean_flip;
139                 gboolean disable_saver;
140                 gboolean above;
141         } fullscreen;
142
143         /* image overlay */
144         struct {
145                 gchar *template_string;
146                 gint x;
147                 gint y;
148         } image_overlay;
149
150         /* properties dialog */
151         struct {
152                 gchar *tabs_order;
153         } properties;
154
155         /* color profiles */
156         struct {
157                 gboolean enabled;
158                 gint input_type;
159                 gchar *input_file[COLOR_PROFILE_INPUTS];
160                 gchar *input_name[COLOR_PROFILE_INPUTS];
161                 gint screen_type;
162                 gchar *screen_file;
163                 gboolean use_image;
164
165         } color_profile;
166
167         /* Helpers programs */
168         struct {
169                 struct {
170                         gchar *command_name;
171                         gchar *command_line;
172                 } html_browser;
173         } helpers;
174
175         /* Metadata */
176         struct {
177                 gboolean enable_metadata_dirs;
178
179                 gboolean save_in_image_file;
180                 gboolean save_legacy_IPTC;
181                 gboolean warn_on_write_problems;
182
183                 gboolean save_legacy_format;
184                 
185                 gboolean sync_grouped_files;
186                 
187                 gboolean confirm_write;
188                 gint confirm_timeout;
189                 gboolean confirm_after_timeout;
190                 gboolean confirm_on_image_change;
191                 gboolean confirm_on_dir_change;
192         } metadata;
193
194 };
195
196 ConfOptions *options;
197 CommandLine *command_line;
198
199 ConfOptions *init_options(ConfOptions *options);
200 void setup_default_options(ConfOptions *options);
201 void save_options(ConfOptions *options);
202 gboolean load_options(ConfOptions *options);
203
204 void copy_layout_options(LayoutOptions *dest, const LayoutOptions *src);
205 void free_layout_options_content(LayoutOptions *dest);
206 LayoutOptions *init_layout_options(LayoutOptions *options);
207
208 #endif /* OPTIONS_H */
209 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */