#include <X11/IntrinsicP.h>#include <X11/StringDefs.h>#include <X11/Xatom.h>#include <X11/Xaw3d/XawInit.h>#include <X11/Xaw3d/MultiSinkP.h>#include <X11/Xaw3d/MultiSrcP.h>#include <X11/Xaw3d/TextP.h>#include "XawI18n.h"#include <stdio.h>#include <ctype.h>Include dependency graph for MultiSink.c:

Go to the source code of this file.
Defines | |
| #define | GETLASTPOS XawTextSourceScan(source, (XawTextPosition) 0, XawstAll, XawsdRight, 1, TRUE) |
| #define | offset(field) XtOffsetOf(MultiSinkRec, multi_sink.field) |
| #define | SuperClass (&textSinkClassRec) |
| #define | insertCursor_width 6 |
| #define | insertCursor_height 3 |
Functions | |
| static void | Initialize () |
| static void | Destroy () |
| static Boolean | SetValues () |
| static int | MaxLines () |
| static int | MaxHeight () |
| static void | SetTabs () |
| static void | DisplayText () |
| static void | InsertCursor () |
| static void | FindPosition () |
| static void | FindDistance () |
| static void | Resolve () |
| static void | GetCursorBounds () |
| static int | CharWidth (Widget w, int x, wchar_t c) |
| static Dimension | PaintText (Widget w, GC gc, Position x, Position y, wchar_t *buf, int len) |
| static void | DisplayText (Widget w, Position x, Position y, XawTextPosition pos1, XawTextPosition pos2, Boolean highlight) |
| static Pixmap | CreateInsertCursor (Screen *s) |
| static void | GetCursorBounds (Widget w, XRectangle *rect) |
| static void | InsertCursor (Widget w, Position x, Position y, XawTextInsertState state) |
| static void | FindDistance (Widget w, XawTextPosition fromPos, int fromx, XawTextPosition toPos, int *resWidth, XawTextPosition *resPos, int *resHeight) |
| static void | FindPosition (Widget w, XawTextPosition fromPos, int fromx, int width, int stopAtWordBreak, XawTextPosition *resPos, int *resWidth, int *resHeight) |
| static void | Resolve (Widget w, XawTextPosition pos, int fromx, int width, XawTextPosition *leftPos, XawTextPosition *rightPos) |
| static void | GetGC (MultiSinkObject sink) |
| static void | Initialize (Widget request, Widget new, ArgList args, Cardinal *num_args) |
| static void | Destroy (Widget w) |
| static Boolean | SetValues (Widget current, Widget request, Widget new, ArgList args, Cardinal *num_args) |
| static int | MaxLines (Widget w, Dimension height) |
| static int | MaxHeight (Widget w, int lines) |
| static void | SetTabs (Widget w, int tab_count, short *tabs) |
| void | _XawMultiSinkPosToXY (Widget w, XawTextPosition pos, Position *x, Position *y) |
Variables | |
| static XtResource | resources [] |
| MultiSinkClassRec | multiSinkClassRec |
| WidgetClass | multiSinkObjectClass = (WidgetClass)&multiSinkClassRec |
| static char | insertCursor_bits [] = {0x0c, 0x1e, 0x33} |
| #define GETLASTPOS XawTextSourceScan(source, (XawTextPosition) 0, XawstAll, XawsdRight, 1, TRUE) |
Definition at line 90 of file MultiSink.c.
| #define insertCursor_height 3 |
Definition at line 344 of file MultiSink.c.
| #define insertCursor_width 6 |
Definition at line 343 of file MultiSink.c.
| #define offset | ( | field | ) | XtOffsetOf(MultiSinkRec, multi_sink.field) |
Definition at line 100 of file MultiSink.c.
| #define SuperClass (&textSinkClassRec) |
Definition at line 112 of file MultiSink.c.
| void _XawMultiSinkPosToXY | ( | Widget | w, | |
| XawTextPosition | pos, | |||
| Position * | x, | |||
| Position * | y | |||
| ) |
Definition at line 769 of file MultiSink.c.
References _XawTextPosToXY(), abs, MultiSinkPart::fontset, _MultiSinkRec::multi_sink, and w.
Referenced by CreateIC(), and SetICValues().
00774 { 00775 MultiSinkObject sink = (MultiSinkObject) ((TextWidget)w)->text.sink; 00776 XFontSetExtents *ext = XExtentsOfFontSet( sink->multi_sink.fontset ); 00777 00778 _XawTextPosToXY( w, pos, x, y ); 00779 *y += abs( ext->max_logical_extent.y ); 00780 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 176 of file MultiSink.c.
References _Xaw_atowc(), MultiSinkPart::display_nonprinting, MultiSinkPart::fontset, i, _MultiSinkRec::multi_sink, TextSinkPart::tabs, _MultiSinkRec::text_sink, width, XawLF, XawSP, and XawTAB.
00181 { 00182 int i, width; 00183 MultiSinkObject sink = (MultiSinkObject) w; 00184 XFontSet fontset = sink->multi_sink.fontset; 00185 Position *tab; 00186 00187 if ( c == _Xaw_atowc(XawLF) ) return(0); 00188 00189 if (c == _Xaw_atowc(XawTAB)) { 00190 /* Adjust for Left Margin. */ 00191 x -= ((TextWidget) XtParent(w))->text.margin.left; 00192 00193 if (x >= (int)XtParent(w)->core.width) return 0; 00194 for (i = 0, tab = sink->text_sink.tabs ; 00195 i < sink->text_sink.tab_count ; i++, tab++) { 00196 if (x < *tab) { 00197 if (*tab < (int)XtParent(w)->core.width) 00198 return *tab - x; 00199 else 00200 return 0; 00201 } 00202 } 00203 return 0; 00204 } 00205 00206 if (XwcTextEscapement (fontset, &c, 1) == 0) 00207 if (sink->multi_sink.display_nonprinting) 00208 c = _Xaw_atowc('@'); 00209 else { 00210 c = _Xaw_atowc(XawSP); 00211 } 00212 00213 /* 00214 * if more efficiency(suppose one column is one ASCII char) 00215 00216 width = XwcGetColumn(fontset->font_charset, fontset->num_of_fonts, c) * 00217 fontset->font_struct_list[0]->min_bounds.width; 00218 * 00219 * WARNING: Very Slower!!! 00220 * 00221 * Li Yuhong. 00222 */ 00223 00224 width = XwcTextEscapement(fontset, &c, 1); 00225 00226 return width; 00227 }
Here is the call graph for this function:

| static Pixmap CreateInsertCursor | ( | Screen * | s | ) | [static] |
Definition at line 348 of file MultiSink.c.
References insertCursor_height, and insertCursor_width.
00350 { 00351 return (XCreateBitmapFromData (DisplayOfScreen(s), RootWindowOfScreen(s), 00352 insertCursor_bits, insertCursor_width, insertCursor_height)); 00353 }
| static void Destroy | ( | Widget | w | ) | [static] |
Definition at line 581 of file MultiSink.c.
References MultiSinkPart::insertCursorOn, MultiSinkPart::invgc, _MultiSinkRec::multi_sink, MultiSinkPart::normgc, and MultiSinkPart::xorgc.
00583 { 00584 MultiSinkObject sink = (MultiSinkObject) w; 00585 00586 XtReleaseGC(w, sink->multi_sink.normgc); 00587 XtReleaseGC(w, sink->multi_sink.invgc); 00588 XtReleaseGC(w, sink->multi_sink.xorgc); 00589 00590 XFreePixmap(XtDisplayOfObject(w), sink->multi_sink.insertCursorOn); 00591 }
| static void Destroy | ( | ) |
| static void DisplayText | ( | Widget | w, | |
| Position | x, | |||
| Position | y, | |||
| XawTextPosition | pos1, | |||
| XawTextPosition | pos2, | |||
| Boolean | highlight | |||
| ) | [static] |
Definition at line 283 of file MultiSink.c.
References _Xaw_atowc(), abs, buf, CharWidth(), MultiSinkPart::display_nonprinting, MultiSinkPart::echo, MultiSinkPart::fontset, gc, MultiSinkPart::invgc, j, XawTextBlock::length, _MultiSinkRec::multi_sink, MultiSinkPart::normgc, PaintText(), XawTextBlock::ptr, void(), width, XawLF, XawTAB, XawTextGetSource(), and XawTextSourceRead().
00288 { 00289 MultiSinkObject sink = (MultiSinkObject) w; 00290 Widget source = XawTextGetSource(XtParent(w)); 00291 wchar_t buf[BUFSIZ]; 00292 XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset); 00293 00294 int j, k; 00295 XawTextBlock blk; 00296 GC gc = highlight ? sink->multi_sink.invgc : sink->multi_sink.normgc; 00297 GC invgc = highlight ? sink->multi_sink.normgc : sink->multi_sink.invgc; 00298 00299 if (!sink->multi_sink.echo) return; 00300 00301 y += abs(ext->max_logical_extent.y); 00302 for ( j = 0 ; pos1 < pos2 ; ) { 00303 pos1 = XawTextSourceRead(source, pos1, &blk, (int) pos2 - pos1); 00304 for (k = 0; k < blk.length; k++) { 00305 if (j >= BUFSIZ) { /* buffer full, dump the text. */ 00306 x += PaintText(w, gc, x, y, buf, j); 00307 j = 0; 00308 } 00309 buf[j] = ((wchar_t *)blk.ptr)[k]; 00310 if (buf[j] == _Xaw_atowc(XawLF)) 00311 continue; 00312 00313 else if (buf[j] == _Xaw_atowc(XawTAB)) { 00314 Position temp = 0; 00315 Dimension width; 00316 00317 if ((j != 0) && ((temp = PaintText(w, gc, x, y, buf, j)) == 0)) 00318 return; 00319 00320 x += temp; 00321 width = CharWidth(w, x, _Xaw_atowc(XawTAB)); 00322 XFillRectangle(XtDisplayOfObject(w), XtWindowOfObject(w), 00323 invgc, (int) x, 00324 (int) y - abs(ext->max_logical_extent.y), 00325 (unsigned int)width, 00326 (unsigned int)ext->max_logical_extent.height); 00327 x += width; 00328 j = -1; 00329 } 00330 else if (XwcTextEscapement (sink->multi_sink.fontset, &buf[j], 1) == 0) { 00331 if (sink->multi_sink.display_nonprinting) 00332 buf[j] = _Xaw_atowc('@'); 00333 else 00334 buf[j] = _Xaw_atowc(' '); 00335 } 00336 j++; 00337 } 00338 } 00339 if (j > 0) 00340 (void) PaintText(w, gc, x, y, buf, j); 00341 }
Here is the call graph for this function:

| static void DisplayText | ( | ) | [static] |
| static void FindDistance | ( | Widget | w, | |
| XawTextPosition | fromPos, | |||
| int | fromx, | |||
| XawTextPosition | toPos, | |||
| int* | resWidth, | |||
| XawTextPosition* | resPos, | |||
| int* | resHeight | |||
| ) | [static] |
Definition at line 407 of file MultiSink.c.
References _Xaw_atowc(), CharWidth(), XawTextBlock::firstPos, MultiSinkPart::fontset, GETLASTPOS, index, XawTextBlock::length, _MultiSinkRec::multi_sink, XawTextBlock::ptr, XawLF, XawTextGetSource(), and XawTextSourceRead().
00415 { 00416 MultiSinkObject sink = (MultiSinkObject) w; 00417 Widget source = XawTextGetSource(XtParent(w)); 00418 00419 XawTextPosition index, lastPos; 00420 wchar_t c; 00421 XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset); 00422 XawTextBlock blk; 00423 00424 /* we may not need this */ 00425 lastPos = GETLASTPOS; 00426 XawTextSourceRead(source, fromPos, &blk, (int) toPos - fromPos); 00427 *resWidth = 0; 00428 for (index = fromPos; index != toPos && index < lastPos; index++) { 00429 if (index - blk.firstPos >= blk.length) 00430 XawTextSourceRead(source, index, &blk, (int) toPos - fromPos); 00431 c = ((wchar_t *)blk.ptr)[index - blk.firstPos]; 00432 *resWidth += CharWidth(w, fromx + *resWidth, c); 00433 if (c == _Xaw_atowc(XawLF)) { 00434 index++; 00435 break; 00436 } 00437 } 00438 *resPos = index; 00439 *resHeight = ext->max_logical_extent.height; 00440 }
Here is the call graph for this function:

| static void FindDistance | ( | ) | [static] |
| static void FindPosition | ( | Widget | w, | |
| XawTextPosition | fromPos, | |||
| int | fromx, | |||
| int | width, | |||
| int | stopAtWordBreak, | |||
| XawTextPosition * | resPos, | |||
| int* | resWidth, | |||
| int* | resHeight | |||
| ) | [static] |
Definition at line 444 of file MultiSink.c.
References _Xaw_atowc(), CharWidth(), FALSE, XawTextBlock::firstPos, MultiSinkPart::fontset, GETLASTPOS, index, XawTextBlock::length, _MultiSinkRec::multi_sink, XawTextBlock::ptr, TRUE, XawLF, XawSP, XawTAB, XawTextGetSource(), and XawTextSourceRead().
00454 { 00455 MultiSinkObject sink = (MultiSinkObject) w; 00456 Widget source = XawTextGetSource(XtParent(w)); 00457 00458 XawTextPosition lastPos, index, whiteSpacePosition = 0; 00459 int lastWidth = 0, whiteSpaceWidth = 0; 00460 Boolean whiteSpaceSeen; 00461 wchar_t c; 00462 XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset); 00463 XawTextBlock blk; 00464 00465 lastPos = GETLASTPOS; 00466 00467 XawTextSourceRead(source, fromPos, &blk, BUFSIZ); 00468 *resWidth = 0; 00469 whiteSpaceSeen = FALSE; 00470 c = 0; 00471 for (index = fromPos; *resWidth <= width && index < lastPos; index++) { 00472 lastWidth = *resWidth; 00473 if (index - blk.firstPos >= blk.length) 00474 XawTextSourceRead(source, index, &blk, BUFSIZ); 00475 c = ((wchar_t *)blk.ptr)[index - blk.firstPos]; 00476 *resWidth += CharWidth(w, fromx + *resWidth, c); 00477 00478 if ((c == _Xaw_atowc(XawSP) || c == _Xaw_atowc(XawTAB)) && 00479 *resWidth <= width) { 00480 whiteSpaceSeen = TRUE; 00481 whiteSpacePosition = index; 00482 whiteSpaceWidth = *resWidth; 00483 } 00484 if (c == _Xaw_atowc(XawLF)) { 00485 index++; 00486 break; 00487 } 00488 } 00489 if (*resWidth > width && index > fromPos) { 00490 *resWidth = lastWidth; 00491 index--; 00492 if (stopAtWordBreak && whiteSpaceSeen) { 00493 index = whiteSpacePosition + 1; 00494 *resWidth = whiteSpaceWidth; 00495 } 00496 } 00497 if (index == lastPos && c != _Xaw_atowc(XawLF)) index = lastPos + 1; 00498 *resPos = index; 00499 *resHeight = ext->max_logical_extent.height; 00500 }
Here is the call graph for this function:

| static void FindPosition | ( | ) |
| static void GetCursorBounds | ( | Widget | w, | |
| XRectangle * | rect | |||
| ) | [static] |
Definition at line 363 of file MultiSink.c.
References MultiSinkPart::cursor_x, MultiSinkPart::cursor_y, insertCursor_height, insertCursor_width, and _MultiSinkRec::multi_sink.
00366 { 00367 MultiSinkObject sink = (MultiSinkObject) w; 00368 00369 rect->width = (unsigned short) insertCursor_width; 00370 rect->height = (unsigned short) insertCursor_height; 00371 rect->x = sink->multi_sink.cursor_x - (short) (rect->width / 2); 00372 rect->y = sink->multi_sink.cursor_y - (short) rect->height; 00373 }
| static void GetCursorBounds | ( | ) |
| static void GetGC | ( | MultiSinkObject | sink | ) | [static] |
Definition at line 519 of file MultiSink.c.
References FALSE, GXxor, L, and long.
00521 { 00522 XtGCMask valuemask = (GCGraphicsExposures | GCForeground | GCBackground ); 00523 XGCValues values; 00524 00525 values.graphics_exposures = (Bool) FALSE; 00526 00527 values.foreground = sink->text_sink.foreground; 00528 values.background = sink->text_sink.background; 00529 00530 sink->multi_sink.normgc = XtAllocateGC( (Widget)sink, 0, valuemask, &values, GCFont, 0 ); 00531 00532 values.foreground = sink->text_sink.background; 00533 values.background = sink->text_sink.foreground; 00534 sink->multi_sink.invgc = XtAllocateGC( (Widget)sink, 0, valuemask, &values, GCFont, 0 ); 00535 00536 values.function = GXxor; 00537 values.background = (unsigned long) 0L; /* (pix ^ 0) = pix */ 00538 values.foreground = (sink->text_sink.background ^ 00539 sink->text_sink.foreground); 00540 valuemask = GCGraphicsExposures | GCFunction | GCForeground | GCBackground; 00541 00542 /* if this GC is not used for fontset rendering then AllocateGC aint needed. Dont hurt tho.*/ 00543 sink->multi_sink.xorgc = XtAllocateGC( (Widget)sink, 0, valuemask, &values, GCFont, 0 ); 00544 }
| static void Initialize | ( | Widget | request, | |
| Widget | new, | |||
| ArgList | args, | |||
| Cardinal* | num_args | |||
| ) | [static] |
Definition at line 559 of file MultiSink.c.
References CreateInsertCursor(), GetGC(), and XawisOff.
00563 { 00564 MultiSinkObject sink = (MultiSinkObject) new; 00565 00566 GetGC(sink); 00567 00568 sink->multi_sink.insertCursorOn= CreateInsertCursor(XtScreenOfObject(new)); 00569 sink->multi_sink.laststate = XawisOff; 00570 sink->multi_sink.cursor_x = sink->multi_sink.cursor_y = 0; 00571 }
Here is the call graph for this function:

| static void Initialize | ( | void | ) | [static] |
| static void InsertCursor | ( | Widget | w, | |
| Position | x, | |||
| Position | y, | |||
| XawTextInsertState | state | |||
| ) | [static] |
Definition at line 380 of file MultiSink.c.
References MultiSinkPart::cursor_x, MultiSinkPart::cursor_y, GetCursorBounds(), MultiSinkPart::insertCursorOn, MultiSinkPart::laststate, _MultiSinkRec::multi_sink, and MultiSinkPart::xorgc.
00384 { 00385 MultiSinkObject sink = (MultiSinkObject) w; 00386 Widget text_widget = XtParent(w); 00387 XRectangle rect; 00388 00389 sink->multi_sink.cursor_x = x; 00390 sink->multi_sink.cursor_y = y; 00391 00392 GetCursorBounds(w, &rect); 00393 if (state != sink->multi_sink.laststate && XtIsRealized(text_widget)) 00394 XCopyPlane(XtDisplay(text_widget), 00395 sink->multi_sink.insertCursorOn, 00396 XtWindow(text_widget), sink->multi_sink.xorgc, 00397 0, 0, (unsigned int) rect.width, (unsigned int) rect.height, 00398 (int) rect.x, (int) rect.y, 1); 00399 sink->multi_sink.laststate = state; 00400 }
Here is the call graph for this function:

| static void InsertCursor | ( | ) |
Definition at line 675 of file MultiSink.c.
References MultiSinkPart::fontset, and _MultiSinkRec::multi_sink.
00679 { 00680 MultiSinkObject sink = (MultiSinkObject) w; 00681 XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset); 00682 00683 return(lines * ext->max_logical_extent.height); 00684 }
| static int MaxHeight | ( | ) |
| static int MaxLines | ( | Widget | w, | |
| Dimension | height | |||
| ) | [static] |
Definition at line 648 of file MultiSink.c.
References MultiSinkPart::fontset, and _MultiSinkRec::multi_sink.
00651 { 00652 MultiSinkObject sink = (MultiSinkObject) w; 00653 int font_height; 00654 XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset); 00655 00656 font_height = ext->max_logical_extent.height; 00657 return( ((int) height) / font_height ); 00658 }
| static int MaxLines | ( | ) | [static] |
| static Dimension PaintText | ( | Widget | w, | |
| GC | gc, | |||
| Position | x, | |||
| Position | y, | |||
| wchar_t* | buf, | |||
| int | len | |||
| ) | [static] |
Definition at line 242 of file MultiSink.c.
References abs, _TextRec::core, MultiSinkPart::fontset, _TextPart::margin, _MultiSinkRec::multi_sink, MultiSinkPart::normgc, _XawTextMargin::right, _TextRec::text, and width.
00248 { 00249 MultiSinkObject sink = (MultiSinkObject) w; 00250 TextWidget ctx = (TextWidget) XtParent(w); 00251 00252 XFontSet fontset = sink->multi_sink.fontset; 00253 Position max_x; 00254 Dimension width = XwcTextEscapement(fontset, buf, len); 00255 XFontSetExtents *ext = XExtentsOfFontSet(fontset); 00256 max_x = (Position) ctx->core.width; 00257 00258 if ( ((int) width) <= -x) /* Don't draw if we can't see it. */ 00259 return(width); 00260 00261 XwcDrawImageString(XtDisplay(ctx), XtWindow(ctx), fontset, gc, 00262 (int) x, (int) y, buf, len); 00263 if ( (((Position) width + x) > max_x) && (ctx->text.margin.right != 0) ) { 00264 x = ctx->core.width - ctx->text.margin.right; 00265 width = ctx->text.margin.right; 00266 XFillRectangle(XtDisplay((Widget) ctx), XtWindow( (Widget) ctx), 00267 sink->multi_sink.normgc, (int) x, 00268 (int) y - abs(ext->max_logical_extent.y), 00269 (unsigned int) width, 00270 (unsigned int) ext->max_logical_extent.height); 00271 return(0); 00272 } 00273 return(width); 00274 }
| static void Resolve | ( | Widget | w, | |
| XawTextPosition | pos, | |||
| int | fromx, | |||
| int | width, | |||
| XawTextPosition * | leftPos, | |||
| XawTextPosition * | rightPos | |||
| ) | [static] |
Definition at line 503 of file MultiSink.c.
References FALSE, FindPosition(), GETLASTPOS, and XawTextGetSource().
00508 { 00509 int resWidth, resHeight; 00510 Widget source = XawTextGetSource(XtParent(w)); 00511 00512 FindPosition(w, pos, fromx, width, FALSE, leftPos, &resWidth, &resHeight); 00513 if (*leftPos > GETLASTPOS) 00514 *leftPos = GETLASTPOS; 00515 *rightPos = *leftPos; 00516 }
Here is the call graph for this function:

| static void Resolve | ( | ) |
| static void SetTabs | ( | Widget | w, | |
| int | tab_count, | |||
| short* | tabs | |||
| ) | [static] |
Definition at line 701 of file MultiSink.c.
References TextSinkPart::char_tabs, f_list(), FALSE, font, MultiSinkPart::fontset, i, _MultiSinkRec::multi_sink, TextSinkPart::tab_count, TextSinkPart::tabs, _MultiSinkRec::text_sink, and void().
00706 { 00707 MultiSinkObject sink = (MultiSinkObject) w; 00708 int i; 00709 Atom XA_FIGURE_WIDTH; 00710 unsigned long figure_width = 0; 00711 XFontStruct *font; 00712 00713 /* 00714 * Bug: 00715 * Suppose the first font of fontset stores the unit of column. 00716 * 00717 * By Li Yuhong, Mar. 14, 1991 00718 */ 00719 { XFontStruct **f_list; 00720 char **f_name; 00721 00722 (void) XFontsOfFontSet(sink->multi_sink.fontset, &f_list, &f_name); 00723 font = f_list[0]; 00724 } 00725 00726 /* 00727 * Find the figure width of the current font. 00728 */ 00729 00730 XA_FIGURE_WIDTH = XInternAtom(XtDisplayOfObject(w), "FIGURE_WIDTH", FALSE); 00731 if ( (XA_FIGURE_WIDTH != None) && 00732 ( (!XGetFontProperty(font, XA_FIGURE_WIDTH, &figure_width)) || 00733 (figure_width == 0)) ) 00734 if (font->per_char && font->min_char_or_byte2 <= '$' && 00735 font->max_char_or_byte2 >= '$') 00736 figure_width = font->per_char['$' - font->min_char_or_byte2].width; 00737 else 00738 figure_width = font->max_bounds.width; 00739 00740 if (tab_count > sink->text_sink.tab_count) { 00741 sink->text_sink.tabs = (Position *) 00742 XtRealloc((char *) sink->text_sink.tabs, 00743 (Cardinal) (tab_count * sizeof(Position))); 00744 sink->text_sink.char_tabs = (short *) 00745 XtRealloc((char *) sink->text_sink.char_tabs, 00746 (Cardinal) (tab_count * sizeof(short))); 00747 } 00748 00749 for ( i = 0 ; i < tab_count ; i++ ) { 00750 sink->text_sink.tabs[i] = tabs[i] * figure_width; 00751 sink->text_sink.char_tabs[i] = tabs[i]; 00752 } 00753 00754 sink->text_sink.tab_count = tab_count; 00755 00756 #ifndef NO_TAB_FIX 00757 ((TextWidget)XtParent(w))->text.redisplay_needed = True; 00758 #endif 00759 }
Here is the call graph for this function:

| static void SetTabs | ( | ) | [static] |
| static Boolean SetValues | ( | Widget | current, | |
| Widget | request, | |||
| Widget | new, | |||
| ArgList | args, | |||
| Cardinal* | num_args | |||
| ) | [static] |
Definition at line 603 of file MultiSink.c.
References TextSinkPart::background, MultiSinkPart::display_nonprinting, MultiSinkPart::echo, MultiSinkPart::fontset, TextSinkPart::foreground, GetGC(), _MultiSinkRec::multi_sink, SetTabs(), _MultiSinkRec::text_sink, and w.
00607 { 00608 MultiSinkObject w = (MultiSinkObject) new; 00609 MultiSinkObject old_w = (MultiSinkObject) current; 00610 00611 /* Font set is not in the GC! Do not make a new GC when font set changes! */ 00612 00613 if ( w->multi_sink.fontset != old_w->multi_sink.fontset ) { 00614 ((TextWidget)XtParent(new))->text.redisplay_needed = True; 00615 #ifndef NO_TAB_FIX 00616 SetTabs( w, w->text_sink.tab_count, w->text_sink.char_tabs ); 00617 #endif 00618 } 00619 00620 if ( w->text_sink.background != old_w->text_sink.background || 00621 w->text_sink.foreground != old_w->text_sink.foreground ) { 00622 00623 XtReleaseGC((Widget)w, w->multi_sink.normgc); 00624 XtReleaseGC((Widget)w, w->multi_sink.invgc); 00625 XtReleaseGC((Widget)w, w->multi_sink.xorgc); 00626 GetGC(w); 00627 ((TextWidget)XtParent(new))->text.redisplay_needed = True; 00628 } else { 00629 if ( (w->multi_sink.echo != old_w->multi_sink.echo) || 00630 (w->multi_sink.display_nonprinting != 00631 old_w->multi_sink.display_nonprinting) ) 00632 ((TextWidget)XtParent(new))->text.redisplay_needed = True; 00633 } 00634 00635 return False; 00636 }
Here is the call graph for this function:

| static Boolean SetValues | ( | ) | [static] |
char insertCursor_bits[] = {0x0c, 0x1e, 0x33} [static] |
Definition at line 345 of file MultiSink.c.
Definition at line 113 of file MultiSink.c.
| WidgetClass multiSinkObjectClass = (WidgetClass)&multiSinkClassRec |
XtResource resources[] [static] |
Initial value:
{
{XtNfontSet, XtCFontSet, XtRFontSet, sizeof (XFontSet),
offset(fontset), XtRString, XtDefaultFontSet},
{XtNecho, XtCOutput, XtRBoolean, sizeof(Boolean),
offset(echo), XtRImmediate, (XtPointer) True},
{XtNdisplayNonprinting, XtCOutput, XtRBoolean, sizeof(Boolean),
offset(display_nonprinting), XtRImmediate, (XtPointer) True},
}
Definition at line 102 of file MultiSink.c.
1.5.1