Fix missing translation
[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 #include <gdk/gdk.h>
25
26 #include "typedefs.h"
27
28 struct SecureSaveInfo;
29
30 #define COLOR_PROFILE_INPUTS 4
31
32 /**
33  * @enum DnDAction
34  * drag and drop default action
35  */
36 enum DnDAction {
37         DND_ACTION_ASK,
38         DND_ACTION_COPY,
39         DND_ACTION_MOVE
40 };
41
42 enum ZoomStyle {
43         ZOOM_GEOMETRIC  = 0,
44         ZOOM_ARITHMETIC = 1
45 };
46
47 struct ConfOptions
48 {
49         /* ui */
50         gboolean progressive_key_scrolling;
51         guint keyboard_scroll_step;
52         gboolean place_dialogs_under_mouse;
53         gboolean mousewheel_scrolls;
54         gboolean image_lm_click_nav;
55         gboolean image_l_click_archive;
56         gboolean image_l_click_video;
57         gchar *image_l_click_video_editor;
58         gboolean show_icon_names;
59         gboolean show_star_rating;
60         gboolean draw_rectangle;
61         gboolean show_predefined_keyword_tree;
62         gboolean overunderexposed;
63         gboolean expand_menu_toolbar;
64         gboolean hamburger_menu;
65
66         /* various */
67         gboolean tree_descend_subdirs;
68         gboolean view_dir_list_single_click_enter;
69
70         gboolean circular_selection_lists;
71
72         gboolean lazy_image_sync;
73         gboolean update_on_time_change;
74
75         guint duplicates_similarity_threshold;
76         guint duplicates_match;
77         gboolean duplicates_thumbnails;
78         guint duplicates_select_type;
79         gboolean rot_invariant_sim;
80         gboolean sort_totals;
81
82         gint open_recent_list_maxsize;
83         gint recent_folder_image_list_maxsize;
84         gint dnd_icon_size;
85         DnDAction dnd_default_action;
86         gint clipboard_selection;
87
88         gboolean save_window_positions;
89         gboolean use_saved_window_positions_for_new_windows;
90         gboolean save_window_workspace;
91         gboolean tools_restore_state;
92         gboolean save_dialog_window_positions;
93         gboolean show_window_ids;
94
95         gint log_window_lines;
96
97         gboolean marks_save;            /**< save marks on exit */
98         gchar *marks_tooltips[FILEDATA_MARKS_SIZE];
99
100         gboolean appimage_notifications;
101
102         gboolean with_rename;
103         gboolean collections_duplicates;
104         gboolean collections_on_top;
105         gboolean hide_window_in_fullscreen;
106
107         gchar *help_search_engine;
108
109         /**
110          * @struct info_comment
111          * info sidebar component height
112          */
113         struct {
114                 gint height;
115         } info_comment;
116
117         /**
118          * @struct info_keywords
119          * info sidebar component height
120          */
121         struct {
122                 gint height;
123         } info_keywords;
124
125         /**
126          * @struct info_title
127          * info sidebar component height
128          */
129         struct {
130                 gint height;
131         } info_title;
132
133         /**
134          * @struct info_rating
135          * info sidebar component height
136          */
137         struct {
138                 gint height;
139         } info_rating;
140
141         /**
142          * @struct info_headline
143          * info sidebar component height
144          */
145         struct {
146                 gint height;
147         } info_headline;
148
149         /* file ops */
150         struct {
151                 gboolean enable_in_place_rename;
152
153                 gboolean confirm_delete;
154                 gboolean confirm_move_to_trash;
155                 gboolean enable_delete_key;
156                 gboolean safe_delete_enable;
157                 gboolean use_system_trash;
158                 gchar *safe_delete_path;
159                 gint safe_delete_folder_maxsize;
160                 gboolean no_trash;
161         } file_ops;
162
163         /* image */
164         struct {
165                 gboolean exif_rotate_enable;
166                 guint scroll_reset_method;
167                 gboolean fit_window_to_image;
168                 gboolean limit_window_size;
169                 gint max_window_size;
170                 gboolean limit_autofit_size;
171                 gint max_autofit_size;
172                 gint max_enlargement_size;
173
174                 gint tile_cache_max;    /**< in megabytes */
175                 gint image_cache_max;   /**< in megabytes */
176                 gboolean enable_read_ahead;
177
178                 ZoomMode zoom_mode;
179                 gboolean zoom_2pass;
180                 gboolean zoom_to_fit_allow_expand;
181                 guint zoom_quality;
182                 gint zoom_increment;    /**< 100 is 1.0, 5 is 0.05, 200 is 2.0, etc. */
183                 ZoomStyle zoom_style;
184
185                 gboolean use_custom_border_color_in_fullscreen;
186                 gboolean use_custom_border_color;
187                 GdkRGBA border_color;
188                 GdkRGBA alpha_color_1;
189                 GdkRGBA alpha_color_2;
190
191                 gint tile_size;
192         } image;
193
194         /* thumbnails */
195         struct {
196                 gint max_width;
197                 gint max_height;
198                 gboolean enable_caching;
199                 gboolean cache_into_dirs;
200                 gboolean use_xvpics;
201                 gboolean spec_standard;
202                 guint quality;
203                 gboolean use_exif;
204                 gboolean use_color_management;
205                 gboolean use_ft_metadata;
206                 gint collection_preview;
207         } thumbnails;
208
209         /* file filtering */
210         struct {
211                 gboolean show_hidden_files;
212                 gboolean show_parent_directory;
213                 gboolean show_dot_directory;
214                 gboolean disable_file_extension_checks;
215                 gboolean disable;
216         } file_filter;
217
218         struct {
219                 gchar *ext;
220         } sidecar;
221
222         /* collections */
223         struct {
224                 gboolean rectangular_selection;
225         } collections;
226
227         /* shell */
228         struct {
229                 gchar *path;
230                 gchar *options;
231         } shell;
232
233         /* file sorting */
234         struct {
235                 gboolean case_sensitive; /**< file sorting method (case) */
236         } file_sort;
237
238         /* slideshow */
239         struct {
240                 gint delay;     /**< in tenths of a second */
241                 gboolean random;
242                 gboolean repeat;
243         } slideshow;
244
245         /* fullscreen */
246         struct {
247                 gint screen;
248                 gboolean clean_flip;
249                 gboolean disable_saver;
250                 gboolean above;
251         } fullscreen;
252
253         /* image overlay */
254         struct {
255                 gchar *template_string;
256                 gint x;
257                 gint y;
258                 guint16 text_red;
259                 guint16 text_green;
260                 guint16 text_blue;
261                 guint16 text_alpha;
262                 guint16 background_red;
263                 guint16 background_green;
264                 guint16 background_blue;
265                 guint16 background_alpha;
266                 gchar *font;
267         } image_overlay;
268
269         /* properties dialog */
270         struct {
271                 gchar *tabs_order;
272         } properties;
273
274         /* color profiles */
275         struct {
276                 gboolean enabled;
277                 gint input_type;
278                 gchar *input_file[COLOR_PROFILE_INPUTS];
279                 gchar *input_name[COLOR_PROFILE_INPUTS];
280                 gchar *screen_file;
281                 gboolean use_image;
282                 gboolean use_x11_screen_profile;
283                 gint render_intent;
284         } color_profile;
285
286         /* Helpers programs */
287         struct {
288                 struct {
289                         gchar *command_name;
290                         gchar *command_line;
291                 } html_browser;
292         } helpers;
293
294         /* Metadata */
295         struct {
296                 gboolean enable_metadata_dirs;
297
298                 gboolean save_in_image_file;
299                 gboolean save_legacy_IPTC;
300                 gboolean warn_on_write_problems;
301
302                 gboolean save_legacy_format;
303
304                 gboolean sync_grouped_files;
305
306                 gboolean confirm_write;
307                 gint confirm_timeout;
308                 gboolean confirm_after_timeout;
309                 gboolean confirm_on_image_change;
310                 gboolean confirm_on_dir_change;
311                 gboolean keywords_case_sensitive;
312                 gboolean write_orientation;
313                 gboolean sidecar_extended_name;
314
315                 gboolean check_spelling;
316         } metadata;
317
318         /* Stereo */
319         struct {
320                 gint mode;
321                 gint fsmode;
322                 gboolean enable_fsmode;
323                 gint fixed_w, fixed_h;
324                 gint fixed_x1, fixed_y1;
325                 gint fixed_x2, fixed_y2;
326                 /**
327                  * @struct tmp
328                  * options in this struct are packed to mode and fsmode entries
329                  */
330                 struct {
331                         gboolean mirror_right;
332                         gboolean mirror_left;
333                         gboolean flip_right;
334                         gboolean flip_left;
335                         gboolean swap;
336                         gboolean temp_disable;
337                         gboolean fs_mirror_right;
338                         gboolean fs_mirror_left;
339                         gboolean fs_flip_right;
340                         gboolean fs_flip_left;
341                         gboolean fs_swap;
342                         gboolean fs_temp_disable;
343                 } tmp;
344         } stereo;
345
346         /* External preview extraction */
347         struct {
348                 gboolean enable;
349                 gchar *select; /**< path to executable */
350                 gchar *extract; /**< path to executable */
351         } external_preview;
352
353         /**
354          * @struct cp_mv_rn
355          * copy move rename
356          */
357         struct {
358                 gint auto_start;
359                 gchar *auto_end;
360                 gint auto_padding;
361                 gint formatted_start;
362         } cp_mv_rn;
363
364         /* log window */
365         struct {
366                 gboolean paused;
367                 gboolean line_wrap;
368                 gboolean timer_data;
369                 gchar *action; /** Used with F1 key */
370         } log_window;
371
372         /* star rating */
373         struct {
374                 gunichar star;
375                 gunichar rejected;
376         } star_rating;
377
378         /* Printer */
379         struct {
380                 gchar *image_font;
381                 gchar *page_font;
382                 gboolean show_image_text;
383                 gboolean show_page_text;
384                 gchar *page_text;
385                 gint image_text_position;
386                 gint page_text_position;
387                 gchar *template_string;
388         } printer;
389
390         /* Threads */
391         struct {
392                 gint duplicates;
393         } threads;
394
395         /* Selectable bars */
396         struct {
397                 gboolean menu_bar;
398                 gboolean tool_bar;
399                 gboolean status_bar;
400         } selectable_bars;
401
402         /* Alternate similarity algorithm */
403         struct {
404                 gboolean enabled;
405                 gboolean grayscale; /**< convert fingerprint to greyscale */
406         } alternate_similarity_algorithm;
407
408         gchar *mouse_button_8; /**< user-definable mouse buttons */
409         gchar *mouse_button_9; /**< user-definable mouse buttons */
410
411         gboolean class_filter[FILE_FORMAT_CLASSES]; /**< class file filter */
412
413         gboolean read_metadata_in_idle;
414
415         gboolean disable_gpu; /**< GPU - see main.cc */
416         gboolean override_disable_gpu; /**< GPU - see main.cc */
417
418         GList *disabled_plugins;
419 };
420
421 struct CommandLine
422 {
423         int argc;
424         gchar **argv;
425         gboolean startup_blank;
426         gboolean startup_full_screen;
427         gboolean startup_in_slideshow;
428         gboolean startup_command_line_collection;
429         gboolean tools_hide;
430         gboolean tools_show;
431         gboolean log_window_show;
432         gchar *path;
433         gchar *file;
434         GList *cmd_list;
435         GList *collection_list;
436         gchar *geometry;
437         gchar *regexp;
438         gchar *log_file;
439         SecureSaveInfo *ssi;
440         gboolean new_instance;
441 };
442
443 extern ConfOptions *options;
444 extern CommandLine *command_line;
445
446 ConfOptions *init_options(ConfOptions *options);
447 void setup_default_options(ConfOptions *options);
448 void save_options(ConfOptions *options);
449 gboolean load_options(ConfOptions *options);
450
451
452 enum StartUpPath {
453         STARTUP_PATH_CURRENT    = 0,
454         STARTUP_PATH_LAST,
455         STARTUP_PATH_HOME,
456 };
457
458 enum SortActionType {
459         BAR_SORT_COPY = 0,
460         BAR_SORT_MOVE,
461         BAR_SORT_FILTER,
462         BAR_SORT_ACTION_COUNT
463 };
464
465 enum SortModeType {
466         BAR_SORT_MODE_FOLDER = 0,
467         BAR_SORT_MODE_COLLECTION,
468         BAR_SORT_MODE_COUNT
469 };
470
471 enum SortSelectionType {
472         BAR_SORT_SELECTION_IMAGE = 0,
473         BAR_SORT_SELECTION_SELECTED,
474         BAR_SORT_SELECTION_COUNT
475 };
476
477 struct LayoutOptions
478 {
479         gchar *id;
480
481         gchar *order;
482         gint style;
483
484         DirViewType dir_view_type;
485         FileViewType file_view_type;
486
487         struct {
488                 SortType method;
489                 gboolean ascend;
490                 gboolean case_sensitive;
491         } dir_view_list_sort;
492
493         struct {
494                 SortType method;
495                 gboolean ascend;
496                 gboolean case_sensitive;
497         } file_view_list_sort;
498
499         gboolean show_thumbnails;
500         gboolean show_marks;
501         gboolean show_file_filter;
502         gboolean show_directory_date;
503         gboolean show_info_pixel;
504         gboolean split_pane_sync;
505         gboolean ignore_alpha;
506
507         struct {
508                 gint w;
509                 gint h;
510                 gint x;
511                 gint y;
512                 gboolean maximized;
513                 gint hdivider_pos;
514                 gint vdivider_pos;
515         } main_window;
516
517         struct {
518                 gint w;
519                 gint h;
520                 gint x;
521                 gint y;
522                 gint vdivider_pos;
523         } float_window;
524
525         struct {
526                 gint vdivider_pos;
527         } folder_window;
528
529         struct {
530                 gint w;
531                 gint h;
532         } properties_window;
533
534         struct {
535                 guint state;
536                 gint histogram_channel;
537                 gint histogram_mode;
538         } image_overlay;
539
540         GdkRectangle log_window;
541
542         struct {
543                 gint w;
544                 gint h;
545                 gint x;
546                 gint y;
547                 gint page_number;
548         } preferences_window;
549
550         struct {
551                 gint w;
552                 gint h;
553                 gint x;
554                 gint y;
555         } search_window;
556
557         struct {
558                 gint w;
559                 gint h;
560                 gint x;
561                 gint y;
562         } dupe_window;
563
564         struct {
565                 gint w;
566                 gint h;
567                 gint x;
568                 gint y;
569         } advanced_exif_window;
570
571         gboolean tools_float;
572         gboolean tools_hidden;
573         gboolean selectable_toolbars_hidden;
574
575         struct {
576                 gboolean info;
577                 gboolean sort;
578                 gboolean tools_float;
579                 gboolean tools_hidden;
580                 gboolean hidden;
581         } bars_state;
582
583         gchar *home_path;
584         gchar *last_path;
585
586         StartUpPath startup_path;
587
588         gboolean animate;
589         gint workspace;
590
591         SortActionType action;
592         SortModeType mode;
593         SortSelectionType selection;
594         gchar *filter_key;
595 };
596
597 void copy_layout_options(LayoutOptions *dest, const LayoutOptions *src);
598 void free_layout_options_content(LayoutOptions *dest);
599 LayoutOptions *init_layout_options(LayoutOptions *options);
600
601 #endif /* OPTIONS_H */
602 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */