1 /* -*- Mode: C; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 3 -*- */
2 
3 /*
4  * GImageView
5  * Copyright (C) 2001 Takuro Ashie
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  *
21  * $Id: prefs.h,v 1.60 2004/09/22 14:26:23 makeinu Exp $
22  */
23 
24 #ifndef __PREFS_H__
25 #define __PREFS_H__
26 
27 #include <gtk/gtk.h>
28 
29 #ifdef HAVE_CONFIG_H
30 #  include "config.h"
31 #endif
32 
33 #define SCRIPTS_DEFAULT_SEARCH_DIR_LIST \
34    DATADIR"/scripts"
35 #define PLUGIN_DEFAULT_SEARCH_DIR_LIST \
36    PLUGINDIR "/" ARCHIVER_PLUGIN_DIR "," \
37    PLUGINDIR "/" IMAGE_LOADER_PLUGIN_DIR "," \
38    PLUGINDIR "/" IMAGE_SAVER_PLUGIN_DIR "," \
39    PLUGINDIR "/" IO_STREAM_PLUGIN_DIR "," \
40    PLUGINDIR "/" THUMBNAIL_PLUGIN_DIR "," \
41    PLUGINDIR "/" IMAGE_VIEW_PLUGIN_DIR "," \
42    PLUGINDIR "/" THUMBNAIL_VIEW_PLUGIN_DIR
43 
44 typedef enum
45 {
46    WINTYPE_DEFAULT = -1,
47    IMAGE_VIEW_WINDOW = 0,
48    THUMBNAIL_WINDOW  = 1
49 } ImgWinType;
50 
51 
52 typedef struct _Config {
53    /* General Option */
54    gint       default_file_open_window;
55    gint       default_dir_open_window;
56    gint       default_arc_open_window;
57    gint       scan_dir_recursive;
58    gboolean   recursive_follow_link;
59    gboolean   recursive_follow_parent;
60    gboolean   read_dotfile;
61    gboolean   detect_filetype_by_ext;
62    gboolean   disp_filename_stdout;
63    gint       interpolation;
64    gboolean   fast_scale_down;
65    gboolean   conv_rel_path_to_abs;
66    gchar     *iconset;
67    gchar     *textentry_font;
68 
69    /* Charset related common option */
70    gchar     *charset_locale;
71    gchar     *charset_internal;
72    gint       charset_auto_detect_lang;
73    gint       charset_filename_mode;
74    gchar     *charset_filename;
75    gpointer   charset_auto_detect_fn;   /* initialized in gimageview.c */
76 
77    /* Start up Option */
78    gboolean   startup_read_dir;
79    gboolean   startup_open_thumbwin;
80    gboolean   startup_no_warning;
81 
82    /* filter */
83    gchar     *imgtype_disables;
84    gchar     *imgtype_user_defs;
85 
86    /* Image View */
87    gboolean   imgwin_save_win_state;
88    guint      imgwin_width;
89    guint      imgwin_height;
90    gboolean   imgwin_fit_to_image;
91    gboolean   imgwin_open_new_win;
92    gboolean   imgwin_raise_window;
93    gboolean   imgwin_show_menubar;
94    gboolean   imgwin_show_toolbar;
95    gboolean   imgwin_show_player;
96    gboolean   imgwin_show_statusbar;
97    gint       imgwin_toolbar_style;
98    gboolean   imgwin_set_bg;
99    gint       imgwin_bg_color[3];             /* red green blue */
100    gboolean   imgwin_fullscreen_set_bg;
101    gint       imgwin_fullscreen_bg_color[3];  /* red green blue */
102 
103    gfloat     imgview_scale;
104    gboolean   imgview_keep_aspect;
105    gint       imgview_default_zoom;
106    gint       imgview_default_rotation;
107    gboolean   imgview_buffer;
108    gboolean   imgview_scrollbar;
109    gint       imgview_player_visible;
110    gboolean   imgview_scroll_nolimit;
111    gboolean   imgview_movie_continuance;
112 
113    gchar     *imgview_mouse_button;
114 
115    /* Thumbnail View */
116    gboolean   thumbwin_save_win_state;
117    guint      thumbwin_width;
118    guint      thumbwin_height;
119    gint       thumbwin_layout_type;
120    gboolean   thumbwin_pane1_horizontal;
121    gboolean   thumbwin_pane2_horizontal;
122    gboolean   thumbwin_pane2_attach_1;
123    gint       thumbwin_widget[3];
124    guint      thumbwin_pane_size1;
125    guint      thumbwin_pane_size2;
126 
127    gboolean   thumbwin_show_dir_view;
128    gboolean   thumbwin_show_preview;
129    gboolean   thumbwin_show_menubar;
130    gboolean   thumbwin_show_toolbar;
131    gboolean   thumbwin_show_statusbar;
132    gboolean   thumbwin_show_tab;
133    gboolean   thumbwin_show_preview_tab;
134 
135    gboolean   thumbwin_raise_window;
136    gint       thumbwin_toolbar_style;
137    gchar     *thumbwin_disp_mode;
138 
139    gint       thumbwin_tab_pos;
140    gboolean   thumbwin_move_to_newtab;
141    gboolean   thumbwin_show_tab_close;
142    gboolean   thumbwin_tab_fullpath;
143    gboolean   thumbwin_force_open_tab;
144 
145    guint      thumbwin_thumb_size;
146    guint      thumbwin_redraw_interval;
147    gboolean   thumbwin_show_progress_detail;
148 
149    guint      thumbwin_sort_type;
150    gboolean   thumbwin_sort_reverse;
151    gboolean   thumbwin_sort_ignore_case;
152    gboolean   thumbwin_sort_ignore_dir;
153 
154    gboolean   thumbview_show_dir;
155    gboolean   thumbview_show_archive;
156 
157    gchar     *thumbview_mouse_button;
158 
159    /* Thumbnail Album */
160    guint      thumbalbum_row_space;
161    guint      thumbalbum_col_space;
162 
163    /* Directory View */
164    gboolean   dirview_show_toolbar;
165    gboolean   dirview_show_dotfile;
166    gboolean   dirview_show_current_dir;
167    gboolean   dirview_show_parent_dir;
168    gint       dirview_line_style;
169    gint       dirview_expander_style;
170    gboolean   dirview_auto_scroll;
171    gint       dirview_auto_scroll_time;
172    gboolean   dirview_auto_expand;
173    gint       dirview_auto_expand_time;
174    gchar     *dirview_mouse_button;
175 
176    /* Preview */
177    gfloat     preview_scale;
178    gint       preview_zoom;
179    gint       preview_rotation;
180    gboolean   preview_keep_aspect;
181    gboolean   preview_scrollbar;
182    gint       preview_player_visible;
183    gboolean   preview_buffer;
184    gchar     *preview_mouse_button;
185 
186    /* Thumbnail Cache */
187    gchar     *cache_read_list;
188    gchar     *cache_write_type;
189 
190    /* comment */
191    gchar     *comment_key_list;
192 
193    gint       comment_charset_read_mode;
194    gint       comment_charset_write_mode;
195    gchar     *comment_charset;
196 
197    /* Movie */
198    gchar     *movie_default_view_mode;
199 
200    /* Slide Show */
201    gint       slideshow_zoom;
202    gint       slideshow_rotation;
203    gfloat     slideshow_img_scale;
204    gint       slideshow_screen_mode;
205    gboolean   slideshow_menubar;
206    gboolean   slideshow_toolbar;
207    gboolean   slideshow_player;
208    gboolean   slideshow_statusbar;
209    gboolean   slideshow_scrollbar;
210    gboolean   slideshow_keep_aspect;
211    gfloat     slideshow_interval;
212    gboolean   slideshow_repeat;
213    gboolean   slideshow_set_bg;
214    gint       slideshow_bg_color[3];  /* red green blue */
215 
216    /* search */
217    gfloat     search_similar_accuracy;
218    gboolean   search_similar_open_collection;
219 
220    /* similar window */
221    gboolean   simwin_sel_thumbview;
222    gboolean   simwin_sel_preview;
223    gboolean   simwin_sel_new_win;
224    gboolean   simwin_sel_shared_win;
225 
226    /* drag and drop */
227    gboolean   dnd_enable_to_external;
228    gboolean   dnd_enable_from_external;
229    gboolean   dnd_refresh_list_always;
230 
231    /* Wallpaper */
232    gchar     *wallpaper_menu;
233 
234    /* External Program */
235    gchar     *progs[16];
236    gchar     *web_browser;
237    gchar     *text_viewer;
238    gboolean   text_viewer_use_internal;
239    gboolean   scripts_use_default_search_dir_list;
240    gchar     *scripts_search_dir_list;
241    gboolean   scripts_show_dialog;
242 
243    /* plugin */
244    gboolean   plugin_use_default_search_dir_list;
245    gchar     *plugin_search_dir_list;
246 } Config;
247 
248 typedef struct _KeyConf {
249    gchar *common_open;
250    gchar *common_imagewin;
251    gchar *common_thumbwin;
252    gchar *common_quit;
253    gchar *common_prefs;
254    gchar *common_toggle_menubar;
255    gchar *common_toggle_toolbar;
256    gchar *common_toggle_tab;
257    gchar *common_toggle_statusbar;
258    gchar *common_toggle_scrollbar;
259    gchar *common_fullscreen;
260    gchar *common_create_thumb;
261    gchar *common_auto_completion1;
262    gchar *common_auto_completion2;
263    gchar *common_popup_menu;
264 
265    gchar *imgwin_toggle_player;
266    gchar *imgwin_buffer;
267    gchar *imgwin_close;
268 
269    gchar *imgwin_fit_win;
270 
271    gchar *imgwin_zoomin;
272    gchar *imgwin_zoomout;
273    gchar *imgwin_fit_img;
274    gchar *imgwin_keep_aspect;
275    gchar *imgwin_zoom10;
276    gchar *imgwin_zoom25;
277    gchar *imgwin_zoom50;
278    gchar *imgwin_zoom75;
279    gchar *imgwin_zoom100;
280    gchar *imgwin_zoom125;
281    gchar *imgwin_zoom150;
282    gchar *imgwin_zoom175;
283    gchar *imgwin_zoom200;
284 
285    gchar *imgwin_rotate_ccw;
286    gchar *imgwin_rotate_cw;
287    gchar *imgwin_rotate_180;
288 
289    gchar *imgwin_next;
290    gchar *imgwin_prev;
291    gchar *imgwin_first;
292    gchar *imgwin_last;
293 
294    gchar *thumbwin_disp_mode[16];
295 
296    gchar *thumbwin_layout0;
297    gchar *thumbwin_layout1;
298    gchar *thumbwin_layout2;
299    gchar *thumbwin_layout3;
300    gchar *thumbwin_layout4;
301    gchar *thumbwin_custom;
302    gchar *thumbwin_slideshow;
303    gchar *thumbwin_first_page;
304    gchar *thumbwin_last_page;
305    gchar *thumbwin_next_page;
306    gchar *thumbwin_prev_page;
307    gchar *thumbwin_toggle_dir_toolbar;
308    gchar *thumbwin_toggle_dirview;
309    gchar *thumbwin_toggle_preview;
310    gchar *thumbwin_toggle_preview_tab;
311    gchar *thumbwin_new_tab;
312    gchar *thumbwin_new_collection;
313    gchar *thumbwin_close_tab;
314    gchar *thumbwin_close_win;
315 
316    gchar *thumbwin_select_all;
317    gchar *thumbwin_unselect_all;
318    gchar *thumbwin_refresh_list;
319    gchar *thumbwin_reload_cache;
320    gchar *thumbwin_recreate_thumb;
321    gchar *thumbwin_rename;
322    gchar *thumbwin_copy;
323    gchar *thumbwin_move;
324    gchar *thumbwin_link;
325    gchar *thumbwin_find_similar;
326    gchar *thumbwin_move_tab_forward;
327    gchar *thumbwin_move_tab_backward;
328    gchar *thumbwin_detach_tab;
329 
330    gchar *thumbwin_sort_name;
331    gchar *thumbwin_sort_atime;
332    gchar *thumbwin_sort_mtime;
333    gchar *thumbwin_sort_ctime;
334    gchar *thumbwin_sort_size;
335    gchar *thumbwin_sort_type;
336    gchar *thumbwin_sort_rev;
337 } KeyConf;
338 
339 extern Config conf;
340 extern KeyConf akey;
341 
342 void prefs_load_config              (void);
343 void prefs_save_config              (void);
344 gint prefs_mouse_get_num            (gint            button_id,
345                                      gint            mod_id,
346                                      const gchar    *string);
347 gint prefs_mouse_get_num_from_event (GdkEventButton *event,
348                                      const gchar    *string);
349 
350 #endif /* __PREFS_H__ */
351