Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:25

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 _XawTextSrcP_h
0049 #define _XawTextSrcP_h
0050 
0051 /*
0052  * TextSrc Object Private Data
0053  */
0054 #include <X11/Xfuncproto.h>
0055 
0056 #include <X11/Xaw/TextSrc.h>
0057 #include <X11/Xaw/TextP.h>  /* This source works with the Text widget */
0058 
0059 _XFUNCPROTOBEGIN
0060 
0061 #ifndef OLDXAW
0062 struct _XawTextAnchor {
0063     XawTextPosition position;
0064     XawTextEntity *entities, *cache;
0065 };
0066 
0067 #define XAW_TENTF_HIDE      0x0001
0068 #define XAW_TENTF_READ      0x0002
0069 #define XAW_TENTF_REPLACE   0x0004
0070 struct _XawTextEntity {
0071     short type;
0072     short flags;
0073     XawTextEntity *next;
0074     XtPointer data;
0075     XawTextPosition offset; /* from the anchor */
0076     Cardinal length;
0077     XrmQuark property;
0078 };
0079 #endif
0080 
0081 #if 0   /* no longer used */
0082 /* New fields for the TextSrc object class */
0083 typedef struct {
0084   XtPointer     next_extension;
0085   XrmQuark      record_type;
0086   long          version;
0087   Cardinal      record_size;
0088   int           (*Input)();
0089 } TextSrcExtRec, *TextSrcExt;
0090 #endif
0091 
0092 typedef XawTextPosition (*_XawSrcReadProc)
0093      (Widget, XawTextPosition, XawTextBlock*, int);
0094 
0095 typedef int (*_XawSrcReplaceProc)
0096      (Widget, XawTextPosition, XawTextPosition, XawTextBlock*);
0097 
0098 typedef XawTextPosition (*_XawSrcScanProc)
0099      (Widget, XawTextPosition, XawTextScanType, XawTextScanDirection,
0100       int, Bool);
0101 
0102 typedef XawTextPosition (*_XawSrcSearchProc)
0103      (Widget, XawTextPosition, XawTextScanDirection, XawTextBlock*);
0104 
0105 typedef void (*_XawSrcSetSelectionProc)
0106      (Widget, XawTextPosition, XawTextPosition, Atom);
0107 
0108 typedef Boolean (*_XawSrcConvertSelectionProc)
0109      (Widget, Atom*, Atom*, Atom*, XtPointer*, unsigned long*, int*);
0110 
0111 typedef struct _TextSrcClassPart {
0112     _XawSrcReadProc Read;
0113     _XawSrcReplaceProc Replace;
0114     _XawSrcScanProc Scan;
0115     _XawSrcSearchProc Search;
0116     _XawSrcSetSelectionProc SetSelection;
0117     _XawSrcConvertSelectionProc ConvertSelection;
0118 #ifndef OLDXAW
0119     XtPointer extension;
0120 #endif
0121 } TextSrcClassPart;
0122 
0123 /* Full class record */
0124 typedef struct _TextSrcClassRec {
0125     ObjectClassPart     object_class;
0126     TextSrcClassPart    textSrc_class;
0127 } TextSrcClassRec;
0128 
0129 extern TextSrcClassRec textSrcClassRec;
0130 
0131 #ifndef OLDXAW
0132 typedef struct _XawTextUndo XawTextUndo;
0133 #endif
0134 
0135 /* New fields for the TextSrc object */
0136 typedef struct {
0137     /* resources */
0138     XawTextEditType edit_mode;
0139     XrmQuark text_format;       /* 2 formats: FMT8BIT for Ascii
0140                        FMTWIDE for ISO 10646 */
0141 #ifndef OLDXAW
0142     XtCallbackList callback;        /* A callback list to call when the
0143                        source is changed */
0144     Boolean changed;
0145     Boolean enable_undo;
0146 
0147     /* private state */
0148     Boolean undo_state;         /* to protect undo manipulation */
0149     XawTextUndo *undo;
0150     WidgetList text;            /* TextWidget's using this source */
0151     Cardinal num_text;
0152     XtCallbackList property_callback;
0153     XawTextAnchor **anchors;
0154     int num_anchors;
0155     XtPointer pad[1];   /* for future use and keep binary compatibility */
0156 #endif
0157 } TextSrcPart;
0158 
0159 /* Full instance record */
0160 typedef struct _TextSrcRec {
0161     ObjectPart  object;
0162     TextSrcPart textSrc;
0163 } TextSrcRec;
0164 
0165 /*
0166  * Semiprivate declarations of functions used in other modules
0167  */
0168 char* _XawTextWCToMB
0169 (
0170  Display    *display,
0171  wchar_t    *wstr,
0172  int        *len_in_out
0173  );
0174 
0175 wchar_t* _XawTextMBToWC
0176 (
0177  Display    *display,
0178  char       *str,
0179  int        *len_in_out
0180  );
0181 
0182 #ifndef OLDXAW
0183 XawTextAnchor *XawTextSourceAddAnchor
0184 (
0185  Widget         source,
0186  XawTextPosition    position
0187  );
0188 
0189 XawTextAnchor *XawTextSourceFindAnchor
0190 (
0191  Widget         source,
0192  XawTextPosition    position
0193  );
0194 
0195 XawTextAnchor *XawTextSourceNextAnchor
0196 (
0197  Widget          source,
0198  XawTextAnchor      *anchor
0199  );
0200 
0201 XawTextAnchor *XawTextSourcePrevAnchor
0202 (
0203  Widget          source,
0204  XawTextAnchor      *anchor
0205  );
0206 
0207 XawTextAnchor *XawTextSourceRemoveAnchor
0208 (
0209  Widget          source,
0210  XawTextAnchor      *anchor
0211  );
0212 
0213 Bool XawTextSourceAnchorAndEntity
0214 (
0215  Widget           w,
0216  XawTextPosition      position,
0217  XawTextAnchor      **anchor_return,
0218  XawTextEntity      **entity_return
0219  );
0220 
0221 XawTextEntity *XawTextSourceAddEntity
0222 (
0223  Widget         source,
0224  int            type,
0225  int            flags,
0226  XtPointer      data,
0227  XawTextPosition    position,
0228  Cardinal       length,
0229  XrmQuark       property
0230  );
0231 
0232 void XawTextSourceClearEntities
0233 (
0234  Widget         w,
0235  XawTextPosition    left,
0236  XawTextPosition    right
0237  );
0238 #endif
0239 
0240 #if 0   /* no longer used */
0241 typedef XawTextPosition (*_XawTextPositionFunc)();
0242 #endif
0243 
0244 #define XtInheritInput          ((_XawTextPositionFunc)_XtInherit)
0245 #define XtInheritRead           ((_XawSrcReadProc)_XtInherit)
0246 #define XtInheritReplace        ((_XawSrcReplaceProc)_XtInherit)
0247 #define XtInheritScan           ((_XawSrcScanProc)_XtInherit)
0248 #define XtInheritSearch         ((_XawSrcSearchProc)_XtInherit)
0249 #define XtInheritSetSelection       ((_XawSrcSetSelectionProc)_XtInherit)
0250 #define XtInheritConvertSelection     ((_XawSrcConvertSelectionProc)_XtInherit)
0251 #if 0
0252 #define XtTextSrcExtVersion       1
0253 #define XtTextSrcExtTypeString        "XT_TEXTSRC_EXT"
0254 #endif
0255 
0256 _XFUNCPROTOEND
0257 
0258 #endif /* _XawTextSrcP_h */