f6e66b4e284c2e487e996c68f96dd04108109323
[geeqie.git] / src / options.h
1 /*
2  * Geeqie
3  * Copyright (C) 2008 - 2012 The Geeqie Team
4  *
5  * Authors: Vladimir Nadvornik, Laurent Monin
6  *
7  * This software is released under the GNU General Public License (GNU GPL).
8  * Please read the included file COPYING for more information.
9  * This software comes with no warranty of any kind, use at your own risk!
10  */
11
12 #ifndef OPTIONS_H
13 #define OPTIONS_H
14
15 typedef struct _ConfOptions ConfOptions;
16
17 struct _ConfOptions
18 {
19         /* ui */
20         gboolean progressive_key_scrolling;
21         gboolean place_dialogs_under_mouse;
22         gboolean mousewheel_scrolls;
23         gboolean show_icon_names;
24
25         /* various */
26         gboolean tree_descend_subdirs;
27
28         gboolean lazy_image_sync;
29         gboolean update_on_time_change;
30
31         guint duplicates_similarity_threshold;
32
33         gint open_recent_list_maxsize;
34         gint dnd_icon_size;
35
36         gboolean save_window_positions;
37         gboolean tools_restore_state;
38
39         /* file ops */
40         struct {
41                 gboolean enable_in_place_rename;
42
43                 gboolean confirm_delete;
44                 gboolean enable_delete_key;
45                 gboolean safe_delete_enable;
46                 gchar *safe_delete_path;
47                 gint safe_delete_folder_maxsize;
48         } file_ops;
49
50         /* image */
51         struct {
52                 gboolean exif_rotate_enable;
53                 gboolean exif_proof_rotate_enable;
54                 guint scroll_reset_method;
55                 gboolean fit_window_to_image;
56                 gboolean limit_window_size;
57                 gint max_window_size;
58                 gboolean limit_autofit_size;
59                 gint max_autofit_size;
60
61                 gint tile_cache_max;    /* in megabytes */
62                 gint image_cache_max;   /* in megabytes */
63                 gboolean enable_read_ahead;
64
65                 ZoomMode zoom_mode;
66                 gboolean zoom_2pass;
67                 gboolean zoom_to_fit_allow_expand;
68                 guint zoom_quality;
69                 gint zoom_increment;    /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */
70                 gboolean use_clutter_renderer;
71
72                 gboolean use_custom_border_color_in_fullscreen;
73                 gboolean use_custom_border_color;
74                 GdkColor border_color;
75         } image;
76
77         /* thumbnails */
78         struct {
79                 gint max_width;
80                 gint max_height;
81                 gboolean enable_caching;
82                 gboolean cache_into_dirs;
83                 gboolean use_xvpics;
84                 gboolean spec_standard;
85                 guint quality;
86                 gboolean use_exif;
87         } thumbnails;
88
89         /* file filtering */
90         struct {
91                 gboolean show_hidden_files;
92                 gboolean show_dot_directory;
93                 gboolean disable;
94         } file_filter;
95
96         struct {
97                 gchar *ext;
98         } sidecar;
99         
100         /* collections */
101         struct {
102                 gboolean rectangular_selection;
103         } collections;
104
105         /* shell */
106         struct {
107                 gchar *path;
108                 gchar *options;
109         } shell;
110         
111         /* file sorting */
112         struct {
113                 SortType method;
114                 gboolean ascending;
115                 gboolean case_sensitive; /* file sorting method (case) */
116         } file_sort;
117
118         /* slideshow */
119         struct {
120                 gint delay;     /* in tenths of a second */
121                 gboolean random;
122                 gboolean repeat;
123         } slideshow;
124
125         /* fullscreen */
126         struct {
127                 gint screen;
128                 gboolean clean_flip;
129                 gboolean disable_saver;
130                 gboolean above;
131         } fullscreen;
132
133         /* image overlay */
134         struct {
135                 gchar *template_string;
136                 gint x;
137                 gint y;
138         } image_overlay;
139
140         /* properties dialog */
141         struct {
142                 gchar *tabs_order;
143         } properties;
144
145         /* color profiles */
146         struct {
147                 gboolean enabled;
148                 gint input_type;
149                 gchar *input_file[COLOR_PROFILE_INPUTS];
150                 gchar *input_name[COLOR_PROFILE_INPUTS];
151                 gchar *screen_file;
152                 gboolean use_image;
153                 gboolean use_x11_screen_profile;
154
155         } color_profile;
156
157         /* Helpers programs */
158         struct {
159                 struct {
160                         gchar *command_name;
161                         gchar *command_line;
162                 } html_browser;
163         } helpers;
164
165         /* Metadata */
166         struct {
167                 gboolean enable_metadata_dirs;
168
169                 gboolean save_in_image_file;
170                 gboolean save_legacy_IPTC;
171                 gboolean warn_on_write_problems;
172
173                 gboolean save_legacy_format;
174                 
175                 gboolean sync_grouped_files;
176                 
177                 gboolean confirm_write;
178                 gint confirm_timeout;
179                 gboolean confirm_after_timeout;
180                 gboolean confirm_on_image_change;
181                 gboolean confirm_on_dir_change;
182                 gboolean keywords_case_sensitive;
183                 gboolean write_orientation;
184         } metadata;
185         
186         /* Stereo */
187         struct {
188                 gint mode;;
189                 gint fsmode;
190                 gboolean enable_fsmode;
191                 gint fixed_w, fixed_h;
192                 gint fixed_x1, fixed_y1;
193                 gint fixed_x2, fixed_y2;
194                 struct { /* options in this struct are packed to mode and fsmode entries */
195                         gboolean mirror_right;
196                         gboolean mirror_left;
197                         gboolean flip_right;
198                         gboolean flip_left;
199                         gboolean swap;
200                         gboolean temp_disable;
201                         gboolean fs_mirror_right;
202                         gboolean fs_mirror_left;
203                         gboolean fs_flip_right;
204                         gboolean fs_flip_left;
205                         gboolean fs_swap;
206                         gboolean fs_temp_disable;
207                 } tmp; 
208         } stereo;
209 };
210
211 ConfOptions *options;
212 CommandLine *command_line;
213
214 ConfOptions *init_options(ConfOptions *options);
215 void setup_default_options(ConfOptions *options);
216 void save_options(ConfOptions *options);
217 gboolean load_options(ConfOptions *options);
218
219 void copy_layout_options(LayoutOptions *dest, const LayoutOptions *src);
220 void free_layout_options_content(LayoutOptions *dest);
221 LayoutOptions *init_layout_options(LayoutOptions *options);
222
223 #endif /* OPTIONS_H */
224 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */