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