| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | #ifndef _XawTextSrcP_h |
| 49 | #define _XawTextSrcP_h |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | #include <X11/Xfuncproto.h> |
| 55 | |
| 56 | #include <X11/Xaw/TextSrc.h> |
| 57 | #include <X11/Xaw/TextP.h> |
| 58 | |
| 59 | _XFUNCPROTOBEGIN |
| 60 | |
| 61 | #ifndef OLDXAW |
| 62 | struct _XawTextAnchor { |
| 63 | XawTextPosition position; |
| 64 | XawTextEntity *entities, *cache; |
| 65 | }; |
| 66 | |
| 67 | #define XAW_TENTF_HIDE 0x0001 |
| 68 | #define XAW_TENTF_READ 0x0002 |
| 69 | #define XAW_TENTF_REPLACE 0x0004 |
| 70 | struct _XawTextEntity { |
| 71 | short type; |
| 72 | short flags; |
| 73 | XawTextEntity *next; |
| 74 | XtPointer data; |
| 75 | XawTextPosition offset; |
| 76 | Cardinal length; |
| 77 | XrmQuark property; |
| 78 | }; |
| 79 | #endif |
| 80 | |
| 81 | #if 0 |
| 82 | |
| 83 | typedef struct { |
| 84 | XtPointer next_extension; |
| 85 | XrmQuark record_type; |
| 86 | long version; |
| 87 | Cardinal record_size; |
| 88 | int (*Input)(); |
| 89 | } TextSrcExtRec, *TextSrcExt; |
| 90 | #endif |
| 91 | |
| 92 | typedef XawTextPosition (*_XawSrcReadProc) |
| 93 | (Widget, XawTextPosition, XawTextBlock*, int); |
| 94 | |
| 95 | typedef int (*_XawSrcReplaceProc) |
| 96 | (Widget, XawTextPosition, XawTextPosition, XawTextBlock*); |
| 97 | |
| 98 | typedef XawTextPosition (*_XawSrcScanProc) |
| 99 | (Widget, XawTextPosition, XawTextScanType, XawTextScanDirection, |
| 100 | int, Bool); |
| 101 | |
| 102 | typedef XawTextPosition (*_XawSrcSearchProc) |
| 103 | (Widget, XawTextPosition, XawTextScanDirection, XawTextBlock*); |
| 104 | |
| 105 | typedef void (*_XawSrcSetSelectionProc) |
| 106 | (Widget, XawTextPosition, XawTextPosition, Atom); |
| 107 | |
| 108 | typedef Boolean (*_XawSrcConvertSelectionProc) |
| 109 | (Widget, Atom*, Atom*, Atom*, XtPointer*, unsigned long*, int*); |
| 110 | |
| 111 | typedef struct _TextSrcClassPart { |
| 112 | _XawSrcReadProc Read; |
| 113 | _XawSrcReplaceProc Replace; |
| 114 | _XawSrcScanProc Scan; |
| 115 | _XawSrcSearchProc Search; |
| 116 | _XawSrcSetSelectionProc SetSelection; |
| 117 | _XawSrcConvertSelectionProc ConvertSelection; |
| 118 | #ifndef OLDXAW |
| 119 | XtPointer extension; |
| 120 | #endif |
| 121 | } TextSrcClassPart; |
| 122 | |
| 123 | |
| 124 | typedef struct _TextSrcClassRec { |
| 125 | ObjectClassPart object_class; |
| 126 | TextSrcClassPart textSrc_class; |
| 127 | } TextSrcClassRec; |
| 128 | |
| 129 | extern TextSrcClassRec textSrcClassRec; |
| 130 | |
| 131 | #ifndef OLDXAW |
| 132 | typedef struct _XawTextUndo XawTextUndo; |
| 133 | #endif |
| 134 | |
| 135 | |
| 136 | typedef struct { |
| 137 | |
| 138 | XawTextEditType edit_mode; |
| 139 | XrmQuark text_format; |
| 140 | |
| 141 | #ifndef OLDXAW |
| 142 | XtCallbackList callback; |
| 143 | |
| 144 | Boolean changed; |
| 145 | Boolean enable_undo; |
| 146 | |
| 147 | |
| 148 | Boolean undo_state; |
| 149 | XawTextUndo *undo; |
| 150 | WidgetList text; |
| 151 | Cardinal num_text; |
| 152 | XtCallbackList property_callback; |
| 153 | XawTextAnchor **anchors; |
| 154 | int num_anchors; |
| 155 | XtPointer pad[1]; |
| 156 | #endif |
| 157 | } TextSrcPart; |
| 158 | |
| 159 | |
| 160 | typedef struct _TextSrcRec { |
| 161 | ObjectPart object; |
| 162 | TextSrcPart textSrc; |
| 163 | } TextSrcRec; |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | char* _XawTextWCToMB |
| 169 | ( |
| 170 | Display *display, |
| 171 | wchar_t *wstr, |
| 172 | int *len_in_out |
| 173 | ); |
| 174 | |
| 175 | wchar_t* _XawTextMBToWC |
| 176 | ( |
| 177 | Display *display, |
| 178 | char *str, |
| 179 | int *len_in_out |
| 180 | ); |
| 181 | |
| 182 | #ifndef OLDXAW |
| 183 | XawTextAnchor *XawTextSourceAddAnchor |
| 184 | ( |
| 185 | Widget source, |
| 186 | XawTextPosition position |
| 187 | ); |
| 188 | |
| 189 | XawTextAnchor *XawTextSourceFindAnchor |
| 190 | ( |
| 191 | Widget source, |
| 192 | XawTextPosition position |
| 193 | ); |
| 194 | |
| 195 | XawTextAnchor *XawTextSourceNextAnchor |
| 196 | ( |
| 197 | Widget source, |
| 198 | XawTextAnchor *anchor |
| 199 | ); |
| 200 | |
| 201 | XawTextAnchor *XawTextSourcePrevAnchor |
| 202 | ( |
| 203 | Widget source, |
| 204 | XawTextAnchor *anchor |
| 205 | ); |
| 206 | |
| 207 | XawTextAnchor *XawTextSourceRemoveAnchor |
| 208 | ( |
| 209 | Widget source, |
| 210 | XawTextAnchor *anchor |
| 211 | ); |
| 212 | |
| 213 | Bool XawTextSourceAnchorAndEntity |
| 214 | ( |
| 215 | Widget w, |
| 216 | XawTextPosition position, |
| 217 | XawTextAnchor **anchor_return, |
| 218 | XawTextEntity **entity_return |
| 219 | ); |
| 220 | |
| 221 | XawTextEntity *XawTextSourceAddEntity |
| 222 | ( |
| 223 | Widget source, |
| 224 | int type, |
| 225 | int flags, |
| 226 | XtPointer data, |
| 227 | XawTextPosition position, |
| 228 | Cardinal length, |
| 229 | XrmQuark property |
| 230 | ); |
| 231 | |
| 232 | void XawTextSourceClearEntities |
| 233 | ( |
| 234 | Widget w, |
| 235 | XawTextPosition left, |
| 236 | XawTextPosition right |
| 237 | ); |
| 238 | #endif |
| 239 | |
| 240 | #if 0 |
| 241 | typedef XawTextPosition (*_XawTextPositionFunc)(); |
| 242 | #endif |
| 243 | |
| 244 | #define XtInheritInput ((_XawTextPositionFunc)_XtInherit) |
| 245 | #define XtInheritRead ((_XawSrcReadProc)_XtInherit) |
| 246 | #define XtInheritReplace ((_XawSrcReplaceProc)_XtInherit) |
| 247 | #define XtInheritScan ((_XawSrcScanProc)_XtInherit) |
| 248 | #define XtInheritSearch ((_XawSrcSearchProc)_XtInherit) |
| 249 | #define XtInheritSetSelection ((_XawSrcSetSelectionProc)_XtInherit) |
| 250 | #define XtInheritConvertSelection ((_XawSrcConvertSelectionProc)_XtInherit) |
| 251 | #if 0 |
| 252 | #define XtTextSrcExtVersion 1 |
| 253 | #define XtTextSrcExtTypeString "XT_TEXTSRC_EXT" |
| 254 | #endif |
| 255 | |
| 256 | _XFUNCPROTOEND |
| 257 | |
| 258 | #endif |