6 * \brief Header: editor public API
9 * \author Andrew Borodin
16 #include "lib/global.h" /* PATH_SEP_STR */
17 #include "lib/vfs/vfs.h" /* vfs_path_t */
19 /*** typedefs(not structures) and defined constants **********************************************/
21 #define DEFAULT_WRAP_LINE_LENGTH 72
23 #define EDIT(x) ((WEdit *)(x))
24 #define CONST_EDIT(x) ((const WEdit *)(x))
26 /*** enums ***************************************************************************************/
28 /*** structures declarations (and typedefs of structures)*****************************************/
32 typedef struct WEdit WEdit
;
36 int word_wrap_line_length
;
37 gboolean typewriter_wrap
;
38 gboolean auto_para_formatting
;
39 gboolean fill_tabs_with_spaces
;
40 gboolean return_does_auto_indent
;
41 gboolean backspace_through_tabs
;
42 gboolean fake_half_tabs
;
43 gboolean persistent_selections
;
44 gboolean drop_selection_on_copy
; /* whether we need to drop selection on copy to buffer */
45 gboolean cursor_beyond_eol
;
46 gboolean cursor_after_inserted_block
;
47 gboolean state_full_filename
;
51 gboolean confirm_save
; /* queries on a save */
52 gboolean save_position
;
53 gboolean syntax_highlighting
;
56 char *filesize_threshold
;
57 char *stop_format_chars
;
58 gboolean visible_tabs
;
60 gboolean show_right_margin
;
61 gboolean simple_statusbar
; /* statusbar draw style */
62 gboolean check_nl_at_eof
;
67 vfs_path_t
*file_vpath
;
71 /*** global variables defined in .c file *********************************************************/
73 extern edit_options_t edit_options
;
75 /*** declarations of public functions ************************************************************/
78 void edit_stack_init (void);
79 void edit_stack_free (void);
81 gboolean
edit_file (const edit_arg_t
* arg
);
82 gboolean
edit_files (const GList
* files
);
84 edit_arg_t
*edit_arg_vpath_new (vfs_path_t
* file_vpath
, long line_number
);
85 edit_arg_t
*edit_arg_new (const char *file_name
, long line_number
);
86 void edit_arg_init (edit_arg_t
* arg
, vfs_path_t
* vpath
, long line
);
87 void edit_arg_assign (edit_arg_t
* arg
, vfs_path_t
* vpath
, long line
);
88 void edit_arg_free (edit_arg_t
* arg
);
90 const char *edit_get_file_name (const WEdit
* edit
);
91 off_t
edit_get_cursor_offset (const WEdit
* edit
);
92 long edit_get_curs_col (const WEdit
* edit
);
93 const char *edit_get_syntax_type (const WEdit
* edit
);
95 /*** inline functions ****************************************************************************/
96 #endif /* MC__EDIT_H */