Init file highlighting only in full mode.
[midnight-commander.git] / src / setup.h
blob4ec473dddd739f1b4ed917846088a0c727326326
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/layout.h" /* 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 #define MAX_MACRO_LENGTH 1024
21 /*** enums ***************************************************************************************/
23 typedef enum
25 QSEARCH_CASE_INSENSITIVE = 0, /* quick search in case insensitive mode */
26 QSEARCH_CASE_SENSITIVE = 1, /* quick search in case sensitive mode */
27 QSEARCH_PANEL_CASE = 2, /* quick search get value from panel case_sensitive */
28 QSEARCH_NUM
29 } qsearch_mode_t;
31 /*** structures declarations (and typedefs of structures)*****************************************/
33 /* panels ini options; [Panels] section */
34 typedef struct
36 gboolean show_mini_info; /* If true, show the mini-info on the panel */
37 gboolean kilobyte_si; /* If TRUE, SI units (1000 based) will be used for larger units
38 * (kilobyte, megabyte, ...). If FALSE, binary units (1024 based) will be used */
39 gboolean mix_all_files; /* If FALSE then directories are shown separately from files */
40 gboolean show_backups; /* If TRUE, show files ending in ~ */
41 gboolean show_dot_files; /* If TRUE, show files starting with a dot */
42 gboolean fast_reload; /* If TRUE then use stat() on the cwd to determine directory changes */
43 gboolean fast_reload_msg_shown; /* Have we shown the fast-reload warning in the past? */
44 gboolean mark_moves_down; /* If TRUE, marking a files moves the cursor down */
45 gboolean reverse_files_only; /* If TRUE, only selection of files is inverted */
46 gboolean auto_save_setup;
47 gboolean navigate_with_arrows; /* If TRUE: l&r arrows are used to chdir if the input line is empty */
48 gboolean scroll_pages; /* If TRUE, panel is scrolled by half the display when the cursor reaches
49 the end or the beginning of the panel */
50 gboolean mouse_move_pages; /* Scroll page/item using mouse wheel */
51 gboolean filetype_mode; /* If TRUE then add per file type hilighting */
52 gboolean permission_mode; /* If TRUE, we use permission hilighting */
53 qsearch_mode_t qsearch_mode; /* Quick search mode */
54 gboolean torben_fj_mode; /* If TRUE, use some usability hacks by Torben */
55 } panels_options_t;
57 struct WPanel;
59 typedef struct macro_action_t
61 unsigned long action;
62 int ch;
63 } macro_action_t;
65 typedef struct macros_t
67 int hotkey;
68 GArray *macro;
69 } macros_t;
71 struct mc_fhl_struct;
73 /*** global variables defined in .c file *********************************************************/
75 /* global paremeters */
76 extern char *profile_name;
77 extern char *global_profile_name;
78 extern int confirm_delete;
79 extern int confirm_directory_hotlist_delete;
80 extern int confirm_execute;
81 extern int confirm_exit;
82 extern int confirm_overwrite;
83 extern int confirm_view_dir;
84 extern int safe_delete;
85 extern int clear_before_exec;
86 extern int auto_menu;
87 extern int drop_menus;
88 extern int verbose;
89 extern int select_flags;
90 extern int setup_copymove_persistent_attr;
91 extern int classic_progressbar;
92 extern int easy_patterns;
93 extern int option_tab_spacing;
94 extern int auto_save_setup;
95 extern int only_leading_plus_minus;
96 extern int cd_symlinks;
97 extern int auto_fill_mkdir_name;
98 extern int output_starts_shell;
99 extern int use_file_to_check_type;
100 extern int file_op_compute_totals;
102 extern panels_options_t panels_options;
104 extern panel_view_mode_t startup_left_mode;
105 extern panel_view_mode_t startup_right_mode;
106 extern gboolean boot_current_is_left;
107 extern int use_internal_view;
108 extern int use_internal_edit;
110 #ifdef HAVE_CHARSET
111 extern int default_source_codepage;
112 extern char *autodetect_codeset;
113 extern gboolean is_autodetect_codeset_enabled;
114 #endif /* !HAVE_CHARSET */
116 /* If set, then print to the given file the last directory we were at */
117 extern char *last_wd_string;
119 extern int quit;
120 /* Set to TRUE to suppress printing the last directory */
121 extern gboolean print_last_revert;
123 extern char *shell;
124 extern const char *mc_prompt;
126 /* index to record_macro_buf[], -1 if not recording a macro */
127 extern int macro_index;
129 /* macro stuff */
130 extern struct macro_action_t record_macro_buf[MAX_MACRO_LENGTH];
132 extern GArray *macros_list;
134 /*** declarations of public functions ************************************************************/
136 char *setup_init (void);
137 void load_setup (void);
138 gboolean save_setup (gboolean save_options, gboolean save_panel_options);
139 void done_setup (void);
140 void save_config (void);
141 void setup_save_config_show_error (const char *filename, GError ** error);
143 void save_layout (void);
145 void load_key_defs (void);
146 #ifdef ENABLE_VFS_FTP
147 char *load_anon_passwd (void);
148 #endif /* ENABLE_VFS_FTP */
150 void load_keymap_defs (gboolean load_from_file);
151 void free_keymap_defs (void);
153 void panel_load_setup (struct WPanel *panel, const char *section);
154 void panel_save_setup (struct WPanel *panel, const char *section);
156 void panels_load_options (void);
157 void panels_save_options (void);
159 /*** inline functions ****************************************************************************/
161 #endif /* MC__SETUP_H */