Fix #137: "Copy path" problem (or may be feature)
[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
38         /* various */
39         gboolean tree_descend_subdirs;
40         gboolean view_dir_list_single_click_enter;
41
42         gboolean lazy_image_sync;
43         gboolean update_on_time_change;
44
45         guint duplicates_similarity_threshold;
46         guint duplicates_match;
47         gboolean duplicates_thumbnails;
48         guint duplicates_select_type;
49         gboolean rot_invariant_sim;
50         gboolean sort_totals;
51
52         gint open_recent_list_maxsize;
53         gint dnd_icon_size;
54         gint clipboard_selection;
55
56         gboolean save_window_positions;
57         gboolean use_saved_window_positions_for_new_windows;
58         gboolean tools_restore_state;
59
60         gint log_window_lines;
61
62         /* info sidebar component heights */
63         struct {
64                 gint height;
65         } info_comment;
66
67         struct {
68                 gint height;
69         } info_keywords;
70
71         struct {
72                 gint height;
73         } info_title;
74
75         struct {
76                 gint height;
77         } info_rating;
78
79         /* file ops */
80         struct {
81                 gboolean enable_in_place_rename;
82
83                 gboolean confirm_delete;
84                 gboolean enable_delete_key;
85                 gboolean safe_delete_enable;
86                 gchar *safe_delete_path;
87                 gint safe_delete_folder_maxsize;
88         } file_ops;
89
90         /* image */
91         struct {
92                 gboolean exif_rotate_enable;
93                 gboolean exif_proof_rotate_enable;
94                 guint scroll_reset_method;
95                 gboolean fit_window_to_image;
96                 gboolean limit_window_size;
97                 gint max_window_size;
98                 gboolean limit_autofit_size;
99                 gint max_autofit_size;
100                 gint max_enlargement_size;
101
102                 gint tile_cache_max;    /* in megabytes */
103                 gint image_cache_max;   /* in megabytes */
104                 gboolean enable_read_ahead;
105
106                 ZoomMode zoom_mode;
107                 gboolean zoom_2pass;
108                 gboolean zoom_to_fit_allow_expand;
109                 guint zoom_quality;
110                 gint zoom_increment;    /* 100 is 1.0, 5 is 0.05, 200 is 2.0, etc. */
111                 gboolean use_clutter_renderer;
112
113                 gboolean use_custom_border_color_in_fullscreen;
114                 gboolean use_custom_border_color;
115                 GdkColor border_color;
116                 GdkColor alpha_color_1;
117                 GdkColor alpha_color_2;
118         } image;
119
120         /* thumbnails */
121         struct {
122                 gint max_width;
123                 gint max_height;
124                 gboolean enable_caching;
125                 gboolean cache_into_dirs;
126                 gboolean use_xvpics;
127                 gboolean spec_standard;
128                 guint quality;
129                 gboolean use_exif;
130         } thumbnails;
131
132         /* file filtering */
133         struct {
134                 gboolean show_hidden_files;
135                 gboolean show_parent_directory;
136                 gboolean show_dot_directory;
137                 gboolean disable_file_extension_checks;
138                 gboolean disable;
139         } file_filter;
140
141         struct {
142                 gchar *ext;
143         } sidecar;
144
145         /* collections */
146         struct {
147                 gboolean rectangular_selection;
148         } collections;
149
150         /* shell */
151         struct {
152                 gchar *path;
153                 gchar *options;
154         } shell;
155
156         /* file sorting */
157         struct {
158                 SortType method;
159                 gboolean ascending;
160                 gboolean case_sensitive; /* file sorting method (case) */
161                 gboolean natural;
162         } file_sort;
163
164         /* slideshow */
165         struct {
166                 gint delay;     /* in tenths of a second */
167                 gboolean random;
168                 gboolean repeat;
169         } slideshow;
170
171         /* fullscreen */
172         struct {
173                 gint screen;
174                 gboolean clean_flip;
175                 gboolean disable_saver;
176                 gboolean above;
177         } fullscreen;
178
179         /* image overlay */
180         struct {
181                 gchar *template_string;
182                 gint x;
183                 gint y;
184                 guint16 text_red;
185                 guint16 text_green;
186                 guint16 text_blue;
187                 guint16 text_alpha;
188                 guint16 background_red;
189                 guint16 background_green;
190                 guint16 background_blue;
191                 guint16 background_alpha;
192                 gchar *font;
193         } image_overlay;
194
195         /* properties dialog */
196         struct {
197                 gchar *tabs_order;
198         } properties;
199
200         /* color profiles */
201         struct {
202                 gboolean enabled;
203                 gint input_type;
204                 gchar *input_file[COLOR_PROFILE_INPUTS];
205                 gchar *input_name[COLOR_PROFILE_INPUTS];
206                 gchar *screen_file;
207                 gboolean use_image;
208                 gboolean use_x11_screen_profile;
209                 gint render_intent;
210         } color_profile;
211
212         /* Helpers programs */
213         struct {
214                 struct {
215                         gchar *command_name;
216                         gchar *command_line;
217                 } html_browser;
218         } helpers;
219
220         /* Metadata */
221         struct {
222                 gboolean enable_metadata_dirs;
223
224                 gboolean save_in_image_file;
225                 gboolean save_legacy_IPTC;
226                 gboolean warn_on_write_problems;
227
228                 gboolean save_legacy_format;
229
230                 gboolean sync_grouped_files;
231
232                 gboolean confirm_write;
233                 gint confirm_timeout;
234                 gboolean confirm_after_timeout;
235                 gboolean confirm_on_image_change;
236                 gboolean confirm_on_dir_change;
237                 gboolean keywords_case_sensitive;
238                 gboolean write_orientation;
239                 gboolean sidecar_extended_name;
240         } metadata;
241
242         /* Stereo */
243         struct {
244                 gint mode;;
245                 gint fsmode;
246                 gboolean enable_fsmode;
247                 gint fixed_w, fixed_h;
248                 gint fixed_x1, fixed_y1;
249                 gint fixed_x2, fixed_y2;
250                 struct { /* options in this struct are packed to mode and fsmode entries */
251                         gboolean mirror_right;
252                         gboolean mirror_left;
253                         gboolean flip_right;
254                         gboolean flip_left;
255                         gboolean swap;
256                         gboolean temp_disable;
257                         gboolean fs_mirror_right;
258                         gboolean fs_mirror_left;
259                         gboolean fs_flip_right;
260                         gboolean fs_flip_left;
261                         gboolean fs_swap;
262                         gboolean fs_temp_disable;
263                 } tmp;
264         } stereo;
265
266         /* copy move rename */
267         struct {
268                 gint auto_start;
269                 gchar *auto_end;
270                 gint auto_padding;
271                 gint formatted_start;
272         } cp_mv_rn;
273
274         /* log window */
275         struct {
276                 gboolean paused;
277                 gboolean line_wrap;
278                 gboolean timer_data;
279         } log_window;
280 };
281
282 ConfOptions *options;
283 CommandLine *command_line;
284
285 ConfOptions *init_options(ConfOptions *options);
286 void setup_default_options(ConfOptions *options);
287 void save_options(ConfOptions *options);
288 gboolean load_options(ConfOptions *options);
289
290 void copy_layout_options(LayoutOptions *dest, const LayoutOptions *src);
291 void free_layout_options_content(LayoutOptions *dest);
292 LayoutOptions *init_layout_options(LayoutOptions *options);
293
294 #endif /* OPTIONS_H */
295 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */