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