File indexing completed on 2025-01-18 10:14:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 #ifndef _XawTextSrcP_h
0049 #define _XawTextSrcP_h
0050
0051
0052
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;
0076 Cardinal length;
0077 XrmQuark property;
0078 };
0079 #endif
0080
0081 #if 0
0082
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
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
0136 typedef struct {
0137
0138 XawTextEditType edit_mode;
0139 XrmQuark text_format;
0140
0141 #ifndef OLDXAW
0142 XtCallbackList callback;
0143
0144 Boolean changed;
0145 Boolean enable_undo;
0146
0147
0148 Boolean undo_state;
0149 XawTextUndo *undo;
0150 WidgetList text;
0151 Cardinal num_text;
0152 XtCallbackList property_callback;
0153 XawTextAnchor **anchors;
0154 int num_anchors;
0155 XtPointer pad[1];
0156 #endif
0157 } TextSrcPart;
0158
0159
0160 typedef struct _TextSrcRec {
0161 ObjectPart object;
0162 TextSrcPart textSrc;
0163 } TextSrcRec;
0164
0165
0166
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
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