Merge branch '2031_solaris_FISH_fix'
[midnight-commander.git] / src / setup.h
blobd7e17bce84536008b238e8ce2e3be70b4d03389e
1 /** \file setup.h
2 * \brief Header: setup loading/saving
3 */
5 #ifndef MC__SETUP_H
6 #define MC__SETUP_H
8 #include <config.h>
10 #include "lib/global.h" /* GError */
12 #include "filemanager/panel.h" /* WPanel, panel_view_mode_t */
14 /*** typedefs(not structures) and defined constants **********************************************/
16 /* TAB length for editor and viewer */
17 #define DEFAULT_TAB_SPACING 8
19 /*** enums ***************************************************************************************/
21 typedef enum
23 QSEARCH_CASE_INSENSITIVE = 0, /* quick search in case insensitive mode */
24 QSEARCH_CASE_SENSITIVE = 1, /* quick search in case sensitive mode */
25 QSEARCH_PANEL_CASE = 2, /* quick search get value from panel case_sensitive */
26 QSEARCH_NUM
27 } qsearch_mode_t;
29 /*** structures declarations (and typedefs of structures)*****************************************/
31 /* panels ini options; [Panels] section */
32 typedef struct
34 gboolean kilobyte_si; /* If TRUE, SI units (1000 based) will be used for larger units
35 * (kilobyte, megabyte, ...). If FALSE, binary units (1024 based) will be used */
36 gboolean mix_all_files; /* If FALSE then directories are shown separately from files */
37 gboolean show_backups; /* If TRUE, show files ending in ~ */
38 gboolean show_dot_files; /* If TRUE, show files starting with a dot */
39 gboolean fast_reload; /* If TRUE then use stat() on the cwd to determine directory changes */
40 gboolean fast_reload_msg_shown; /* Have we shown the fast-reload warning in the past? */
41 gboolean mark_moves_down; /* If TRUE, marking a files moves the cursor down */
42 gboolean reverse_files_only; /* If TRUE, only selection of files is inverted */
43 gboolean auto_save_setup;
44 gboolean navigate_with_arrows; /* If TRUE: l&r arrows are used to chdir if the input line is empty */
45 gboolean scroll_pages; /* If TRUE, panel is scrolled by half the display when the cursor reaches
46 the end or the beginning of the panel */
47 gboolean mouse_move_pages; /* Scroll page/item using mouse wheel */
48 gboolean filetype_mode; /* If TRUE then add per file type hilighting */
49 gboolean permission_mode; /* If TRUE, we use permission hilighting */
50 qsearch_mode_t qsearch_mode; /* Quick search mode */
51 } panels_options_t;
53 /*** global variables defined in .c file *********************************************************/
55 /* global paremeters */
56 extern char *profile_name;
57 extern char *global_profile_name;
58 extern char *setup_color_string;
59 extern char *term_color_string;
60 extern char *color_terminal_string;
61 extern int confirm_delete;
62 extern int confirm_directory_hotlist_delete;
63 extern int confirm_execute;
64 extern int confirm_exit;
65 extern int confirm_overwrite;
66 extern int confirm_history_cleanup;
67 extern int confirm_view_dir;
68 extern int safe_delete;
69 extern int clear_before_exec;
70 extern int auto_menu;
71 extern int drop_menus;
72 extern int verbose;
73 extern int select_flags;
74 extern int setup_copymove_persistent_attr;
75 extern int num_history_items_recorded;
76 extern int classic_progressbar;
77 extern int easy_patterns;
78 extern int option_tab_spacing;
79 extern int auto_save_setup;
80 extern int only_leading_plus_minus;
81 extern int cd_symlinks;
82 extern int show_all_if_ambiguous;
83 extern int auto_fill_mkdir_name;
84 extern int output_starts_shell;
85 extern int use_file_to_check_type;
86 extern int file_op_compute_totals;
88 extern panels_options_t panels_options;
90 extern panel_view_mode_t startup_left_mode;
91 extern panel_view_mode_t startup_right_mode;
92 extern gboolean boot_current_is_left;
94 /*** declarations of public functions ************************************************************/
96 char *setup_init (void);
97 void load_setup (void);
98 gboolean save_setup (gboolean save_options, gboolean save_panel_options);
99 void done_setup (void);
100 void save_config (void);
101 void setup_save_config_show_error (const char *filename, GError ** error);
103 void save_layout (void);
105 void load_key_defs (void);
106 #ifdef ENABLE_VFS_FTP
107 char *load_anon_passwd (void);
108 #endif /* ENABLE_VFS_FTP */
110 void load_keymap_defs (void);
111 void free_keymap_defs (void);
113 void panel_load_setup (WPanel * panel, const char *section);
114 void panel_save_setup (WPanel * panel, const char *section);
116 void panels_load_options (void);
117 void panels_save_options (void);
119 /*** inline functions ****************************************************************************/
121 #endif /* MC__SETUP_H */