#include <stdio.h>#include <ctype.h>#include <X11/IntrinsicP.h>#include <X11/StringDefs.h>#include <X11/Xaw3d/XawInit.h>#include <X11/Xaw3d/TextSinkP.h>#include <X11/Xaw3d/TextP.h>Include dependency graph for TextSink.c:

Go to the source code of this file.
Defines | |
| #define | offset(field) XtOffsetOf(TextSinkRec, text_sink.field) |
| #define | SuperClass (&objectClassRec) |
Functions | |
| static void | ClassPartInitialize () |
| static void | Initialize () |
| static void | Destroy () |
| static Boolean | SetValues () |
| static int | MaxHeight () |
| static int | MaxLines () |
| static void | DisplayText () |
| static void | InsertCursor () |
| static void | ClearToBackground () |
| static void | FindPosition () |
| static void | FindDistance () |
| static void | Resolve () |
| static void | SetTabs () |
| static void | GetCursorBounds () |
| static void | ClassPartInitialize (WidgetClass wc) |
| 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 void | DisplayText (Widget w, Position x, Position y, XawTextPosition pos1, XawTextPosition pos2, Boolean highlight) |
| static void | InsertCursor (Widget w, Position x, Position y, XawTextInsertState state) |
| static void | ClearToBackground (Widget w, Position x, Position y, Dimension width, Dimension height) |
| static void | FindPosition (Widget w, XawTextPosition fromPos, int fromx, int width, Boolean stopAtWordBreak, XawTextPosition *resPos, int *resWidth, int *resHeight) |
| static void | FindDistance (Widget w, XawTextPosition fromPos, int fromx, XawTextPosition toPos, int *resWidth, XawTextPosition *resPos, int *resHeight) |
| static void | Resolve (Widget w, XawTextPosition pos, int fromx, int width, XawTextPosition *resPos) |
| static int | MaxLines (Widget w, Dimension height) |
| static int | MaxHeight (Widget w, int lines) |
| static void | SetTabs (Widget w, int tab_count, short *tabs) |
| static void | GetCursorBounds (Widget w, XRectangle *rect) |
| void | XawTextSinkDisplayText (Widget w, Position x, Position y, XawTextPosition pos1, XawTextPosition pos2, Boolean highlight) |
| void | XawTextSinkInsertCursor (Widget w, Position x, Position y, XawTextInsertState state) |
| void | XawTextSinkClearToBackground (Widget w, Position x, Position y, Dimension width, Dimension height) |
| void | XawTextSinkFindPosition (Widget w, XawTextPosition fromPos, int fromx, int width, Boolean stopAtWordBreak, XawTextPosition *resPos, int *resWidth, int *resHeight) |
| void | XawTextSinkFindDistance (Widget w, XawTextPosition fromPos, int fromx, XawTextPosition toPos, int *resWidth, XawTextPosition *resPos, int *resHeight) |
| void | XawTextSinkResolve (Widget w, XawTextPosition pos, int fromx, int width, XawTextPosition *resPos) |
| int | XawTextSinkMaxLines (Widget w, Dimension height) |
| int | XawTextSinkMaxHeight (Widget w, int lines) |
| void | XawTextSinkSetTabs (Widget w, int tab_count, int *tabs) |
| void | XawTextSinkGetCursorBounds (Widget w, XRectangle *rect) |
Variables | |
| static XtResource | resources [] |
| TextSinkClassRec | textSinkClassRec |
| WidgetClass | textSinkObjectClass = (WidgetClass)&textSinkClassRec |
| #define offset | ( | field | ) | XtOffsetOf(TextSinkRec, text_sink.field) |
Definition at line 61 of file TextSink.c.
| #define SuperClass (&objectClassRec) |
Definition at line 70 of file TextSink.c.
| static void ClassPartInitialize | ( | WidgetClass | wc | ) | [static] |
Definition at line 125 of file TextSink.c.
References _TextSinkClassPart::ClearToBackground, _TextSinkClassPart::DisplayText, _TextSinkClassPart::FindDistance, _TextSinkClassPart::FindPosition, _TextSinkClassPart::GetCursorBounds, _TextSinkClassPart::InsertCursor, _TextSinkClassPart::MaxHeight, _TextSinkClassPart::MaxLines, _TextSinkClassRec::object_class, _TextSinkClassPart::Resolve, _TextSinkClassPart::SetTabs, _TextSinkClassRec::text_sink_class, XtInheritClearToBackground, XtInheritDisplayText, XtInheritFindDistance, XtInheritFindPosition, XtInheritGetCursorBounds, XtInheritInsertCursor, XtInheritMaxHeight, XtInheritMaxLines, XtInheritResolve, and XtInheritSetTabs.
00127 { 00128 TextSinkObjectClass t_src, superC; 00129 00130 t_src = (TextSinkObjectClass) wc; 00131 superC = (TextSinkObjectClass) t_src->object_class.superclass; 00132 00133 /* 00134 * We don't need to check for null super since we'll get to TextSink 00135 * eventually. 00136 */ 00137 00138 if (t_src->text_sink_class.DisplayText == XtInheritDisplayText) 00139 t_src->text_sink_class.DisplayText = superC->text_sink_class.DisplayText; 00140 00141 if (t_src->text_sink_class.InsertCursor == XtInheritInsertCursor) 00142 t_src->text_sink_class.InsertCursor = 00143 superC->text_sink_class.InsertCursor; 00144 00145 if (t_src->text_sink_class.ClearToBackground== XtInheritClearToBackground) 00146 t_src->text_sink_class.ClearToBackground = 00147 superC->text_sink_class.ClearToBackground; 00148 00149 if (t_src->text_sink_class.FindPosition == XtInheritFindPosition) 00150 t_src->text_sink_class.FindPosition = 00151 superC->text_sink_class.FindPosition; 00152 00153 if (t_src->text_sink_class.FindDistance == XtInheritFindDistance) 00154 t_src->text_sink_class.FindDistance = 00155 superC->text_sink_class.FindDistance; 00156 00157 if (t_src->text_sink_class.Resolve == XtInheritResolve) 00158 t_src->text_sink_class.Resolve = superC->text_sink_class.Resolve; 00159 00160 if (t_src->text_sink_class.MaxLines == XtInheritMaxLines) 00161 t_src->text_sink_class.MaxLines = superC->text_sink_class.MaxLines; 00162 00163 if (t_src->text_sink_class.MaxHeight == XtInheritMaxHeight) 00164 t_src->text_sink_class.MaxHeight = superC->text_sink_class.MaxHeight; 00165 00166 if (t_src->text_sink_class.SetTabs == XtInheritSetTabs) 00167 t_src->text_sink_class.SetTabs = superC->text_sink_class.SetTabs; 00168 00169 if (t_src->text_sink_class.GetCursorBounds == XtInheritGetCursorBounds) 00170 t_src->text_sink_class.GetCursorBounds = 00171 superC->text_sink_class.GetCursorBounds; 00172 }
| static void ClassPartInitialize | ( | ) | [static] |
| static void ClearToBackground | ( | Widget | w, | |
| Position | x, | |||
| Position | y, | |||
| Dimension | width, | |||
| Dimension | height | |||
| ) | [static] |
Definition at line 299 of file TextSink.c.
00303 { 00304 /* 00305 * Don't clear in height or width are zero. 00306 * XClearArea() has special semantic for these values. 00307 */ 00308 00309 if ( (height == 0) || (width == 0) ) return; 00310 XClearArea(XtDisplayOfObject(w), XtWindowOfObject(w), 00311 x, y, width, height, False); 00312 }
| static void ClearToBackground | ( | ) |
| static void Destroy | ( | Widget | w | ) | [static] |
Definition at line 204 of file TextSink.c.
References TextSinkPart::char_tabs, TextSinkPart::tabs, and _TextSinkRec::text_sink.
00206 { 00207 TextSinkObject sink = (TextSinkObject) w; 00208 00209 XtFree((char *) sink->text_sink.tabs); 00210 XtFree((char *) sink->text_sink.char_tabs); 00211 }
| static void Destroy | ( | ) |
| static void DisplayText | ( | Widget | w, | |
| Position | x, | |||
| Position | y, | |||
| XawTextPosition | pos1, | |||
| XawTextPosition | pos2, | |||
| Boolean | highlight | |||
| ) | [static] |
| static void DisplayText | ( | ) | [static] |
| static void FindDistance | ( | Widget | w, | |
| XawTextPosition | fromPos, | |||
| int | fromx, | |||
| XawTextPosition | toPos, | |||
| int * | resWidth, | |||
| XawTextPosition * | resPos, | |||
| int * | resHeight | |||
| ) | [static] |
| static void FindDistance | ( | ) | [static] |
| static void FindPosition | ( | Widget | w, | |
| XawTextPosition | fromPos, | |||
| int | fromx, | |||
| int | width, | |||
| Boolean | stopAtWordBreak, | |||
| XawTextPosition * | resPos, | |||
| int * | resWidth, | |||
| int * | resHeight | |||
| ) | [static] |
| static void FindPosition | ( | ) |
| static void GetCursorBounds | ( | Widget | w, | |
| XRectangle * | rect | |||
| ) | [static] |
| static void GetCursorBounds | ( | ) |
| static void Initialize | ( | Widget | request, | |
| Widget | new, | |||
| ArgList | args, | |||
| Cardinal * | num_args | |||
| ) | [static] |
Definition at line 184 of file TextSink.c.
References TextSinkPart::char_tabs, NULL, TextSinkPart::tab_count, TextSinkPart::tabs, and _TextSinkRec::text_sink.
00188 { 00189 TextSinkObject sink = (TextSinkObject) new; 00190 00191 sink->text_sink.tab_count = 0; /* Initialize the tab stops. */ 00192 sink->text_sink.tabs = NULL; 00193 sink->text_sink.char_tabs = NULL; 00194 }
| static void Initialize | ( | void | ) |
Initialisation of Scilab
| static void InsertCursor | ( | Widget | w, | |
| Position | x, | |||
| Position | y, | |||
| XawTextInsertState | state | |||
| ) | [static] |
| static void InsertCursor | ( | ) |
| static int MaxHeight | ( | ) | [static] |
| static int MaxLines | ( | Widget | w, | |
| Dimension | height | |||
| ) | [static] |
Definition at line 400 of file TextSink.c.
00403 { 00404 /* 00405 * The fontset has gone down to descent Sink Widget, so 00406 * the functions such MaxLines, SetTabs... are bound to the descent. 00407 * 00408 * by Li Yuhong, Jan. 15, 1991 00409 */ 00410 return 0; 00411 }
| static int MaxLines | ( | ) |
| static void Resolve | ( | Widget | w, | |
| XawTextPosition | pos, | |||
| int | fromx, | |||
| int | width, | |||
| XawTextPosition * | resPos | |||
| ) | [static] |
| static void Resolve | ( | ) |
| static void SetTabs | ( | Widget | w, | |
| int | tab_count, | |||
| short * | tabs | |||
| ) | [static] |
| static void SetTabs | ( | ) |
| static Boolean SetValues | ( | Widget | current, | |
| Widget | request, | |||
| Widget | new, | |||
| ArgList | args, | |||
| Cardinal * | num_args | |||
| ) | [static] |
Definition at line 223 of file TextSink.c.
References FALSE, TextSinkPart::foreground, _TextSinkRec::text_sink, and w.
00227 { 00228 TextSinkObject w = (TextSinkObject) new; 00229 TextSinkObject old_w = (TextSinkObject) current; 00230 00231 if (w->text_sink.foreground != old_w->text_sink.foreground) 00232 ((TextWidget)XtParent(new))->text.redisplay_needed = True; 00233 00234 return FALSE; 00235 }
| static Boolean SetValues | ( | ) | [static] |
| void XawTextSinkClearToBackground | ( | Widget | w, | |
| Position | x, | |||
| Position | y, | |||
| Dimension | width, | |||
| Dimension | height | |||
| ) |
Definition at line 566 of file TextSink.c.
References w.
00571 { 00572 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00573 00574 (*class->text_sink_class.ClearToBackground)(w, x, y, width, height); 00575 }
| void XawTextSinkDisplayText | ( | Widget | w, | |
| Position | x, | |||
| Position | y, | |||
| XawTextPosition | pos1, | |||
| XawTextPosition | pos2, | |||
| Boolean | highlight | |||
| ) |
Definition at line 499 of file TextSink.c.
References w.
Referenced by DisplayText().
00505 { 00506 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00507 00508 (*class->text_sink_class.DisplayText)(w, x, y, pos1, pos2, highlight); 00509 }
Here is the caller graph for this function:

| void XawTextSinkFindDistance | ( | Widget | w, | |
| XawTextPosition | fromPos, | |||
| int | fromx, | |||
| XawTextPosition | toPos, | |||
| int * | resWidth, | |||
| XawTextPosition * | resPos, | |||
| int * | resHeight | |||
| ) |
Definition at line 638 of file TextSink.c.
References w.
Referenced by LineAndXYForPosition().
00643 { 00644 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00645 00646 (*class->text_sink_class.FindDistance)(w, fromPos, fromx, toPos, 00647 resWidth, resPos, resHeight); 00648 }
Here is the caller graph for this function:

| void XawTextSinkFindPosition | ( | Widget | w, | |
| XawTextPosition | fromPos, | |||
| int | fromx, | |||
| int | width, | |||
| Boolean | stopAtWordBreak, | |||
| XawTextPosition * | resPos, | |||
| int * | resWidth, | |||
| int * | resHeight | |||
| ) |
Definition at line 602 of file TextSink.c.
References w.
Referenced by _BuildLineTable(), AutoFill(), InsertNewCRs(), PositionForXY(), and UpdateTextInLine().
00611 { 00612 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00613 00614 (*class->text_sink_class.FindPosition)(w, fromPos, fromx, width, 00615 stopAtWordBreak, 00616 resPos, resWidth, resHeight); 00617 }
Here is the caller graph for this function:

| void XawTextSinkGetCursorBounds | ( | Widget | w, | |
| XRectangle * | rect | |||
| ) |
Definition at line 771 of file TextSink.c.
References w.
Referenced by NotePosition(), and ProcessExposeRegion().
00775 { 00776 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00777 00778 (*class->text_sink_class.GetCursorBounds)(w, rect); 00779 }
Here is the caller graph for this function:

| void XawTextSinkInsertCursor | ( | Widget | w, | |
| Position | x, | |||
| Position | y, | |||
| XawTextInsertState | state | |||
| ) |
Definition at line 532 of file TextSink.c.
References w.
Referenced by InsertCursor().
00537 { 00538 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00539 00540 (*class->text_sink_class.InsertCursor)(w, x, y, state); 00541 }
Here is the caller graph for this function:

Definition at line 719 of file TextSink.c.
References w.
Referenced by _XawTextCheckResize(), and Initialize().
00723 { 00724 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00725 00726 return((*class->text_sink_class.MaxHeight)(w, lines)); 00727 }
Here is the caller graph for this function:

| int XawTextSinkMaxLines | ( | Widget | w, | |
| Dimension | height | |||
| ) |
Definition at line 696 of file TextSink.c.
References w.
Referenced by _XawTextBuildLineTable().
00700 { 00701 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00702 00703 return((*class->text_sink_class.MaxLines)(w, height)); 00704 }
Here is the caller graph for this function:

| void XawTextSinkResolve | ( | Widget | w, | |
| XawTextPosition | pos, | |||
| int | fromx, | |||
| int | width, | |||
| XawTextPosition * | resPos | |||
| ) |
Definition at line 666 of file TextSink.c.
References w.
00672 { 00673 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00674 00675 (*class->text_sink_class.Resolve)(w, pos, fromx, width, resPos); 00676 }
Definition at line 741 of file TextSink.c.
Referenced by Initialize().
00745 { 00746 if (tab_count > 0) { 00747 TextSinkObjectClass class = (TextSinkObjectClass) w->core.widget_class; 00748 short *char_tabs = (short*)XtMalloc( (unsigned)tab_count*sizeof(short) ); 00749 short *tab; 00750 int i; 00751 00752 for (i = tab_count, tab = char_tabs; i; i--) *tab++ = (short)*tabs++; 00753 00754 (*class->text_sink_class.SetTabs)(w, tab_count, char_tabs); 00755 XtFree((char *)char_tabs); 00756 } 00757 }
Here is the caller graph for this function:

XtResource resources[] [static] |
Initial value:
{
{XtNforeground, XtCForeground, XtRPixel, sizeof (Pixel),
offset(foreground), XtRString, XtDefaultForeground},
{XtNbackground, XtCBackground, XtRPixel, sizeof (Pixel),
offset(background), XtRString, XtDefaultBackground},
}
Definition at line 62 of file TextSink.c.
Definition at line 71 of file TextSink.c.
| WidgetClass textSinkObjectClass = (WidgetClass)&textSinkClassRec |
Definition at line 122 of file TextSink.c.
1.5.1