gtk+3: fix dependencies for new gnome/accessibility/at-spi2-core
[oi-userland.git] / components / x11 / libXaw5 / src / AsciiSink.c
blob4652bad510d04eec1e56a8cc5f69d26ad245bb0c
1 /* $XConsortium: AsciiSink.c,v 1.62 94/04/17 20:11:41 kaleb Exp $ */
3 /***********************************************************
5 Copyright (c) 1987, 1988, 1994 X Consortium
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
29 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
31 All Rights Reserved
33 Permission to use, copy, modify, and distribute this software and its
34 documentation for any purpose and without fee is hereby granted,
35 provided that the above copyright notice appear in all copies and that
36 both that copyright notice and this permission notice appear in
37 supporting documentation, and that the name of Digital not be
38 used in advertising or publicity pertaining to distribution of the
39 software without specific, written prior permission.
41 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
42 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
43 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
44 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
46 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47 SOFTWARE.
49 ******************************************************************/
51 #include <stdio.h>
53 #include <X11/Xatom.h>
54 #include <X11/IntrinsicP.h>
55 #include <X11/StringDefs.h>
56 #include <X11/Xaw/XawInit.h>
57 #include "AsciiSinkP.h"
58 #include <X11/Xaw/AsciiSrcP.h> /* For source function defs. */
59 #include <X11/Xaw/TextP.h> /* I also reach into the text widget. */
61 #ifdef GETLASTPOS
62 #undef GETLASTPOS /* We will use our own GETLASTPOS. */
63 #endif
65 #define GETLASTPOS XawTextSourceScan(source, (XawTextPosition) 0, XawstAll, XawsdRight, 1, TRUE)
67 static void Initialize(), Destroy();
68 static Boolean SetValues();
69 static int MaxLines(), MaxHeight();
70 static void SetTabs();
72 static void DisplayText(), InsertCursor(), FindPosition();
73 static void FindDistance(), Resolve(), GetCursorBounds();
75 #define offset(field) XtOffsetOf(AsciiSinkRec, ascii_sink.field)
77 static XtResource resources[] = {
78 {XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
79 offset(font), XtRString, XtDefaultFont},
80 {XtNecho, XtCOutput, XtRBoolean, sizeof(Boolean),
81 offset(echo), XtRImmediate, (XtPointer) True},
82 {XtNdisplayNonprinting, XtCOutput, XtRBoolean, sizeof(Boolean),
83 offset(display_nonprinting), XtRImmediate, (XtPointer) True},
85 #undef offset
87 #define SuperClass (&textSinkClassRec)
88 AsciiSinkClassRec asciiSinkClassRec = {
90 /* core_class fields */
91 /* superclass */ (WidgetClass) SuperClass,
92 /* class_name */ "AsciiSink",
93 /* widget_size */ sizeof(AsciiSinkRec),
94 /* class_initialize */ XawInitializeWidgetSet,
95 /* class_part_initialize */ NULL,
96 /* class_inited */ FALSE,
97 /* initialize */ Initialize,
98 /* initialize_hook */ NULL,
99 /* obj1 */ NULL,
100 /* obj2 */ NULL,
101 /* obj3 */ 0,
102 /* resources */ resources,
103 /* num_resources */ XtNumber(resources),
104 /* xrm_class */ NULLQUARK,
105 /* obj4 */ FALSE,
106 /* obj5 */ FALSE,
107 /* obj6 */ FALSE,
108 /* obj7 */ FALSE,
109 /* destroy */ Destroy,
110 /* obj8 */ NULL,
111 /* obj9 */ NULL,
112 /* set_values */ SetValues,
113 /* set_values_hook */ NULL,
114 /* obj10 */ NULL,
115 /* get_values_hook */ NULL,
116 /* obj11 */ NULL,
117 /* version */ XtVersion,
118 /* callback_private */ NULL,
119 /* obj12 */ NULL,
120 /* obj13 */ NULL,
121 /* obj14 */ NULL,
122 /* extension */ NULL
124 /* text_sink_class fields */
126 /* DisplayText */ DisplayText,
127 /* InsertCursor */ InsertCursor,
128 /* ClearToBackground */ XtInheritClearToBackground,
129 /* FindPosition */ FindPosition,
130 /* FindDistance */ FindDistance,
131 /* Resolve */ Resolve,
132 /* MaxLines */ MaxLines,
133 /* MaxHeight */ MaxHeight,
134 /* SetTabs */ SetTabs,
135 /* GetCursorBounds */ GetCursorBounds
137 /* ascii_sink_class fields */
139 /* unused */ 0
143 WidgetClass asciiSinkObjectClass = (WidgetClass)&asciiSinkClassRec;
145 /* Utilities */
147 static int
148 CharWidth (w, x, c)
149 Widget w;
150 int x;
151 unsigned char c;
153 int i, width, nonPrinting;
154 AsciiSinkObject sink = (AsciiSinkObject) w;
155 XFontStruct *font = sink->ascii_sink.font;
156 Position *tab;
158 if ( c == XawLF ) return(0);
160 if (c == XawTAB) {
161 /* Adjust for Left Margin. */
162 x -= ((TextWidget) XtParent(w))->text.margin.left;
164 if (x >= (int)XtParent(w)->core.width) return 0;
165 for (i = 0, tab = sink->text_sink.tabs ;
166 i < sink->text_sink.tab_count ; i++, tab++) {
167 if (x < *tab) {
168 if (*tab < (int)XtParent(w)->core.width)
169 return *tab - x;
170 else
171 return 0;
174 return 0;
177 if ( (nonPrinting = (c < (unsigned char) XawSP)) )
178 if (sink->ascii_sink.display_nonprinting)
179 c += '@';
180 else {
181 c = XawSP;
182 nonPrinting = False;
185 if (font->per_char &&
186 (c >= font->min_char_or_byte2 && c <= font->max_char_or_byte2))
187 width = font->per_char[c - font->min_char_or_byte2].width;
188 else
189 width = font->min_bounds.width;
191 if (nonPrinting)
192 width += CharWidth(w, x, (unsigned char) '^');
194 return width;
197 /* Function Name: PaintText
198 * Description: Actually paints the text into the windoe.
199 * Arguments: w - the text widget.
200 * gc - gc to paint text with.
201 * x, y - location to paint the text.
202 * buf, len - buffer and length of text to paint.
203 * Returns: the width of the text painted, or 0.
205 * NOTE: If this string attempts to paint past the end of the window
206 * then this function will return zero.
209 static Dimension
210 PaintText(w, gc, x, y, buf, len)
211 Widget w;
212 GC gc;
213 Position x, y;
214 unsigned char * buf;
215 int len;
217 AsciiSinkObject sink = (AsciiSinkObject) w;
218 TextWidget ctx = (TextWidget) XtParent(w);
220 Position max_x;
221 Dimension width = XTextWidth(sink->ascii_sink.font, (char *) buf, len);
222 max_x = (Position) ctx->core.width;
224 if ( ((int) width) <= -x) /* Don't draw if we can't see it. */
225 return(width);
227 XDrawImageString(XtDisplay(ctx), XtWindow(ctx), gc,
228 (int) x, (int) y, (char *) buf, len);
229 if ( (((Position) width + x) > max_x) && (ctx->text.margin.right != 0) ) {
230 x = ctx->core.width - ctx->text.margin.right;
231 width = ctx->text.margin.right;
232 XFillRectangle(XtDisplay((Widget) ctx), XtWindow( (Widget) ctx),
233 sink->ascii_sink.normgc, (int) x,
234 (int) y - sink->ascii_sink.font->ascent,
235 (unsigned int) width,
236 (unsigned int) (sink->ascii_sink.font->ascent +
237 sink->ascii_sink.font->descent));
238 return(0);
240 return(width);
243 /* Sink Object Functions */
246 * This function does not know about drawing more than one line of text.
249 static void
250 DisplayText(w, x, y, pos1, pos2, highlight)
251 Widget w;
252 Position x, y;
253 Boolean highlight;
254 XawTextPosition pos1, pos2;
256 AsciiSinkObject sink = (AsciiSinkObject) w;
257 Widget source = XawTextGetSource(XtParent(w));
258 unsigned char buf[BUFSIZ];
260 int j, k;
261 XawTextBlock blk;
262 GC gc = highlight ? sink->ascii_sink.invgc : sink->ascii_sink.normgc;
263 GC invgc = highlight ? sink->ascii_sink.normgc : sink->ascii_sink.invgc;
265 if (!sink->ascii_sink.echo) return;
267 y += sink->ascii_sink.font->ascent;
268 for ( j = 0 ; pos1 < pos2 ; ) {
269 pos1 = XawTextSourceRead(source, pos1, &blk, (int)(pos2 - pos1));
270 for (k = 0; k < blk.length; k++) {
271 if (j >= BUFSIZ) { /* buffer full, dump the text. */
272 x += PaintText(w, gc, x, y, buf, j);
273 j = 0;
275 buf[j] = blk.ptr[k];
276 if (buf[j] == XawLF) /* line feeds ('\n') are not printed. */
277 continue;
279 else if (buf[j] == '\t') {
280 Position temp = 0;
281 Dimension width;
283 if ((j != 0) && ((temp = PaintText(w, gc, x, y, buf, j)) == 0))
284 return;
286 x += temp;
287 width = CharWidth(w, x, (unsigned char) '\t');
288 XFillRectangle(XtDisplayOfObject(w), XtWindowOfObject(w),
289 invgc, (int) x,
290 (int) y - sink->ascii_sink.font->ascent,
291 (unsigned int) width,
292 (unsigned int) (sink->ascii_sink.font->ascent +
293 sink->ascii_sink.font->descent));
294 x += width;
295 j = -1;
297 else if ( buf[j] < (unsigned char) ' ' ) {
298 if (sink->ascii_sink.display_nonprinting) {
299 buf[j + 1] = buf[j] + '@';
300 buf[j] = '^';
301 j++;
303 else
304 buf[j] = ' ';
306 j++;
309 if (j > 0)
310 (void) PaintText(w, gc, x, y, buf, j);
313 #define insertCursor_width 6
314 #define insertCursor_height 3
315 static char insertCursor_bits[] = {0x0c, 0x1e, 0x33};
317 static Pixmap
318 CreateInsertCursor(s)
319 Screen *s;
321 return (XCreateBitmapFromData (DisplayOfScreen(s), RootWindowOfScreen(s),
322 insertCursor_bits, insertCursor_width, insertCursor_height));
325 /* Function Name: GetCursorBounds
326 * Description: Returns the size and location of the cursor.
327 * Arguments: w - the text object.
328 * RETURNED rect - an X rectangle to return the cursor bounds in.
329 * Returns: none.
332 static void
333 GetCursorBounds(w, rect)
334 Widget w;
335 XRectangle * rect;
337 AsciiSinkObject sink = (AsciiSinkObject) w;
339 rect->width = (unsigned short) insertCursor_width;
340 rect->height = (unsigned short) insertCursor_height;
341 rect->x = sink->ascii_sink.cursor_x - (short) (rect->width / 2);
342 rect->y = sink->ascii_sink.cursor_y - (short) rect->height;
346 * The following procedure manages the "insert" cursor.
349 static void
350 InsertCursor (w, x, y, state)
351 Widget w;
352 Position x, y;
353 XawTextInsertState state;
355 AsciiSinkObject sink = (AsciiSinkObject) w;
356 Widget text_widget = XtParent(w);
357 XRectangle rect;
359 sink->ascii_sink.cursor_x = x;
360 sink->ascii_sink.cursor_y = y;
362 GetCursorBounds(w, &rect);
363 if (state != sink->ascii_sink.laststate && XtIsRealized(text_widget))
364 XCopyPlane(XtDisplay(text_widget),
365 sink->ascii_sink.insertCursorOn,
366 XtWindow(text_widget), sink->ascii_sink.xorgc,
367 0, 0, (unsigned int) rect.width, (unsigned int) rect.height,
368 (int) rect.x, (int) rect.y, 1);
369 sink->ascii_sink.laststate = state;
373 * Given two positions, find the distance between them.
376 static void
377 FindDistance (w, fromPos, fromx, toPos, resWidth, resPos, resHeight)
378 Widget w;
379 XawTextPosition fromPos; /* First position. */
380 int fromx; /* Horizontal location of first position. */
381 XawTextPosition toPos; /* Second position. */
382 int *resWidth; /* Distance between fromPos and resPos. */
383 XawTextPosition *resPos; /* Actual second position used. */
384 int *resHeight; /* Height required. */
386 AsciiSinkObject sink = (AsciiSinkObject) w;
387 Widget source = XawTextGetSource(XtParent(w));
389 XawTextPosition index, lastPos;
390 unsigned char c;
391 XawTextBlock blk;
393 /* we may not need this */
394 lastPos = GETLASTPOS;
395 XawTextSourceRead(source, fromPos, &blk, (int)(toPos - fromPos));
396 *resWidth = 0;
397 for (index = fromPos; index != toPos && index < lastPos; index++) {
398 if ((int)index - blk.firstPos >= blk.length)
399 XawTextSourceRead(source, index, &blk, (int)(toPos - fromPos));
400 c = blk.ptr[index - blk.firstPos];
401 *resWidth += CharWidth(w, fromx + *resWidth, c);
402 if (c == XawLF) {
403 index++;
404 break;
407 *resPos = index;
408 *resHeight = sink->ascii_sink.font->ascent +sink->ascii_sink.font->descent;
412 static void
413 FindPosition(w, fromPos, fromx, width, stopAtWordBreak,
414 resPos, resWidth, resHeight)
415 Widget w;
416 XawTextPosition fromPos; /* Starting position. */
417 int fromx; /* Horizontal location of starting position.*/
418 int width; /* Desired width. */
419 int stopAtWordBreak; /* Whether the resulting position should be at
420 a word break. */
421 XawTextPosition *resPos; /* Resulting position. */
422 int *resWidth; /* Actual width used. */
423 int *resHeight; /* Height required. */
425 AsciiSinkObject sink = (AsciiSinkObject) w;
426 Widget source = XawTextGetSource(XtParent(w));
428 XawTextPosition lastPos, index, whiteSpacePosition;
429 int lastWidth, whiteSpaceWidth;
430 Boolean whiteSpaceSeen;
431 unsigned char c;
432 XawTextBlock blk;
434 lastPos = GETLASTPOS;
436 XawTextSourceRead(source, fromPos, &blk, BUFSIZ);
437 *resWidth = 0;
438 whiteSpaceSeen = FALSE;
439 c = 0;
440 for (index = fromPos; *resWidth <= width && index < lastPos; index++) {
441 lastWidth = *resWidth;
442 if ((int)index - blk.firstPos >= blk.length)
443 XawTextSourceRead(source, index, &blk, BUFSIZ);
444 c = blk.ptr[index - blk.firstPos];
445 *resWidth += CharWidth(w, fromx + *resWidth, c);
447 if ((c == XawSP || c == XawTAB) && *resWidth <= width) {
448 whiteSpaceSeen = TRUE;
449 whiteSpacePosition = index;
450 whiteSpaceWidth = *resWidth;
452 if (c == XawLF) {
453 index++;
454 break;
457 if (*resWidth > width && index > fromPos) {
458 *resWidth = lastWidth;
459 index--;
460 if (stopAtWordBreak && whiteSpaceSeen) {
461 index = whiteSpacePosition + 1;
462 *resWidth = whiteSpaceWidth;
465 if (index == lastPos && c != XawLF) index = lastPos + 1;
466 *resPos = index;
467 *resHeight = sink->ascii_sink.font->ascent +sink->ascii_sink.font->descent;
470 static void
471 Resolve (w, pos, fromx, width, leftPos, rightPos)
472 Widget w;
473 XawTextPosition pos;
474 int fromx, width;
475 XawTextPosition *leftPos, *rightPos;
477 int resWidth, resHeight;
478 Widget source = XawTextGetSource(XtParent(w));
480 FindPosition(w, pos, fromx, width, FALSE, leftPos, &resWidth, &resHeight);
481 if (*leftPos > GETLASTPOS)
482 *leftPos = GETLASTPOS;
483 *rightPos = *leftPos;
486 static void
487 GetGC(sink)
488 AsciiSinkObject sink;
490 XtGCMask valuemask = (GCFont |
491 GCGraphicsExposures | GCForeground | GCBackground );
492 XGCValues values;
494 values.font = sink->ascii_sink.font->fid;
495 values.graphics_exposures = (Bool) FALSE;
497 values.foreground = sink->text_sink.foreground;
498 values.background = sink->text_sink.background;
499 sink->ascii_sink.normgc = XtGetGC((Widget)sink, valuemask, &values);
501 values.foreground = sink->text_sink.background;
502 values.background = sink->text_sink.foreground;
503 sink->ascii_sink.invgc = XtGetGC((Widget)sink, valuemask, &values);
505 values.function = GXxor;
506 values.background = (unsigned long) 0L; /* (pix ^ 0) = pix */
507 values.foreground = (sink->text_sink.background ^
508 sink->text_sink.foreground);
509 valuemask = GCGraphicsExposures | GCFunction | GCForeground | GCBackground;
511 sink->ascii_sink.xorgc = XtGetGC((Widget)sink, valuemask, &values);
515 /***** Public routines *****/
517 /* Function Name: Initialize
518 * Description: Initializes the TextSink Object.
519 * Arguments: request, new - the requested and new values for the object
520 * instance.
521 * Returns: none.
525 /* ARGSUSED */
526 static void
527 Initialize(request, new, args, num_args)
528 Widget request, new;
529 ArgList args;
530 Cardinal *num_args;
532 AsciiSinkObject sink = (AsciiSinkObject) new;
534 GetGC(sink);
536 sink->ascii_sink.insertCursorOn= CreateInsertCursor(XtScreenOfObject(new));
537 sink->ascii_sink.laststate = XawisOff;
538 sink->ascii_sink.cursor_x = sink->ascii_sink.cursor_y = 0;
541 /* Function Name: Destroy
542 * Description: This function cleans up when the object is
543 * destroyed.
544 * Arguments: w - the AsciiSink Object.
545 * Returns: none.
548 static void
549 Destroy(w)
550 Widget w;
552 AsciiSinkObject sink = (AsciiSinkObject) w;
554 XtReleaseGC(w, sink->ascii_sink.normgc);
555 XtReleaseGC(w, sink->ascii_sink.invgc);
556 XtReleaseGC(w, sink->ascii_sink.xorgc);
557 XFreePixmap(XtDisplayOfObject(w), sink->ascii_sink.insertCursorOn);
560 /* Function Name: SetValues
561 * Description: Sets the values for the AsciiSink
562 * Arguments: current - current state of the object.
563 * request - what was requested.
564 * new - what the object will become.
565 * Returns: True if redisplay is needed.
568 /* ARGSUSED */
569 static Boolean
570 SetValues(current, request, new, args, num_args)
571 Widget current, request, new;
572 ArgList args;
573 Cardinal *num_args;
575 AsciiSinkObject w = (AsciiSinkObject) new;
576 AsciiSinkObject old_w = (AsciiSinkObject) current;
578 if (w->ascii_sink.font != old_w->ascii_sink.font
579 || w->text_sink.background != old_w->text_sink.background
580 || w->text_sink.foreground != old_w->text_sink.foreground) {
581 XtReleaseGC((Widget)w, w->ascii_sink.normgc);
582 XtReleaseGC((Widget)w, w->ascii_sink.invgc);
583 XtReleaseGC((Widget)w, w->ascii_sink.xorgc);
584 GetGC(w);
585 ((TextWidget)XtParent(new))->text.redisplay_needed = True;
586 } else {
587 if ( (w->ascii_sink.echo != old_w->ascii_sink.echo) ||
588 (w->ascii_sink.display_nonprinting !=
589 old_w->ascii_sink.display_nonprinting) )
590 ((TextWidget)XtParent(new))->text.redisplay_needed = True;
593 return False;
596 /* Function Name: MaxLines
597 * Description: Finds the Maximum number of lines that will fit in
598 * a given height.
599 * Arguments: w - the AsciiSink Object.
600 * height - height to fit lines into.
601 * Returns: the number of lines that will fit.
604 /* ARGSUSED */
605 static int
606 MaxLines(w, height)
607 Widget w;
608 Dimension height;
610 AsciiSinkObject sink = (AsciiSinkObject) w;
611 int font_height;
613 font_height = sink->ascii_sink.font->ascent + sink->ascii_sink.font->descent;
614 return( ((int) height) / font_height );
617 /* Function Name: MaxHeight
618 * Description: Finds the Minium height that will contain a given number
619 * lines.
620 * Arguments: w - the AsciiSink Object.
621 * lines - the number of lines.
622 * Returns: the height.
625 /* ARGSUSED */
626 static int
627 MaxHeight(w, lines)
628 Widget w;
629 int lines;
631 AsciiSinkObject sink = (AsciiSinkObject) w;
633 return(lines * (sink->ascii_sink.font->ascent +
634 sink->ascii_sink.font->descent));
637 /* Function Name: SetTabs
638 * Description: Sets the Tab stops.
639 * Arguments: w - the AsciiSink Object.
640 * tab_count - the number of tabs in the list.
641 * tabs - the text positions of the tabs.
642 * Returns: none
645 static void
646 SetTabs(w, tab_count, tabs)
647 Widget w;
648 int tab_count;
649 short *tabs;
651 AsciiSinkObject sink = (AsciiSinkObject) w;
652 int i;
653 Atom XA_FIGURE_WIDTH;
654 unsigned long figure_width = 0;
655 XFontStruct *font = sink->ascii_sink.font;
658 * Find the figure width of the current font.
661 XA_FIGURE_WIDTH = XInternAtom(XtDisplayOfObject(w), "FIGURE_WIDTH", FALSE);
662 if ( (XA_FIGURE_WIDTH != None) &&
663 ( (!XGetFontProperty(font, XA_FIGURE_WIDTH, &figure_width)) ||
664 (figure_width == 0)) )
665 if (font->per_char && font->min_char_or_byte2 <= '$' &&
666 font->max_char_or_byte2 >= '$')
667 figure_width = font->per_char['$' - font->min_char_or_byte2].width;
668 else
669 figure_width = font->max_bounds.width;
671 if (tab_count > sink->text_sink.tab_count) {
672 sink->text_sink.tabs = (Position *)
673 XtRealloc((char *) sink->text_sink.tabs,
674 (Cardinal) (tab_count * sizeof(Position)));
675 sink->text_sink.char_tabs = (short *)
676 XtRealloc((char *) sink->text_sink.char_tabs,
677 (Cardinal) (tab_count * sizeof(short)));
680 for ( i = 0 ; i < tab_count ; i++ ) {
681 sink->text_sink.tabs[i] = tabs[i] * figure_width;
682 sink->text_sink.char_tabs[i] = tabs[i];
685 sink->text_sink.tab_count = tab_count;
687 #ifndef NO_TAB_FIX
688 { TextWidget ctx = (TextWidget)XtParent(w);
689 ctx->text.redisplay_needed = True;
690 _XawTextBuildLineTable(ctx, ctx->text.lt.top, TRUE);
692 #endif