138de5aca91710b2059ca81d88c65cc90f34968c
[geeqie.git] / src / options.h
1 /*
2  * Geeqie
3  * Copyright (C) 2008 - 2012 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
25         /* various */
26         gboolean tree_descend_subdirs;
27
28         gboolean lazy_image_sync;
29         gboolean update_on_time_change;
30
31         guint duplicates_similarity_threshold;
32
33         gint open_recent_list_maxsize;
34         gint dnd_icon_size;
35
36         gboolean save_window_positions;
37         gboolean tools_restore_state;
38
39         /* file ops */
40         struct {
41                 gboolean enable_in_place_rename;
42
43                 gboolean confirm_delete;
44                 gboolean enable_delete_key;
45                 gboolean safe_delete_enable;
46                 gchar *safe_delete_path;
47                 gint safe_delete_folder_maxsize;
48         } file_ops;
49
50         /* image */
51         struct {
52                 gboolean exif_rotate_enable;
53                 gboolean exif_proof_rotate_enable;
54                 guint scroll_reset_method;
55                 gboolean fit_window_to_image;
56                 gboolean limit_window_size;
57                 gint max_window_size;
58                 gboolean limit_autofit_size;
59                 gint max_autofit_size;
60
61                 gint tile_cache_max;    /* in megabytes */
62                 gint image_cache_max;   /* in megabytes */
63                 gboolean enable_read_ahead;
64
65                 ZoomMode zoom_mode;
66                 gboolean zoom_2pass;
67                 gboolean zoom_to_fit_allow_expand;
68                 guint zoom_quality;
69                 gint zoom_increment;    /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */
70                 gboolean use_clutter_renderer;
71
72                 gboolean use_custom_border_color_in_fullscreen;
73                 gboolean use_custom_border_color;
74                 GdkColor border_color;
75         } image;
76
77         /* thumbnails */
78         struct {
79                 gint max_width;
80                 gint max_height;
81                 gboolean enable_caching;
82                 gboolean cache_into_dirs;
83                 gboolean use_xvpics;
84                 gboolean spec_standard;
85                 guint quality;
86                 gboolean use_exif;
87         } thumbnails;
88
89         /* file filtering */
90         struct {
91                 gboolean show_hidden_files;
92                 gboolean show_parent_directory;
93                 gboolean show_dot_directory;
94                 gboolean disable_file_extension_checks;
95                 gboolean disable;
96         } file_filter;
97
98         struct {
99                 gchar *ext;
100         } sidecar;
101
102         /* collections */
103         struct {
104                 gboolean rectangular_selection;
105         } collections;
106
107         /* shell */
108         struct {
109                 gchar *path;
110                 gchar *options;
111         } shell;
112
113         /* file sorting */
114         struct {
115                 SortType method;
116                 gboolean ascending;
117                 gboolean case_sensitive; /* file sorting method (case) */
118         } file_sort;
119
120         /* slideshow */
121         struct {
122                 gint delay;     /* in tenths of a second */
123                 gboolean random;
124                 gboolean repeat;
125         } slideshow;
126
127         /* fullscreen */
128         struct {
129                 gint screen;
130                 gboolean clean_flip;
131                 gboolean disable_saver;
132                 gboolean above;
133         } fullscreen;
134
135         /* image overlay */
136         struct {
137                 gchar *template_string;
138                 gint x;
139                 gint y;
140         } image_overlay;
141
142         /* properties dialog */
143         struct {
144                 gchar *tabs_order;
145         } properties;
146
147         /* color profiles */
148         struct {
149                 gboolean enabled;
150                 gint input_type;
151                 gchar *input_file[COLOR_PROFILE_INPUTS];
152                 gchar *input_name[COLOR_PROFILE_INPUTS];
153                 gchar *screen_file;
154                 gboolean use_image;
155                 gboolean use_x11_screen_profile;
156
157         } color_profile;
158
159         /* Helpers programs */
160         struct {
161                 struct {
162                         gchar *command_name;
163                         gchar *command_line;
164                 } html_browser;
165         } helpers;
166
167         /* Metadata */
168         struct {
169                 gboolean enable_metadata_dirs;
170
171                 gboolean save_in_image_file;
172                 gboolean save_legacy_IPTC;
173                 gboolean warn_on_write_problems;
174
175                 gboolean save_legacy_format;
176
177                 gboolean sync_grouped_files;
178
179                 gboolean confirm_write;
180                 gint confirm_timeout;
181                 gboolean confirm_after_timeout;
182                 gboolean confirm_on_image_change;
183                 gboolean confirm_on_dir_change;
184                 gboolean keywords_case_sensitive;
185                 gboolean write_orientation;
186         } metadata;
187
188         /* Stereo */
189         struct {
190                 gint mode;;
191                 gint fsmode;
192                 gboolean enable_fsmode;
193                 gint fixed_w, fixed_h;
194                 gint fixed_x1, fixed_y1;
195                 gint fixed_x2, fixed_y2;
196                 struct { /* options in this struct are packed to mode and fsmode entries */
197                         gboolean mirror_right;
198                         gboolean mirror_left;
199                         gboolean flip_right;
200                         gboolean flip_left;
201                         gboolean swap;
202                         gboolean temp_disable;
203                         gboolean fs_mirror_right;
204                         gboolean fs_mirror_left;
205                         gboolean fs_flip_right;
206                         gboolean fs_flip_left;
207                         gboolean fs_swap;
208                         gboolean fs_temp_disable;
209                 } tmp;
210         } stereo;
211 };
212
213 ConfOptions *options;
214 CommandLine *command_line;
215
216 ConfOptions *init_options(ConfOptions *options);
217 void setup_default_options(ConfOptions *options);
218 void save_options(ConfOptions *options);
219 gboolean load_options(ConfOptions *options);
220
221 void copy_layout_options(LayoutOptions *dest, const LayoutOptions *src);
222 void free_layout_options_content(LayoutOptions *dest);
223 LayoutOptions *init_layout_options(LayoutOptions *options);
224
225 #endif /* OPTIONS_H */
226 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */