root/src/setup.h

/* [previous][next][first][last][top][bottom][index][help]  */

INCLUDED FROM


   1 /** \file setup.h
   2  *  \brief Header: setup loading/saving
   3  */
   4 
   5 #ifndef MC__SETUP_H
   6 #define MC__SETUP_H
   7 
   8 #include <config.h>
   9 
  10 #include "lib/global.h"  // GError
  11 
  12 #include "filemanager/layout.h"  // panel_view_mode_t
  13 #include "filemanager/panel.h"   // WPanel
  14 
  15 /*** typedefs(not structures) and defined constants **********************************************/
  16 
  17 /* TAB length for editor and viewer */
  18 #define DEFAULT_TAB_SPACING 8
  19 
  20 #define MAX_MACRO_LENGTH    1024
  21 
  22 /*** enums ***************************************************************************************/
  23 
  24 typedef enum
  25 {
  26     QSEARCH_CASE_INSENSITIVE = 0,  // quick search in case insensitive mode
  27     QSEARCH_CASE_SENSITIVE = 1,    // quick search in case sensitive mode
  28     QSEARCH_PANEL_CASE = 2,        // quick search get value from panel case_sensitive
  29     QSEARCH_NUM
  30 } qsearch_mode_t;
  31 
  32 /*** structures declarations (and typedefs of structures)*****************************************/
  33 
  34 /* panels ini options; [Panels] section */
  35 typedef struct
  36 {
  37     gboolean show_mini_info;  // If true, show the mini-info on the panel
  38     gboolean
  39         kilobyte_si;  // If TRUE, SI units (1000 based) will be used for larger units (kilobyte,
  40                       // megabyte, ...). If FALSE, binary units (1024 based) will be used
  41     gboolean mix_all_files;   // If FALSE then directories are shown separately from files
  42     gboolean show_backups;    // If TRUE, show files ending in ~
  43     gboolean show_dot_files;  // If TRUE, show files starting with a dot
  44     gboolean fast_reload;     // If TRUE then use stat() on the cwd to determine directory changes
  45     gboolean fast_reload_msg_shown;  // Have we shown the fast-reload warning in the past?
  46     gboolean mark_moves_down;        // If TRUE, marking a files moves the cursor down
  47     gboolean reverse_files_only;     // If TRUE, only selection of files is inverted
  48     gboolean auto_save_setup;
  49     gboolean
  50         navigate_with_arrows;   // If TRUE: l&r arrows are used to chdir if the input line is empty
  51     gboolean scroll_pages;      // If TRUE, panel is scrolled by half the display when the cursor
  52                                 // reaches the end or the beginning of the panel
  53     gboolean scroll_center;     // If TRUE, scroll when the cursor hits the middle of the panel
  54     gboolean mouse_move_pages;  // Scroll page/item using mouse wheel
  55     gboolean filetype_mode;     // If TRUE then add per file type highlighting
  56     gboolean permission_mode;   // If TRUE, we use permission highlighting
  57     qsearch_mode_t qsearch_mode;  // Quick search mode
  58     gboolean torben_fj_mode;      // If TRUE, use some usability hacks by Torben
  59     select_flags_t select_flags;  // Select/unselect file flags
  60 } panels_options_t;
  61 
  62 typedef struct macro_action_t
  63 {
  64     long action;
  65     int ch;
  66 } macro_action_t;
  67 
  68 typedef struct macros_t
  69 {
  70     int hotkey;
  71     GArray *macro;
  72 } macros_t;
  73 
  74 struct mc_fhl_struct;
  75 
  76 /*** global variables defined in .c file *********************************************************/
  77 
  78 /* global parameters */
  79 extern gboolean confirm_delete;
  80 extern gboolean confirm_directory_hotlist_delete;
  81 extern gboolean confirm_execute;
  82 extern gboolean confirm_exit;
  83 extern gboolean confirm_overwrite;
  84 extern gboolean confirm_view_dir;
  85 extern gboolean safe_delete;
  86 extern gboolean safe_overwrite;
  87 extern gboolean clear_before_exec;
  88 extern gboolean auto_menu;
  89 extern gboolean drop_menus;
  90 extern gboolean verbose;
  91 extern gboolean copymove_persistent_attr;
  92 extern gboolean classic_progressbar;
  93 extern gboolean easy_patterns;
  94 extern int option_tab_spacing;
  95 extern gboolean auto_save_setup;
  96 extern gboolean only_leading_plus_minus;
  97 extern int cd_symlinks;
  98 extern gboolean auto_fill_mkdir_name;
  99 extern gboolean output_starts_shell;
 100 #ifdef USE_FILE_CMD
 101 extern gboolean use_file_to_check_type;
 102 #endif
 103 extern gboolean file_op_compute_totals;
 104 extern gboolean editor_ask_filename_before_edit;
 105 
 106 extern panels_options_t panels_options;
 107 
 108 extern panel_view_mode_t startup_left_mode;
 109 extern panel_view_mode_t startup_right_mode;
 110 extern gboolean boot_current_is_left;
 111 extern gboolean use_internal_view;
 112 extern gboolean use_internal_edit;
 113 
 114 #ifdef HAVE_CHARSET
 115 extern int default_source_codepage;
 116 extern char *autodetect_codeset;
 117 extern gboolean is_autodetect_codeset_enabled;
 118 #endif
 119 
 120 #ifdef HAVE_ASPELL
 121 extern char *spell_language;
 122 #endif
 123 
 124 /* Value of "other_dir" key in ini file */
 125 extern char *saved_other_dir;
 126 
 127 /* If set, then print to the given file the last directory we were at */
 128 extern char *last_wd_str;
 129 
 130 extern int quit;
 131 /* Set to TRUE to suppress printing the last directory */
 132 extern gboolean print_last_revert;
 133 
 134 #ifdef USE_INTERNAL_EDIT
 135 /* index to record_macro_buf[], -1 if not recording a macro */
 136 extern int macro_index;
 137 
 138 /* macro stuff */
 139 extern struct macro_action_t record_macro_buf[MAX_MACRO_LENGTH];
 140 
 141 extern GArray *macros_list;
 142 #endif
 143 
 144 extern int saving_setup;
 145 
 146 /*** declarations of public functions ************************************************************/
 147 
 148 const char *setup_init (void);
 149 void load_setup (void);
 150 gboolean save_setup (gboolean save_options, gboolean save_panel_options);
 151 void done_setup (void);
 152 void setup_save_config_show_error (const char *filename, GError **mcerror);
 153 
 154 void load_key_defs (void);
 155 #ifdef ENABLE_VFS_FTP
 156 char *load_anon_passwd (void);
 157 #endif
 158 
 159 void panel_load_setup (WPanel *panel, const char *section);
 160 void panel_save_setup (WPanel *panel, const char *section);
 161 
 162 /*** inline functions ****************************************************************************/
 163 
 164 #endif

/* [previous][next][first][last][top][bottom][index][help]  */