edit.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* edit.h - editor public API
  2. Copyright (C) 1996, 1997, 2009 Free Software Foundation, Inc.
  3. Authors: 1996, 1997 Paul Sheer
  4. 2009 Andrew Borodin
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301, USA.
  17. */
  18. /** \file edit.h
  19. * \brief Header: editor public API
  20. * \author Paul Sheer
  21. * \date 1996, 1997
  22. * \author Andrew Borodin
  23. * \date 2009
  24. */
  25. #ifndef MC_EDIT_H
  26. #define MC_EDIT_H
  27. #include "../src/global.h" /* PATH_SEP_STR */
  28. #include "../src/fileloc.h"
  29. /* Editor widget */
  30. struct WEdit;
  31. typedef struct WEdit WEdit;
  32. #define EDIT_KEY_EMULATION_NORMAL 0
  33. #define EDIT_KEY_EMULATION_EMACS 1
  34. #define EDIT_KEY_EMULATION_USER 2
  35. extern int option_word_wrap_line_length;
  36. extern int option_typewriter_wrap;
  37. extern int option_auto_para_formatting;
  38. extern int option_fill_tabs_with_spaces;
  39. extern int option_return_does_auto_indent;
  40. extern int option_backspace_through_tabs;
  41. extern int option_fake_half_tabs;
  42. extern int option_persistent_selections;
  43. extern int option_cursor_beyond_eol;
  44. extern int option_line_state;
  45. extern int option_save_mode;
  46. extern int option_save_position;
  47. extern int option_syntax_highlighting;
  48. extern char *option_backup_ext;
  49. /* what editor are we going to emulate? */
  50. extern int edit_key_emulation;
  51. extern int edit_confirm_save;
  52. extern int visible_tabs;
  53. extern int visible_tws;
  54. extern int simple_statusbar;
  55. /* used in main() */
  56. void edit_stack_init (void);
  57. void edit_stack_free (void);
  58. int edit_file (const char *_file, int line);
  59. const char *edit_get_file_name (const WEdit *edit);
  60. int edit_get_curs_col (const WEdit *edit);
  61. const char *edit_get_syntax_type (const WEdit *edit);
  62. #endif /* MC_EDIT_H */