1 #ifndef __EDIT_WIDGET_H
2 #define __EDIT_WIDGET_H
4 #include "../src/dialog.h" /* Widget */
6 #define MAX_MACRO_LENGTH 1024
7 #define N_LINE_CACHES 32
9 #define BOOK_MARK_COLOR ((25 << 8) | 5)
10 #define BOOK_MARK_FOUND_COLOR ((26 << 8) | 4)
13 int line
; /* line number */
15 struct _book_mark
*next
;
16 struct _book_mark
*prev
;
20 unsigned short keyword
;
22 unsigned char context
;
23 unsigned char _context
;
31 int num_widget_columns
;
33 char *filename
; /* Name of the file */
34 char *dir
; /* NULL if filename is absolute */
36 /* dynamic buffers and cursor position for editor: */
37 long curs1
; /* position of the cursor from the beginning of the file. */
38 long curs2
; /* position from the end of the file */
39 unsigned char *buffers1
[MAXBUFF
+ 1]; /* all data up to curs1 */
40 unsigned char *buffers2
[MAXBUFF
+ 1]; /* all data from end of file down to curs2 */
42 /* search variables */
43 long search_start
; /* First character to start searching from */
44 int found_len
; /* Length of found string or 0 if none was found */
45 long found_start
; /* the found word from a search - start position */
47 /* display information */
48 long last_byte
; /* Last byte of file */
49 long start_display
; /* First char displayed */
50 long start_col
; /* First displayed column, negative */
51 long max_column
; /* The maximum cursor position ever reached used to calc hori scroll bar */
52 long curs_row
; /* row position of cursor on the screen */
53 long curs_col
; /* column position on screen */
54 int force
; /* how much of the screen do we redraw? */
55 int overwrite
:1; /* Overwrite on type mode (as opposed to insert) */
56 int modified
:1; /* File has been modified and needs saving */
57 int loading_done
:1; /* File has been loaded into the editor */
58 int locked
:1; /* We hold lock on current file */
59 int screen_modified
:1; /* File has been changed since the last screen draw */
60 int delete_file
:1; /* New file, needs to be deleted unless modified */
61 int highlight
:1; /* There is a selected block */
62 long prev_col
; /* recent column position of the cursor - used when moving
63 up or down past lines that are shorter than the current line */
64 long curs_line
; /* line number of the cursor. */
65 long start_line
; /* line number of the top of the page */
68 long total_lines
; /* total lines in the file */
69 long mark1
; /* position of highlight start */
70 long mark2
; /* position of highlight end */
71 int column1
; /* position of column highlight start */
72 int column2
; /* position of column highlight end */
73 long bracket
; /* position of a matching bracket */
75 /* cache speedup for line lookups */
77 int line_numbers
[N_LINE_CACHES
];
78 long line_offsets
[N_LINE_CACHES
];
80 struct _book_mark
*book_mark
;
82 /* undo stack and pointers */
83 unsigned long stack_pointer
;
85 unsigned long stack_size
;
86 unsigned long stack_size_mask
;
87 unsigned long stack_bottom
;
88 int stack_disable
:1; /* If not 0, don't save events in the undo stack */
90 struct stat stat1
; /* Result of mc_fstat() on the file */
92 /* syntax higlighting */
93 struct _syntax_marker
*syntax_marker
;
94 struct context_rule
**rules
;
96 struct syntax_rule rule
;
97 char *syntax_type
; /* description of syntax highlighting type being used */
98 GTree
*defines
; /* List of defines */
101 int macro_i
; /* index to macro[], -1 if not recording a macro */
102 int macro_depth
; /* depth of the macro recursion */
103 struct macro macro
[MAX_MACRO_LENGTH
];
106 #endif /* !__EDIT_WIDGET_H */