Lines Matching refs:ctx

103 #define IsValidLine(ctx, num) ( ((num) == 0) || \
104 ((ctx)->text.lt.info[(num)].position != 0) )
345 * Arguments: ctx - the text widget.
350 PositionHScrollBar(ctx)
351 TextWidget ctx;
353 Widget vbar = ctx->text.vbar, hbar = ctx->text.hbar;
356 if (ctx->text.hbar == NULL) return;
361 XtResizeWidget( hbar, ctx->core.width - left, hbar->core.height,
366 top = ctx->core.height - ( hbar->core.height + hbar->core.border_width);
372 * Arguments: ctx - the text widget.
377 PositionVScrollBar(ctx)
378 TextWidget ctx;
380 Widget vbar = ctx->text.vbar;
386 XtResizeWidget( vbar, vbar->core.width, ctx->core.height, bw);
391 CreateVScrollBar(ctx)
392 TextWidget ctx;
396 if (ctx->text.vbar != NULL) return;
398 ctx->text.vbar = vbar =
399 XtCreateWidget("vScrollbar", scrollbarWidgetClass, (Widget)ctx,
401 XtAddCallback( vbar, XtNscrollProc, VScroll, (XtPointer)ctx );
402 XtAddCallback( vbar, XtNjumpProc, VJump, (XtPointer)ctx );
403 if (ctx->text.hbar == NULL)
404 XtAddCallback((Widget) ctx, XtNunrealizeCallback, UnrealizeScrollbars,
407 ctx->text.r_margin.left += vbar->core.width + vbar->core.border_width;
408 ctx->text.margin.left = ctx->text.r_margin.left;
410 PositionVScrollBar(ctx);
411 PositionHScrollBar(ctx); /* May modify location of Horiz. Bar. */
413 if (XtIsRealized((Widget)ctx)) {
421 * Arguments: ctx - the parent text widget.
426 DestroyVScrollBar(ctx)
427 TextWidget ctx;
429 Widget vbar = ctx->text.vbar;
433 ctx->text.r_margin.left -= vbar->core.width + vbar->core.border_width;
434 ctx->text.margin.left = ctx->text.r_margin.left;
435 if (ctx->text.hbar == NULL)
436 XtRemoveCallback((Widget) ctx, XtNunrealizeCallback, UnrealizeScrollbars,
439 ctx->text.vbar = NULL;
440 PositionHScrollBar(ctx);
444 CreateHScrollBar(ctx)
445 TextWidget ctx;
450 if (ctx->text.hbar != NULL) return;
453 ctx->text.hbar = hbar =
454 XtCreateWidget("hScrollbar", scrollbarWidgetClass, (Widget)ctx, args, ONE);
455 XtAddCallback( hbar, XtNscrollProc, HScroll, (XtPointer)ctx );
456 XtAddCallback( hbar, XtNjumpProc, HJump, (XtPointer)ctx );
457 if (ctx->text.vbar == NULL)
458 XtAddCallback((Widget) ctx, XtNunrealizeCallback, UnrealizeScrollbars,
461 PositionHScrollBar(ctx);
462 if (XtIsRealized((Widget)ctx)) {
470 * Arguments: ctx - the parent text widget.
475 DestroyHScrollBar(ctx)
476 TextWidget ctx;
478 Widget hbar = ctx->text.hbar;
483 ctx->text.r_margin.bottom -= hbar->core.height + hbar->core.border_width;
484 ctx->text.margin.bottom = ctx->text.r_margin.bottom;
486 if (ctx->text.vbar == NULL)
487 XtRemoveCallback((Widget) ctx, XtNunrealizeCallback, UnrealizeScrollbars,
490 ctx->text.hbar = NULL;
523 TextWidget ctx = (TextWidget) new;
526 ctx->text.lt.lines = 0;
527 ctx->text.lt.info = NULL;
528 (void) bzero((char *) &(ctx->text.origSel), sizeof(XawTextSelection));
529 (void) bzero((char *) &(ctx->text.s), sizeof(XawTextSelection));
530 ctx->text.s.type = XawselectPosition;
531 ctx->text.salt = NULL;
532 ctx->text.hbar = ctx->text.vbar = (Widget) NULL;
533 ctx->text.lasttime = 0; /* ||| correct? */
534 ctx->text.time = 0; /* ||| correct? */
535 ctx->text.showposition = TRUE;
536 ctx->text.lastPos = (ctx->text.source != NULL) ? GETLASTPOS : 0;
537 ctx->text.file_insert = NULL;
538 ctx->text.search = NULL;
539 ctx->text.updateFrom = (XawTextPosition *) XtMalloc((unsigned) ONE);
540 ctx->text.updateTo = (XawTextPosition *) XtMalloc((unsigned) ONE);
541 ctx->text.numranges = ctx->text.maxranges = 0;
542 ctx->text.gc = DefaultGCOfScreen(XtScreen(ctx));
543 ctx->text.hasfocus = FALSE;
544 ctx->text.margin = ctx->text.r_margin; /* Strucure copy. */
545 ctx->text.update_disabled = FALSE;
546 ctx->text.old_insert = -1;
547 ctx->text.mult = 1;
548 ctx->text.single_char = FALSE;
549 ctx->text.copy_area_offsets = NULL;
550 ctx->text.salt2 = NULL;
552 if (ctx->core.height == DEFAULT_TEXT_HEIGHT) {
553 ctx->core.height = VMargins(ctx);
554 if (ctx->text.sink != NULL)
555 ctx->core.height += XawTextSinkMaxHeight(ctx->text.sink, 1);
558 if (ctx->text.scroll_vert != XawtextScrollNever)
559 if ( (ctx->text.resize == XawtextResizeHeight) ||
560 (ctx->text.resize == XawtextResizeBoth) ) {
561 warn_msg (ctx, "Vertical", "height resize");
562 ctx->text.scroll_vert = XawtextScrollNever;
564 else if (ctx->text.scroll_vert == XawtextScrollAlways)
565 CreateVScrollBar(ctx);
567 if (ctx->text.scroll_horiz != XawtextScrollNever)
568 if (ctx->text.wrap != XawtextWrapNever) {
569 warn_msg (ctx, Horizontal, "wrapping active");
570 ctx->text.scroll_horiz = XawtextScrollNever;
572 else if ( (ctx->text.resize == XawtextResizeWidth) ||
573 (ctx->text.resize == XawtextResizeBoth) ) {
574 warn_msg (ctx, Horizontal, "width resize");
575 ctx->text.scroll_horiz = XawtextScrollNever;
577 else if (ctx->text.scroll_horiz == XawtextScrollAlways)
578 CreateHScrollBar(ctx);
587 TextWidget ctx = (TextWidget)w;
593 if (ctx->text.hbar != NULL) { /* Put up Hbar -- Must be first. */
594 XtRealizeWidget(ctx->text.hbar);
595 XtMapWidget(ctx->text.hbar);
598 if (ctx->text.vbar != NULL) { /* Put up Vbar. */
599 XtRealizeWidget(ctx->text.vbar);
600 XtMapWidget(ctx->text.vbar);
603 _XawTextBuildLineTable(ctx, ctx->text.lt.top, TRUE);
604 _XawTextSetScrollBars(ctx);
605 _XawTextCheckResize(ctx);
614 TextWidget ctx = (TextWidget) widget;
616 if (ctx->text.hbar)
617 XtUnrealizeWidget(ctx->text.hbar);
618 if (ctx->text.vbar)
619 XtUnrealizeWidget(ctx->text.vbar);
660 * the value of ctx->insertPos and an implicit argument. In the event that
669 TextWidget ctx = (TextWidget)w;
673 if (ctx->text.lt.lines < 1) return;
675 if ( LineAndXYForPosition(ctx, ctx->text.insertPos, &line, &x, &y) ) {
676 if (line < ctx->text.lt.lines)
677 y += (ctx->text.lt.info[line + 1].y - ctx->text.lt.info[line].y) + 1;
679 y += (ctx->text.lt.info[line].y - ctx->text.lt.info[line - 1].y) + 1;
681 if (ctx->text.display_caret)
682 XawTextSinkInsertCursor(ctx->text.sink, x, y, state);
684 ctx->text.ev_x = x;
685 ctx->text.ev_y = y;
689 if ( ctx->simple.international ) {
692 XtSetArg (list[0], XtNinsertPosition, ctx->text.insertPos);
704 _XawTextNeedsUpdating(ctx, left, right)
705 TextWidget ctx;
711 for (i = 0; i < ctx->text.numranges; i++) {
712 if (left <= ctx->text.updateTo[i] && right >= ctx->text.updateFrom[i]) {
713 ctx->text.updateFrom[i] = Min(left, ctx->text.updateFrom[i]);
714 ctx->text.updateTo[i] = Max(right, ctx->text.updateTo[i]);
718 ctx->text.numranges++;
719 if (ctx->text.numranges > ctx->text.maxranges) {
720 ctx->text.maxranges = ctx->text.numranges;
721 len = ctx->text.maxranges * sizeof(XawTextPosition);
722 ctx->text.updateFrom = (XawTextPosition *)
723 XtRealloc((char *)ctx->text.updateFrom, (unsigned) len);
724 ctx->text.updateTo = (XawTextPosition *)
725 XtRealloc((char *)ctx->text.updateTo, (unsigned) len);
727 ctx->text.updateFrom[ctx->text.numranges - 1] = left;
728 ctx->text.updateTo[ctx->text.numranges - 1] = right;
739 _XawTextGetText(ctx, left, right)
740 TextWidget ctx;
747 if (_XawTextFormat(ctx) == (int)XawFmt8Bit)
749 else if (_XawTextFormat(ctx) == (int)XawFmtWide)
757 left = SrcRead(ctx->text.source, left, &text, (int)(right - left));
776 _XawTextGetSTRING(ctx, left, right)
777 TextWidget ctx;
786 if (_XawTextFormat(ctx) == (int)XawFmtWide) {
787 MultiSinkObject sink = (MultiSinkObject) ctx->text.sink;
788 ws = (wchar_t *)_XawTextGetText(ctx, left, right);
799 s = (unsigned char *)_XawTextGetText(ctx, left, right);
828 PositionForXY (ctx, x, y)
829 TextWidget ctx;
835 if (ctx->text.lt.lines == 0) return 0;
837 for (line = 0; line < ctx->text.lt.lines - 1; line++) {
838 if (y <= ctx->text.lt.info[line + 1].y)
841 position = ctx->text.lt.info[line].position;
842 if (position >= ctx->text.lastPos)
843 return(ctx->text.lastPos);
844 fromx = (int) ctx->text.margin.left;
845 XawTextSinkFindPosition( ctx->text.sink, position, fromx, x - fromx,
847 if (position > ctx->text.lastPos) return(ctx->text.lastPos);
848 if (position >= ctx->text.lt.info[line + 1].position)
849 position = SrcScan(ctx->text.source, ctx->text.lt.info[line + 1].position,
862 LineForPosition (ctx, position)
863 TextWidget ctx;
868 for (line = 0; line < ctx->text.lt.lines; line++)
869 if (position < ctx->text.lt.info[line + 1].position)
882 LineAndXYForPosition (ctx, pos, line, x, y)
883 TextWidget ctx;
893 *x = ctx->text.margin.left;
894 *y = ctx->text.margin.top;
895 if (visible = IsPositionVisible(ctx, pos)) {
896 *line = LineForPosition(ctx, pos);
897 *y = ctx->text.lt.info[*line].y;
898 *x = ctx->text.margin.left;
899 linePos = ctx->text.lt.info[*line].position;
900 XawTextSinkFindDistance( ctx->text.sink, linePos,
918 TextWidget ctx,
922 _XawTextBuildLineTable (ctx, position, force_rebuild)
923 TextWidget ctx;
932 if ((int)ctx->core.height > VMargins(ctx)) {
933 height = ctx->core.height - VMargins(ctx);
934 lines = XawTextSinkMaxLines(ctx->text.sink, height);
938 if ( (lines != ctx->text.lt.lines) || (ctx->text.lt.info == NULL) ) {
939 ctx->text.lt.info = (XawTextLineTableEntry *) XtRealloc((char *) ctx->text.
941 ctx->text.lt.lines = lines;
945 if ( force_rebuild || (position != ctx->text.lt.top) ) {
946 (void) bzero((char *) ctx->text.lt.info, size);
947 (void) _BuildLineTable(ctx, ctx->text.lt.top = position, zeroPosition, 0);
956 _BuildLineTable(ctx, position, min_pos, line)
957 TextWidget ctx;
961 XawTextLineTableEntry * lt = ctx->text.lt.info + line;
965 Widget src = ctx->text.source;
967 if ( ((ctx->text.resize == XawtextResizeWidth) ||
968 (ctx->text.resize == XawtextResizeBoth) ) ||
969 (ctx->text.wrap == XawtextWrapNever) )
972 width = Max(0, ((int)ctx->core.width - (int)HMargins(ctx)));
974 y = ( (line == 0) ? ctx->text.margin.top : lt->y );
981 XawTextSinkFindPosition( ctx->text.sink, position, ctx->text.margin.left,
982 width, ctx->text.wrap == XawtextWrapWord,
987 if (ctx->text.wrap == XawtextWrapNever)
990 if ( endPos == ctx->text.lastPos) { /* We have reached the end. */
997 if ( (line > ctx->text.lt.lines) ||
1018 if (line++ < ctx->text.lt.lines) { /* make sure not to run of the end. */
1019 (++lt)->y = (count == 0) ? y : ctx->core.height;
1021 lt->position = ctx->text.lastPos + 100;
1024 if (line < ctx->text.lt.lines) /* Clear out rest of table. */
1026 (ctx->text.lt.lines - line) * sizeof(XawTextLineTableEntry) );
1028 ctx->text.lt.info[ctx->text.lt.lines].position = lt->position;
1036 * Arguments: ctx - the text widget.
1043 GetWidestLine(ctx)
1044 TextWidget ctx;
1048 XawTextLineTablePtr lt = &(ctx->text.lt);
1058 CheckVBarScrolling(ctx)
1059 TextWidget ctx;
1062 Boolean temp = (ctx->text.vbar == NULL);
1064 if (ctx->text.scroll_vert == XawtextScrollNever) return;
1066 if ( (ctx->text.lastPos > 0) && (ctx->text.lt.lines > 0)) {
1067 first = ctx->text.lt.top;
1068 first /= (float) ctx->text.lastPos;
1069 last = ctx->text.lt.info[ctx->text.lt.lines].position;
1070 if ( ctx->text.lt.info[ctx->text.lt.lines].position < ctx->text.lastPos )
1071 last /= (float) ctx->text.lastPos;
1075 if (ctx->text.scroll_vert == XawtextScrollWhenNeeded) {
1078 Position y = ctx->core.height - ctx->text.margin.bottom;
1080 if (ctx->text.hbar != NULL)
1081 y -= (ctx->text.hbar->core.height +
1082 2 * ctx->text.hbar->core.border_width);
1084 last_pos = PositionForXY(ctx, (Position) ctx->core.width, y);
1085 line = LineForPosition(ctx, last_pos);
1087 if ( (y < ctx->text.lt.info[line + 1].y) || ((last - first) < 1.0) )
1088 CreateVScrollBar(ctx);
1090 DestroyVScrollBar(ctx);
1093 if (ctx->text.vbar != NULL)
1094 XawScrollbarSetThumb(ctx->text.vbar, first, last - first);
1096 if ( (ctx->text.vbar == NULL) != temp) {
1097 _XawTextNeedsUpdating(ctx, zeroPosition, ctx->text.lastPos);
1098 if (ctx->text.vbar == NULL)
1099 _XawTextBuildLineTable (ctx, zeroPosition, FALSE);
1102 else if (ctx->text.vbar != NULL)
1103 if (ctx->text.scroll_vert == XawtextScrollWhenNeeded)
1104 DestroyVScrollBar(ctx);
1105 else if (ctx->text.scroll_vert == XawtextScrollAlways)
1106 XawScrollbarSetThumb(ctx->text.vbar, 0.0, 1.0);
1116 _XawTextSetScrollBars(ctx)
1117 TextWidget ctx;
1120 Boolean temp = (ctx->text.hbar == NULL);
1121 Boolean vtemp = (ctx->text.vbar == NULL);
1123 CheckVBarScrolling(ctx);
1125 if (ctx->text.scroll_horiz == XawtextScrollNever) return;
1127 if (ctx->text.vbar != NULL)
1128 widest = (int)(ctx->core.width - ctx->text.vbar->core.width -
1129 ctx->text.vbar->core.border_width);
1131 widest = ctx->core.width;
1132 widest /= (last = GetWidestLine(ctx));
1133 if (ctx->text.scroll_horiz == XawtextScrollWhenNeeded)
1135 CreateHScrollBar(ctx);
1137 DestroyHScrollBar(ctx);
1139 if ( (ctx->text.hbar == NULL) != temp ) {
1140 _XawTextBuildLineTable (ctx, ctx->text.lt.top, TRUE);
1141 CheckVBarScrolling(ctx); /* Recheck need for vbar, now that we added
1145 if (ctx->text.hbar != NULL) {
1146 first = ctx->text.r_margin.left - ctx->text.margin.left;
1148 XawScrollbarSetThumb(ctx->text.hbar, first, widest);
1151 if (((ctx->text.hbar == NULL) && (ctx->text.margin.left !=
1152 ctx->text.r_margin.left)) ||
1153 (ctx->text.vbar == NULL) != vtemp)
1155 ctx->text.margin.left = ctx->text.r_margin.left;
1156 _XawTextNeedsUpdating(ctx, zeroPosition, ctx->text.lastPos);
1157 FlushUpdate(ctx);
1168 _XawTextVScroll(ctx, n)
1169 TextWidget ctx;
1175 XawTextLineTable * lt = &(ctx->text.lt);
1177 if (abs(n) > ctx->text.lt.lines)
1178 n = (n > 0) ? ctx->text.lt.lines : -ctx->text.lt.lines;
1183 if ( IsValidLine(ctx, n) )
1184 top = Min(lt->info[n].position, ctx->text.lastPos);
1186 top = ctx->text.lastPos;
1188 y = IsValidLine(ctx, n) ? lt->info[n].y : ctx->core.height;
1189 _XawTextBuildLineTable(ctx, top, FALSE);
1190 if (top >= ctx->text.lastPos)
1191 DisplayTextWindow( (Widget) ctx);
1193 XCopyArea(XtDisplay(ctx), XtWindow(ctx), XtWindow(ctx), ctx->text.gc,
1194 0, y, (int)ctx->core.width, (int)ctx->core.height - y,
1195 0, ctx->text.margin.top);
1197 PushCopyQueue(ctx, 0, (int) -y);
1198 SinkClearToBG(ctx->text.sink,
1200 (Position) (ctx->text.margin.top + ctx->core.height - y),
1201 (Dimension) ctx->core.width, (Dimension) ctx->core.height);
1204 _XawTextNeedsUpdating(ctx, lt->info[lt->lines - n].position,
1205 ctx->text.lastPos);
1206 _XawTextSetScrollBars(ctx);
1215 top = SrcScan(ctx->text.source, target, XawstEOL,
1218 _XawTextBuildLineTable(ctx, top, FALSE);
1219 y = IsValidLine(ctx, n) ? lt->info[n].y : ctx->core.height;
1220 updateTo = IsValidLine(ctx, n) ? lt->info[n].position : ctx->text.lastPos;
1221 if (IsValidLine(ctx, lt->lines - n))
1222 height = lt->info[lt->lines-n].y - ctx->text.margin.top;
1223 else if (ctx->core.height - HMargins(ctx))
1224 height = ctx->core.height - HMargins(ctx);
1227 if (y > (int) ctx->text.margin.top)
1228 clear_height = y - ctx->text.margin.top;
1233 XCopyArea(XtDisplay(ctx), XtWindow(ctx), XtWindow(ctx), ctx->text.gc,
1234 0, ctx->text.margin.top, (int) ctx->core.width, height, 0, y);
1235 PushCopyQueue(ctx, 0, (int) y);
1236 SinkClearToBG(ctx->text.sink, (Position) 0, ctx->text.margin.top,
1237 (Dimension) ctx->core.width, (Dimension) clear_height);
1239 _XawTextNeedsUpdating(ctx, lt->info[0].position, updateTo);
1240 _XawTextSetScrollBars(ctx);
1243 DisplayTextWindow((Widget)ctx);
1245 XtSetArg (list[0], XtNinsertPosition, ctx->text.lt.top+ctx->text.lt.lines);
1246 _XawImSetValues ((Widget) ctx, list, 1);
1256 TextWidget ctx = (TextWidget) closure;
1257 Widget tw = (Widget) ctx;
1261 _XawTextPrepareToUpdate(ctx);
1263 old_left = ctx->text.margin.left;
1264 ctx->text.margin.left -= pixels;
1265 if (ctx->text.margin.left > ctx->text.r_margin.left) {
1266 ctx->text.margin.left = ctx->text.r_margin.left;
1267 pixels = old_left - ctx->text.margin.left;
1271 rect.width = (unsigned short) pixels + ctx->text.margin.right;
1272 rect.x = (short) ctx->core.width - (short) rect.width;
1273 rect.y = (short) ctx->text.margin.top;
1274 rect.height = (unsigned short) ctx->core.height - rect.y;
1276 XCopyArea(XtDisplay(tw), XtWindow(tw), XtWindow(tw), ctx->text.gc,
1278 (unsigned int) rect.x, (unsigned int) ctx->core.height,
1281 PushCopyQueue(ctx, (int) -pixels, 0);
1286 if (ctx->text.vbar != NULL)
1287 rect.x += (short) (ctx->text.vbar->core.width +
1288 ctx->text.vbar->core.border_width);
1291 rect.y = ctx->text.margin.top;
1292 rect.height = ctx->core.height - rect.y;
1294 XCopyArea(XtDisplay(tw), XtWindow(tw), XtWindow(tw), ctx->text.gc,
1296 (unsigned int) ctx->core.width - rect.width,
1300 PushCopyQueue(ctx, (int) rect.width, 0);
1306 t_rect.x = ctx->core.width - ctx->text.margin.right;
1307 t_rect.width = ctx->text.margin.right;
1311 SinkClearToBG(ctx->text.sink, (Position) t_rect.x, (Position) t_rect.y,
1314 UpdateTextInRectangle(ctx, &t_rect);
1322 SinkClearToBG(ctx->text.sink, (Position) rect.x, (Position) rect.y,
1325 UpdateTextInRectangle(ctx, &rect);
1327 _XawTextExecuteUpdate(ctx);
1328 _XawTextSetScrollBars(ctx);
1337 TextWidget ctx = (TextWidget) closure;
1339 Position new_left, old_left = ctx->text.margin.left;
1343 new_left = ctx->text.r_margin.left;
1344 new_left -= (Position) (*percent * GetWidestLine(ctx));
1347 if (labs(move) < (int)ctx->core.width) {
1348 HScroll(w, (XtPointer) ctx, (XtPointer) move);
1351 _XawTextPrepareToUpdate(ctx);
1352 ctx->text.margin.left = new_left;
1353 if (XtIsRealized((Widget) ctx)) DisplayTextWindow((Widget) ctx);
1354 _XawTextExecuteUpdate(ctx);
1359 * Arguments: ctx - the text widget.
1367 UpdateTextInLine(ctx, line, left, right)
1368 TextWidget ctx;
1374 XawTextLineTableEntry * lt = ctx->text.lt.info + line;
1376 if ( ((int)(lt->textWidth + ctx->text.margin.left) < left) ||
1377 ( ctx->text.margin.left > right ) )
1380 local_width = left - ctx->text.margin.left;
1381 XawTextSinkFindPosition(ctx->text.sink, lt->position,
1382 (int) ctx->text.margin.left,
1385 if (right >= (Position) lt->textWidth - ctx->text.margin.left)
1386 if ( (IsValidLine(ctx, line + 1)) &&
1387 (ctx->text.lt.info[line + 1].position <= ctx->text.lastPos) )
1388 pos2 = SrcScan( ctx->text.source, (lt + 1)->position, XawstPositions,
1395 local_left = ctx->text.margin.left + width;
1397 XawTextSinkFindPosition(ctx->text.sink, pos1, local_left,
1400 t_pos = SrcScan( ctx->text.source, pos2,
1406 _XawTextNeedsUpdating(ctx, pos1, pos2);
1421 TextWidget ctx = (TextWidget)closure;
1424 height = ctx->core.height - VMargins(ctx);
1427 lines = (int) (lines * (int) ctx->text.lt.lines) / height;
1428 _XawTextPrepareToUpdate(ctx);
1429 _XawTextVScroll(ctx, lines);
1430 _XawTextExecuteUpdate(ctx);
1452 TextWidget ctx = (TextWidget)closure;
1454 XawTextLineTable * lt = &(ctx->text.lt);
1456 _XawTextPrepareToUpdate(ctx);
1458 if ( (lt->lines > 0) && (IsValidLine(ctx, lt->lines - 1)) )
1461 old_bot = ctx->text.lastPos;
1463 position = (long) (*percent * (float) ctx->text.lastPos);
1464 position= SrcScan(ctx->text.source, position, XawstEOL, XawsdLeft, 1, FALSE);
1468 _XawTextVScroll(ctx, line);
1472 _XawTextBuildLineTable(ctx, position, FALSE);
1473 new_bot = IsValidLine(ctx, lt->lines-1) ? lt->info[lt->lines-1].position
1474 : ctx->text.lastPos;
1479 _XawTextBuildLineTable(ctx, old_top, FALSE);
1480 _XawTextVScroll(ctx, -line);
1483 DisplayTextWindow( (Widget) ctx);
1485 _XawTextExecuteUpdate(ctx);
1511 TextWidget ctx = (TextWidget)w;
1512 Widget src = ctx->text.source;
1526 XmuConvertStandardSelection(w, ctx->text.time, selection,
1557 if (MatchSelection (*selection, &ctx->text.s))
1558 s = &ctx->text.s;
1561 for (salt = ctx->text.salt; salt; salt = salt->next)
1572 if (_XawTextFormat(ctx) == (int)XawFmtWide)
1587 *value = _XawTextGetSTRING(ctx, s->left, s->right);
1588 if (_XawTextFormat(ctx) == (int)XawFmtWide) {
1607 if (_XawTextFormat(ctx) == (int)XawFmtWide && *type == XA_STRING) {
1667 _XawTextZapSelection( ctx, (XEvent *) NULL, TRUE);
1675 if (XmuConvertStandardSelection(w, ctx->text.time, selection, target, type,
1712 TextWidget ctx = (TextWidget) w;
1717 _XawTextPrepareToUpdate(ctx);
1719 atomP = ctx->text.s.selections;
1720 for (i = 0 ; i < ctx->text.s.atom_count; i++, atomP++)
1725 while (ctx->text.s.atom_count &&
1726 ctx->text.s.selections[ctx->text.s.atom_count-1] == 0)
1727 ctx->text.s.atom_count--;
1733 atomP = ctx->text.s.selections;
1734 for (i = 0 ; i < ctx->text.s.atom_count; i++, atomP++)
1736 *atomP = ctx->text.s.selections[--ctx->text.s.atom_count];
1737 while (ctx->text.s.atom_count &&
1738 ctx->text.s.selections[ctx->text.s.atom_count-1] == 0)
1739 ctx->text.s.atom_count--;
1742 if (ctx->text.s.atom_count == 0)
1743 ModifySelection(ctx, ctx->text.insertPos, ctx->text.insertPos);
1745 if (ctx->text.old_insert >= 0) /* Update in progress. */
1746 _XawTextExecuteUpdate(ctx);
1749 for (salt = ctx->text.salt; salt; salt = nextSalt)
1783 ctx->text.salt = nextSalt;
1792 _XawTextSaltAwaySelection (ctx, selections, num_atoms)
1793 TextWidget ctx;
1801 LoseSelection ((Widget) ctx, selections + i);
1815 salt->s.left = ctx->text.s.left;
1816 salt->s.right = ctx->text.s.right;
1817 salt->s.type = ctx->text.s.type;
1818 salt->contents = _XawTextGetSTRING(ctx, ctx->text.s.left, ctx->text.s.right);
1819 if (_XawTextFormat(ctx) == (int)XawFmtWide) {
1821 if (XwcTextListToTextProperty(XtDisplay((Widget)ctx),
1833 salt->next = ctx->text.salt;
1834 ctx->text.salt = salt;
1841 XtOwnSelection ((Widget) ctx, selections[i], ctx->text.time,
1849 _SetSelection(ctx, left, right, selections, count)
1850 TextWidget ctx;
1857 if (left < ctx->text.s.left) {
1858 pos = Min(right, ctx->text.s.left);
1859 _XawTextNeedsUpdating(ctx, left, pos);
1861 if (left > ctx->text.s.left) {
1862 pos = Min(left, ctx->text.s.right);
1863 _XawTextNeedsUpdating(ctx, ctx->text.s.left, pos);
1865 if (right < ctx->text.s.right) {
1866 pos = Max(right, ctx->text.s.left);
1867 _XawTextNeedsUpdating(ctx, pos, ctx->text.s.right);
1869 if (right > ctx->text.s.right) {
1870 pos = Max(left, ctx->text.s.right);
1871 _XawTextNeedsUpdating(ctx, pos, right);
1874 ctx->text.s.left = left;
1875 ctx->text.s.right = right;
1877 SrcSetSelection(ctx->text.source, left, right,
1881 Widget w = (Widget) ctx;
1896 tptr= ptr= (unsigned char *) _XawTextGetSTRING(ctx, ctx->text.s.left,
1897 ctx->text.s.right);
1898 if (_XawTextFormat(ctx) == (int)XawFmtWide) {
1931 XtOwnSelection(w, selection, ctx->text.time, ConvertSelection,
1936 XawTextUnsetSelection((Widget)ctx);
1948 _XawTextReplace (ctx, pos1, pos2, text)
1949 TextWidget ctx;
1956 Widget src = ctx->text.source;
1959 Boolean tmp = ctx->text.update_disabled;
1961 ctx->text.update_disabled = True; /* No redisplay during replacement. */
1970 if ((pos1 == ctx->text.insertPos) && (edit_mode == XawtextAppend)) {
1971 ctx->text.insertPos = ctx->text.lastPos;
1972 pos2 = SrcScan(src, ctx->text.insertPos, XawstPositions, XawsdRight,
1973 (int)(ctx->text.insertPos - pos1), (Boolean)TRUE);
1974 pos1 = ctx->text.insertPos;
1976 ctx->text.update_disabled = FALSE; /* rearm redisplay. */
1982 updateFrom = Max(updateFrom, ctx->text.lt.top);
1984 line1 = LineForPosition(ctx, updateFrom);
1986 ctx->text.update_disabled = tmp; /* restore redisplay */
1990 XawTextUnsetSelection((Widget)ctx);
1992 ctx->text.lastPos = GETLASTPOS;
1993 if (ctx->text.lt.top >= ctx->text.lastPos) {
1994 _XawTextBuildLineTable(ctx, ctx->text.lastPos, FALSE);
1995 ClearWindow( (Widget) ctx);
1996 ctx->text.update_disabled = tmp; /* restore redisplay */
2000 ctx->text.single_char = (text->length <= 1 && pos2 - pos1 <= 1);
2004 if (delta < ctx->text.lastPos) {
2005 for (pos2 += delta, i = 0; i < ctx->text.numranges; i++) {
2006 if (ctx->text.updateFrom[i] > pos1)
2007 ctx->text.updateFrom[i] += delta;
2008 if (ctx->text.updateTo[i] >= pos1)
2009 ctx->text.updateTo[i] += delta;
2020 i = LineForPosition(ctx, pos1) + 1;
2021 for (lineP = ctx->text.lt.info + i; i <= ctx->text.lt.lines; i++, lineP++)
2031 if (IsPositionVisible(ctx, updateFrom)) {
2032 updateTo = _BuildLineTable(ctx,
2033 ctx->text.lt.info[line1].position, pos1, line1);
2034 _XawTextNeedsUpdating(ctx, updateFrom, updateTo);
2037 ctx->text.update_disabled = tmp; /* restore redisplay */
2055 TextWidget ctx = (TextWidget)w;
2057 int height, line, i, lastPos = ctx->text.lastPos;
2061 pos1 = (pos1 < ctx->text.lt.top) ? ctx->text.lt.top : pos1;
2062 pos2 = FindGoodPosition(ctx, pos2);
2063 if ( (pos1 >= pos2) || !LineAndXYForPosition(ctx, pos1, &line, &x, &y) )
2066 for ( startPos = pos1, i = line; IsValidLine(ctx, i) &&
2067 (i < ctx->text.lt.lines) ; i++) {
2070 if ( (endPos = ctx->text.lt.info[i + 1].position) > pos2 ) {
2072 done_painting = (!clear_eol || ctx->text.single_char);
2079 height = ctx->text.lt.info[i + 1].y - ctx->text.lt.info[i].y;
2082 if ( (x == (Position) ctx->text.margin.left) && (x > 0) )
2083 SinkClearToBG (ctx->text.sink,
2085 (Dimension) ctx->text.margin.left, (Dimension)height);
2087 if ( (startPos >= ctx->text.s.right) || (endPos <= ctx->text.s.left) )
2088 XawTextSinkDisplayText(ctx->text.sink, x, y, startPos, endPos, FALSE);
2089 else if ((startPos >= ctx->text.s.left) && (endPos <= ctx->text.s.right))
2090 XawTextSinkDisplayText(ctx->text.sink, x, y, startPos, endPos, TRUE);
2092 DisplayText(w, startPos, ctx->text.s.left);
2093 DisplayText(w, Max(startPos, ctx->text.s.left),
2094 Min(endPos, ctx->text.s.right));
2095 DisplayText(w, ctx->text.s.right, endPos);
2100 SinkClearToBG(ctx->text.sink,
2101 (Position) (ctx->text.lt.info[i].textWidth +
2102 ctx->text.margin.left),
2118 SinkClearToBG(ctx->text.sink,
2119 (Position) ctx->text.margin.left, (Position) y,
2126 x = (Position) ctx->text.margin.left;
2127 y = ctx->text.lt.info[i + 1].y;
2129 || (y >= (int)(ctx->core.height - ctx->text.margin.bottom)) )
2132 ctx->text.single_char = FALSE;
2146 DoSelection (ctx, pos, time, motion)
2147 TextWidget ctx;
2154 Widget src = ctx->text.source;
2157 newType = ctx->text.s.type;
2159 if ( (labs((long) time - (long) ctx->text.lasttime) < MULTI_CLICK_TIME) &&
2160 ((pos >= ctx->text.s.left) && (pos <= ctx->text.s.right))) {
2161 sarray = ctx->text.sarray;
2162 for (;*sarray != XawselectNull && *sarray != ctx->text.s.type; sarray++);
2165 newType = *(ctx->text.sarray);
2169 newType = *(ctx->text.sarray);
2173 newType = *(ctx->text.sarray);
2175 ctx->text.lasttime = time;
2203 newRight = SrcScan(ctx->text.source, pos, stype, XawsdRight, 1, FALSE);
2204 newRight =SrcScan(ctx->text.source, newRight,stype,XawsdLeft,1, FALSE);
2207 newLeft = SrcScan(ctx->text.source, pos, stype, XawsdLeft, 1, FALSE);
2211 newLeft =SrcScan(ctx->text.source, newLeft, stype, XawsdRight,1,FALSE);
2229 XtAppWarning(XtWidgetToApplicationContext((Widget) ctx),
2234 if ( (newLeft != ctx->text.s.left) || (newRight != ctx->text.s.right)
2235 || (newType != ctx->text.s.type)) {
2236 ModifySelection(ctx, newLeft, newRight);
2237 if (pos - ctx->text.s.left < ctx->text.s.right - pos)
2238 ctx->text.insertPos = newLeft;
2240 ctx->text.insertPos = newRight;
2241 ctx->text.s.type = newType;
2244 ctx->text.origSel.type = ctx->text.s.type;
2245 ctx->text.origSel.left = ctx->text.s.left;
2246 ctx->text.origSel.right = ctx->text.s.right;
2248 if (pos >= ctx->text.s.left + ((ctx->text.s.right - ctx->text.s.left) / 2))
2249 ctx->text.extendDir = XawsdRight;
2251 ctx->text.extendDir = XawsdLeft;
2264 ExtendSelection (ctx, pos, motion)
2265 TextWidget ctx;
2272 if (ctx->text.s.left == ctx->text.s.right) /* no current selection. */
2273 ctx->text.s.left = ctx->text.s.right = ctx->text.insertPos;
2275 ctx->text.origSel.left = ctx->text.s.left;
2276 ctx->text.origSel.right = ctx->text.s.right;
2279 ctx->text.origSel.type = ctx->text.s.type;
2281 if (pos >= ctx->text.s.left + ((ctx->text.s.right - ctx->text.s.left) / 2))
2282 ctx->text.extendDir = XawsdRight;
2284 ctx->text.extendDir = XawsdLeft;
2287 if ((ctx->text.extendDir == XawsdRight && pos <= ctx->text.origSel.left) ||
2288 (ctx->text.extendDir == XawsdLeft && pos >= ctx->text.origSel.right)) {
2289 ctx->text.extendDir = (ctx->text.extendDir == XawsdRight) ?
2291 ModifySelection(ctx, ctx->text.origSel.left, ctx->text.origSel.right);
2294 dir = ctx->text.extendDir;
2295 switch (ctx->text.s.type) {
2302 if (ctx->text.s.type == XawselectWord)
2315 right_pos = SrcScan(ctx->text.source, pos, stype, XawsdRight, 1, FALSE);
2316 right_pos =SrcScan(ctx->text.source, right_pos,stype,XawsdLeft,1, FALSE);
2319 left_pos = SrcScan(ctx->text.source, pos, stype, XawsdLeft, 1, FALSE);
2323 left_pos =SrcScan(ctx->text.source, left_pos, stype, XawsdRight,1,FALSE);
2332 pos = SrcScan(ctx->text.source, pos, XawstEOL, dir, 1, dir == XawsdRight);
2335 pos = ctx->text.insertPos;
2342 ModifySelection(ctx, ctx->text.s.left, pos);
2344 ModifySelection(ctx, pos, ctx->text.s.right);
2346 ctx->text.insertPos = pos;
2357 TextWidget ctx = (TextWidget) w;
2360 SinkClearToBG(ctx->text.sink,
2368 * Arguments: ctx - the text widget.
2373 _XawTextClearAndCenterDisplay(ctx)
2374 TextWidget ctx;
2376 int insert_line = LineForPosition(ctx, ctx->text.insertPos);
2377 int scroll_by = insert_line - ctx->text.lt.lines/2;
2379 _XawTextVScroll(ctx, scroll_by);
2380 DisplayTextWindow( (Widget) ctx);
2392 TextWidget ctx = (TextWidget) w;
2394 _XawTextBuildLineTable(ctx, ctx->text.lt.top, FALSE);
2395 _XawTextNeedsUpdating(ctx, zeroPosition, ctx->text.lastPos);
2396 _XawTextSetScrollBars(ctx);
2406 _XawTextCheckResize(ctx)
2407 TextWidget ctx;
2409 Widget w = (Widget) ctx;
2413 if ( (ctx->text.resize == XawtextResizeWidth) ||
2414 (ctx->text.resize == XawtextResizeBoth) ) {
2417 for (lt = ctx->text.lt.info;
2418 IsValidLine(ctx, line) && (line < ctx->text.lt.lines);
2420 if ((int)(lt->textWidth + ctx->text.margin.left) > (int)rbox.width)
2421 rbox.width = lt->textWidth + ctx->text.margin.left;
2424 rbox.width += ctx->text.margin.right;
2425 if (rbox.width > ctx->core.width) { /* Only get wider. */
2432 if ( !((ctx->text.resize == XawtextResizeHeight) ||
2433 (ctx->text.resize == XawtextResizeBoth)) )
2436 if (IsPositionVisible(ctx, ctx->text.lastPos))
2437 line = LineForPosition(ctx, ctx->text.lastPos);
2439 line = ctx->text.lt.lines;
2441 if ( (line + 1) == ctx->text.lt.lines ) return;
2443 old_height = ctx->core.height;
2445 rbox.height = XawTextSinkMaxHeight(ctx->text.sink, line + 1) + VMargins(ctx);
2453 _XawTextBuildLineTable(ctx, ctx->text.lt.top, TRUE);
2462 _XawTextSelectionList(ctx, list, nelems)
2463 TextWidget ctx;
2467 Atom * sel = ctx->text.s.selections;
2468 Display *dpy = XtDisplay((Widget) ctx);
2471 if (nelems > ctx->text.s.array_size) {
2473 ctx->text.s.array_size = nelems;
2474 ctx->text.s.selections = sel;
2478 ctx->text.s.atom_count = nelems;
2479 return ctx->text.s.selections;
2484 * Arguments: ctx - the text widget.
2490 * NOTE: if (ctx->text.s.left >= ctx->text.s.right) then the selection
2495 _XawTextSetSelection(ctx, l, r, list, nelems)
2496 TextWidget ctx;
2508 _SetSelection(ctx, l, r, _XawTextSelectionList(ctx, list, nelems), nelems);
2514 * Arguments: ctx - the text widget.
2518 * NOTE: if (ctx->text.s.left >= ctx->text.s.right) then the selection
2523 ModifySelection(ctx, left, right)
2524 TextWidget ctx;
2528 ctx->text.insertPos = left;
2529 _SetSelection( ctx, left, right, (Atom*) NULL, ZERO );
2539 _XawTextAlterSelection (ctx, mode, action, params, num_params)
2540 TextWidget ctx;
2555 if (ctx->text.search != NULL)
2556 ctx->text.search->selection_changed = TRUE;
2558 position = PositionForXY (ctx, (int) ctx->text.ev_x, (int) ctx->text.ev_y);
2562 DoSelection (ctx, position, ctx->text.time, flag);
2564 ExtendSelection (ctx, position, flag);
2567 _XawTextSetSelection(ctx, ctx->text.s.left, ctx->text.s.right,
2589 * Arguments: ctx - the text widget.
2595 UpdateTextInRectangle(ctx, rect)
2596 TextWidget ctx;
2599 XawTextLineTableEntry *info = ctx->text.lt.info;
2603 for (line = 0;( (line < ctx->text.lt.lines) &&
2604 IsValidLine(ctx, line) && (info->y < bottom)); line++, info++)
2606 UpdateTextInLine(ctx, line, x, right);
2622 TextWidget ctx = (TextWidget) w;
2639 PopCopyQueue(ctx);
2643 need_to_draw = TranslateExposeRegion(ctx, &expose);
2645 PopCopyQueue(ctx);
2650 _XawTextPrepareToUpdate(ctx);
2651 UpdateTextInRectangle(ctx, &expose);
2652 XawTextSinkGetCursorBounds(ctx->text.sink, &cursor);
2654 SinkClearToBG(ctx->text.sink, (Position) cursor.x, (Position) cursor.y,
2656 UpdateTextInRectangle(ctx, &cursor);
2658 _XawTextExecuteUpdate(ctx);
2666 _XawTextPrepareToUpdate(ctx)
2667 TextWidget ctx;
2669 if (ctx->text.old_insert < 0) {
2670 InsertCursor((Widget)ctx, XawisOff);
2671 ctx->text.numranges = 0;
2672 ctx->text.showposition = FALSE;
2673 ctx->text.old_insert = ctx->text.insertPos;
2684 void FlushUpdate(ctx)
2685 TextWidget ctx;
2689 if (!XtIsRealized((Widget)ctx)) {
2690 ctx->text.numranges = 0;
2693 while (ctx->text.numranges > 0) {
2694 updateFrom = ctx->text.updateFrom[0];
2696 for (i = 1 ; i < ctx->text.numranges ; i++) {
2697 if (ctx->text.updateFrom[i] < updateFrom) {
2698 updateFrom = ctx->text.updateFrom[i];
2702 updateTo = ctx->text.updateTo[w];
2703 ctx->text.numranges--;
2704 ctx->text.updateFrom[w] = ctx->text.updateFrom[ctx->text.numranges];
2705 ctx->text.updateTo[w] = ctx->text.updateTo[ctx->text.numranges];
2706 for (i = ctx->text.numranges - 1 ; i >= 0 ; i--) {
2707 while (ctx->text.updateFrom[i] <= updateTo && i < ctx->text.numranges) {
2708 updateTo = ctx->text.updateTo[i];
2709 ctx->text.numranges--;
2710 ctx->text.updateFrom[i] = ctx->text.updateFrom[ctx->text.numranges];
2711 ctx->text.updateTo[i] = ctx->text.updateTo[ctx->text.numranges];
2714 DisplayText((Widget)ctx, updateFrom, updateTo);
2727 _XawTextShowPosition(ctx)
2728 TextWidget ctx;
2734 if ( (!XtIsRealized((Widget)ctx)) || (ctx->text.lt.lines <= 0) )
2745 x = ctx->core.width;
2746 y = ctx->core.height - ctx->text.margin.bottom;
2747 if (ctx->text.hbar != NULL)
2748 y -= ctx->text.hbar->core.height + 2 * ctx->text.hbar->core.border_width;
2750 max_pos = PositionForXY (ctx, x, y);
2751 lines = LineForPosition(ctx, max_pos) + 1; /* number of visable lines. */
2753 if ( (ctx->text.insertPos >= ctx->text.lt.top) &&
2754 (ctx->text.insertPos < max_pos))
2757 first = ctx->text.lt.top;
2760 if (ctx->text.insertPos < first) { /* We need to scroll down. */
2761 top = SrcScan(ctx->text.source, ctx->text.insertPos,
2768 first = SrcScan(ctx->text.source, first,
2782 first = SrcScan(ctx->text.source, first,
2796 top = SrcScan(ctx->text.source, ctx->text.insertPos,
2800 lines = LineForPosition(ctx, top);
2806 _XawTextBuildLineTable(ctx, top, FALSE);
2807 DisplayTextWindow((Widget)ctx);
2810 _XawTextVScroll(ctx, lines);
2812 _XawTextSetScrollBars(ctx);
2820 _XawTextExecuteUpdate(ctx)
2821 TextWidget ctx;
2823 if ( ctx->text.update_disabled || (ctx->text.old_insert < 0) )
2826 if((ctx->text.old_insert != ctx->text.insertPos) || (ctx->text.showposition))
2827 _XawTextShowPosition(ctx);
2828 FlushUpdate(ctx);
2829 InsertCursor((Widget)ctx, XawisOn);
2830 ctx->text.old_insert = -1;
2838 TextWidget ctx = (TextWidget)w;
2840 DestroyHScrollBar(ctx);
2841 DestroyVScrollBar(ctx);
2843 XtFree((char *)ctx->text.s.selections);
2844 XtFree((char *)ctx->text.lt.info);
2845 XtFree((char *)ctx->text.search);
2846 XtFree((char *)ctx->text.updateFrom);
2847 XtFree((char *)ctx->text.updateTo);
2859 TextWidget ctx = (TextWidget) w;
2861 PositionVScrollBar(ctx);
2862 PositionHScrollBar(ctx);
2864 _XawTextBuildLineTable(ctx, ctx->text.lt.top, TRUE);
2865 _XawTextSetScrollBars(ctx);
2995 FindGoodPosition(ctx, pos)
2996 TextWidget ctx;
3000 return ( ((pos > ctx->text.lastPos) ? ctx->text.lastPos : pos) );
3011 * Arguments: ctx - the text widget.
3017 PushCopyQueue(ctx, h, v)
3018 TextWidget ctx;
3027 if (ctx->text.copy_area_offsets == NULL)
3028 ctx->text.copy_area_offsets = offsets;
3030 struct text_move * end = ctx->text.copy_area_offsets;
3038 * Arguments: ctx - the text widget.
3043 PopCopyQueue(ctx)
3044 TextWidget ctx;
3046 struct text_move * offsets = ctx->text.copy_area_offsets;
3050 XtName( (Widget) ctx ) );
3052 ctx->text.copy_area_offsets = offsets->next;
3060 * Arguments: ctx - the text widget.
3069 TranslateExposeRegion(ctx, expose)
3070 TextWidget ctx;
3073 struct text_move * offsets = ctx->text.copy_area_offsets;
3104 value = y + height - ctx->core.height;
3120 value = x + width - ctx->core.width;
3214 TextWidget ctx = (TextWidget) w;
3216 ctx->text.source = source;
3217 ctx->text.lt.top = startPos;
3218 ctx->text.s.left = ctx->text.s.right = 0;
3219 ctx->text.insertPos = startPos;
3220 ctx->text.lastPos = GETLASTPOS;
3222 _XawTextBuildLineTable(ctx, ctx->text.lt.top, TRUE);
3244 TextWidget ctx = (TextWidget) w;
3247 _XawTextPrepareToUpdate(ctx);
3248 endPos = FindGoodPosition(ctx, endPos);
3249 startPos = FindGoodPosition(ctx, startPos);
3250 if ((result = _XawTextReplace(ctx, startPos, endPos, text)) == XawEditDone) {
3252 if (ctx->text.insertPos >= (endPos + delta)) {
3254 ctx->text.insertPos = SrcScan(ctx->text.source, ctx->text.insertPos,
3259 _XawTextCheckResize(ctx);
3260 _XawTextExecuteUpdate(ctx);
3261 _XawTextSetScrollBars(ctx);
3286 TextWidget ctx = (TextWidget) w;
3288 _XawTextPrepareToUpdate(ctx);
3289 ctx->text.insertPos = FindGoodPosition(ctx, position);
3290 ctx->text.showposition = TRUE;
3292 _XawTextExecuteUpdate(ctx);
3318 TextWidget ctx = (TextWidget)w;
3320 while (ctx->text.s.atom_count != 0) {
3321 Atom sel = ctx->text.s.selections[ctx->text.s.atom_count - 1];
3327 XtDisownSelection(w, sel, ctx->text.time);
3343 TextWidget ctx = (TextWidget) w;
3345 _XawTextPrepareToUpdate(ctx);
3346 _XawTextSetSelection(ctx, FindGoodPosition(ctx, left),
3347 FindGoodPosition(ctx, right), (String*)NULL, ZERO);
3348 _XawTextExecuteUpdate(ctx);
3360 TextWidget ctx = (TextWidget) w;
3362 from = FindGoodPosition(ctx, from);
3363 to = FindGoodPosition(ctx, to);
3364 ctx->text.lastPos = GETLASTPOS;
3365 _XawTextPrepareToUpdate(ctx);
3366 _XawTextNeedsUpdating(ctx, from, to);
3367 _XawTextBuildLineTable(ctx, ctx->text.lt.top, TRUE);
3368 _XawTextExecuteUpdate(ctx);
3392 TextWidget ctx = (TextWidget)w;
3395 if (!ctx->text.update_disabled) return;
3397 ctx->text.update_disabled = False;
3398 lastPos = ctx->text.lastPos = GETLASTPOS;
3399 ctx->text.lt.top = FindGoodPosition(ctx, ctx->text.lt.top);
3400 ctx->text.insertPos = FindGoodPosition(ctx, ctx->text.insertPos);
3401 if ( (ctx->text.s.left > lastPos) || (ctx->text.s.right > lastPos) )
3402 ctx->text.s.left = ctx->text.s.right = 0;
3404 _XawTextBuildLineTable(ctx, ctx->text.lt.top, TRUE);
3407 _XawTextExecuteUpdate(ctx);
3435 TextWidget ctx = (TextWidget) w;
3437 if (ctx->text.display_caret == display_caret) return;
3440 _XawTextPrepareToUpdate(ctx);
3441 ctx->text.display_caret = display_caret;
3442 _XawTextExecuteUpdate(ctx);
3445 ctx->text.display_caret = display_caret;
3474 TextWidget ctx = (TextWidget) w;
3476 return(SrcSearch(ctx->text.source, ctx->text.insertPos, dir, text));