TextSrc.h

Go to the documentation of this file.
00001 /*
00002  * $XConsortium: TextSrc.h,v 1.11 94/04/17 20:13:15 kaleb Exp $
00003  */
00004 
00005 /***********************************************************
00006 
00007 Copyright (c) 1987, 1988, 1994  X Consortium
00008 
00009 Permission is hereby granted, free of charge, to any person obtaining a copy
00010 of this software and associated documentation files (the "Software"), to deal
00011 in the Software without restriction, including without limitation the rights
00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00013 copies of the Software, and to permit persons to whom the Software is
00014 furnished to do so, subject to the following conditions:
00015 
00016 The above copyright notice and this permission notice shall be included in
00017 all copies or substantial portions of the Software.
00018 
00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00022 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00023 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00024 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025 
00026 Except as contained in this notice, the name of the X Consortium shall not be
00027 used in advertising or otherwise to promote the sale, use or other dealings
00028 in this Software without prior written authorization from the X Consortium.
00029 
00030 
00031 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
00032 
00033                         All Rights Reserved
00034 
00035 Permission to use, copy, modify, and distribute this software and its 
00036 documentation for any purpose and without fee is hereby granted, 
00037 provided that the above copyright notice appear in all copies and that
00038 both that copyright notice and this permission notice appear in 
00039 supporting documentation, and that the name of Digital not be
00040 used in advertising or publicity pertaining to distribution of the
00041 software without specific, written prior permission.  
00042 
00043 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
00044 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
00045 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00046 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00047 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
00048 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00049 SOFTWARE.
00050 
00051 ******************************************************************/
00052 
00053 #ifndef _XawTextSrc_h
00054 #define _XawTextSrc_h
00055 
00056 /***********************************************************************
00057  *
00058  * TextSrc Object
00059  *
00060  ***********************************************************************/
00061 
00062 #include <X11/Xaw3d/Text.h>
00063 
00064 /* Resources:
00065 
00066  Name                Class              RepType         Default Value
00067  ----                -----              -------         -------------
00068  editType            EditType           XawTextEditType XawtextRead
00069 
00070 */
00071  
00072 /* Class record constants */
00073 
00074 extern WidgetClass textSrcObjectClass;
00075 
00076 typedef struct _TextSrcClassRec *TextSrcObjectClass;
00077 typedef struct _TextSrcRec      *TextSrcObject;
00078 
00079 typedef enum {XawstPositions, XawstWhiteSpace, XawstEOL, XawstParagraph,
00080               XawstAll} XawTextScanType;
00081 typedef enum {Normal, Selected }highlightType;
00082 typedef enum {XawsmTextSelect, XawsmTextExtend} XawTextSelectionMode;
00083 typedef enum {XawactionStart, XawactionAdjust, XawactionEnd}
00084     XawTextSelectionAction;
00085 
00086 /*
00087  * Error Conditions:
00088  */
00089 
00090 #define XawTextReadError -1
00091 #define XawTextScanError -1
00092 
00093 /************************************************************
00094  *
00095  * Public Functions.
00096  *
00097  ************************************************************/
00098 
00099 _XFUNCPROTOBEGIN
00100 
00101 /*      Function Name: XawTextSourceRead
00102  *      Description: This function reads the source.
00103  *      Arguments: w - the TextSrc Object.
00104  *                 pos - position of the text to retreive.
00105  * RETURNED        text - text block that will contain returned text.
00106  *                 length - maximum number of characters to read.
00107  *      Returns: The number of characters read into the buffer.
00108  */
00109 
00110 extern XawTextPosition XawTextSourceRead(
00111 #if NeedFunctionPrototypes
00112     Widget              /* w */,
00113     XawTextPosition     /* pos */,
00114     XawTextBlock*       /* text_return */,
00115     int                 /* length */
00116 #endif
00117 );
00118 
00119 /*      Function Name: XawTextSourceReplace.
00120  *      Description: Replaces a block of text with new text.
00121  *      Arguments: src - the Text Source Object.
00122  *                 startPos, endPos - ends of text that will be removed.
00123  *                 text - new text to be inserted into buffer at startPos.
00124  *      Returns: XawEditError or XawEditDone.
00125  */
00126 
00127 extern int XawTextSourceReplace (
00128 #if NeedFunctionPrototypes
00129     Widget              /* w */,
00130     XawTextPosition     /* start */,
00131     XawTextPosition     /* end */,
00132     XawTextBlock*       /* text */
00133 #endif
00134 );
00135 
00136 /*      Function Name: XawTextSourceScan
00137  *      Description: Scans the text source for the number and type
00138  *                   of item specified.
00139  *      Arguments: w - the TextSrc Object.
00140  *                 position - the position to start scanning.
00141  *                 type - type of thing to scan for.
00142  *                 dir - direction to scan.
00143  *                 count - which occurance if this thing to search for.
00144  *                 include - whether or not to include the character found in
00145  *                           the position that is returned. 
00146  *      Returns: The position of the text.
00147  *
00148  */
00149 
00150 extern XawTextPosition XawTextSourceScan(
00151 #if NeedFunctionPrototypes
00152     Widget              /* w */,
00153     XawTextPosition     /* position */,
00154 #if NeedWidePrototypes
00155     /* XawTextScanType */ int           /* type */,
00156     /* XawTextScanDirection */ int      /* dir */,
00157 #else
00158     XawTextScanType     /* type */,
00159     XawTextScanDirection /* dir */,
00160 #endif
00161     int                 /* count */,
00162 #if NeedWidePrototypes
00163     /* Boolean */ int   /* include */
00164 #else
00165     Boolean             /* include */
00166 #endif
00167 #endif
00168 );
00169 
00170 /*      Function Name: XawTextSourceSearch
00171  *      Description: Searchs the text source for the text block passed
00172  *      Arguments: w - the TextSource Object.
00173  *                 position - the position to start scanning.
00174  *                 dir - direction to scan.
00175  *                 text - the text block to search for.
00176  *      Returns: The position of the text we are searching for or
00177  *               XawTextSearchError.
00178  */
00179 
00180 extern XawTextPosition XawTextSourceSearch(
00181 #if NeedFunctionPrototypes
00182     Widget              /* w */,
00183     XawTextPosition     /* position */,
00184 #if NeedWidePrototypes
00185     /* XawTextScanDirection */ int      /* dir */,
00186 #else
00187     XawTextScanDirection /* dir */,
00188 #endif
00189     XawTextBlock*       /* text */
00190 #endif
00191 );
00192 
00193 /*      Function Name: XawTextSourceConvertSelection
00194  *      Description: Dummy selection converter.
00195  *      Arguments: w - the TextSrc object.
00196  *                 selection - the current selection atom.
00197  *                 target    - the current target atom.
00198  *                 type      - the type to conver the selection to.
00199  * RETURNED        value, length - the return value that has been converted.
00200  * RETURNED        format    - the format of the returned value.
00201  *      Returns: TRUE if the selection has been converted.
00202  *
00203  */
00204 
00205 extern Boolean XawTextSourceConvertSelection(
00206 #if NeedFunctionPrototypes
00207     Widget              /* w */,
00208     Atom*               /* selection */,
00209     Atom*               /* target */,
00210     Atom*               /* type */,
00211     XtPointer*          /* value_return */,
00212     unsigned long*      /* length_return */,
00213     int*                /* format_return */
00214 #endif
00215 );
00216 
00217 /*      Function Name: XawTextSourceSetSelection
00218  *      Description: allows special setting of the selection.
00219  *      Arguments: w - the TextSrc object.
00220  *                 left, right - bounds of the selection.
00221  *                 selection - the selection atom.
00222  *      Returns: none
00223  */
00224 
00225 extern void XawTextSourceSetSelection(
00226 #if NeedFunctionPrototypes
00227     Widget              /* w */,
00228     XawTextPosition     /* start */,
00229     XawTextPosition     /* end */,
00230     Atom                /* selection */
00231 #endif
00232 );
00233 
00234 _XFUNCPROTOEND
00235 
00236 #endif /* _XawTextSrc_h */
00237 /* DON'T ADD STUFF AFTER THIS #endif */

Generated on Sun Mar 4 15:03:55 2007 for Scilab [trunk] by  doxygen 1.5.1