Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:26:37

0001 /***********************************************************
0002 
0003 Copyright 1987, 1988, 1994, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024 
0025 
0026 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
0027 
0028                         All Rights Reserved
0029 
0030 Permission to use, copy, modify, and distribute this software and its
0031 documentation for any purpose and without fee is hereby granted,
0032 provided that the above copyright notice appear in all copies and that
0033 both that copyright notice and this permission notice appear in
0034 supporting documentation, and that the name of Digital not be
0035 used in advertising or publicity pertaining to distribution of the
0036 software without specific, written prior permission.
0037 
0038 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
0039 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
0040 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
0041 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
0042 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
0043 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
0044 SOFTWARE.
0045 
0046 ******************************************************************/
0047 
0048 #ifndef _XawTextSrc_h
0049 #define _XawTextSrc_h
0050 
0051 #include <X11/Xaw/Text.h>
0052 
0053 /* Resources:
0054 
0055  Name            Class      RepType     Default Value
0056  ----            -----      -------     -------------
0057  callback        Callback       Callback    NULL
0058  editType        EditType       XawTextEditType XawtextRead
0059  enableUndo      Undo       Boolean     False
0060  sourceChanged       Changed        Boolean     False
0061 
0062 */
0063 
0064 /* Class record constants */
0065 extern WidgetClass textSrcObjectClass;
0066 
0067 typedef struct _TextSrcClassRec *TextSrcObjectClass;
0068 typedef struct _TextSrcRec      *TextSrcObject;
0069 
0070 typedef enum {
0071     XawstPositions,
0072     XawstWhiteSpace,
0073     XawstEOL,
0074     XawstParagraph,
0075     XawstAll,
0076     XawstAlphaNumeric
0077   } XawTextScanType;
0078 
0079 typedef enum {
0080     Normal,
0081     Selected
0082 } highlightType;
0083 
0084 typedef enum {
0085     XawsmTextSelect,
0086     XawsmTextExtend
0087 } XawTextSelectionMode;
0088 
0089 typedef enum {
0090     XawactionStart,
0091     XawactionAdjust,
0092     XawactionEnd
0093 } XawTextSelectionAction;
0094 
0095 #define XawTextReadError -1
0096 #define XawTextScanError -1
0097 
0098 #ifndef OLDXAW
0099 #define XtNenableUndo       "enableUndo"
0100 #define XtCUndo         "Undo"
0101 
0102 #define XtNsourceChanged    "sourceChanged"
0103 #define XtCChanged      "Changed"
0104 
0105 #define XtNpropertyCallback "propertyCallback"
0106 #endif
0107 
0108 /*
0109  * Public Functions
0110  */
0111 _XFUNCPROTOBEGIN
0112 
0113 /*
0114  * Function:
0115  *  XawTextSourceRead
0116  *
0117  * Parameters:
0118  *  w      - TextSrc Object
0119  *  pos    - position of the text to retrieve
0120  *  text   - text block that will contain returned text
0121  *  length - maximum number of characters to read
0122  *
0123  * Description:
0124  *  This function reads the source.
0125  *
0126  * Returns:
0127  *  The number of characters read into the buffer
0128  */
0129 XawTextPosition XawTextSourceRead
0130 (
0131  Widget         w,
0132  XawTextPosition    pos,
0133  XawTextBlock       *text_return,
0134  int            length
0135  );
0136 
0137 /*
0138  * Function:
0139  *  XawTextSourceReplace
0140  *
0141  * Parameters:
0142  *  src  - Text Source Object
0143  *  startPos - ends of text that will be removed
0144  *  endPos   - ""
0145  *  text     - new text to be inserted into buffer at startPos
0146  *
0147  * Description:
0148  *  Replaces a block of text with new text
0149  *
0150  * Returns:
0151  *  XawEditError or XawEditDone
0152  */
0153 int XawTextSourceReplace
0154 (
0155  Widget         w,
0156  XawTextPosition    start,
0157  XawTextPosition    end,
0158  XawTextBlock       *text
0159  );
0160 
0161 /*
0162  * Function:
0163  *  XawTextSourceScan
0164  *
0165  * Parameters:
0166  *  w    - TextSrc Object
0167  *  position - position to start scanning
0168  *  type     - type of thing to scan for
0169  *  dir  - direction to scan
0170  *  count    - which occurrence if this thing to search for
0171  *  include  - whether or not to include the character found in
0172  *         the position that is returned.
0173  *
0174  * Description:
0175  *  Scans the text source for the number and type of item specified.
0176  *
0177  * Returns:
0178  *  The position of the text
0179  */
0180 XawTextPosition XawTextSourceScan
0181 (
0182  Widget         w,
0183  XawTextPosition    position,
0184 #if NeedWidePrototypes
0185  int            type,
0186  int            dir,
0187  int            count,
0188  int            include
0189 #else
0190  XawTextScanType    type,
0191  XawTextScanDirection   dir,
0192  int            count,
0193  Boolean        include
0194 #endif
0195  );
0196 
0197 /*
0198  * Function:
0199  *  XawTextSourceSearch
0200  *
0201  * Parameters:
0202  *  w    - TextSource Object
0203  *  position - position to start scanning
0204  *  dir  - direction to search
0205  *  text     - the text block to search for
0206  *
0207  * Description:
0208  *  Searches the text source for the text block passed.
0209  *
0210  * Returns:
0211  *  The position of the text we are searching for or XawTextSearchError
0212  */
0213 XawTextPosition XawTextSourceSearch
0214 (
0215  Widget         w,
0216  XawTextPosition    position,
0217 #if NeedWidePrototypes
0218  int            dir,
0219 #else
0220  XawTextScanDirection   dir,
0221 #endif
0222  XawTextBlock       *text
0223  );
0224 
0225 /*
0226  * Function:
0227  *  XawTextSourceConvertSelection
0228  *
0229  * Parameters:
0230  *  w     - TextSrc object
0231  *  selection - current selection atom
0232  *  target    - current target atom
0233  *  type      - type to convert the selection to
0234  *  value     - return value that has been converted
0235  *  length    - ""
0236  *  format    - format of the returned value
0237  *
0238  * Returns:
0239  *  True if the selection has been converted
0240  */
0241 Boolean XawTextSourceConvertSelection
0242 (
0243  Widget         w,
0244  Atom           *selection,
0245  Atom           *target,
0246  Atom           *type,
0247  XtPointer      *value_return,
0248  unsigned long      *length_return,
0249  int            *format_return
0250  );
0251 
0252 /*
0253  * Function:
0254  *  XawTextSourceSetSelection
0255  *
0256  * Parameters:
0257  *  w     - TextSrc object
0258  *  left      - bounds of the selection
0259  *  right     - ""
0260  *  selection - selection atom
0261  *
0262  * Description:
0263  *  Allows special setting of the selection.
0264  */
0265 void XawTextSourceSetSelection
0266 (
0267  Widget         w,
0268  XawTextPosition    start,
0269  XawTextPosition    end,
0270  Atom           selection
0271  );
0272 
0273 _XFUNCPROTOEND
0274 
0275 #endif /* _XawTextSrc_h */