From 272e57235cd60a2e65ac8258d96a02eb3939b687 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 25 Mar 2011 10:41:05 +0000 Subject: git update until 25 Mar 2011 xserver fontconfig glproto libXau libXft libXmu libfontenc libxcb mesa mkfontscale pixman randrproto xkeyboard-config xtrans xwininfo updated following packages: xproto-7.0.21 xineramaproto-1.2.1 libXt-1.1.1 libxkbfile-1.0.7 libXpm-3.5.9 libXfont-1.4.3 libXaw-1.0.9 bdftopcf-1.0.3 encodings-1.0.4 fixesproto-5.0 font-adobe-100dpi-1.0.3 font-adobe-75dpi-1.0.3 font-adobe-utopia-100dpi-1.0.4 font-adobe-utopia-75dpi-1.0.4 font-adobe-utopia-type1-1.0.4 font-alias-1.0.3 font-arabic-misc-1.0.3 font-bh-100dpi-1.0.3 font-bh-75dpi-1.0.3 font-bh-lucidatypewriter-100dpi-1.0.3 font-bh-lucidatypewriter-75dpi-1.0.3 font-bh-ttf-1.0.3 font-bh-type1-1.0.3 font-bitstream-100dpi-1.0.3 font-bitstream-75dpi-1.0.3 font-bitstream-speedo-1.0.2 font-bitstream-type1-1.0.3 font-cronyx-cyrillic-1.0.3 font-cursor-misc-1.0.3 font-daewoo-misc-1.0.3 font-dec-misc-1.0.3 font-ibm-type1-1.0.3 font-isas-misc-1.0.3 font-jis-misc-1.0.3 font-micro-misc-1.0.3 font-misc-cyrillic-1.0.3 font-misc-ethiopic-1.0.3 font-misc-meltho-1.0.3 font-misc-misc-1.1.2 font-mutt-misc-1.0.3 font-schumacher-misc-1.1.2 font-screen-cyrillic-1.0.4 font-sony-misc-1.0.3 font-sun-misc-1.0.3 font-util-1.2.0 font-winitzki-cyrillic-1.0.3 font-xfree86-type1-1.0.4 --- libXaw/specs/TextSink.xml | 915 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 915 insertions(+) create mode 100644 libXaw/specs/TextSink.xml (limited to 'libXaw/specs/TextSink.xml') diff --git a/libXaw/specs/TextSink.xml b/libXaw/specs/TextSink.xml new file mode 100644 index 000000000..bafe557bd --- /dev/null +++ b/libXaw/specs/TextSink.xml @@ -0,0 +1,915 @@ + +TextSink Object + + + + + + + + + + + + +Application Header file <X11/Xaw/TextSink.h> + +Class Header file <X11/Xaw/TextSinkP.h> + +Class textSinkObjectClass + +Class Name TextSink + +Superclass Object + + + + +The TextSink object is the root object for all text sinks. Any new text +sink objects should be subclasses of the TextSink Object. The TextSink +Class contains all methods that the Text widget expects a text sink to +export. + + + +Since all text sinks will have some resources in common, the TextSink +defines a few new resources. + + +Resources + + +When creating an TextSink object instance, the following resources are +retrieved from the argument list or from the resource database: + + + + + + + + + + + + + + Name + Class + Type + Notes + Default Value + + + + + background + Background + Pixel + + XtDefaultBackground + + + destroyCallback + Callback + XtCallbackList + + NULL + + + foreground + Foreground + Pixel + + XtDefaultForeground + + + _ + + + + + + + + + + +Subclassing the TextSink + + + +The only purpose of the TextSink Object is to be subclassed. It +contains the minimum set of class methods that all text sinks must have. +While all may be inherited, the direct descendant of TextSink must +specify some of them as TextSink does contain enough information to +be a valid text sink by itself. Do not try to use +the TextSink as a valid sink for the Text widget; it is not intended +to be used as a sink by itself. + + + + + + + + + Function + Inherit with + Public Interface + must specify + + + + + DisplayText + XtInheritDisplayText + XawTextSinkDisplayText + yes + + + InsertCursor + XtInheritInsertCursor + XawTextSinkInsertCursor + yes + + + ClearToBackground + XtInheritClearToBackground + XawTextSinkClearToBackground + no + + + FindPosition + XtInheritFindPosition + XawTextSinkFindPosition + yes + + + FindDistance + XtInheritFindDistance + XawTextSinkFindDistance + yes + + + Resolve + XtInheritResolve + XawTextSinkResolve + yes + + + MaxLines + XtInheritMaxLines + XawTextSinkMaxLines + no + + + MaxHeight + XtInheritMaxHeight + XawTextSinkMaxHeight + no + + + SetTabs + XtInheritSetTabs + XawTextSinkSetTabs + no + + + GetCursorBounds + XtInheritGetCursorBounds + XawTextSinkGetCursorBounds + yes + + + + + + +Displaying Text + + +To display a section of the text buffer contained in the text source +use the function DisplayText: + + + + void DisplayText + Widget w + Positionx, y + XawTextPositionpos1, pos2 + Boolean highlight + + + + + + + w + + + +Specifies the TextSink object. + + + + + + x + + + +Specifies the x location to start drawing the text. + + + + + + y + + + +Specifies the y location to start drawing text. + + + + + + pos1 + + + +Specifies the location within the text source of the first character +to be printed. + + + + + + pos2 + + + +Specifies the location within the text source of the last character +to be printed. + + + + + + highlight + + + +Specifies whether or not to paint the text region highlighted. + + + + + + + +The Text widget will only pass one line at a time to the text sink, so +this function does not need to know how to line feed the text. It is +acceptable for this function to just ignore Carriage Returns. x +and y denote the upper left hand corner of the first character to +be displayed. + + + +Displaying the Insert Point + + +The function that controls the display of the text cursor is +InsertCursor. This function will be called whenever the text +widget desires to change the state of, or move the insert point. + + + void InsertCursor + Widget w + Positionx, y + XawTextInsertState state + + + + + + + w + + + +Specifies the TextSink object. + + + + + + x + + + +Specifies the x location of the cursor in Pixels. + + + + + + y + + + +Specifies the y location of the cursor in Pixels. + + + + + + state + + + +Specifies the state of the cursor, may be one of XawisOn or +XawisOff. + + + + + + + +X and y denote the upper left hand corner of the insert point. + + + +Clearing Portions of the Text window + + +To clear a portion of the Text window to its background color, the Text +widget will call ClearToBackground. The TextSink object already +defines this function as calling XClearArea on the region passed. +This behavior will be used if you specify +XtInheritClearToBackground for this method. + + + + + void ClearToBackground + Widget w + Positionx, y + Dimensionwidth, height + + + + + + + w + + + +Specifies the TextSink object. + + + + + + x + + + +Specifies the x location, in pixels, of the Region to clear. + + + + + + y + + + +Specifies the y location, in pixels, of the Region to clear. + + + + + + width + + + +Specifies the width, in pixels, of the Region to clear. + + + + + + height + + + +Specifies the height, in pixels, of the Region to clear. + + + + + + + +X and y denote the upper left hand corner of region to clear. + + + +Finding a Text Position Given Pixel Values + + +To find the text character position that will be rendered at a given x +location the Text widget uses the function FindPosition: + + + + void FindPosition + Widget w + XawTextPosition fromPos + intfromX, width + Boolean stopAtWordBreak + XawTextPosition *pos_return + int*width_return, *height_return + + + + + + + w + + + +Specifies the TextSink object. + + + + + + fromPos + + + +Specifies a reference position, usually the first character in this line. +This character is always to the left of the desired character location. + + + + + + fromX + + + +Specifies the distance that the left edge of fromPos is from the +left edge of the window. This is the reference x location for the +reference position. + + + + + + width + + + +Specifies the distance, in pixels, from the reference position to the +desired character position. + + + + + + stopAtWordBreak + + + +Specifies whether or not the position that is returned should be forced +to be on a word boundary. + + + + + + pos_return + + + +Returns the character position that corresponds to the location that has +been specified, or the work break immediately to the left of the +position if stopAtWordBreak is True. + + + + + + width_return + + + +Returns the actual distance between fromPos and pos_return. + + + + + + height_return + + + +Returns the maximum height of the text between fromPos and +pos_return. + + + + + + + +This function need make no attempt to deal with line feeds. The text +widget will only call it one line at a time. + + + + +Another means of finding a text position is provided by the Resolve +function: + + + + void Resolve + Widget w + XawTextPosition fromPos + intfromX, width + XawTextPosition *pos_return + + + + + + + w + + + +Specifies the TextSink object. + + + + + + fromPos + + + +Specifies a reference position, usually the first character in this line. +This character is always to the left of the desired character location. + + + + + + fromX + + + +Specifies the distance that the left edge of fromPos is from the +left edge of the window. This is the reference x location for the +reference position. + + + + + + width + + + +Specifies the distance, in pixels, from the reference position to the +desired character position. + + + + + + pos_return + + + +Returns the character position that corresponds to the +location that has been specified, or the word break immediately to the left +if stopAtWordBreak is True. + + + + + + + +This function need make no attempt to deal with line feeds. The text +widget will only call it one line at a time. This is a more convenient +interface to the FindPosition function, and provides a subset of its +functionality. + + + + +Finding the Distance Between two Text Positions + + +To find the distance in pixels between two text positions on the same +line use the function FindDistance. + + + + void FindDistance + Widget w + XawTextPositionfromPos, toPos + int fromX + XawTextPosition *pos_return + int*width_return, *height_return + + + + + + + w + + + +Specifies the TextSink object. + + + + + + fromPos + + + +Specifies the text buffer position, in characters, of the first position. + + + + + + fromX + + + +Specifies the distance that the left edge of fromPos is from the +left edge of the window. This is the reference x location for the +reference position. + + + + + + toPos + + + +Specifies the text buffer position, in characters, of the second position. + + + + + + resWidth + + + +Return the actual distance between fromPos +and pos_return. + + + + + + resPos + + + +Returns the character position that corresponds to the actual character +position used for toPos in the calculations. This may be +different than toPos, for example if fromPos and toPos +are on different lines in the file. + + + + + + height_return + + + +Returns the maximum height of the text between fromPos and +pos_return. + + + + + + + +This function need make no attempt to deal with line feeds. The Text +widget will only call it one line at a time. + + + +Finding the Size of the Drawing area + + +To find the maximum number of lines that will fit into the current Text +widget, use the function MaxLines. The TextSink already defines +this function to compute the maximum number of lines by using the height +of font. + + + + int MaxLines + Widget w + Dimension height + + + + + + + w + + + +Specifies the TextSink object. + + + + + + height + + + +Specifies the height of the current drawing area. + + + + + + + +Returns the maximum number of lines that will fit in height. + + + + +To find the height required for a given number of text lines, use +the function MaxHeight. The TextSink already defines this +function to compute the maximum height of the window by using the +height of font. + + + + int MaxHeight + Widget w + int lines + + + + + + + w + + + +Specifies the TextSink object. + + + + + + height + + + +Specifies the height of the current drawing area. + + + + + + + +Returns the height that will be taken up by the number of lines passed. + + + +Setting the Tab Stops + + +To set the tab stops for a text sink use the SetTabs function. +The TextSink already defines this function to set the tab x location in +pixels to be the number of characters times the figure width of +font. + + + + void SetTabs + Widget w + inttab_count, *tabs + + + + + + + w + + + +Specifies the TextSink object. + + + + + + tab_count + + + +Specifies the number of tabs passed in tabs. + + + + + + tabs + + + +Specifies the position, in characters, of the tab stops. + + + + + + + +This function is responsible for the converting character positions passed +to it into whatever internal positions the TextSink uses for tab placement. + + + +Getting the Insert Point's Size and Location + + +To get the size and location of the insert point use the +GetCursorBounds function. + + + + void GetCursorBounds + Widget w + XRectangle *rect_return + + + + + + + w + + + +Specifies the TextSinkObject. + + + + + + rect_return + + + +Returns the location and size of the insert point. + + + + + + + +Rect will be filled with the current size and location of the +insert point. + + + + + -- cgit v1.2.3