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