setup.h 5.6 KB

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