749N/A * Copyright 1989 Massachusetts Institute of Technology 749N/A * Permission to use, copy, modify, distribute, and sell this software and its 749N/A * documentation for any purpose is hereby granted without fee, provided that 749N/A * the above copyright notice appear in all copies and that both that 749N/A * copyright notice and this permission notice appear in supporting 749N/A * documentation, and that the name of M.I.T. not be used in advertising or 749N/A * publicity pertaining to distribution of the software without specific, 749N/A * written prior permission. M.I.T. makes no representations about the 749N/A * suitability of this software for any purpose. It is provided "as is" 749N/A * without express or implied warranty. 749N/A * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 749N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T. 749N/A * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 749N/A * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 749N/A * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 749N/A * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 749N/A * Author: Chris Peterson, MIT X Consortium. 749N/A * Much code taken from X11R3 String and Disk Sources. 749N/A/**************************************************************** 749N/A * Full class record constant 749N/A ****************************************************************/ 749N/A /* class_name */ "TextSrc",
749N/A/* textSrc_class fields */ 749N/A * We don't need to check for null super since we'll get to TextSrc 749N/A/************************************************************ 749N/A * Class specific methods. 749N/A ************************************************************/ 749N/A * Description: This function reads the source. 749N/A * Arguments: w - the TextSrc Object. 749N/A * pos - position of the text to retreive. 749N/A * RETURNED text - text block that will contain returned text. 749N/A * length - maximum number of characters to read. 749N/A * Returns: The number of characters read into the buffer. 749N/A "TextSrc Object: No read function is defined.");
749N/A/* Function Name: Replace. 749N/A * Description: Replaces a block of text with new text. 749N/A * Arguments: src - the Text Source Object. 749N/A * startPos, endPos - ends of text that will be removed. 749N/A * text - new text to be inserted into buffer at startPos. 749N/A * Returns: XawEditError. 749N/A * Description: Scans the text source for the number and type 749N/A * Arguments: w - the TextSrc Object. 749N/A * position - the position to start scanning. 749N/A * type - type of thing to scan for. 749N/A * dir - direction to scan. 749N/A * count - which occurance if this thing to search for. 749N/A * include - whether or not to include the character found in 749N/A * the position that is returned. 749N/A * Returns: EXITS WITH AN ERROR MESSAGE. 749N/A "TextSrc Object: No SCAN function is defined.");
749N/A/* Function Name: Search 749N/A * Description: Searchs the text source for the text block passed 749N/A * Arguments: w - the TextSource Object. 749N/A * position - the position to start scanning. 749N/A * dir - direction to scan. 749N/A * text - the text block to search for. 749N/A * Returns: XawTextSearchError. 749N/A/* Function Name: ConvertSelection 749N/A * Description: Dummy selection converter. 749N/A * Arguments: w - the TextSrc object. 749N/A * selection - the current selection atom. 749N/A * target - the current target atom. 749N/A * type - the type to conver the selection to. 749N/A * RETURNED value, length - the return value that has been converted. 749N/A * RETURNED format - the format of the returned value. 749N/A * Returns: TRUE if the selection has been converted. 749N/A/* Function Name: SetSelection 749N/A * Description: allows special setting of the selection. 749N/A * Arguments: w - the TextSrc object. 749N/A * left, right - bounds of the selection. 749N/A * selection - the selection atom. 749N/A /* This space intentionally left blank. */ 749N/A/************************************************************ 749N/A ************************************************************/ 749N/A/* Function Name: XawTextSourceRead 749N/A * Description: This function reads the source. 749N/A * Arguments: w - the TextSrc Object. 749N/A * pos - position of the text to retreive. 749N/A * RETURNED text - text block that will contain returned text. 749N/A * length - maximum number of characters to read. 749N/A * Returns: The number of characters read into the buffer. 749N/A/* Function Name: XawTextSourceReplace. 749N/A * Description: Replaces a block of text with new text. 749N/A * Arguments: src - the Text Source Object. 749N/A * startPos, endPos - ends of text that will be removed. 749N/A * text - new text to be inserted into buffer at startPos. 749N/A * Returns: XawEditError or XawEditDone. 749N/A/* Function Name: XawTextSourceScan 749N/A * Description: Scans the text source for the number and type 749N/A * Arguments: w - the TextSrc Object. 749N/A * position - the position to start scanning. 749N/A * type - type of thing to scan for. 749N/A * dir - direction to scan. 749N/A * count - which occurance if this thing to search for. 749N/A * include - whether or not to include the character found in 749N/A * the position that is returned. 749N/A * Returns: The position of the text. 749N/A/* Function Name: XawTextSourceSearch 749N/A * Description: Searchs the text source for the text block passed 749N/A * Arguments: w - the TextSource Object. 749N/A * position - the position to start scanning. 749N/A * dir - direction to scan. 749N/A * text - the text block to search for. 749N/A * Returns: The position of the text we are searching for or 749N/A/* Function Name: XawTextSourceConvertSelection 749N/A * Description: Dummy selection converter. 749N/A * Arguments: w - the TextSrc object. 749N/A * selection - the current selection atom. 749N/A * target - the current target atom. 749N/A * type - the type to conver the selection to. 749N/A * RETURNED value, length - the return value that has been converted. 749N/A * RETURNED format - the format of the returned value. 749N/A * Returns: TRUE if the selection has been converted. 749N/A/* Function Name: XawTextSourceSetSelection 749N/A * Description: allows special setting of the selection. 749N/A * Arguments: w - the TextSrc object. 749N/A * left, right - bounds of the selection. 749N/A * selection - the selection atom.