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