1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef _TEXTCONV_H_
21
22 #include "lisp.h"
23 #include "frame.h"
24
25
26
27
28
29
30
31 struct textconv_interface
32 {
33
34
35
36 void (*reset) (struct frame *);
37
38
39
40
41
42 void (*point_changed) (struct frame *, struct window *,
43 struct buffer *);
44
45
46
47 void (*compose_region_changed) (struct frame *);
48
49
50
51 void (*notify_conversion) (unsigned long);
52 };
53
54
55
56 enum textconv_caret_direction
57 {
58 TEXTCONV_FORWARD_CHAR,
59 TEXTCONV_BACKWARD_CHAR,
60 TEXTCONV_FORWARD_WORD,
61 TEXTCONV_BACKWARD_WORD,
62 TEXTCONV_CARET_UP,
63 TEXTCONV_CARET_DOWN,
64 TEXTCONV_NEXT_LINE,
65 TEXTCONV_PREVIOUS_LINE,
66 TEXTCONV_LINE_START,
67 TEXTCONV_LINE_END,
68 TEXTCONV_ABSOLUTE_POSITION,
69 };
70
71 enum textconv_operation
72 {
73 TEXTCONV_SUBSTITUTION,
74 TEXTCONV_RETRIEVAL,
75 };
76
77
78
79
80 struct textconv_conversion_text
81 {
82
83 size_t length, bytes;
84
85
86
87 char *text;
88 };
89
90
91
92
93 struct textconv_callback_struct
94 {
95
96
97 EMACS_INT position;
98
99
100
101 enum textconv_caret_direction direction;
102
103
104
105 unsigned short factor;
106
107
108
109
110
111
112
113
114 enum textconv_operation operation;
115
116
117
118 struct textconv_conversion_text text;
119 };
120
121
122
123 #define TEXTCONV_SKIP_CONVERSION_REGION (1 << 0)
124
125 extern int textconv_query (struct frame *, struct textconv_callback_struct *,
126 int);
127 extern bool detect_conversion_events (void);
128 extern void handle_pending_conversion_events (void);
129 extern void start_batch_edit (struct frame *, unsigned long);
130 extern void end_batch_edit (struct frame *, unsigned long);
131 extern void commit_text (struct frame *, Lisp_Object, ptrdiff_t,
132 unsigned long);
133 extern void finish_composing_text (struct frame *, unsigned long,
134 bool);
135 extern void set_composing_text (struct frame *, Lisp_Object,
136 ptrdiff_t, unsigned long);
137 extern void set_composing_region (struct frame *, ptrdiff_t, ptrdiff_t,
138 unsigned long);
139 extern void textconv_set_point_and_mark (struct frame *, ptrdiff_t,
140 ptrdiff_t, unsigned long);
141 extern void delete_surrounding_text (struct frame *, ptrdiff_t,
142 ptrdiff_t, unsigned long);
143 extern void request_point_update (struct frame *, unsigned long);
144 extern void textconv_barrier (struct frame *, unsigned long);
145 extern char *get_extracted_text (struct frame *, ptrdiff_t, ptrdiff_t *,
146 ptrdiff_t *, ptrdiff_t *, ptrdiff_t *,
147 ptrdiff_t *, bool *);
148 extern char *get_surrounding_text (struct frame *, ptrdiff_t,
149 ptrdiff_t, ptrdiff_t *,
150 ptrdiff_t *, ptrdiff_t *,
151 ptrdiff_t *, ptrdiff_t *);
152 extern bool conversion_disabled_p (void);
153 extern void check_postponed_buffers (void);
154
155 extern void register_textconv_interface (struct textconv_interface *);
156
157 #endif