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