edit.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. /* Editor widget */
  29. struct WEdit;
  30. typedef struct WEdit WEdit;
  31. #define EDIT_KEY_EMULATION_NORMAL 0
  32. #define EDIT_KEY_EMULATION_EMACS 1
  33. #define EDIT_KEY_EMULATION_USER 2
  34. extern int option_word_wrap_line_length;
  35. extern int option_typewriter_wrap;
  36. extern int option_auto_para_formatting;
  37. extern int option_tab_spacing;
  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. /* editor home directory */
  63. #define EDIT_DIR ".mc" PATH_SEP_STR "cedit"
  64. /* file names */
  65. #define EDIT_SYNTAX_FILE EDIT_DIR PATH_SEP_STR "Syntax"
  66. #define EDIT_CLIP_FILE EDIT_DIR PATH_SEP_STR "cooledit.clip"
  67. #define EDIT_MACRO_FILE EDIT_DIR PATH_SEP_STR "cooledit.macros"
  68. #define EDIT_BLOCK_FILE EDIT_DIR PATH_SEP_STR "cooledit.block"
  69. #define EDIT_TEMP_FILE EDIT_DIR PATH_SEP_STR "cooledit.temp"
  70. #define EDIT_GLOBAL_MENU "cedit.menu"
  71. #define EDIT_LOCAL_MENU ".cedit.menu"
  72. #define EDIT_HOME_MENU EDIT_DIR PATH_SEP_STR "menu"
  73. #endif /* MC_EDIT_H */