1 |
/* $Header$ */ |
/* $Header$ */ |
2 |
|
|
3 |
/* |
/* |
4 |
* tkText.h -- |
* tkText.h -- |
5 |
* |
* |
6 |
* Declarations shared among the files that implement text |
* Declarations shared among the files that implement text |
7 |
* widgets. |
* widgets. |
8 |
* |
* |
9 |
* Copyright (c) 1992-1994 The Regents of the University of California. |
* Copyright (c) 1992-1994 The Regents of the University of California. |
10 |
* Copyright (c) 1994-1995 Sun Microsystems, Inc. |
* Copyright (c) 1994-1995 Sun Microsystems, Inc. |
11 |
* |
* |
12 |
* See the file "license.terms" for information on usage and redistribution |
* See the file "license.terms" for information on usage and redistribution |
13 |
* of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
* of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
14 |
* |
* |
15 |
* RCS: @(#) $Id: tktext.h,v 1.1.1.1 2001/06/13 05:08:53 dtashley Exp $ |
* RCS: @(#) $Id: tktext.h,v 1.1.1.1 2001/06/13 05:08:53 dtashley Exp $ |
16 |
*/ |
*/ |
17 |
|
|
18 |
#ifndef _TKTEXT |
#ifndef _TKTEXT |
19 |
#define _TKTEXT |
#define _TKTEXT |
20 |
|
|
21 |
#ifndef _TK |
#ifndef _TK |
22 |
#include "tk.h" |
#include "tk.h" |
23 |
#endif |
#endif |
24 |
|
|
25 |
#ifdef BUILD_tk |
#ifdef BUILD_tk |
26 |
# undef TCL_STORAGE_CLASS |
# undef TCL_STORAGE_CLASS |
27 |
# define TCL_STORAGE_CLASS DLLEXPORT |
# define TCL_STORAGE_CLASS DLLEXPORT |
28 |
#endif |
#endif |
29 |
|
|
30 |
/* |
/* |
31 |
* Opaque types for structures whose guts are only needed by a single |
* Opaque types for structures whose guts are only needed by a single |
32 |
* file: |
* file: |
33 |
*/ |
*/ |
34 |
|
|
35 |
typedef struct TkTextBTree *TkTextBTree; |
typedef struct TkTextBTree *TkTextBTree; |
36 |
|
|
37 |
/* |
/* |
38 |
* The data structure below defines a single line of text (from newline |
* The data structure below defines a single line of text (from newline |
39 |
* to newline, not necessarily what appears on one line of the screen). |
* to newline, not necessarily what appears on one line of the screen). |
40 |
*/ |
*/ |
41 |
|
|
42 |
typedef struct TkTextLine { |
typedef struct TkTextLine { |
43 |
struct Node *parentPtr; /* Pointer to parent node containing |
struct Node *parentPtr; /* Pointer to parent node containing |
44 |
* line. */ |
* line. */ |
45 |
struct TkTextLine *nextPtr; /* Next in linked list of lines with |
struct TkTextLine *nextPtr; /* Next in linked list of lines with |
46 |
* same parent node in B-tree. NULL |
* same parent node in B-tree. NULL |
47 |
* means end of list. */ |
* means end of list. */ |
48 |
struct TkTextSegment *segPtr; /* First in ordered list of segments |
struct TkTextSegment *segPtr; /* First in ordered list of segments |
49 |
* that make up the line. */ |
* that make up the line. */ |
50 |
} TkTextLine; |
} TkTextLine; |
51 |
|
|
52 |
/* |
/* |
53 |
* ----------------------------------------------------------------------- |
* ----------------------------------------------------------------------- |
54 |
* Segments: each line is divided into one or more segments, where each |
* Segments: each line is divided into one or more segments, where each |
55 |
* segment is one of several things, such as a group of characters, a |
* segment is one of several things, such as a group of characters, a |
56 |
* tag toggle, a mark, or an embedded widget. Each segment starts with |
* tag toggle, a mark, or an embedded widget. Each segment starts with |
57 |
* a standard header followed by a body that varies from type to type. |
* a standard header followed by a body that varies from type to type. |
58 |
* ----------------------------------------------------------------------- |
* ----------------------------------------------------------------------- |
59 |
*/ |
*/ |
60 |
|
|
61 |
/* |
/* |
62 |
* The data structure below defines the body of a segment that represents |
* The data structure below defines the body of a segment that represents |
63 |
* a tag toggle. There is one of these structures at both the beginning |
* a tag toggle. There is one of these structures at both the beginning |
64 |
* and end of each tagged range. |
* and end of each tagged range. |
65 |
*/ |
*/ |
66 |
|
|
67 |
typedef struct TkTextToggle { |
typedef struct TkTextToggle { |
68 |
struct TkTextTag *tagPtr; /* Tag that starts or ends here. */ |
struct TkTextTag *tagPtr; /* Tag that starts or ends here. */ |
69 |
int inNodeCounts; /* 1 means this toggle has been |
int inNodeCounts; /* 1 means this toggle has been |
70 |
* accounted for in node toggle |
* accounted for in node toggle |
71 |
* counts; 0 means it hasn't, yet. */ |
* counts; 0 means it hasn't, yet. */ |
72 |
} TkTextToggle; |
} TkTextToggle; |
73 |
|
|
74 |
/* |
/* |
75 |
* The data structure below defines line segments that represent |
* The data structure below defines line segments that represent |
76 |
* marks. There is one of these for each mark in the text. |
* marks. There is one of these for each mark in the text. |
77 |
*/ |
*/ |
78 |
|
|
79 |
typedef struct TkTextMark { |
typedef struct TkTextMark { |
80 |
struct TkText *textPtr; /* Overall information about text |
struct TkText *textPtr; /* Overall information about text |
81 |
* widget. */ |
* widget. */ |
82 |
TkTextLine *linePtr; /* Line structure that contains the |
TkTextLine *linePtr; /* Line structure that contains the |
83 |
* segment. */ |
* segment. */ |
84 |
Tcl_HashEntry *hPtr; /* Pointer to hash table entry for mark |
Tcl_HashEntry *hPtr; /* Pointer to hash table entry for mark |
85 |
* (in textPtr->markTable). */ |
* (in textPtr->markTable). */ |
86 |
} TkTextMark; |
} TkTextMark; |
87 |
|
|
88 |
/* |
/* |
89 |
* A structure of the following type holds information for each window |
* A structure of the following type holds information for each window |
90 |
* embedded in a text widget. This information is only used by the |
* embedded in a text widget. This information is only used by the |
91 |
* file tkTextWind.c |
* file tkTextWind.c |
92 |
*/ |
*/ |
93 |
|
|
94 |
typedef struct TkTextEmbWindow { |
typedef struct TkTextEmbWindow { |
95 |
struct TkText *textPtr; /* Information about the overall text |
struct TkText *textPtr; /* Information about the overall text |
96 |
* widget. */ |
* widget. */ |
97 |
TkTextLine *linePtr; /* Line structure that contains this |
TkTextLine *linePtr; /* Line structure that contains this |
98 |
* window. */ |
* window. */ |
99 |
Tk_Window tkwin; /* Window for this segment. NULL |
Tk_Window tkwin; /* Window for this segment. NULL |
100 |
* means that the window hasn't |
* means that the window hasn't |
101 |
* been created yet. */ |
* been created yet. */ |
102 |
char *create; /* Script to create window on-demand. |
char *create; /* Script to create window on-demand. |
103 |
* NULL means no such script. |
* NULL means no such script. |
104 |
* Malloc-ed. */ |
* Malloc-ed. */ |
105 |
int align; /* How to align window in vertical |
int align; /* How to align window in vertical |
106 |
* space. See definitions in |
* space. See definitions in |
107 |
* tkTextWind.c. */ |
* tkTextWind.c. */ |
108 |
int padX, padY; /* Padding to leave around each side |
int padX, padY; /* Padding to leave around each side |
109 |
* of window, in pixels. */ |
* of window, in pixels. */ |
110 |
int stretch; /* Should window stretch to fill |
int stretch; /* Should window stretch to fill |
111 |
* vertical space of line (except for |
* vertical space of line (except for |
112 |
* pady)? 0 or 1. */ |
* pady)? 0 or 1. */ |
113 |
int chunkCount; /* Number of display chunks that |
int chunkCount; /* Number of display chunks that |
114 |
* refer to this window. */ |
* refer to this window. */ |
115 |
int displayed; /* Non-zero means that the window |
int displayed; /* Non-zero means that the window |
116 |
* has been displayed on the screen |
* has been displayed on the screen |
117 |
* recently. */ |
* recently. */ |
118 |
} TkTextEmbWindow; |
} TkTextEmbWindow; |
119 |
|
|
120 |
/* |
/* |
121 |
* A structure of the following type holds information for each image |
* A structure of the following type holds information for each image |
122 |
* embedded in a text widget. This information is only used by the |
* embedded in a text widget. This information is only used by the |
123 |
* file tkTextImage.c |
* file tkTextImage.c |
124 |
*/ |
*/ |
125 |
|
|
126 |
typedef struct TkTextEmbImage { |
typedef struct TkTextEmbImage { |
127 |
struct TkText *textPtr; /* Information about the overall text |
struct TkText *textPtr; /* Information about the overall text |
128 |
* widget. */ |
* widget. */ |
129 |
TkTextLine *linePtr; /* Line structure that contains this |
TkTextLine *linePtr; /* Line structure that contains this |
130 |
* image. */ |
* image. */ |
131 |
char *imageString; /* Name of the image for this segment */ |
char *imageString; /* Name of the image for this segment */ |
132 |
char *imageName; /* Name used by text widget to identify |
char *imageName; /* Name used by text widget to identify |
133 |
* this image. May be unique-ified */ |
* this image. May be unique-ified */ |
134 |
char *name; /* Name used in the hash table. |
char *name; /* Name used in the hash table. |
135 |
* used by "image names" to identify |
* used by "image names" to identify |
136 |
* this instance of the image */ |
* this instance of the image */ |
137 |
Tk_Image image; /* Image for this segment. NULL |
Tk_Image image; /* Image for this segment. NULL |
138 |
* means that the image hasn't |
* means that the image hasn't |
139 |
* been created yet. */ |
* been created yet. */ |
140 |
int align; /* How to align image in vertical |
int align; /* How to align image in vertical |
141 |
* space. See definitions in |
* space. See definitions in |
142 |
* tkTextImage.c. */ |
* tkTextImage.c. */ |
143 |
int padX, padY; /* Padding to leave around each side |
int padX, padY; /* Padding to leave around each side |
144 |
* of image, in pixels. */ |
* of image, in pixels. */ |
145 |
int chunkCount; /* Number of display chunks that |
int chunkCount; /* Number of display chunks that |
146 |
* refer to this image. */ |
* refer to this image. */ |
147 |
} TkTextEmbImage; |
} TkTextEmbImage; |
148 |
|
|
149 |
/* |
/* |
150 |
* The data structure below defines line segments. |
* The data structure below defines line segments. |
151 |
*/ |
*/ |
152 |
|
|
153 |
typedef struct TkTextSegment { |
typedef struct TkTextSegment { |
154 |
struct Tk_SegType *typePtr; /* Pointer to record describing |
struct Tk_SegType *typePtr; /* Pointer to record describing |
155 |
* segment's type. */ |
* segment's type. */ |
156 |
struct TkTextSegment *nextPtr; /* Next in list of segments for this |
struct TkTextSegment *nextPtr; /* Next in list of segments for this |
157 |
* line, or NULL for end of list. */ |
* line, or NULL for end of list. */ |
158 |
int size; /* Size of this segment (# of bytes |
int size; /* Size of this segment (# of bytes |
159 |
* of index space it occupies). */ |
* of index space it occupies). */ |
160 |
union { |
union { |
161 |
char chars[4]; /* Characters that make up character |
char chars[4]; /* Characters that make up character |
162 |
* info. Actual length varies to |
* info. Actual length varies to |
163 |
* hold as many characters as needed.*/ |
* hold as many characters as needed.*/ |
164 |
TkTextToggle toggle; /* Information about tag toggle. */ |
TkTextToggle toggle; /* Information about tag toggle. */ |
165 |
TkTextMark mark; /* Information about mark. */ |
TkTextMark mark; /* Information about mark. */ |
166 |
TkTextEmbWindow ew; /* Information about embedded |
TkTextEmbWindow ew; /* Information about embedded |
167 |
* window. */ |
* window. */ |
168 |
TkTextEmbImage ei; /* Information about embedded |
TkTextEmbImage ei; /* Information about embedded |
169 |
* image. */ |
* image. */ |
170 |
} body; |
} body; |
171 |
} TkTextSegment; |
} TkTextSegment; |
172 |
|
|
173 |
/* |
/* |
174 |
* Data structures of the type defined below are used during the |
* Data structures of the type defined below are used during the |
175 |
* execution of Tcl commands to keep track of various interesting |
* execution of Tcl commands to keep track of various interesting |
176 |
* places in a text. An index is only valid up until the next |
* places in a text. An index is only valid up until the next |
177 |
* modification to the character structure of the b-tree so they |
* modification to the character structure of the b-tree so they |
178 |
* can't be retained across Tcl commands. However, mods to marks |
* can't be retained across Tcl commands. However, mods to marks |
179 |
* or tags don't invalidate indices. |
* or tags don't invalidate indices. |
180 |
*/ |
*/ |
181 |
|
|
182 |
typedef struct TkTextIndex { |
typedef struct TkTextIndex { |
183 |
TkTextBTree tree; /* Tree containing desired position. */ |
TkTextBTree tree; /* Tree containing desired position. */ |
184 |
TkTextLine *linePtr; /* Pointer to line containing position |
TkTextLine *linePtr; /* Pointer to line containing position |
185 |
* of interest. */ |
* of interest. */ |
186 |
int byteIndex; /* Index within line of desired |
int byteIndex; /* Index within line of desired |
187 |
* character (0 means first one). */ |
* character (0 means first one). */ |
188 |
} TkTextIndex; |
} TkTextIndex; |
189 |
|
|
190 |
/* |
/* |
191 |
* Types for procedure pointers stored in TkTextDispChunk strutures: |
* Types for procedure pointers stored in TkTextDispChunk strutures: |
192 |
*/ |
*/ |
193 |
|
|
194 |
typedef struct TkTextDispChunk TkTextDispChunk; |
typedef struct TkTextDispChunk TkTextDispChunk; |
195 |
|
|
196 |
typedef void Tk_ChunkDisplayProc _ANSI_ARGS_(( |
typedef void Tk_ChunkDisplayProc _ANSI_ARGS_(( |
197 |
TkTextDispChunk *chunkPtr, int x, int y, |
TkTextDispChunk *chunkPtr, int x, int y, |
198 |
int height, int baseline, Display *display, |
int height, int baseline, Display *display, |
199 |
Drawable dst, int screenY)); |
Drawable dst, int screenY)); |
200 |
typedef void Tk_ChunkUndisplayProc _ANSI_ARGS_(( |
typedef void Tk_ChunkUndisplayProc _ANSI_ARGS_(( |
201 |
struct TkText *textPtr, |
struct TkText *textPtr, |
202 |
TkTextDispChunk *chunkPtr)); |
TkTextDispChunk *chunkPtr)); |
203 |
typedef int Tk_ChunkMeasureProc _ANSI_ARGS_(( |
typedef int Tk_ChunkMeasureProc _ANSI_ARGS_(( |
204 |
TkTextDispChunk *chunkPtr, int x)); |
TkTextDispChunk *chunkPtr, int x)); |
205 |
typedef void Tk_ChunkBboxProc _ANSI_ARGS_(( |
typedef void Tk_ChunkBboxProc _ANSI_ARGS_(( |
206 |
TkTextDispChunk *chunkPtr, int index, int y, |
TkTextDispChunk *chunkPtr, int index, int y, |
207 |
int lineHeight, int baseline, int *xPtr, |
int lineHeight, int baseline, int *xPtr, |
208 |
int *yPtr, int *widthPtr, int *heightPtr)); |
int *yPtr, int *widthPtr, int *heightPtr)); |
209 |
|
|
210 |
/* |
/* |
211 |
* The structure below represents a chunk of stuff that is displayed |
* The structure below represents a chunk of stuff that is displayed |
212 |
* together on the screen. This structure is allocated and freed by |
* together on the screen. This structure is allocated and freed by |
213 |
* generic display code but most of its fields are filled in by |
* generic display code but most of its fields are filled in by |
214 |
* segment-type-specific code. |
* segment-type-specific code. |
215 |
*/ |
*/ |
216 |
|
|
217 |
struct TkTextDispChunk { |
struct TkTextDispChunk { |
218 |
/* |
/* |
219 |
* The fields below are set by the type-independent code before |
* The fields below are set by the type-independent code before |
220 |
* calling the segment-type-specific layoutProc. They should not |
* calling the segment-type-specific layoutProc. They should not |
221 |
* be modified by segment-type-specific code. |
* be modified by segment-type-specific code. |
222 |
*/ |
*/ |
223 |
|
|
224 |
int x; /* X position of chunk, in pixels. |
int x; /* X position of chunk, in pixels. |
225 |
* This position is measured from the |
* This position is measured from the |
226 |
* left edge of the logical line, |
* left edge of the logical line, |
227 |
* not from the left edge of the |
* not from the left edge of the |
228 |
* window (i.e. it doesn't change |
* window (i.e. it doesn't change |
229 |
* under horizontal scrolling). */ |
* under horizontal scrolling). */ |
230 |
struct TkTextDispChunk *nextPtr; /* Next chunk in the display line |
struct TkTextDispChunk *nextPtr; /* Next chunk in the display line |
231 |
* or NULL for the end of the list. */ |
* or NULL for the end of the list. */ |
232 |
struct TextStyle *stylePtr; /* Display information, known only |
struct TextStyle *stylePtr; /* Display information, known only |
233 |
* to tkTextDisp.c. */ |
* to tkTextDisp.c. */ |
234 |
|
|
235 |
/* |
/* |
236 |
* The fields below are set by the layoutProc that creates the |
* The fields below are set by the layoutProc that creates the |
237 |
* chunk. |
* chunk. |
238 |
*/ |
*/ |
239 |
|
|
240 |
Tk_ChunkDisplayProc *displayProc; /* Procedure to invoke to draw this |
Tk_ChunkDisplayProc *displayProc; /* Procedure to invoke to draw this |
241 |
* chunk on the display or an |
* chunk on the display or an |
242 |
* off-screen pixmap. */ |
* off-screen pixmap. */ |
243 |
Tk_ChunkUndisplayProc *undisplayProc; |
Tk_ChunkUndisplayProc *undisplayProc; |
244 |
/* Procedure to invoke when segment |
/* Procedure to invoke when segment |
245 |
* ceases to be displayed on screen |
* ceases to be displayed on screen |
246 |
* anymore. */ |
* anymore. */ |
247 |
Tk_ChunkMeasureProc *measureProc; /* Procedure to find character under |
Tk_ChunkMeasureProc *measureProc; /* Procedure to find character under |
248 |
* a given x-location. */ |
* a given x-location. */ |
249 |
Tk_ChunkBboxProc *bboxProc; /* Procedure to find bounding box |
Tk_ChunkBboxProc *bboxProc; /* Procedure to find bounding box |
250 |
* of character in chunk. */ |
* of character in chunk. */ |
251 |
int numBytes; /* Number of bytes that will be |
int numBytes; /* Number of bytes that will be |
252 |
* displayed in the chunk. */ |
* displayed in the chunk. */ |
253 |
int minAscent; /* Minimum space above the baseline |
int minAscent; /* Minimum space above the baseline |
254 |
* needed by this chunk. */ |
* needed by this chunk. */ |
255 |
int minDescent; /* Minimum space below the baseline |
int minDescent; /* Minimum space below the baseline |
256 |
* needed by this chunk. */ |
* needed by this chunk. */ |
257 |
int minHeight; /* Minimum total line height needed |
int minHeight; /* Minimum total line height needed |
258 |
* by this chunk. */ |
* by this chunk. */ |
259 |
int width; /* Width of this chunk, in pixels. |
int width; /* Width of this chunk, in pixels. |
260 |
* Initially set by chunk-specific |
* Initially set by chunk-specific |
261 |
* code, but may be increased to |
* code, but may be increased to |
262 |
* include tab or extra space at end |
* include tab or extra space at end |
263 |
* of line. */ |
* of line. */ |
264 |
int breakIndex; /* Index within chunk of last |
int breakIndex; /* Index within chunk of last |
265 |
* acceptable position for a line |
* acceptable position for a line |
266 |
* (break just before this byte index). |
* (break just before this byte index). |
267 |
* <= 0 means don't break during or |
* <= 0 means don't break during or |
268 |
* immediately after this chunk. */ |
* immediately after this chunk. */ |
269 |
ClientData clientData; /* Additional information for use |
ClientData clientData; /* Additional information for use |
270 |
* of displayProc and undisplayProc. */ |
* of displayProc and undisplayProc. */ |
271 |
}; |
}; |
272 |
|
|
273 |
/* |
/* |
274 |
* One data structure of the following type is used for each tag in a |
* One data structure of the following type is used for each tag in a |
275 |
* text widget. These structures are kept in textPtr->tagTable and |
* text widget. These structures are kept in textPtr->tagTable and |
276 |
* referred to in other structures. |
* referred to in other structures. |
277 |
*/ |
*/ |
278 |
|
|
279 |
typedef enum { TEXT_WRAPMODE_NULL, TEXT_WRAPMODE_NONE, |
typedef enum { TEXT_WRAPMODE_NULL, TEXT_WRAPMODE_NONE, |
280 |
TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_WORD |
TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_WORD |
281 |
} TkWrapMode; |
} TkWrapMode; |
282 |
|
|
283 |
extern Tk_CustomOption textWrapModeOption; |
extern Tk_CustomOption textWrapModeOption; |
284 |
|
|
285 |
typedef struct TkTextTag { |
typedef struct TkTextTag { |
286 |
char *name; /* Name of this tag. This field is actually |
char *name; /* Name of this tag. This field is actually |
287 |
* a pointer to the key from the entry in |
* a pointer to the key from the entry in |
288 |
* textPtr->tagTable, so it needn't be freed |
* textPtr->tagTable, so it needn't be freed |
289 |
* explicitly. */ |
* explicitly. */ |
290 |
int priority; /* Priority of this tag within widget. 0 |
int priority; /* Priority of this tag within widget. 0 |
291 |
* means lowest priority. Exactly one tag |
* means lowest priority. Exactly one tag |
292 |
* has each integer value between 0 and |
* has each integer value between 0 and |
293 |
* numTags-1. */ |
* numTags-1. */ |
294 |
struct Node *tagRootPtr; /* Pointer into the B-Tree at the lowest |
struct Node *tagRootPtr; /* Pointer into the B-Tree at the lowest |
295 |
* node that completely dominates the ranges |
* node that completely dominates the ranges |
296 |
* of text occupied by the tag. At this |
* of text occupied by the tag. At this |
297 |
* node there is no information about the |
* node there is no information about the |
298 |
* tag. One or more children of the node |
* tag. One or more children of the node |
299 |
* do contain information about the tag. */ |
* do contain information about the tag. */ |
300 |
int toggleCount; /* Total number of tag toggles */ |
int toggleCount; /* Total number of tag toggles */ |
301 |
|
|
302 |
/* |
/* |
303 |
* Information for displaying text with this tag. The information |
* Information for displaying text with this tag. The information |
304 |
* belows acts as an override on information specified by lower-priority |
* belows acts as an override on information specified by lower-priority |
305 |
* tags. If no value is specified, then the next-lower-priority tag |
* tags. If no value is specified, then the next-lower-priority tag |
306 |
* on the text determins the value. The text widget itself provides |
* on the text determins the value. The text widget itself provides |
307 |
* defaults if no tag specifies an override. |
* defaults if no tag specifies an override. |
308 |
*/ |
*/ |
309 |
|
|
310 |
Tk_3DBorder border; /* Used for drawing background. NULL means |
Tk_3DBorder border; /* Used for drawing background. NULL means |
311 |
* no value specified here. */ |
* no value specified here. */ |
312 |
char *bdString; /* -borderwidth option string (malloc-ed). |
char *bdString; /* -borderwidth option string (malloc-ed). |
313 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
314 |
int borderWidth; /* Width of 3-D border for background. */ |
int borderWidth; /* Width of 3-D border for background. */ |
315 |
char *reliefString; /* -relief option string (malloc-ed). |
char *reliefString; /* -relief option string (malloc-ed). |
316 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
317 |
int relief; /* 3-D relief for background. */ |
int relief; /* 3-D relief for background. */ |
318 |
Pixmap bgStipple; /* Stipple bitmap for background. None |
Pixmap bgStipple; /* Stipple bitmap for background. None |
319 |
* means no value specified here. */ |
* means no value specified here. */ |
320 |
XColor *fgColor; /* Foreground color for text. NULL means |
XColor *fgColor; /* Foreground color for text. NULL means |
321 |
* no value specified here. */ |
* no value specified here. */ |
322 |
Tk_Font tkfont; /* Font for displaying text. NULL means |
Tk_Font tkfont; /* Font for displaying text. NULL means |
323 |
* no value specified here. */ |
* no value specified here. */ |
324 |
Pixmap fgStipple; /* Stipple bitmap for text and other |
Pixmap fgStipple; /* Stipple bitmap for text and other |
325 |
* foreground stuff. None means no value |
* foreground stuff. None means no value |
326 |
* specified here.*/ |
* specified here.*/ |
327 |
char *justifyString; /* -justify option string (malloc-ed). |
char *justifyString; /* -justify option string (malloc-ed). |
328 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
329 |
Tk_Justify justify; /* How to justify text: TK_JUSTIFY_LEFT, |
Tk_Justify justify; /* How to justify text: TK_JUSTIFY_LEFT, |
330 |
* TK_JUSTIFY_RIGHT, or TK_JUSTIFY_CENTER. |
* TK_JUSTIFY_RIGHT, or TK_JUSTIFY_CENTER. |
331 |
* Only valid if justifyString is non-NULL. */ |
* Only valid if justifyString is non-NULL. */ |
332 |
char *lMargin1String; /* -lmargin1 option string (malloc-ed). |
char *lMargin1String; /* -lmargin1 option string (malloc-ed). |
333 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
334 |
int lMargin1; /* Left margin for first display line of |
int lMargin1; /* Left margin for first display line of |
335 |
* each text line, in pixels. Only valid |
* each text line, in pixels. Only valid |
336 |
* if lMargin1String is non-NULL. */ |
* if lMargin1String is non-NULL. */ |
337 |
char *lMargin2String; /* -lmargin2 option string (malloc-ed). |
char *lMargin2String; /* -lmargin2 option string (malloc-ed). |
338 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
339 |
int lMargin2; /* Left margin for second and later display |
int lMargin2; /* Left margin for second and later display |
340 |
* lines of each text line, in pixels. Only |
* lines of each text line, in pixels. Only |
341 |
* valid if lMargin2String is non-NULL. */ |
* valid if lMargin2String is non-NULL. */ |
342 |
char *offsetString; /* -offset option string (malloc-ed). |
char *offsetString; /* -offset option string (malloc-ed). |
343 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
344 |
int offset; /* Vertical offset of text's baseline from |
int offset; /* Vertical offset of text's baseline from |
345 |
* baseline of line. Used for superscripts |
* baseline of line. Used for superscripts |
346 |
* and subscripts. Only valid if |
* and subscripts. Only valid if |
347 |
* offsetString is non-NULL. */ |
* offsetString is non-NULL. */ |
348 |
char *overstrikeString; /* -overstrike option string (malloc-ed). |
char *overstrikeString; /* -overstrike option string (malloc-ed). |
349 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
350 |
int overstrike; /* Non-zero means draw horizontal line through |
int overstrike; /* Non-zero means draw horizontal line through |
351 |
* middle of text. Only valid if |
* middle of text. Only valid if |
352 |
* overstrikeString is non-NULL. */ |
* overstrikeString is non-NULL. */ |
353 |
char *rMarginString; /* -rmargin option string (malloc-ed). |
char *rMarginString; /* -rmargin option string (malloc-ed). |
354 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
355 |
int rMargin; /* Right margin for text, in pixels. Only |
int rMargin; /* Right margin for text, in pixels. Only |
356 |
* valid if rMarginString is non-NULL. */ |
* valid if rMarginString is non-NULL. */ |
357 |
char *spacing1String; /* -spacing1 option string (malloc-ed). |
char *spacing1String; /* -spacing1 option string (malloc-ed). |
358 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
359 |
int spacing1; /* Extra spacing above first display |
int spacing1; /* Extra spacing above first display |
360 |
* line for text line. Only valid if |
* line for text line. Only valid if |
361 |
* spacing1String is non-NULL. */ |
* spacing1String is non-NULL. */ |
362 |
char *spacing2String; /* -spacing2 option string (malloc-ed). |
char *spacing2String; /* -spacing2 option string (malloc-ed). |
363 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
364 |
int spacing2; /* Extra spacing between display |
int spacing2; /* Extra spacing between display |
365 |
* lines for the same text line. Only valid |
* lines for the same text line. Only valid |
366 |
* if spacing2String is non-NULL. */ |
* if spacing2String is non-NULL. */ |
367 |
char *spacing3String; /* -spacing2 option string (malloc-ed). |
char *spacing3String; /* -spacing2 option string (malloc-ed). |
368 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
369 |
int spacing3; /* Extra spacing below last display |
int spacing3; /* Extra spacing below last display |
370 |
* line for text line. Only valid if |
* line for text line. Only valid if |
371 |
* spacing3String is non-NULL. */ |
* spacing3String is non-NULL. */ |
372 |
char *tabString; /* -tabs option string (malloc-ed). |
char *tabString; /* -tabs option string (malloc-ed). |
373 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
374 |
struct TkTextTabArray *tabArrayPtr; |
struct TkTextTabArray *tabArrayPtr; |
375 |
/* Info about tabs for tag (malloc-ed) |
/* Info about tabs for tag (malloc-ed) |
376 |
* or NULL. Corresponds to tabString. */ |
* or NULL. Corresponds to tabString. */ |
377 |
char *underlineString; /* -underline option string (malloc-ed). |
char *underlineString; /* -underline option string (malloc-ed). |
378 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
379 |
int underline; /* Non-zero means draw underline underneath |
int underline; /* Non-zero means draw underline underneath |
380 |
* text. Only valid if underlineString is |
* text. Only valid if underlineString is |
381 |
* non-NULL. */ |
* non-NULL. */ |
382 |
TkWrapMode wrapMode; /* How to handle wrap-around for this tag. |
TkWrapMode wrapMode; /* How to handle wrap-around for this tag. |
383 |
* Must be TEXT_WRAPMODE_CHAR, |
* Must be TEXT_WRAPMODE_CHAR, |
384 |
* TEXT_WRAPMODE_NONE, TEXT_WRAPMODE_WORD, |
* TEXT_WRAPMODE_NONE, TEXT_WRAPMODE_WORD, |
385 |
* or TEXT_WRAPMODE_NULL to use wrapmode for |
* or TEXT_WRAPMODE_NULL to use wrapmode for |
386 |
* whole widget. */ |
* whole widget. */ |
387 |
char *elideString; /* -elide option string (malloc-ed). |
char *elideString; /* -elide option string (malloc-ed). |
388 |
* NULL means option not specified. */ |
* NULL means option not specified. */ |
389 |
int elide; /* Non-zero means that data under this tag |
int elide; /* Non-zero means that data under this tag |
390 |
* should not be displayed. */ |
* should not be displayed. */ |
391 |
int affectsDisplay; /* Non-zero means that this tag affects the |
int affectsDisplay; /* Non-zero means that this tag affects the |
392 |
* way information is displayed on the screen |
* way information is displayed on the screen |
393 |
* (so need to redisplay if tag changes). */ |
* (so need to redisplay if tag changes). */ |
394 |
} TkTextTag; |
} TkTextTag; |
395 |
|
|
396 |
#define TK_TAG_AFFECTS_DISPLAY 0x1 |
#define TK_TAG_AFFECTS_DISPLAY 0x1 |
397 |
#define TK_TAG_UNDERLINE 0x2 |
#define TK_TAG_UNDERLINE 0x2 |
398 |
#define TK_TAG_JUSTIFY 0x4 |
#define TK_TAG_JUSTIFY 0x4 |
399 |
#define TK_TAG_OFFSET 0x10 |
#define TK_TAG_OFFSET 0x10 |
400 |
|
|
401 |
/* |
/* |
402 |
* The data structure below is used for searching a B-tree for transitions |
* The data structure below is used for searching a B-tree for transitions |
403 |
* on a single tag (or for all tag transitions). No code outside of |
* on a single tag (or for all tag transitions). No code outside of |
404 |
* tkTextBTree.c should ever modify any of the fields in these structures, |
* tkTextBTree.c should ever modify any of the fields in these structures, |
405 |
* but it's OK to use them for read-only information. |
* but it's OK to use them for read-only information. |
406 |
*/ |
*/ |
407 |
|
|
408 |
typedef struct TkTextSearch { |
typedef struct TkTextSearch { |
409 |
TkTextIndex curIndex; /* Position of last tag transition |
TkTextIndex curIndex; /* Position of last tag transition |
410 |
* returned by TkBTreeNextTag, or |
* returned by TkBTreeNextTag, or |
411 |
* index of start of segment |
* index of start of segment |
412 |
* containing starting position for |
* containing starting position for |
413 |
* search if TkBTreeNextTag hasn't |
* search if TkBTreeNextTag hasn't |
414 |
* been called yet, or same as |
* been called yet, or same as |
415 |
* stopIndex if search is over. */ |
* stopIndex if search is over. */ |
416 |
TkTextSegment *segPtr; /* Actual tag segment returned by last |
TkTextSegment *segPtr; /* Actual tag segment returned by last |
417 |
* call to TkBTreeNextTag, or NULL if |
* call to TkBTreeNextTag, or NULL if |
418 |
* TkBTreeNextTag hasn't returned |
* TkBTreeNextTag hasn't returned |
419 |
* anything yet. */ |
* anything yet. */ |
420 |
TkTextSegment *nextPtr; /* Where to resume search in next |
TkTextSegment *nextPtr; /* Where to resume search in next |
421 |
* call to TkBTreeNextTag. */ |
* call to TkBTreeNextTag. */ |
422 |
TkTextSegment *lastPtr; /* Stop search before just before |
TkTextSegment *lastPtr; /* Stop search before just before |
423 |
* considering this segment. */ |
* considering this segment. */ |
424 |
TkTextTag *tagPtr; /* Tag to search for (or tag found, if |
TkTextTag *tagPtr; /* Tag to search for (or tag found, if |
425 |
* allTags is non-zero). */ |
* allTags is non-zero). */ |
426 |
int linesLeft; /* Lines left to search (including |
int linesLeft; /* Lines left to search (including |
427 |
* curIndex and stopIndex). When |
* curIndex and stopIndex). When |
428 |
* this becomes <= 0 the search is |
* this becomes <= 0 the search is |
429 |
* over. */ |
* over. */ |
430 |
int allTags; /* Non-zero means ignore tag check: |
int allTags; /* Non-zero means ignore tag check: |
431 |
* search for transitions on all |
* search for transitions on all |
432 |
* tags. */ |
* tags. */ |
433 |
} TkTextSearch; |
} TkTextSearch; |
434 |
|
|
435 |
/* |
/* |
436 |
* The following data structure describes a single tab stop. |
* The following data structure describes a single tab stop. |
437 |
*/ |
*/ |
438 |
|
|
439 |
typedef enum {LEFT, RIGHT, CENTER, NUMERIC} TkTextTabAlign; |
typedef enum {LEFT, RIGHT, CENTER, NUMERIC} TkTextTabAlign; |
440 |
|
|
441 |
typedef struct TkTextTab { |
typedef struct TkTextTab { |
442 |
int location; /* Offset in pixels of this tab stop |
int location; /* Offset in pixels of this tab stop |
443 |
* from the left margin (lmargin2) of |
* from the left margin (lmargin2) of |
444 |
* the text. */ |
* the text. */ |
445 |
TkTextTabAlign alignment; /* Where the tab stop appears relative |
TkTextTabAlign alignment; /* Where the tab stop appears relative |
446 |
* to the text. */ |
* to the text. */ |
447 |
} TkTextTab; |
} TkTextTab; |
448 |
|
|
449 |
typedef struct TkTextTabArray { |
typedef struct TkTextTabArray { |
450 |
int numTabs; /* Number of tab stops. */ |
int numTabs; /* Number of tab stops. */ |
451 |
TkTextTab tabs[1]; /* Array of tabs. The actual size |
TkTextTab tabs[1]; /* Array of tabs. The actual size |
452 |
* will be numTabs. THIS FIELD MUST |
* will be numTabs. THIS FIELD MUST |
453 |
* BE THE LAST IN THE STRUCTURE. */ |
* BE THE LAST IN THE STRUCTURE. */ |
454 |
} TkTextTabArray; |
} TkTextTabArray; |
455 |
|
|
456 |
/* |
/* |
457 |
* A data structure of the following type is kept for each text widget that |
* A data structure of the following type is kept for each text widget that |
458 |
* currently exists for this process: |
* currently exists for this process: |
459 |
*/ |
*/ |
460 |
|
|
461 |
typedef struct TkText { |
typedef struct TkText { |
462 |
Tk_Window tkwin; /* Window that embodies the text. NULL |
Tk_Window tkwin; /* Window that embodies the text. NULL |
463 |
* means that the window has been destroyed |
* means that the window has been destroyed |
464 |
* but the data structures haven't yet been |
* but the data structures haven't yet been |
465 |
* cleaned up.*/ |
* cleaned up.*/ |
466 |
Display *display; /* Display for widget. Needed, among other |
Display *display; /* Display for widget. Needed, among other |
467 |
* things, to allow resources to be freed |
* things, to allow resources to be freed |
468 |
* even after tkwin has gone away. */ |
* even after tkwin has gone away. */ |
469 |
Tcl_Interp *interp; /* Interpreter associated with widget. Used |
Tcl_Interp *interp; /* Interpreter associated with widget. Used |
470 |
* to delete widget command. */ |
* to delete widget command. */ |
471 |
Tcl_Command widgetCmd; /* Token for text's widget command. */ |
Tcl_Command widgetCmd; /* Token for text's widget command. */ |
472 |
TkTextBTree tree; /* B-tree representation of text and tags for |
TkTextBTree tree; /* B-tree representation of text and tags for |
473 |
* widget. */ |
* widget. */ |
474 |
Tcl_HashTable tagTable; /* Hash table that maps from tag names to |
Tcl_HashTable tagTable; /* Hash table that maps from tag names to |
475 |
* pointers to TkTextTag structures. */ |
* pointers to TkTextTag structures. */ |
476 |
int numTags; /* Number of tags currently defined for |
int numTags; /* Number of tags currently defined for |
477 |
* widget; needed to keep track of |
* widget; needed to keep track of |
478 |
* priorities. */ |
* priorities. */ |
479 |
Tcl_HashTable markTable; /* Hash table that maps from mark names to |
Tcl_HashTable markTable; /* Hash table that maps from mark names to |
480 |
* pointers to mark segments. */ |
* pointers to mark segments. */ |
481 |
Tcl_HashTable windowTable; /* Hash table that maps from window names |
Tcl_HashTable windowTable; /* Hash table that maps from window names |
482 |
* to pointers to window segments. If a |
* to pointers to window segments. If a |
483 |
* window segment doesn't yet have an |
* window segment doesn't yet have an |
484 |
* associated window, there is no entry for |
* associated window, there is no entry for |
485 |
* it here. */ |
* it here. */ |
486 |
Tcl_HashTable imageTable; /* Hash table that maps from image names |
Tcl_HashTable imageTable; /* Hash table that maps from image names |
487 |
* to pointers to image segments. If an |
* to pointers to image segments. If an |
488 |
* image segment doesn't yet have an |
* image segment doesn't yet have an |
489 |
* associated image, there is no entry for |
* associated image, there is no entry for |
490 |
* it here. */ |
* it here. */ |
491 |
int state; /* Either STATE_NORMAL or STATE_DISABLED. A |
int state; /* Either STATE_NORMAL or STATE_DISABLED. A |
492 |
* text widget is read-only when disabled. */ |
* text widget is read-only when disabled. */ |
493 |
|
|
494 |
/* |
/* |
495 |
* Default information for displaying (may be overridden by tags |
* Default information for displaying (may be overridden by tags |
496 |
* applied to ranges of characters). |
* applied to ranges of characters). |
497 |
*/ |
*/ |
498 |
|
|
499 |
Tk_3DBorder border; /* Structure used to draw 3-D border and |
Tk_3DBorder border; /* Structure used to draw 3-D border and |
500 |
* default background. */ |
* default background. */ |
501 |
int borderWidth; /* Width of 3-D border to draw around entire |
int borderWidth; /* Width of 3-D border to draw around entire |
502 |
* widget. */ |
* widget. */ |
503 |
int padX, padY; /* Padding between text and window border. */ |
int padX, padY; /* Padding between text and window border. */ |
504 |
int relief; /* 3-d effect for border around entire |
int relief; /* 3-d effect for border around entire |
505 |
* widget: TK_RELIEF_RAISED etc. */ |
* widget: TK_RELIEF_RAISED etc. */ |
506 |
int highlightWidth; /* Width in pixels of highlight to draw |
int highlightWidth; /* Width in pixels of highlight to draw |
507 |
* around widget when it has the focus. |
* around widget when it has the focus. |
508 |
* <= 0 means don't draw a highlight. */ |
* <= 0 means don't draw a highlight. */ |
509 |
XColor *highlightBgColorPtr; |
XColor *highlightBgColorPtr; |
510 |
/* Color for drawing traversal highlight |
/* Color for drawing traversal highlight |
511 |
* area when highlight is off. */ |
* area when highlight is off. */ |
512 |
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ |
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ |
513 |
Tk_Cursor cursor; /* Current cursor for window, or None. */ |
Tk_Cursor cursor; /* Current cursor for window, or None. */ |
514 |
XColor *fgColor; /* Default foreground color for text. */ |
XColor *fgColor; /* Default foreground color for text. */ |
515 |
Tk_Font tkfont; /* Default font for displaying text. */ |
Tk_Font tkfont; /* Default font for displaying text. */ |
516 |
int charWidth; /* Width of average character in default |
int charWidth; /* Width of average character in default |
517 |
* font. */ |
* font. */ |
518 |
int spacing1; /* Default extra spacing above first display |
int spacing1; /* Default extra spacing above first display |
519 |
* line for each text line. */ |
* line for each text line. */ |
520 |
int spacing2; /* Default extra spacing between display lines |
int spacing2; /* Default extra spacing between display lines |
521 |
* for the same text line. */ |
* for the same text line. */ |
522 |
int spacing3; /* Default extra spacing below last display |
int spacing3; /* Default extra spacing below last display |
523 |
* line for each text line. */ |
* line for each text line. */ |
524 |
char *tabOptionString; /* Value of -tabs option string (malloc'ed). */ |
char *tabOptionString; /* Value of -tabs option string (malloc'ed). */ |
525 |
TkTextTabArray *tabArrayPtr; |
TkTextTabArray *tabArrayPtr; |
526 |
/* Information about tab stops (malloc'ed). |
/* Information about tab stops (malloc'ed). |
527 |
* NULL means perform default tabbing |
* NULL means perform default tabbing |
528 |
* behavior. */ |
* behavior. */ |
529 |
|
|
530 |
/* |
/* |
531 |
* Additional information used for displaying: |
* Additional information used for displaying: |
532 |
*/ |
*/ |
533 |
|
|
534 |
TkWrapMode wrapMode; /* How to handle wrap-around. Must be |
TkWrapMode wrapMode; /* How to handle wrap-around. Must be |
535 |
* TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_NONE, or |
* TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_NONE, or |
536 |
* TEXT_WRAPMODE_WORD. */ |
* TEXT_WRAPMODE_WORD. */ |
537 |
int width, height; /* Desired dimensions for window, measured |
int width, height; /* Desired dimensions for window, measured |
538 |
* in characters. */ |
* in characters. */ |
539 |
int setGrid; /* Non-zero means pass gridding information |
int setGrid; /* Non-zero means pass gridding information |
540 |
* to window manager. */ |
* to window manager. */ |
541 |
int prevWidth, prevHeight; /* Last known dimensions of window; used to |
int prevWidth, prevHeight; /* Last known dimensions of window; used to |
542 |
* detect changes in size. */ |
* detect changes in size. */ |
543 |
TkTextIndex topIndex; /* Identifies first character in top display |
TkTextIndex topIndex; /* Identifies first character in top display |
544 |
* line of window. */ |
* line of window. */ |
545 |
struct TextDInfo *dInfoPtr; /* Information maintained by tkTextDisp.c. */ |
struct TextDInfo *dInfoPtr; /* Information maintained by tkTextDisp.c. */ |
546 |
|
|
547 |
/* |
/* |
548 |
* Information related to selection. |
* Information related to selection. |
549 |
*/ |
*/ |
550 |
|
|
551 |
TkTextTag *selTagPtr; /* Pointer to "sel" tag. Used to tell when |
TkTextTag *selTagPtr; /* Pointer to "sel" tag. Used to tell when |
552 |
* a new selection has been made. */ |
* a new selection has been made. */ |
553 |
Tk_3DBorder selBorder; /* Border and background for selected |
Tk_3DBorder selBorder; /* Border and background for selected |
554 |
* characters. This is a copy of information |
* characters. This is a copy of information |
555 |
* in *cursorTagPtr, so it shouldn't be |
* in *cursorTagPtr, so it shouldn't be |
556 |
* explicitly freed. */ |
* explicitly freed. */ |
557 |
char *selBdString; /* Value of -selectborderwidth option, or NULL |
char *selBdString; /* Value of -selectborderwidth option, or NULL |
558 |
* if not specified (malloc'ed). */ |
* if not specified (malloc'ed). */ |
559 |
XColor *selFgColorPtr; /* Foreground color for selected text. |
XColor *selFgColorPtr; /* Foreground color for selected text. |
560 |
* This is a copy of information in |
* This is a copy of information in |
561 |
* *cursorTagPtr, so it shouldn't be |
* *cursorTagPtr, so it shouldn't be |
562 |
* explicitly freed. */ |
* explicitly freed. */ |
563 |
int exportSelection; /* Non-zero means tie "sel" tag to X |
int exportSelection; /* Non-zero means tie "sel" tag to X |
564 |
* selection. */ |
* selection. */ |
565 |
TkTextIndex selIndex; /* Used during multi-pass selection retrievals. |
TkTextIndex selIndex; /* Used during multi-pass selection retrievals. |
566 |
* This index identifies the next character |
* This index identifies the next character |
567 |
* to be returned from the selection. */ |
* to be returned from the selection. */ |
568 |
int abortSelections; /* Set to 1 whenever the text is modified |
int abortSelections; /* Set to 1 whenever the text is modified |
569 |
* in a way that interferes with selection |
* in a way that interferes with selection |
570 |
* retrieval: used to abort incremental |
* retrieval: used to abort incremental |
571 |
* selection retrievals. */ |
* selection retrievals. */ |
572 |
int selOffset; /* Offset in selection corresponding to |
int selOffset; /* Offset in selection corresponding to |
573 |
* selLine and selCh. -1 means neither |
* selLine and selCh. -1 means neither |
574 |
* this information nor selIndex is of any |
* this information nor selIndex is of any |
575 |
* use. */ |
* use. */ |
576 |
|
|
577 |
/* |
/* |
578 |
* Information related to insertion cursor: |
* Information related to insertion cursor: |
579 |
*/ |
*/ |
580 |
|
|
581 |
TkTextSegment *insertMarkPtr; |
TkTextSegment *insertMarkPtr; |
582 |
/* Points to segment for "insert" mark. */ |
/* Points to segment for "insert" mark. */ |
583 |
Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion |
Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion |
584 |
* cursor. */ |
* cursor. */ |
585 |
int insertWidth; /* Total width of insert cursor. */ |
int insertWidth; /* Total width of insert cursor. */ |
586 |
int insertBorderWidth; /* Width of 3-D border around insert cursor. */ |
int insertBorderWidth; /* Width of 3-D border around insert cursor. */ |
587 |
int insertOnTime; /* Number of milliseconds cursor should spend |
int insertOnTime; /* Number of milliseconds cursor should spend |
588 |
* in "on" state for each blink. */ |
* in "on" state for each blink. */ |
589 |
int insertOffTime; /* Number of milliseconds cursor should spend |
int insertOffTime; /* Number of milliseconds cursor should spend |
590 |
* in "off" state for each blink. */ |
* in "off" state for each blink. */ |
591 |
Tcl_TimerToken insertBlinkHandler; |
Tcl_TimerToken insertBlinkHandler; |
592 |
/* Timer handler used to blink cursor on and |
/* Timer handler used to blink cursor on and |
593 |
* off. */ |
* off. */ |
594 |
|
|
595 |
/* |
/* |
596 |
* Information used for event bindings associated with tags: |
* Information used for event bindings associated with tags: |
597 |
*/ |
*/ |
598 |
|
|
599 |
Tk_BindingTable bindingTable; |
Tk_BindingTable bindingTable; |
600 |
/* Table of all bindings currently defined |
/* Table of all bindings currently defined |
601 |
* for this widget. NULL means that no |
* for this widget. NULL means that no |
602 |
* bindings exist, so the table hasn't been |
* bindings exist, so the table hasn't been |
603 |
* created. Each "object" used for this |
* created. Each "object" used for this |
604 |
* table is the address of a tag. */ |
* table is the address of a tag. */ |
605 |
TkTextSegment *currentMarkPtr; |
TkTextSegment *currentMarkPtr; |
606 |
/* Pointer to segment for "current" mark, |
/* Pointer to segment for "current" mark, |
607 |
* or NULL if none. */ |
* or NULL if none. */ |
608 |
XEvent pickEvent; /* The event from which the current character |
XEvent pickEvent; /* The event from which the current character |
609 |
* was chosen. Must be saved so that we |
* was chosen. Must be saved so that we |
610 |
* can repick after modifications to the |
* can repick after modifications to the |
611 |
* text. */ |
* text. */ |
612 |
int numCurTags; /* Number of tags associated with character |
int numCurTags; /* Number of tags associated with character |
613 |
* at current mark. */ |
* at current mark. */ |
614 |
TkTextTag **curTagArrayPtr; /* Pointer to array of tags for current |
TkTextTag **curTagArrayPtr; /* Pointer to array of tags for current |
615 |
* mark, or NULL if none. */ |
* mark, or NULL if none. */ |
616 |
|
|
617 |
/* |
/* |
618 |
* Miscellaneous additional information: |
* Miscellaneous additional information: |
619 |
*/ |
*/ |
620 |
|
|
621 |
char *takeFocus; /* Value of -takeFocus option; not used in |
char *takeFocus; /* Value of -takeFocus option; not used in |
622 |
* the C code, but used by keyboard traversal |
* the C code, but used by keyboard traversal |
623 |
* scripts. Malloc'ed, but may be NULL. */ |
* scripts. Malloc'ed, but may be NULL. */ |
624 |
char *xScrollCmd; /* Prefix of command to issue to update |
char *xScrollCmd; /* Prefix of command to issue to update |
625 |
* horizontal scrollbar when view changes. */ |
* horizontal scrollbar when view changes. */ |
626 |
char *yScrollCmd; /* Prefix of command to issue to update |
char *yScrollCmd; /* Prefix of command to issue to update |
627 |
* vertical scrollbar when view changes. */ |
* vertical scrollbar when view changes. */ |
628 |
int flags; /* Miscellaneous flags; see below for |
int flags; /* Miscellaneous flags; see below for |
629 |
* definitions. */ |
* definitions. */ |
630 |
} TkText; |
} TkText; |
631 |
|
|
632 |
/* |
/* |
633 |
* Flag values for TkText records: |
* Flag values for TkText records: |
634 |
* |
* |
635 |
* GOT_SELECTION: Non-zero means we've already claimed the |
* GOT_SELECTION: Non-zero means we've already claimed the |
636 |
* selection. |
* selection. |
637 |
* INSERT_ON: Non-zero means insertion cursor should be |
* INSERT_ON: Non-zero means insertion cursor should be |
638 |
* displayed on screen. |
* displayed on screen. |
639 |
* GOT_FOCUS: Non-zero means this window has the input |
* GOT_FOCUS: Non-zero means this window has the input |
640 |
* focus. |
* focus. |
641 |
* BUTTON_DOWN: 1 means that a mouse button is currently |
* BUTTON_DOWN: 1 means that a mouse button is currently |
642 |
* down; this is used to implement grabs |
* down; this is used to implement grabs |
643 |
* for the duration of button presses. |
* for the duration of button presses. |
644 |
* UPDATE_SCROLLBARS: Non-zero means scrollbar(s) should be updated |
* UPDATE_SCROLLBARS: Non-zero means scrollbar(s) should be updated |
645 |
* during next redisplay operation. |
* during next redisplay operation. |
646 |
*/ |
*/ |
647 |
|
|
648 |
#define GOT_SELECTION 1 |
#define GOT_SELECTION 1 |
649 |
#define INSERT_ON 2 |
#define INSERT_ON 2 |
650 |
#define GOT_FOCUS 4 |
#define GOT_FOCUS 4 |
651 |
#define BUTTON_DOWN 8 |
#define BUTTON_DOWN 8 |
652 |
#define UPDATE_SCROLLBARS 0x10 |
#define UPDATE_SCROLLBARS 0x10 |
653 |
#define NEED_REPICK 0x20 |
#define NEED_REPICK 0x20 |
654 |
|
|
655 |
/* |
/* |
656 |
* Records of the following type define segment types in terms of |
* Records of the following type define segment types in terms of |
657 |
* a collection of procedures that may be called to manipulate |
* a collection of procedures that may be called to manipulate |
658 |
* segments of that type. |
* segments of that type. |
659 |
*/ |
*/ |
660 |
|
|
661 |
typedef TkTextSegment * Tk_SegSplitProc _ANSI_ARGS_(( |
typedef TkTextSegment * Tk_SegSplitProc _ANSI_ARGS_(( |
662 |
struct TkTextSegment *segPtr, int index)); |
struct TkTextSegment *segPtr, int index)); |
663 |
typedef int Tk_SegDeleteProc _ANSI_ARGS_(( |
typedef int Tk_SegDeleteProc _ANSI_ARGS_(( |
664 |
struct TkTextSegment *segPtr, |
struct TkTextSegment *segPtr, |
665 |
TkTextLine *linePtr, int treeGone)); |
TkTextLine *linePtr, int treeGone)); |
666 |
typedef TkTextSegment * Tk_SegCleanupProc _ANSI_ARGS_(( |
typedef TkTextSegment * Tk_SegCleanupProc _ANSI_ARGS_(( |
667 |
struct TkTextSegment *segPtr, TkTextLine *linePtr)); |
struct TkTextSegment *segPtr, TkTextLine *linePtr)); |
668 |
typedef void Tk_SegLineChangeProc _ANSI_ARGS_(( |
typedef void Tk_SegLineChangeProc _ANSI_ARGS_(( |
669 |
struct TkTextSegment *segPtr, TkTextLine *linePtr)); |
struct TkTextSegment *segPtr, TkTextLine *linePtr)); |
670 |
typedef int Tk_SegLayoutProc _ANSI_ARGS_((struct TkText *textPtr, |
typedef int Tk_SegLayoutProc _ANSI_ARGS_((struct TkText *textPtr, |
671 |
struct TkTextIndex *indexPtr, TkTextSegment *segPtr, |
struct TkTextIndex *indexPtr, TkTextSegment *segPtr, |
672 |
int offset, int maxX, int maxChars, |
int offset, int maxX, int maxChars, |
673 |
int noCharsYet, TkWrapMode wrapMode, |
int noCharsYet, TkWrapMode wrapMode, |
674 |
struct TkTextDispChunk *chunkPtr)); |
struct TkTextDispChunk *chunkPtr)); |
675 |
typedef void Tk_SegCheckProc _ANSI_ARGS_((TkTextSegment *segPtr, |
typedef void Tk_SegCheckProc _ANSI_ARGS_((TkTextSegment *segPtr, |
676 |
TkTextLine *linePtr)); |
TkTextLine *linePtr)); |
677 |
|
|
678 |
typedef struct Tk_SegType { |
typedef struct Tk_SegType { |
679 |
char *name; /* Name of this kind of segment. */ |
char *name; /* Name of this kind of segment. */ |
680 |
int leftGravity; /* If a segment has zero size (e.g. a |
int leftGravity; /* If a segment has zero size (e.g. a |
681 |
* mark or tag toggle), does it |
* mark or tag toggle), does it |
682 |
* attach to character to its left |
* attach to character to its left |
683 |
* or right? 1 means left, 0 means |
* or right? 1 means left, 0 means |
684 |
* right. */ |
* right. */ |
685 |
Tk_SegSplitProc *splitProc; /* Procedure to split large segment |
Tk_SegSplitProc *splitProc; /* Procedure to split large segment |
686 |
* into two smaller ones. */ |
* into two smaller ones. */ |
687 |
Tk_SegDeleteProc *deleteProc; /* Procedure to call to delete |
Tk_SegDeleteProc *deleteProc; /* Procedure to call to delete |
688 |
* segment. */ |
* segment. */ |
689 |
Tk_SegCleanupProc *cleanupProc; /* After any change to a line, this |
Tk_SegCleanupProc *cleanupProc; /* After any change to a line, this |
690 |
* procedure is invoked for all |
* procedure is invoked for all |
691 |
* segments left in the line to |
* segments left in the line to |
692 |
* perform any cleanup they wish |
* perform any cleanup they wish |
693 |
* (e.g. joining neighboring |
* (e.g. joining neighboring |
694 |
* segments). */ |
* segments). */ |
695 |
Tk_SegLineChangeProc *lineChangeProc; |
Tk_SegLineChangeProc *lineChangeProc; |
696 |
/* Invoked when a segment is about |
/* Invoked when a segment is about |
697 |
* to be moved from its current line |
* to be moved from its current line |
698 |
* to an earlier line because of |
* to an earlier line because of |
699 |
* a deletion. The linePtr is that |
* a deletion. The linePtr is that |
700 |
* for the segment's old line. |
* for the segment's old line. |
701 |
* CleanupProc will be invoked after |
* CleanupProc will be invoked after |
702 |
* the deletion is finished. */ |
* the deletion is finished. */ |
703 |
Tk_SegLayoutProc *layoutProc; /* Returns size information when |
Tk_SegLayoutProc *layoutProc; /* Returns size information when |
704 |
* figuring out what to display in |
* figuring out what to display in |
705 |
* window. */ |
* window. */ |
706 |
Tk_SegCheckProc *checkProc; /* Called during consistency checks |
Tk_SegCheckProc *checkProc; /* Called during consistency checks |
707 |
* to check internal consistency of |
* to check internal consistency of |
708 |
* segment. */ |
* segment. */ |
709 |
} Tk_SegType; |
} Tk_SegType; |
710 |
|
|
711 |
/* |
/* |
712 |
* The constant below is used to specify a line when what is really |
* The constant below is used to specify a line when what is really |
713 |
* wanted is the entire text. For now, just use a very big number. |
* wanted is the entire text. For now, just use a very big number. |
714 |
*/ |
*/ |
715 |
|
|
716 |
#define TK_END_OF_TEXT 1000000 |
#define TK_END_OF_TEXT 1000000 |
717 |
|
|
718 |
/* |
/* |
719 |
* The following definition specifies the maximum number of characters |
* The following definition specifies the maximum number of characters |
720 |
* needed in a string to hold a position specifier. |
* needed in a string to hold a position specifier. |
721 |
*/ |
*/ |
722 |
|
|
723 |
#define TK_POS_CHARS 30 |
#define TK_POS_CHARS 30 |
724 |
|
|
725 |
/* |
/* |
726 |
* Declarations for variables shared among the text-related files: |
* Declarations for variables shared among the text-related files: |
727 |
*/ |
*/ |
728 |
|
|
729 |
extern int tkBTreeDebug; |
extern int tkBTreeDebug; |
730 |
extern int tkTextDebug; |
extern int tkTextDebug; |
731 |
extern Tk_SegType tkTextCharType; |
extern Tk_SegType tkTextCharType; |
732 |
extern Tk_SegType tkTextLeftMarkType; |
extern Tk_SegType tkTextLeftMarkType; |
733 |
extern Tk_SegType tkTextRightMarkType; |
extern Tk_SegType tkTextRightMarkType; |
734 |
extern Tk_SegType tkTextToggleOnType; |
extern Tk_SegType tkTextToggleOnType; |
735 |
extern Tk_SegType tkTextToggleOffType; |
extern Tk_SegType tkTextToggleOffType; |
736 |
|
|
737 |
/* |
/* |
738 |
* Declarations for procedures that are used by the text-related files |
* Declarations for procedures that are used by the text-related files |
739 |
* but shouldn't be used anywhere else in Tk (or by Tk clients): |
* but shouldn't be used anywhere else in Tk (or by Tk clients): |
740 |
*/ |
*/ |
741 |
|
|
742 |
extern int TkBTreeCharTagged _ANSI_ARGS_((TkTextIndex *indexPtr, |
extern int TkBTreeCharTagged _ANSI_ARGS_((TkTextIndex *indexPtr, |
743 |
TkTextTag *tagPtr)); |
TkTextTag *tagPtr)); |
744 |
extern void TkBTreeCheck _ANSI_ARGS_((TkTextBTree tree)); |
extern void TkBTreeCheck _ANSI_ARGS_((TkTextBTree tree)); |
745 |
extern int TkBTreeCharsInLine _ANSI_ARGS_((TkTextLine *linePtr)); |
extern int TkBTreeCharsInLine _ANSI_ARGS_((TkTextLine *linePtr)); |
746 |
extern int TkBTreeBytesInLine _ANSI_ARGS_((TkTextLine *linePtr)); |
extern int TkBTreeBytesInLine _ANSI_ARGS_((TkTextLine *linePtr)); |
747 |
extern TkTextBTree TkBTreeCreate _ANSI_ARGS_((TkText *textPtr)); |
extern TkTextBTree TkBTreeCreate _ANSI_ARGS_((TkText *textPtr)); |
748 |
extern void TkBTreeDestroy _ANSI_ARGS_((TkTextBTree tree)); |
extern void TkBTreeDestroy _ANSI_ARGS_((TkTextBTree tree)); |
749 |
extern void TkBTreeDeleteChars _ANSI_ARGS_((TkTextIndex *index1Ptr, |
extern void TkBTreeDeleteChars _ANSI_ARGS_((TkTextIndex *index1Ptr, |
750 |
TkTextIndex *index2Ptr)); |
TkTextIndex *index2Ptr)); |
751 |
extern TkTextLine * TkBTreeFindLine _ANSI_ARGS_((TkTextBTree tree, |
extern TkTextLine * TkBTreeFindLine _ANSI_ARGS_((TkTextBTree tree, |
752 |
int line)); |
int line)); |
753 |
extern TkTextTag ** TkBTreeGetTags _ANSI_ARGS_((TkTextIndex *indexPtr, |
extern TkTextTag ** TkBTreeGetTags _ANSI_ARGS_((TkTextIndex *indexPtr, |
754 |
int *numTagsPtr)); |
int *numTagsPtr)); |
755 |
extern void TkBTreeInsertChars _ANSI_ARGS_((TkTextIndex *indexPtr, |
extern void TkBTreeInsertChars _ANSI_ARGS_((TkTextIndex *indexPtr, |
756 |
char *string)); |
char *string)); |
757 |
extern int TkBTreeLineIndex _ANSI_ARGS_((TkTextLine *linePtr)); |
extern int TkBTreeLineIndex _ANSI_ARGS_((TkTextLine *linePtr)); |
758 |
extern void TkBTreeLinkSegment _ANSI_ARGS_((TkTextSegment *segPtr, |
extern void TkBTreeLinkSegment _ANSI_ARGS_((TkTextSegment *segPtr, |
759 |
TkTextIndex *indexPtr)); |
TkTextIndex *indexPtr)); |
760 |
extern TkTextLine * TkBTreeNextLine _ANSI_ARGS_((TkTextLine *linePtr)); |
extern TkTextLine * TkBTreeNextLine _ANSI_ARGS_((TkTextLine *linePtr)); |
761 |
extern int TkBTreeNextTag _ANSI_ARGS_((TkTextSearch *searchPtr)); |
extern int TkBTreeNextTag _ANSI_ARGS_((TkTextSearch *searchPtr)); |
762 |
extern int TkBTreeNumLines _ANSI_ARGS_((TkTextBTree tree)); |
extern int TkBTreeNumLines _ANSI_ARGS_((TkTextBTree tree)); |
763 |
extern TkTextLine * TkBTreePreviousLine _ANSI_ARGS_((TkTextLine *linePtr)); |
extern TkTextLine * TkBTreePreviousLine _ANSI_ARGS_((TkTextLine *linePtr)); |
764 |
extern int TkBTreePrevTag _ANSI_ARGS_((TkTextSearch *searchPtr)); |
extern int TkBTreePrevTag _ANSI_ARGS_((TkTextSearch *searchPtr)); |
765 |
extern void TkBTreeStartSearch _ANSI_ARGS_((TkTextIndex *index1Ptr, |
extern void TkBTreeStartSearch _ANSI_ARGS_((TkTextIndex *index1Ptr, |
766 |
TkTextIndex *index2Ptr, TkTextTag *tagPtr, |
TkTextIndex *index2Ptr, TkTextTag *tagPtr, |
767 |
TkTextSearch *searchPtr)); |
TkTextSearch *searchPtr)); |
768 |
extern void TkBTreeStartSearchBack _ANSI_ARGS_((TkTextIndex *index1Ptr, |
extern void TkBTreeStartSearchBack _ANSI_ARGS_((TkTextIndex *index1Ptr, |
769 |
TkTextIndex *index2Ptr, TkTextTag *tagPtr, |
TkTextIndex *index2Ptr, TkTextTag *tagPtr, |
770 |
TkTextSearch *searchPtr)); |
TkTextSearch *searchPtr)); |
771 |
extern void TkBTreeTag _ANSI_ARGS_((TkTextIndex *index1Ptr, |
extern void TkBTreeTag _ANSI_ARGS_((TkTextIndex *index1Ptr, |
772 |
TkTextIndex *index2Ptr, TkTextTag *tagPtr, |
TkTextIndex *index2Ptr, TkTextTag *tagPtr, |
773 |
int add)); |
int add)); |
774 |
extern void TkBTreeUnlinkSegment _ANSI_ARGS_((TkTextBTree tree, |
extern void TkBTreeUnlinkSegment _ANSI_ARGS_((TkTextBTree tree, |
775 |
TkTextSegment *segPtr, TkTextLine *linePtr)); |
TkTextSegment *segPtr, TkTextLine *linePtr)); |
776 |
extern void TkTextBindProc _ANSI_ARGS_((ClientData clientData, |
extern void TkTextBindProc _ANSI_ARGS_((ClientData clientData, |
777 |
XEvent *eventPtr)); |
XEvent *eventPtr)); |
778 |
extern void TkTextChanged _ANSI_ARGS_((TkText *textPtr, |
extern void TkTextChanged _ANSI_ARGS_((TkText *textPtr, |
779 |
TkTextIndex *index1Ptr, TkTextIndex *index2Ptr)); |
TkTextIndex *index1Ptr, TkTextIndex *index2Ptr)); |
780 |
extern int TkTextCharBbox _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextCharBbox _ANSI_ARGS_((TkText *textPtr, |
781 |
TkTextIndex *indexPtr, int *xPtr, int *yPtr, |
TkTextIndex *indexPtr, int *xPtr, int *yPtr, |
782 |
int *widthPtr, int *heightPtr)); |
int *widthPtr, int *heightPtr)); |
783 |
extern int TkTextCharLayoutProc _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextCharLayoutProc _ANSI_ARGS_((TkText *textPtr, |
784 |
TkTextIndex *indexPtr, TkTextSegment *segPtr, |
TkTextIndex *indexPtr, TkTextSegment *segPtr, |
785 |
int offset, int maxX, int maxChars, int noBreakYet, |
int offset, int maxX, int maxChars, int noBreakYet, |
786 |
TkWrapMode wrapMode, TkTextDispChunk *chunkPtr)); |
TkWrapMode wrapMode, TkTextDispChunk *chunkPtr)); |
787 |
extern void TkTextCreateDInfo _ANSI_ARGS_((TkText *textPtr)); |
extern void TkTextCreateDInfo _ANSI_ARGS_((TkText *textPtr)); |
788 |
extern int TkTextDLineInfo _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextDLineInfo _ANSI_ARGS_((TkText *textPtr, |
789 |
TkTextIndex *indexPtr, int *xPtr, int *yPtr, |
TkTextIndex *indexPtr, int *xPtr, int *yPtr, |
790 |
int *widthPtr, int *heightPtr, int *basePtr)); |
int *widthPtr, int *heightPtr, int *basePtr)); |
791 |
extern TkTextTag * TkTextCreateTag _ANSI_ARGS_((TkText *textPtr, |
extern TkTextTag * TkTextCreateTag _ANSI_ARGS_((TkText *textPtr, |
792 |
char *tagName)); |
char *tagName)); |
793 |
extern void TkTextFreeDInfo _ANSI_ARGS_((TkText *textPtr)); |
extern void TkTextFreeDInfo _ANSI_ARGS_((TkText *textPtr)); |
794 |
extern void TkTextFreeTag _ANSI_ARGS_((TkText *textPtr, |
extern void TkTextFreeTag _ANSI_ARGS_((TkText *textPtr, |
795 |
TkTextTag *tagPtr)); |
TkTextTag *tagPtr)); |
796 |
extern int TkTextGetIndex _ANSI_ARGS_((Tcl_Interp *interp, |
extern int TkTextGetIndex _ANSI_ARGS_((Tcl_Interp *interp, |
797 |
TkText *textPtr, char *string, |
TkText *textPtr, char *string, |
798 |
TkTextIndex *indexPtr)); |
TkTextIndex *indexPtr)); |
799 |
extern TkTextTabArray * TkTextGetTabs _ANSI_ARGS_((Tcl_Interp *interp, |
extern TkTextTabArray * TkTextGetTabs _ANSI_ARGS_((Tcl_Interp *interp, |
800 |
Tk_Window tkwin, char *string)); |
Tk_Window tkwin, char *string)); |
801 |
extern void TkTextIndexBackBytes _ANSI_ARGS_(( |
extern void TkTextIndexBackBytes _ANSI_ARGS_(( |
802 |
CONST TkTextIndex *srcPtr, int count, |
CONST TkTextIndex *srcPtr, int count, |
803 |
TkTextIndex *dstPtr)); |
TkTextIndex *dstPtr)); |
804 |
extern void TkTextIndexBackChars _ANSI_ARGS_(( |
extern void TkTextIndexBackChars _ANSI_ARGS_(( |
805 |
CONST TkTextIndex *srcPtr, int count, |
CONST TkTextIndex *srcPtr, int count, |
806 |
TkTextIndex *dstPtr)); |
TkTextIndex *dstPtr)); |
807 |
extern int TkTextIndexCmp _ANSI_ARGS_(( |
extern int TkTextIndexCmp _ANSI_ARGS_(( |
808 |
CONST TkTextIndex *index1Ptr, |
CONST TkTextIndex *index1Ptr, |
809 |
CONST TkTextIndex *index2Ptr)); |
CONST TkTextIndex *index2Ptr)); |
810 |
extern void TkTextIndexForwBytes _ANSI_ARGS_(( |
extern void TkTextIndexForwBytes _ANSI_ARGS_(( |
811 |
CONST TkTextIndex *srcPtr, int count, |
CONST TkTextIndex *srcPtr, int count, |
812 |
TkTextIndex *dstPtr)); |
TkTextIndex *dstPtr)); |
813 |
extern void TkTextIndexForwChars _ANSI_ARGS_(( |
extern void TkTextIndexForwChars _ANSI_ARGS_(( |
814 |
CONST TkTextIndex *srcPtr, int count, |
CONST TkTextIndex *srcPtr, int count, |
815 |
TkTextIndex *dstPtr)); |
TkTextIndex *dstPtr)); |
816 |
extern TkTextSegment * TkTextIndexToSeg _ANSI_ARGS_(( |
extern TkTextSegment * TkTextIndexToSeg _ANSI_ARGS_(( |
817 |
CONST TkTextIndex *indexPtr, int *offsetPtr)); |
CONST TkTextIndex *indexPtr, int *offsetPtr)); |
818 |
extern void TkTextInsertDisplayProc _ANSI_ARGS_(( |
extern void TkTextInsertDisplayProc _ANSI_ARGS_(( |
819 |
TkTextDispChunk *chunkPtr, int x, int y, int height, |
TkTextDispChunk *chunkPtr, int x, int y, int height, |
820 |
int baseline, Display *display, Drawable dst, |
int baseline, Display *display, Drawable dst, |
821 |
int screenY)); |
int screenY)); |
822 |
extern void TkTextLostSelection _ANSI_ARGS_(( |
extern void TkTextLostSelection _ANSI_ARGS_(( |
823 |
ClientData clientData)); |
ClientData clientData)); |
824 |
extern TkTextIndex * TkTextMakeCharIndex _ANSI_ARGS_((TkTextBTree tree, |
extern TkTextIndex * TkTextMakeCharIndex _ANSI_ARGS_((TkTextBTree tree, |
825 |
int lineIndex, int charIndex, |
int lineIndex, int charIndex, |
826 |
TkTextIndex *indexPtr)); |
TkTextIndex *indexPtr)); |
827 |
extern int TkTextIsElided _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextIsElided _ANSI_ARGS_((TkText *textPtr, |
828 |
TkTextIndex *indexPtr)); |
TkTextIndex *indexPtr)); |
829 |
extern TkTextIndex * TkTextMakeByteIndex _ANSI_ARGS_((TkTextBTree tree, |
extern TkTextIndex * TkTextMakeByteIndex _ANSI_ARGS_((TkTextBTree tree, |
830 |
int lineIndex, int byteIndex, |
int lineIndex, int byteIndex, |
831 |
TkTextIndex *indexPtr)); |
TkTextIndex *indexPtr)); |
832 |
extern int TkTextMarkCmd _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextMarkCmd _ANSI_ARGS_((TkText *textPtr, |
833 |
Tcl_Interp *interp, int argc, char **argv)); |
Tcl_Interp *interp, int argc, char **argv)); |
834 |
extern int TkTextMarkNameToIndex _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextMarkNameToIndex _ANSI_ARGS_((TkText *textPtr, |
835 |
char *name, TkTextIndex *indexPtr)); |
char *name, TkTextIndex *indexPtr)); |
836 |
extern void TkTextMarkSegToIndex _ANSI_ARGS_((TkText *textPtr, |
extern void TkTextMarkSegToIndex _ANSI_ARGS_((TkText *textPtr, |
837 |
TkTextSegment *markPtr, TkTextIndex *indexPtr)); |
TkTextSegment *markPtr, TkTextIndex *indexPtr)); |
838 |
extern void TkTextEventuallyRepick _ANSI_ARGS_((TkText *textPtr)); |
extern void TkTextEventuallyRepick _ANSI_ARGS_((TkText *textPtr)); |
839 |
extern void TkTextPickCurrent _ANSI_ARGS_((TkText *textPtr, |
extern void TkTextPickCurrent _ANSI_ARGS_((TkText *textPtr, |
840 |
XEvent *eventPtr)); |
XEvent *eventPtr)); |
841 |
extern void TkTextPixelIndex _ANSI_ARGS_((TkText *textPtr, |
extern void TkTextPixelIndex _ANSI_ARGS_((TkText *textPtr, |
842 |
int x, int y, TkTextIndex *indexPtr)); |
int x, int y, TkTextIndex *indexPtr)); |
843 |
extern void TkTextPrintIndex _ANSI_ARGS_(( |
extern void TkTextPrintIndex _ANSI_ARGS_(( |
844 |
CONST TkTextIndex *indexPtr, char *string)); |
CONST TkTextIndex *indexPtr, char *string)); |
845 |
extern void TkTextRedrawRegion _ANSI_ARGS_((TkText *textPtr, |
extern void TkTextRedrawRegion _ANSI_ARGS_((TkText *textPtr, |
846 |
int x, int y, int width, int height)); |
int x, int y, int width, int height)); |
847 |
extern void TkTextRedrawTag _ANSI_ARGS_((TkText *textPtr, |
extern void TkTextRedrawTag _ANSI_ARGS_((TkText *textPtr, |
848 |
TkTextIndex *index1Ptr, TkTextIndex *index2Ptr, |
TkTextIndex *index1Ptr, TkTextIndex *index2Ptr, |
849 |
TkTextTag *tagPtr, int withTag)); |
TkTextTag *tagPtr, int withTag)); |
850 |
extern void TkTextRelayoutWindow _ANSI_ARGS_((TkText *textPtr)); |
extern void TkTextRelayoutWindow _ANSI_ARGS_((TkText *textPtr)); |
851 |
extern int TkTextScanCmd _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextScanCmd _ANSI_ARGS_((TkText *textPtr, |
852 |
Tcl_Interp *interp, int argc, char **argv)); |
Tcl_Interp *interp, int argc, char **argv)); |
853 |
extern int TkTextSeeCmd _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextSeeCmd _ANSI_ARGS_((TkText *textPtr, |
854 |
Tcl_Interp *interp, int argc, char **argv)); |
Tcl_Interp *interp, int argc, char **argv)); |
855 |
extern int TkTextSegToOffset _ANSI_ARGS_(( |
extern int TkTextSegToOffset _ANSI_ARGS_(( |
856 |
CONST TkTextSegment *segPtr, |
CONST TkTextSegment *segPtr, |
857 |
CONST TkTextLine *linePtr)); |
CONST TkTextLine *linePtr)); |
858 |
extern TkTextSegment * TkTextSetMark _ANSI_ARGS_((TkText *textPtr, char *name, |
extern TkTextSegment * TkTextSetMark _ANSI_ARGS_((TkText *textPtr, char *name, |
859 |
TkTextIndex *indexPtr)); |
TkTextIndex *indexPtr)); |
860 |
extern void TkTextSetYView _ANSI_ARGS_((TkText *textPtr, |
extern void TkTextSetYView _ANSI_ARGS_((TkText *textPtr, |
861 |
TkTextIndex *indexPtr, int pickPlace)); |
TkTextIndex *indexPtr, int pickPlace)); |
862 |
extern int TkTextTagCmd _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextTagCmd _ANSI_ARGS_((TkText *textPtr, |
863 |
Tcl_Interp *interp, int argc, char **argv)); |
Tcl_Interp *interp, int argc, char **argv)); |
864 |
extern int TkTextImageCmd _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextImageCmd _ANSI_ARGS_((TkText *textPtr, |
865 |
Tcl_Interp *interp, int argc, char **argv)); |
Tcl_Interp *interp, int argc, char **argv)); |
866 |
extern int TkTextImageIndex _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextImageIndex _ANSI_ARGS_((TkText *textPtr, |
867 |
char *name, TkTextIndex *indexPtr)); |
char *name, TkTextIndex *indexPtr)); |
868 |
extern int TkTextWindowCmd _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextWindowCmd _ANSI_ARGS_((TkText *textPtr, |
869 |
Tcl_Interp *interp, int argc, char **argv)); |
Tcl_Interp *interp, int argc, char **argv)); |
870 |
extern int TkTextWindowIndex _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextWindowIndex _ANSI_ARGS_((TkText *textPtr, |
871 |
char *name, TkTextIndex *indexPtr)); |
char *name, TkTextIndex *indexPtr)); |
872 |
extern int TkTextXviewCmd _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextXviewCmd _ANSI_ARGS_((TkText *textPtr, |
873 |
Tcl_Interp *interp, int argc, char **argv)); |
Tcl_Interp *interp, int argc, char **argv)); |
874 |
extern int TkTextYviewCmd _ANSI_ARGS_((TkText *textPtr, |
extern int TkTextYviewCmd _ANSI_ARGS_((TkText *textPtr, |
875 |
Tcl_Interp *interp, int argc, char **argv)); |
Tcl_Interp *interp, int argc, char **argv)); |
876 |
|
|
877 |
# undef TCL_STORAGE_CLASS |
# undef TCL_STORAGE_CLASS |
878 |
# define TCL_STORAGE_CLASS DLLIMPORT |
# define TCL_STORAGE_CLASS DLLIMPORT |
879 |
|
|
880 |
#endif /* _TKTEXT */ |
#endif /* _TKTEXT */ |
881 |
|
|
882 |
/* End of tktext.h */ |
/* End of tktext.h */ |