970N/A#
endif /* lint && SABER */ 1339N/A/*********************************************************** 970N/ACopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts, 970N/Aand the Massachusetts Institute of Technology, Cambridge, Massachusetts. 970N/APermission to use, copy, modify, and distribute this software and its 970N/Adocumentation for any purpose and without fee is hereby granted, 970N/Aprovided that the above copyright notice appear in all copies and that 970N/Aboth that copyright notice and this permission notice appear in 970N/Asupporting documentation, and that the names of Digital or MIT not be 970N/Aused in advertising or publicity pertaining to distribution of the 970N/Asoftware without specific, written prior permission. 970N/ADIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 970N/AALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 970N/ADIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 970N/AANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 970N/AWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 970N/AARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 970N/A******************************************************************/ 970N/A /* class_name */ "AsciiSink",
1105N/A/* text_sink_class fields */ 1172N/A/* ascii_sink_class fields. */ 1339N/A /* Adjust for Left Margin. */ 970N/A/* Function Name: PaintText 970N/A * Description: Actually paints the text into the windoe. 970N/A * Arguments: w - the text widget. 970N/A * gc - gc to paint text with. 970N/A * x, y - location to paint the text. 1189N/A * buf, len - buffer and length of text to paint. 1189N/A * Returns: the width of the text painted, or 0. 970N/A * NOTE: If this string attempts to paint past the end of the window 970N/A * then this function will return zero. 970N/A if ( ((
int)
width) <= -x)
/* Don't draw if we can't see it. */ 1153N/A * This function does not know about drawing more than one line of text. 1153N/A if (
buf[j] ==
LF)
/* line feeds ('\n') are not printed. */ 970N/A else if (
buf[j] < (
unsigned char)
' ' ) {
970N/A/* Function Name: GetCursorBounds 1261N/A * Description: Returns the size and location of the cursor. 1261N/A * Arguments: w - the text object. 1261N/A * RETURNED rect - an X rectangle to return the cursor bounds in. 1261N/A * The following procedure manages the "insert" cursor. 1153N/A * Given two positions, find the distance between them. 1153N/Aint fromx;
/* Horizontal location of first position. */ 1130N/Aint fromx;
/* Horizontal location of starting position.*/ 970N/A/***** Public routines *****/ 970N/A/* Function Name: Initialize 970N/A * Description: Initializes the TextSink Object. 970N/A * Arguments: request, new - the requested and new values for the object /* Function Name: Destroy * Description: This function cleans up when the object is * Arguments: w - the AsciiSink Object. /* Function Name: SetValues * Description: Sets the values for the AsciiSink * Arguments: current - current state of the object. * request - what was requested. * new - what the object will become. * Returns: True if redisplay is needed.