(Re)-implement natural and case sorting
[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 struct ConfOptions
25 {
26         /* ui */
27         gboolean progressive_key_scrolling;
28         guint keyboard_scroll_step;
29         gboolean place_dialogs_under_mouse;
30         gboolean mousewheel_scrolls;
31         gboolean image_lm_click_nav;
32         gboolean image_l_click_archive;
33         gboolean image_l_click_video;
34         gchar *image_l_click_video_editor;
35         gboolean show_icon_names;
36         gboolean show_star_rating;
37         gboolean draw_rectangle;
38         gboolean show_predefined_keyword_tree;
39         gboolean overunderexposed;
40         gboolean expand_menu_toolbar;
41
42         /* various */
43         gboolean tree_descend_subdirs;
44         gboolean view_dir_list_single_click_enter;
45
46         gboolean circular_selection_lists;
47
48         gboolean lazy_image_sync;
49         gboolean update_on_time_change;
50
51         guint duplicates_similarity_threshold;
52         guint duplicates_match;
53         gboolean duplicates_thumbnails;
54         guint duplicates_select_type;
55         gboolean rot_invariant_sim;
56         gboolean sort_totals;
57
58         gint open_recent_list_maxsize;
59         gint recent_folder_image_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 appimage_notifications;
77
78         gboolean with_rename;
79         gboolean collections_on_top;
80         gboolean hide_window_in_fullscreen;
81
82         gchar *help_search_engine;
83
84         /**
85          * @struct info_comment
86          * info sidebar component height
87          */
88         struct {
89                 gint height;
90         } info_comment;
91
92         /**
93          * @struct info_keywords
94          * info sidebar component height
95          */
96         struct {
97                 gint height;
98         } info_keywords;
99
100         /**
101          * @struct info_title
102          * info sidebar component height
103          */
104         struct {
105                 gint height;
106         } info_title;
107
108         /**
109          * @struct info_rating
110          * info sidebar component height
111          */
112         struct {
113                 gint height;
114         } info_rating;
115
116         /**
117          * @struct info_headline
118          * info sidebar component height
119          */
120         struct {
121                 gint height;
122         } info_headline;
123
124         /* file ops */
125         struct {
126                 gboolean enable_in_place_rename;
127
128                 gboolean confirm_delete;
129                 gboolean confirm_move_to_trash;
130                 gboolean enable_delete_key;
131                 gboolean safe_delete_enable;
132                 gboolean use_system_trash;
133                 gchar *safe_delete_path;
134                 gint safe_delete_folder_maxsize;
135                 gboolean no_trash;
136         } file_ops;
137
138         /* image */
139         struct {
140                 gboolean exif_rotate_enable;
141                 guint scroll_reset_method;
142                 gboolean fit_window_to_image;
143                 gboolean limit_window_size;
144                 gint max_window_size;
145                 gboolean limit_autofit_size;
146                 gint max_autofit_size;
147                 gint max_enlargement_size;
148
149                 gint tile_cache_max;    /**< in megabytes */
150                 gint image_cache_max;   /**< in megabytes */
151                 gboolean enable_read_ahead;
152
153                 ZoomMode zoom_mode;
154                 gboolean zoom_2pass;
155                 gboolean zoom_to_fit_allow_expand;
156                 guint zoom_quality;
157                 gint zoom_increment;    /**< 100 is 1.0, 5 is 0.05, 200 is 2.0, etc. */
158                 ZoomStyle zoom_style;
159
160                 gboolean use_custom_border_color_in_fullscreen;
161                 gboolean use_custom_border_color;
162                 GdkColor border_color;
163                 GdkColor alpha_color_1;
164                 GdkColor alpha_color_2;
165
166                 gint tile_size;
167         } image;
168
169         /* thumbnails */
170         struct {
171                 gint max_width;
172                 gint max_height;
173                 gboolean enable_caching;
174                 gboolean cache_into_dirs;
175                 gboolean use_xvpics;
176                 gboolean spec_standard;
177                 guint quality;
178                 gboolean use_exif;
179                 gboolean use_color_management;
180                 gboolean use_ft_metadata;
181                 gint collection_preview;
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                 gboolean case_sensitive; /**< file sorting method (case) */
211         } file_sort;
212
213         /* slideshow */
214         struct {
215                 gint delay;     /**< in tenths of a second */
216                 gboolean random;
217                 gboolean repeat;
218         } slideshow;
219
220         /* fullscreen */
221         struct {
222                 gint screen;
223                 gboolean clean_flip;
224                 gboolean disable_saver;
225                 gboolean above;
226         } fullscreen;
227
228         /* image overlay */
229         struct {
230                 gchar *template_string;
231                 gint x;
232                 gint y;
233                 guint16 text_red;
234                 guint16 text_green;
235                 guint16 text_blue;
236                 guint16 text_alpha;
237                 guint16 background_red;
238                 guint16 background_green;
239                 guint16 background_blue;
240                 guint16 background_alpha;
241                 gchar *font;
242         } image_overlay;
243
244         /* properties dialog */
245         struct {
246                 gchar *tabs_order;
247         } properties;
248
249         /* color profiles */
250         struct {
251                 gboolean enabled;
252                 gint input_type;
253                 gchar *input_file[COLOR_PROFILE_INPUTS];
254                 gchar *input_name[COLOR_PROFILE_INPUTS];
255                 gchar *screen_file;
256                 gboolean use_image;
257                 gboolean use_x11_screen_profile;
258                 gint render_intent;
259         } color_profile;
260
261         /* Helpers programs */
262         struct {
263                 struct {
264                         gchar *command_name;
265                         gchar *command_line;
266                 } html_browser;
267         } helpers;
268
269         /* Metadata */
270         struct {
271                 gboolean enable_metadata_dirs;
272
273                 gboolean save_in_image_file;
274                 gboolean save_legacy_IPTC;
275                 gboolean warn_on_write_problems;
276
277                 gboolean save_legacy_format;
278
279                 gboolean sync_grouped_files;
280
281                 gboolean confirm_write;
282                 gint confirm_timeout;
283                 gboolean confirm_after_timeout;
284                 gboolean confirm_on_image_change;
285                 gboolean confirm_on_dir_change;
286                 gboolean keywords_case_sensitive;
287                 gboolean write_orientation;
288                 gboolean sidecar_extended_name;
289
290                 gboolean check_spelling;
291         } metadata;
292
293         /* Stereo */
294         struct {
295                 gint mode;
296                 gint fsmode;
297                 gboolean enable_fsmode;
298                 gint fixed_w, fixed_h;
299                 gint fixed_x1, fixed_y1;
300                 gint fixed_x2, fixed_y2;
301                 /**
302                  * @struct tmp
303                  * options in this struct are packed to mode and fsmode entries
304                  */
305                 struct {
306                         gboolean mirror_right;
307                         gboolean mirror_left;
308                         gboolean flip_right;
309                         gboolean flip_left;
310                         gboolean swap;
311                         gboolean temp_disable;
312                         gboolean fs_mirror_right;
313                         gboolean fs_mirror_left;
314                         gboolean fs_flip_right;
315                         gboolean fs_flip_left;
316                         gboolean fs_swap;
317                         gboolean fs_temp_disable;
318                 } tmp;
319         } stereo;
320
321         /* External preview extraction */
322         struct {
323                 gboolean enable;
324                 gchar *select; /**< path to executable */
325                 gchar *extract; /**< path to executable */
326         } external_preview;
327
328         /**
329          * @struct cp_mv_rn
330          * copy move rename
331          */
332         struct {
333                 gint auto_start;
334                 gchar *auto_end;
335                 gint auto_padding;
336                 gint formatted_start;
337         } cp_mv_rn;
338
339         /* log window */
340         struct {
341                 gboolean paused;
342                 gboolean line_wrap;
343                 gboolean timer_data;
344                 gchar *action; /** Used with F1 key */
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.cc */
378         gboolean override_disable_gpu; /**< GPU - see main.cc */
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: */