Fix #705: Toolbar status class filter
[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         gboolean show_guidelines;
39         gboolean draw_rectangle;
40         gboolean show_predefined_keyword_tree;
41         gboolean overunderexposed;
42
43         /* various */
44         gboolean tree_descend_subdirs;
45         gboolean view_dir_list_single_click_enter;
46
47         gboolean lazy_image_sync;
48         gboolean update_on_time_change;
49
50         guint duplicates_similarity_threshold;
51         guint duplicates_match;
52         gboolean duplicates_thumbnails;
53         guint duplicates_select_type;
54         gboolean rot_invariant_sim;
55         gboolean sort_totals;
56
57         gint open_recent_list_maxsize;
58         gint dnd_icon_size;
59         gint clipboard_selection;
60
61         gboolean save_window_positions;
62         gboolean use_saved_window_positions_for_new_windows;
63         gboolean tools_restore_state;
64         gboolean save_dialog_window_positions;
65         gboolean show_window_ids;
66
67         gint log_window_lines;
68
69         gboolean marks_save;            // save marks on exit
70         gchar *marks_tooltips[FILEDATA_MARKS_SIZE];
71
72         gboolean with_rename;
73         gboolean collections_on_top;
74
75         gchar *help_search_engine;
76
77         /* info sidebar component heights */
78         struct {
79                 gint height;
80         } info_comment;
81
82         struct {
83                 gint height;
84         } info_keywords;
85
86         struct {
87                 gint height;
88         } info_title;
89
90         struct {
91                 gint height;
92         } info_rating;
93
94         /* file ops */
95         struct {
96                 gboolean enable_in_place_rename;
97
98                 gboolean confirm_delete;
99                 gboolean confirm_move_to_trash;
100                 gboolean enable_delete_key;
101                 gboolean safe_delete_enable;
102                 gboolean use_system_trash;
103                 gchar *safe_delete_path;
104                 gint safe_delete_folder_maxsize;
105                 gboolean no_trash;
106         } file_ops;
107
108         /* image */
109         struct {
110                 gboolean exif_rotate_enable;
111                 gboolean exif_proof_rotate_enable;
112                 guint scroll_reset_method;
113                 gboolean fit_window_to_image;
114                 gboolean limit_window_size;
115                 gint max_window_size;
116                 gboolean limit_autofit_size;
117                 gint max_autofit_size;
118                 gint max_enlargement_size;
119
120                 gint tile_cache_max;    /* in megabytes */
121                 gint image_cache_max;   /* in megabytes */
122                 gboolean enable_read_ahead;
123
124                 ZoomMode zoom_mode;
125                 gboolean zoom_2pass;
126                 gboolean zoom_to_fit_allow_expand;
127                 guint zoom_quality;
128                 gint zoom_increment;    /* 100 is 1.0, 5 is 0.05, 200 is 2.0, etc. */
129                 gboolean use_clutter_renderer;
130
131                 gboolean use_custom_border_color_in_fullscreen;
132                 gboolean use_custom_border_color;
133                 GdkColor border_color;
134                 GdkColor alpha_color_1;
135                 GdkColor alpha_color_2;
136         } image;
137
138         /* thumbnails */
139         struct {
140                 gint max_width;
141                 gint max_height;
142                 gboolean enable_caching;
143                 gboolean cache_into_dirs;
144                 gboolean use_xvpics;
145                 gboolean spec_standard;
146                 guint quality;
147                 gboolean use_exif;
148                 gboolean use_ft_metadata;
149                 gint collection_preview;
150 //              gboolean use_ft_metadata_small;
151         } thumbnails;
152
153         /* file filtering */
154         struct {
155                 gboolean show_hidden_files;
156                 gboolean show_parent_directory;
157                 gboolean show_dot_directory;
158                 gboolean disable_file_extension_checks;
159                 gboolean disable;
160         } file_filter;
161
162         struct {
163                 gchar *ext;
164         } sidecar;
165
166         /* collections */
167         struct {
168                 gboolean rectangular_selection;
169         } collections;
170
171         /* shell */
172         struct {
173                 gchar *path;
174                 gchar *options;
175         } shell;
176
177         /* file sorting */
178         struct {
179                 SortType method;
180                 gboolean ascending;
181                 gboolean case_sensitive; /* file sorting method (case) */
182                 gboolean natural;
183         } file_sort;
184
185         /* slideshow */
186         struct {
187                 gint delay;     /* in tenths of a second */
188                 gboolean random;
189                 gboolean repeat;
190         } slideshow;
191
192         /* fullscreen */
193         struct {
194                 gint screen;
195                 gboolean clean_flip;
196                 gboolean disable_saver;
197                 gboolean above;
198         } fullscreen;
199
200         /* image overlay */
201         struct {
202                 gchar *template_string;
203                 gint x;
204                 gint y;
205                 guint16 text_red;
206                 guint16 text_green;
207                 guint16 text_blue;
208                 guint16 text_alpha;
209                 guint16 background_red;
210                 guint16 background_green;
211                 guint16 background_blue;
212                 guint16 background_alpha;
213                 gchar *font;
214         } image_overlay;
215
216         /* properties dialog */
217         struct {
218                 gchar *tabs_order;
219         } properties;
220
221         /* color profiles */
222         struct {
223                 gboolean enabled;
224                 gint input_type;
225                 gchar *input_file[COLOR_PROFILE_INPUTS];
226                 gchar *input_name[COLOR_PROFILE_INPUTS];
227                 gchar *screen_file;
228                 gboolean use_image;
229                 gboolean use_x11_screen_profile;
230                 gint render_intent;
231         } color_profile;
232
233         /* Helpers programs */
234         struct {
235                 struct {
236                         gchar *command_name;
237                         gchar *command_line;
238                 } html_browser;
239         } helpers;
240
241         /* Metadata */
242         struct {
243                 gboolean enable_metadata_dirs;
244
245                 gboolean save_in_image_file;
246                 gboolean save_legacy_IPTC;
247                 gboolean warn_on_write_problems;
248
249                 gboolean save_legacy_format;
250
251                 gboolean sync_grouped_files;
252
253                 gboolean confirm_write;
254                 gint confirm_timeout;
255                 gboolean confirm_after_timeout;
256                 gboolean confirm_on_image_change;
257                 gboolean confirm_on_dir_change;
258                 gboolean keywords_case_sensitive;
259                 gboolean write_orientation;
260                 gboolean sidecar_extended_name;
261         } metadata;
262
263         /* Stereo */
264         struct {
265                 gint mode;;
266                 gint fsmode;
267                 gboolean enable_fsmode;
268                 gint fixed_w, fixed_h;
269                 gint fixed_x1, fixed_y1;
270                 gint fixed_x2, fixed_y2;
271                 struct { /* options in this struct are packed to mode and fsmode entries */
272                         gboolean mirror_right;
273                         gboolean mirror_left;
274                         gboolean flip_right;
275                         gboolean flip_left;
276                         gboolean swap;
277                         gboolean temp_disable;
278                         gboolean fs_mirror_right;
279                         gboolean fs_mirror_left;
280                         gboolean fs_flip_right;
281                         gboolean fs_flip_left;
282                         gboolean fs_swap;
283                         gboolean fs_temp_disable;
284                 } tmp;
285         } stereo;
286
287         /* copy move rename */
288         struct {
289                 gint auto_start;
290                 gchar *auto_end;
291                 gint auto_padding;
292                 gint formatted_start;
293         } cp_mv_rn;
294
295         /* log window */
296         struct {
297                 gboolean paused;
298                 gboolean line_wrap;
299                 gboolean timer_data;
300         } log_window;
301
302         /* star rating */
303         struct {
304                 gunichar star;
305                 gunichar rejected;
306         } star_rating;
307
308         /* Printer */
309         struct {
310                 gchar *image_font;
311                 gchar *page_font;
312                 gboolean show_image_text;
313                 gboolean show_page_text;
314                 gchar *page_text;
315                 gint image_text_position;
316                 gint page_text_position;
317                 gchar *template_string;
318         } printer;
319
320         /* user-definable mouse buttons */
321         gchar *mouse_button_8;
322         gchar *mouse_button_9;
323
324         /* class file filter */
325         gboolean class_filter[FILE_FORMAT_CLASSES];
326
327         gboolean read_metadata_in_idle;
328
329         GList *disabled_plugins;
330 };
331
332 ConfOptions *options;
333 CommandLine *command_line;
334
335 ConfOptions *init_options(ConfOptions *options);
336 void setup_default_options(ConfOptions *options);
337 void save_options(ConfOptions *options);
338 gboolean load_options(ConfOptions *options);
339
340 void copy_layout_options(LayoutOptions *dest, const LayoutOptions *src);
341 void free_layout_options_content(LayoutOptions *dest);
342 LayoutOptions *init_layout_options(LayoutOptions *options);
343
344 #endif /* OPTIONS_H */
345 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */