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