-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckText.h
703 lines (639 loc) · 26.5 KB
/
ckText.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
/*
* ckText.h --
*
* Declarations shared among the files that implement text
* widgets.
*
* Copyright (c) 1992-1994 The Regents of the University of California.
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
*/
#ifndef _CKTEXT_H
#define _CKTEXT_H
#ifndef _CK
#include "ck.h"
#endif
/*
* Opaque types for structures whose guts are only needed by a single
* file:
*/
typedef struct CkTextBTree *CkTextBTree;
/*
* The data structure below defines a single line of text (from newline
* to newline, not necessarily what appears on one line of the screen).
*/
typedef struct CkTextLine {
struct Node *parentPtr; /* Pointer to parent node containing
* line. */
struct CkTextLine *nextPtr; /* Next in linked list of lines with
* same parent node in B-tree. NULL
* means end of list. */
struct CkTextSegment *segPtr; /* First in ordered list of segments
* that make up the line. */
} CkTextLine;
/*
* -----------------------------------------------------------------------
* Segments: each line is divided into one or more segments, where each
* segment is one of several things, such as a group of characters, a
* tag toggle, a mark, or an embedded widget. Each segment starts with
* a standard header followed by a body that varies from type to type.
* -----------------------------------------------------------------------
*/
/*
* The data structure below defines the body of a segment that represents
* a tag toggle. There is one of these structures at both the beginning
* and end of each tagged range.
*/
typedef struct CkTextToggle {
struct CkTextTag *tagPtr; /* Tag that starts or ends here. */
int inNodeCounts; /* 1 means this toggle has been
* accounted for in node toggle
* counts; 0 means it hasn't, yet. */
} CkTextToggle;
/*
* The data structure below defines line segments that represent
* marks. There is one of these for each mark in the text.
*/
typedef struct CkTextMark {
struct CkText *textPtr; /* Overall information about text
* widget. */
CkTextLine *linePtr; /* Line structure that contains the
* segment. */
Tcl_HashEntry *hPtr; /* Pointer to hash table entry for mark
* (in textPtr->markTable). */
} CkTextMark;
/*
* A structure of the following type holds information for each window
* embedded in a text widget. This information is only used by the
* file ckTextWind.c
*/
typedef struct CkTextEmbWindow {
struct CkText *textPtr; /* Information about the overall text
* widget. */
CkTextLine *linePtr; /* Line structure that contains this
* window. */
CkWindow winPtr; /* Window for this segment. NULL
* means that the window hasn't
* been created yet. */
char *create; /* Script to create window on-demand.
* NULL means no such script.
* Malloc-ed. */
int align; /* How to align window in vertical
* space. See definitions in
* ckTextWind.c. */
int padX, padY; /* Padding to leave around each side
* of window, in pixels. */
int stretch; /* Should window stretch to fill
* vertical space of line (except for
* pady)? 0 or 1. */
int chunkCount; /* Number of display chunks that
* refer to this window. */
int displayed; /* Non-zero means that the window
* has been displayed on the screen
* recently. */
} CkTextEmbWindow;
/*
* The data structure below defines line segments.
*/
typedef struct CkTextSegment {
struct Ck_SegType *typePtr; /* Pointer to record describing
* segment's type. */
struct CkTextSegment *nextPtr; /* Next in list of segments for this
* line, or NULL for end of list. */
int size; /* Size of this segment (# of bytes
* of index space it occupies). */
union {
char chars[4]; /* Characters that make up character
* info. Actual length varies to
* hold as many characters as needed.*/
CkTextToggle toggle; /* Information about tag toggle. */
CkTextMark mark; /* Information about mark. */
CkTextEmbWindow ew; /* Information about embedded
* window. */
} body;
} CkTextSegment;
/*
* Data structures of the type defined below are used during the
* execution of Tcl commands to keep track of various interesting
* places in a text. An index is only valid up until the next
* modification to the character structure of the b-tree so they
* can't be retained across Tcl commands. However, mods to marks
* or tags don't invalidate indices.
*/
typedef struct CkTextIndex {
CkTextBTree tree; /* Tree containing desired position. */
CkTextLine *linePtr; /* Pointer to line containing position
* of interest. */
int charIndex; /* Index within line of desired
* character (0 means first one). */
} CkTextIndex;
/*
* Types for procedure pointers stored in CkTextDispChunk strutures:
*/
typedef struct CkTextDispChunk CkTextDispChunk;
typedef void Ck_ChunkDisplayProc _ANSI_ARGS_((
CkTextDispChunk *chunkPtr, int x, int y,
int height, int baseline, WINDOW *window,
int screenY));
typedef void Ck_ChunkUndisplayProc _ANSI_ARGS_((
struct CkText *textPtr,
CkTextDispChunk *chunkPtr));
typedef int Ck_ChunkMeasureProc _ANSI_ARGS_((
CkTextDispChunk *chunkPtr, int x));
typedef void Ck_ChunkBboxProc _ANSI_ARGS_((
CkTextDispChunk *chunkPtr, int index, int y,
int lineHeight, int baseline, int *xPtr,
int *yPtr, int *widthPtr, int *heightPtr));
/*
* The structure below represents a chunk of stuff that is displayed
* together on the screen. This structure is allocated and freed by
* generic display code but most of its fields are filled in by
* segment-type-specific code.
*/
struct CkTextDispChunk {
/*
* The fields below are set by the type-independent code before
* calling the segment-type-specific layoutProc. They should not
* be modified by segment-type-specific code.
*/
int x; /* X position of chunk, in pixels.
* This position is measured from the
* left edge of the logical line,
* not from the left edge of the
* window (i.e. it doesn't change
* under horizontal scrolling). */
struct CkTextDispChunk *nextPtr; /* Next chunk in the display line
* or NULL for the end of the list. */
struct Style *stylePtr; /* Display information, known only
* to ckTextDisp.c. */
/*
* The fields below are set by the layoutProc that creates the
* chunk.
*/
Ck_ChunkDisplayProc *displayProc; /* Procedure to invoke to draw this
* chunk on the display or an
* off-screen pixmap. */
Ck_ChunkUndisplayProc *undisplayProc;
/* Procedure to invoke when segment
* ceases to be displayed on screen
* anymore. */
Ck_ChunkMeasureProc *measureProc; /* Procedure to find character under
* a given x-location. */
Ck_ChunkBboxProc *bboxProc; /* Procedure to find bounding box
* of character in chunk. */
int numChars; /* Number of characters that will be
* displayed in the chunk. */
int minHeight; /* Minimum total line height needed
* by this chunk. */
int width; /* Width of this chunk, in pixels.
* Initially set by chunk-specific
* code, but may be increased to
* include tab or extra space at end
* of line. */
int breakIndex; /* Index within chunk of last
* acceptable position for a line
* (break just before this character).
* <= 0 means don't break during or
* immediately after this chunk. */
ClientData clientData; /* Additional information for use
* of displayProc and undisplayProc. */
};
/*
* One data structure of the following type is used for each tag in a
* text widget. These structures are kept in textPtr->tagTable and
* referred to in other structures.
*/
typedef struct CkTextTag {
char *name; /* Name of this tag. This field is actually
* a pointer to the key from the entry in
* textPtr->tagTable, so it needn't be freed
* explicitly. */
int priority; /* Priority of this tag within widget. 0
* means lowest priority. Exactly one tag
* has each integer value between 0 and
* numTags-1. */
/*
* Information for displaying text with this tag. The information
* belows acts as an override on information specified by lower-priority
* tags. If no value is specified, then the next-lower-priority tag
* on the text determins the value. The text widget itself provides
* defaults if no tag specifies an override.
*/
int bg, fg, attr; /* Foreground/background/video attributes
* for text. -1 means no value specified. */
char *justifyString; /* -justify option string (malloc-ed).
* NULL means option not specified. */
Ck_Justify justify; /* How to justify text: CK_JUSTIFY_LEFT,
* CK_JUSTIFY_RIGHT, or CK_JUSTIFY_CENTER.
* Only valid if justifyString is non-NULL. */
char *lMargin1String; /* -lmargin1 option string (malloc-ed).
* NULL means option not specified. */
int lMargin1; /* Left margin for first display line of
* each text line, in pixels. Only valid
* if lMargin1String is non-NULL. */
char *lMargin2String; /* -lmargin2 option string (malloc-ed).
* NULL means option not specified. */
int lMargin2; /* Left margin for second and later display
* lines of each text line, in pixels. Only
* valid if lMargin2String is non-NULL. */
char *rMarginString; /* -rmargin option string (malloc-ed).
* NULL means option not specified. */
int rMargin; /* Right margin for text, in pixels. Only
* valid if rMarginString is non-NULL. */
char *tabString; /* -tabs option string (malloc-ed).
* NULL means option not specified. */
struct CkTextTabArray *tabArrayPtr;
/* Info about tabs for tag (malloc-ed)
* or NULL. Corresponds to tabString. */
Ck_Uid wrapMode; /* How to handle wrap-around for this tag.
* Must be ckTextCharUid, ckTextNoneUid,
* ckTextWordUid, or NULL to use wrapMode
* for whole widget. */
int affectsDisplay; /* Non-zero means that this tag affects the
* way information is displayed on the screen
* (so need to redisplay if tag changes). */
} CkTextTag;
#define TK_TAG_AFFECTS_DISPLAY 0x1
#define TK_TAG_UNDERLINE 0x2
#define TK_TAG_JUSTIFY 0x4
#define TK_TAG_OFFSET 0x10
/*
* The data structure below is used for searching a B-tree for transitions
* on a single tag (or for all tag transitions). No code outside of
* ckTextBTree.c should ever modify any of the fields in these structures,
* but it's OK to use them for read-only information.
*/
typedef struct CkTextSearch {
CkTextIndex curIndex; /* Position of last tag transition
* returned by CkBTreeNextTag, or
* index of start of segment
* containing starting position for
* search if CkBTreeNextTag hasn't
* been called yet, or same as
* stopIndex if search is over. */
CkTextSegment *segPtr; /* Actual tag segment returned by last
* call to CkBTreeNextTag, or NULL if
* CkBTreeNextTag hasn't returned
* anything yet. */
CkTextSegment *nextPtr; /* Where to resume search in next
* call to CkBTreeNextTag. */
CkTextSegment *lastPtr; /* Stop search before just before
* considering this segment. */
CkTextTag *tagPtr; /* Tag to search for (or tag found, if
* allTags is non-zero). */
int linesLeft; /* Lines left to search (including
* curIndex and stopIndex). When
* this becomes <= 0 the search is
* over. */
int allTags; /* Non-zero means ignore tag check:
* search for transitions on all
* tags. */
} CkTextSearch;
/*
* The following data structure describes a single tab stop.
*/
typedef enum {LEFT, RIGHT, CENTER, NUMERIC} CkTextTabAlign;
typedef struct CkTextTab {
int location; /* Offset in pixels of this tab stop
* from the left margin (lmargin2) of
* the text. */
CkTextTabAlign alignment; /* Where the tab stop appears relative
* to the text. */
} CkTextTab;
typedef struct CkTextTabArray {
int numTabs; /* Number of tab stops. */
CkTextTab tabs[1]; /* Array of tabs. The actual size
* will be numTabs. THIS FIELD MUST
* BE THE LAST IN THE STRUCTURE. */
} CkTextTabArray;
/*
* A data structure of the following type is kept for each text widget that
* currently exists for this process:
*/
typedef struct CkText {
CkWindow *winPtr; /* Window that embodies the text. NULL
* means that the window has been destroyed
* but the data structures haven't yet been
* cleaned up.*/
Tcl_Interp *interp; /* Interpreter associated with widget. Used
* to delete widget command. */
Tcl_Command widgetCmd; /* Token for text's widget command. */
CkTextBTree tree; /* B-tree representation of text and tags for
* widget. */
Tcl_HashTable tagTable; /* Hash table that maps from tag names to
* pointers to CkTextTag structures. */
int numTags; /* Number of tags currently defined for
* widget; needed to keep track of
* priorities. */
Tcl_HashTable markTable; /* Hash table that maps from mark names to
* pointers to mark segments. */
Tcl_HashTable windowTable; /* Hash table that maps from window names
* to pointers to window segments. If a
* window segment doesn't yet have an
* associated window, there is no entry for
* it here. */
Ck_Uid state; /* Normal or disabled. Text is read-only
* when disabled. */
/*
* Default information for displaying (may be overridden by tags
* applied to ranges of characters).
*/
int bg, fg, attr;
char *tabOptionString; /* Value of -tabs option string (malloc'ed). */
CkTextTabArray *tabArrayPtr;
/* Information about tab stops (malloc'ed).
* NULL means perform default tabbing
* behavior. */
/*
* Additional information used for displaying:
*/
Ck_Uid wrapMode; /* How to handle wrap-around. Must be
* ckTextCharUid, ckTextNoneUid, or
* ckTextWordUid. */
int width, height; /* Desired dimensions for window, measured
* in characters. */
int prevWidth, prevHeight; /* Last known dimensions of window; used to
* detect changes in size. */
CkTextIndex topIndex; /* Identifies first character in top display
* line of window. */
struct DInfo *dInfoPtr; /* Information maintained by ckTextDisp.c. */
/*
* Information related to selection.
*/
int selFg, selBg, selAttr;
CkTextTag *selTagPtr; /* Pointer to "sel" tag. Used to tell when
* a new selection has been made. */
CkTextIndex selIndex; /* Used during multi-pass selection retrievals.
* This index identifies the next character
* to be returned from the selection. */
int abortSelections; /* Set to 1 whenever the text is modified
* in a way that interferes with selection
* retrieval: used to abort incremental
* selection retrievals. */
int selOffset; /* Offset in selection corresponding to
* selLine and selCh. -1 means neither
* this information nor selIndex is of any
* use. */
int insertX, insertY; /* Window coordinates of HW cursor. */
/*
* Information related to insertion cursor:
*/
CkTextSegment *insertMarkPtr;
/* Points to segment for "insert" mark. */
/*
* Information used for event bindings associated with tags:
*/
Ck_BindingTable bindingTable;
/* Table of all bindings currently defined
* for this widget. NULL means that no
* bindings exist, so the table hasn't been
* created. Each "object" used for this
* table is the address of a tag. */
CkTextSegment *currentMarkPtr;
/* Pointer to segment for "current" mark,
* or NULL if none. */
CkEvent pickEvent; /* The event from which the current character
* was chosen. Must be saved so that we
* can repick after modifications to the
* text. */
int numCurTags; /* Number of tags associated with character
* at current mark. */
CkTextTag **curTagArrayPtr; /* Pointer to array of tags for current
* mark, or NULL if none. */
/*
* Miscellaneous additional information:
*/
char *takeFocus; /* Value of -takeFocus option; not used in
* the C code, but used by keyboard traversal
* scripts. Malloc'ed, but may be NULL. */
char *xScrollCmd; /* Prefix of command to issue to update
* horizontal scrollbar when view changes. */
char *yScrollCmd; /* Prefix of command to issue to update
* vertical scrollbar when view changes. */
int flags; /* Miscellaneous flags; see below for
* definitions. */
} CkText;
/*
* Flag values for CkText records:
*
* GOT_SELECTION: Non-zero means we've already claimed the
* selection.
* INSERT_ON: Non-zero means insertion cursor should be
* displayed on screen.
* GOT_FOCUS: Non-zero means this window has the input
* focus.
* UPDATE_SCROLLBARS: Non-zero means scrollbar(s) should be updated
* during next redisplay operation.
*/
#define GOT_SELECTION 1
#define INSERT_ON 2
#define GOT_FOCUS 4
#define UPDATE_SCROLLBARS 0x10
#define NEED_REPICK 0x20
/*
* Records of the following type define segment types in terms of
* a collection of procedures that may be called to manipulate
* segments of that type.
*/
typedef CkTextSegment * Ck_SegSplitProc _ANSI_ARGS_((
struct CkTextSegment *segPtr, int index));
typedef int Ck_SegDeleteProc _ANSI_ARGS_((
struct CkTextSegment *segPtr,
CkTextLine *linePtr, int treeGone));
typedef CkTextSegment * Ck_SegCleanupProc _ANSI_ARGS_((
struct CkTextSegment *segPtr, CkTextLine *linePtr));
typedef void Ck_SegLineChangeProc _ANSI_ARGS_((
struct CkTextSegment *segPtr, CkTextLine *linePtr));
typedef int Ck_SegLayoutProc _ANSI_ARGS_((struct CkText *textPtr,
struct CkTextIndex *indexPtr, CkTextSegment *segPtr,
int offset, int maxX, int maxChars,
int noCharsYet, Ck_Uid wrapMode,
struct CkTextDispChunk *chunkPtr));
typedef void Ck_SegCheckProc _ANSI_ARGS_((CkTextSegment *segPtr,
CkTextLine *linePtr));
typedef struct Ck_SegType {
char *name; /* Name of this kind of segment. */
int leftGravity; /* If a segment has zero size (e.g. a
* mark or tag toggle), does it
* attach to character to its left
* or right? 1 means left, 0 means
* right. */
Ck_SegSplitProc *splitProc; /* Procedure to split large segment
* into two smaller ones. */
Ck_SegDeleteProc *deleteProc; /* Procedure to call to delete
* segment. */
Ck_SegCleanupProc *cleanupProc; /* After any change to a line, this
* procedure is invoked for all
* segments left in the line to
* perform any cleanup they wish
* (e.g. joining neighboring
* segments). */
Ck_SegLineChangeProc *lineChangeProc;
/* Invoked when a segment is about
* to be moved from its current line
* to an earlier line because of
* a deletion. The linePtr is that
* for the segment's old line.
* CleanupProc will be invoked after
* the deletion is finished. */
Ck_SegLayoutProc *layoutProc; /* Returns size information when
* figuring out what to display in
* window. */
Ck_SegCheckProc *checkProc; /* Called during consistency checks
* to check internal consistency of
* segment. */
} Ck_SegType;
/*
* The constant below is used to specify a line when what is really
* wanted is the entire text. For now, just use a very big number.
*/
#define TK_END_OF_TEXT 1000000
/*
* The following definition specifies the maximum number of characters
* needed in a string to hold a position specifier.
*/
#define TK_POS_CHARS 30
/*
* Declarations for variables shared among the text-related files:
*/
extern int ckBTreeDebug;
extern int ckTextDebug;
extern Ck_SegType ckTextCharType;
extern Ck_Uid ckTextCharUid;
extern Ck_Uid ckTextDisabledUid;
extern Ck_SegType ckTextLeftMarkType;
extern Ck_Uid ckTextNoneUid;
extern Ck_Uid ckTextNormalUid;
extern Ck_SegType ckTextRightMarkType;
extern Ck_SegType ckTextToggleOnType;
extern Ck_SegType ckTextToggleOffType;
extern Ck_Uid ckTextWordUid;
/*
* Declarations for procedures that are used by the text-related files
* but shouldn't be used anywhere else in Ck (or by Ck clients):
*/
extern int CkBTreeCharTagged _ANSI_ARGS_((CkTextIndex *indexPtr,
CkTextTag *tagPtr));
extern void CkBTreeCheck _ANSI_ARGS_((CkTextBTree tree));
extern int CkBTreeCharsInLine _ANSI_ARGS_((CkTextLine *linePtr));
extern CkTextBTree CkBTreeCreate _ANSI_ARGS_((void));
extern void CkBTreeDestroy _ANSI_ARGS_((CkTextBTree tree));
extern void CkBTreeDeleteChars _ANSI_ARGS_((CkTextIndex *index1Ptr,
CkTextIndex *index2Ptr));
extern CkTextLine * CkBTreeFindLine _ANSI_ARGS_((CkTextBTree tree,
int line));
extern CkTextTag ** CkBTreeGetTags _ANSI_ARGS_((CkTextIndex *indexPtr,
int *numTagsPtr));
extern void CkBTreeInsertChars _ANSI_ARGS_((CkTextIndex *indexPtr,
char *string));
extern int CkBTreeLineIndex _ANSI_ARGS_((CkTextLine *linePtr));
extern void CkBTreeLinkSegment _ANSI_ARGS_((CkTextSegment *segPtr,
CkTextIndex *indexPtr));
extern CkTextLine * CkBTreeNextLine _ANSI_ARGS_((CkTextLine *linePtr));
extern int CkBTreeNextTag _ANSI_ARGS_((CkTextSearch *searchPtr));
extern int CkBTreeNumLines _ANSI_ARGS_((CkTextBTree tree));
extern void CkBTreeStartSearch _ANSI_ARGS_((CkTextIndex *index1Ptr,
CkTextIndex *index2Ptr, CkTextTag *tagPtr,
CkTextSearch *searchPtr));
extern void CkBTreeTag _ANSI_ARGS_((CkTextIndex *index1Ptr,
CkTextIndex *index2Ptr, CkTextTag *tagPtr,
int add));
extern void CkBTreeUnlinkSegment _ANSI_ARGS_((CkTextBTree tree,
CkTextSegment *segPtr, CkTextLine *linePtr));
extern void CkTextBindProc _ANSI_ARGS_((ClientData clientData,
CkEvent *eventPtr));
extern void CkTextChanged _ANSI_ARGS_((CkText *textPtr,
CkTextIndex *index1Ptr, CkTextIndex *index2Ptr));
extern int CkTextCharBbox _ANSI_ARGS_((CkText *textPtr,
CkTextIndex *indexPtr, int *xPtr, int *yPtr,
int *widthPtr, int *heightPtr));
extern int CkTextCharLayoutProc _ANSI_ARGS_((CkText *textPtr,
CkTextIndex *indexPtr, CkTextSegment *segPtr,
int offset, int maxX, int maxChars, int noBreakYet,
Ck_Uid wrapMode, CkTextDispChunk *chunkPtr));
extern void CkTextCreateDInfo _ANSI_ARGS_((CkText *textPtr));
extern int CkTextDLineInfo _ANSI_ARGS_((CkText *textPtr,
CkTextIndex *indexPtr, int *xPtr, int *yPtr,
int *widthPtr, int *heightPtr, int *basePtr));
extern CkTextTag * CkTextCreateTag _ANSI_ARGS_((CkText *textPtr,
char *tagName));
extern void CkTextFreeDInfo _ANSI_ARGS_((CkText *textPtr));
extern void CkTextFreeTag _ANSI_ARGS_((CkText *textPtr,
CkTextTag *tagPtr));
extern int CkTextGetIndex _ANSI_ARGS_((Tcl_Interp *interp,
CkText *textPtr, char *string,
CkTextIndex *indexPtr));
extern CkTextTabArray * CkTextGetTabs _ANSI_ARGS_((Tcl_Interp *interp,
CkWindow *winPtr, char *string));
#if CK_USE_UTF
extern void CkTextIndexBackBytes _ANSI_ARGS_((CkTextIndex *srcPtr,
int count, CkTextIndex *dstPtr));
#endif
extern void CkTextIndexBackChars _ANSI_ARGS_((CkTextIndex *srcPtr,
int count, CkTextIndex *dstPtr));
extern int CkTextIndexCmp _ANSI_ARGS_((CkTextIndex *index1Ptr,
CkTextIndex *index2Ptr));
#if CK_USE_UTF
extern void CkTextIndexForwBytes _ANSI_ARGS_((CkTextIndex *srcPtr,
int count, CkTextIndex *dstPtr));
#endif
extern void CkTextIndexForwChars _ANSI_ARGS_((CkTextIndex *srcPtr,
int count, CkTextIndex *dstPtr));
extern CkTextSegment * CkTextIndexToSeg _ANSI_ARGS_((CkTextIndex *indexPtr,
int *offsetPtr));
extern void CkTextInsertDisplayProc _ANSI_ARGS_((
CkTextDispChunk *chunkPtr, int x, int y, int height,
int baseline, WINDOW *window, int screenY));
extern void CkTextLostSelection _ANSI_ARGS_((
ClientData clientData));
#if CK_USE_UTF
extern CkTextIndex * CkTextMakeByteIndex _ANSI_ARGS_((CkTextBTree tree,
int lineIndex, int byteIndex,
CkTextIndex *indexPtr));
#endif
extern CkTextIndex * CkTextMakeIndex _ANSI_ARGS_((CkTextBTree tree,
int lineIndex, int charIndex,
CkTextIndex *indexPtr));
extern int CkTextMarkCmd _ANSI_ARGS_((CkText *textPtr,
Tcl_Interp *interp, int argc, char **argv));
extern int CkTextMarkNameToIndex _ANSI_ARGS_((CkText *textPtr,
char *name, CkTextIndex *indexPtr));
extern void CkTextMarkSegToIndex _ANSI_ARGS_((CkText *textPtr,
CkTextSegment *markPtr, CkTextIndex *indexPtr));
extern void CkTextEventuallyRepick _ANSI_ARGS_((CkText *textPtr));
extern void CkTextPickCurrent _ANSI_ARGS_((CkText *textPtr,
CkEvent *eventPtr));
extern void CkTextPixelIndex _ANSI_ARGS_((CkText *textPtr,
int x, int y, CkTextIndex *indexPtr));
extern void CkTextPrintIndex _ANSI_ARGS_((CkTextIndex *indexPtr,
char *string));
extern void CkTextRedrawRegion _ANSI_ARGS_((CkText *textPtr,
int x, int y, int width, int height));
extern void CkTextRedrawTag _ANSI_ARGS_((CkText *textPtr,
CkTextIndex *index1Ptr, CkTextIndex *index2Ptr,
CkTextTag *tagPtr, int withTag));
extern void CkTextRelayoutWindow _ANSI_ARGS_((CkText *textPtr));
extern int CkTextScanCmd _ANSI_ARGS_((CkText *textPtr,
Tcl_Interp *interp, int argc, char **argv));
extern int CkTextSeeCmd _ANSI_ARGS_((CkText *textPtr,
Tcl_Interp *interp, int argc, char **argv));
extern int CkTextSegToOffset _ANSI_ARGS_((CkTextSegment *segPtr,
CkTextLine *linePtr));
extern CkTextSegment * CkTextSetMark _ANSI_ARGS_((CkText *textPtr, char *name,
CkTextIndex *indexPtr));
extern void CkTextSetYView _ANSI_ARGS_((CkText *textPtr,
CkTextIndex *indexPtr, int pickPlace));
extern int CkTextTagCmd _ANSI_ARGS_((CkText *textPtr,
Tcl_Interp *interp, int argc, char **argv));
extern int CkTextWindowCmd _ANSI_ARGS_((CkText *textPtr,
Tcl_Interp *interp, int argc, char **argv));
extern int CkTextWindowIndex _ANSI_ARGS_((CkText *textPtr,
char *name, CkTextIndex *indexPtr));
extern int CkTextXviewCmd _ANSI_ARGS_((CkText *textPtr,
Tcl_Interp *interp, int argc, char **argv));
extern int CkTextYviewCmd _ANSI_ARGS_((CkText *textPtr,
Tcl_Interp *interp, int argc, char **argv));
#endif /* _CKTEXT_H */