Collections changes
[geeqie.git] / src / options.h
1 /*
2  * Copyright (C) 2008 - 2016 The Geeqie Team
3  *
4  * Authors: Vladimir Nadvornik, Laurent Monin
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef OPTIONS_H
22 #define OPTIONS_H
23
24 typedef struct _ConfOptions ConfOptions;
25
26 struct _ConfOptions
27 {
28         /* ui */
29         gboolean progressive_key_scrolling;
30         guint keyboard_scroll_step;
31         gboolean place_dialogs_under_mouse;
32         gboolean mousewheel_scrolls;
33         gboolean image_lm_click_nav;
34         gboolean image_l_click_video;
35         gchar *image_l_click_video_editor;
36         gboolean show_icon_names;
37         gboolean show_star_rating;
38
39         /* various */
40         gboolean tree_descend_subdirs;
41         gboolean view_dir_list_single_click_enter;
42
43         gboolean lazy_image_sync;
44         gboolean update_on_time_change;
45
46         guint duplicates_similarity_threshold;
47         guint duplicates_match;
48         gboolean duplicates_thumbnails;
49         guint duplicates_select_type;
50         gboolean rot_invariant_sim;
51         gboolean sort_totals;
52
53         gint open_recent_list_maxsize;
54         gint dnd_icon_size;
55         gint clipboard_selection;
56
57         gboolean save_window_positions;
58         gboolean use_saved_window_positions_for_new_windows;
59         gboolean tools_restore_state;
60         gboolean save_dialog_window_positions;
61         gboolean show_window_ids;
62
63         gint log_window_lines;
64
65         gboolean marks_save;            // save marks on exit
66         gchar *marks_tooltips[FILEDATA_MARKS_SIZE];
67
68         gboolean with_rename;
69         gboolean collections_on_top;
70
71         gchar *help_search_engine;
72
73         /* info sidebar component heights */
74         struct {
75                 gint height;
76         } info_comment;
77
78         struct {
79                 gint height;
80         } info_keywords;
81
82         struct {
83                 gint height;
84         } info_title;
85
86         struct {
87                 gint height;
88         } info_rating;
89
90         /* file ops */
91         struct {
92                 gboolean enable_in_place_rename;
93
94                 gboolean confirm_delete;
95                 gboolean enable_delete_key;
96                 gboolean safe_delete_enable;
97                 gchar *safe_delete_path;
98                 gint safe_delete_folder_maxsize;
99         } file_ops;
100
101         /* image */
102         struct {
103                 gboolean exif_rotate_enable;
104                 gboolean exif_proof_rotate_enable;
105                 guint scroll_reset_method;
106                 gboolean fit_window_to_image;
107                 gboolean limit_window_size;
108                 gint max_window_size;
109                 gboolean limit_autofit_size;
110                 gint max_autofit_size;
111                 gint max_enlargement_size;
112
113                 gint tile_cache_max;    /* in megabytes */
114                 gint image_cache_max;   /* in megabytes */
115                 gboolean enable_read_ahead;
116
117                 ZoomMode zoom_mode;
118                 gboolean zoom_2pass;
119                 gboolean zoom_to_fit_allow_expand;
120                 guint zoom_quality;
121                 gint zoom_increment;    /* 100 is 1.0, 5 is 0.05, 200 is 2.0, etc. */
122                 gboolean use_clutter_renderer;
123
124                 gboolean use_custom_border_color_in_fullscreen;
125                 gboolean use_custom_border_color;
126                 GdkColor border_color;
127                 GdkColor alpha_color_1;
128                 GdkColor alpha_color_2;
129         } image;
130
131         /* thumbnails */
132         struct {
133                 gint max_width;
134                 gint max_height;
135                 gboolean enable_caching;
136                 gboolean cache_into_dirs;
137                 gboolean use_xvpics;
138                 gboolean spec_standard;
139                 guint quality;
140                 gboolean use_exif;
141                 gboolean use_ft_metadata;
142 //              gboolean use_ft_metadata_small;
143         } thumbnails;
144
145         /* file filtering */
146         struct {
147                 gboolean show_hidden_files;
148                 gboolean show_parent_directory;
149                 gboolean show_dot_directory;
150                 gboolean disable_file_extension_checks;
151                 gboolean disable;
152         } file_filter;
153
154         struct {
155                 gchar *ext;
156         } sidecar;
157
158         /* collections */
159         struct {
160                 gboolean rectangular_selection;
161         } collections;
162
163         /* shell */
164         struct {
165                 gchar *path;
166                 gchar *options;
167         } shell;
168
169         /* file sorting */
170         struct {
171                 SortType method;
172                 gboolean ascending;
173                 gboolean case_sensitive; /* file sorting method (case) */
174                 gboolean natural;
175         } file_sort;
176
177         /* slideshow */
178         struct {
179                 gint delay;     /* in tenths of a second */
180                 gboolean random;
181                 gboolean repeat;
182         } slideshow;
183
184         /* fullscreen */
185         struct {
186                 gint screen;
187                 gboolean clean_flip;
188                 gboolean disable_saver;
189                 gboolean above;
190         } fullscreen;
191
192         /* image overlay */
193         struct {
194                 gchar *template_string;
195                 gint x;
196                 gint y;
197                 guint16 text_red;
198                 guint16 text_green;
199                 guint16 text_blue;
200                 guint16 text_alpha;
201                 guint16 background_red;
202                 guint16 background_green;
203                 guint16 background_blue;
204                 guint16 background_alpha;
205                 gchar *font;
206         } image_overlay;
207
208         /* properties dialog */
209         struct {
210                 gchar *tabs_order;
211         } properties;
212
213         /* color profiles */
214         struct {
215                 gboolean enabled;
216                 gint input_type;
217                 gchar *input_file[COLOR_PROFILE_INPUTS];
218                 gchar *input_name[COLOR_PROFILE_INPUTS];
219                 gchar *screen_file;
220                 gboolean use_image;
221                 gboolean use_x11_screen_profile;
222                 gint render_intent;
223         } color_profile;
224
225         /* Helpers programs */
226         struct {
227                 struct {
228                         gchar *command_name;
229                         gchar *command_line;
230                 } html_browser;
231         } helpers;
232
233         /* Metadata */
234         struct {
235                 gboolean enable_metadata_dirs;
236
237                 gboolean save_in_image_file;
238                 gboolean save_legacy_IPTC;
239                 gboolean warn_on_write_problems;
240
241                 gboolean save_legacy_format;
242
243                 gboolean sync_grouped_files;
244
245                 gboolean confirm_write;
246                 gint confirm_timeout;
247                 gboolean confirm_after_timeout;
248                 gboolean confirm_on_image_change;
249                 gboolean confirm_on_dir_change;
250                 gboolean keywords_case_sensitive;
251                 gboolean write_orientation;
252                 gboolean sidecar_extended_name;
253         } metadata;
254
255         /* Stereo */
256         struct {
257                 gint mode;;
258                 gint fsmode;
259                 gboolean enable_fsmode;
260                 gint fixed_w, fixed_h;
261                 gint fixed_x1, fixed_y1;
262                 gint fixed_x2, fixed_y2;
263                 struct { /* options in this struct are packed to mode and fsmode entries */
264                         gboolean mirror_right;
265                         gboolean mirror_left;
266                         gboolean flip_right;
267                         gboolean flip_left;
268                         gboolean swap;
269                         gboolean temp_disable;
270                         gboolean fs_mirror_right;
271                         gboolean fs_mirror_left;
272                         gboolean fs_flip_right;
273                         gboolean fs_flip_left;
274                         gboolean fs_swap;
275                         gboolean fs_temp_disable;
276                 } tmp;
277         } stereo;
278
279         /* copy move rename */
280         struct {
281                 gint auto_start;
282                 gchar *auto_end;
283                 gint auto_padding;
284                 gint formatted_start;
285         } cp_mv_rn;
286
287         /* log window */
288         struct {
289                 gboolean paused;
290                 gboolean line_wrap;
291                 gboolean timer_data;
292         } log_window;
293
294         /* star rating */
295         struct {
296                 gunichar star;
297                 gunichar rejected;
298         } star_rating;
299
300         gboolean read_metadata_in_idle;
301 };
302
303 ConfOptions *options;
304 CommandLine *command_line;
305
306 ConfOptions *init_options(ConfOptions *options);
307 void setup_default_options(ConfOptions *options);
308 void save_options(ConfOptions *options);
309 gboolean load_options(ConfOptions *options);
310
311 void copy_layout_options(LayoutOptions *dest, const LayoutOptions *src);
312 void free_layout_options_content(LayoutOptions *dest);
313 LayoutOptions *init_layout_options(LayoutOptions *options);
314
315 #endif /* OPTIONS_H */
316 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */