| 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 _XawTextSinkP_h |
| 49 | #define _XawTextSinkP_h |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | #include <X11/Xaw/TextSink.h> |
| 55 | #include <X11/Xaw/TextP.h> |
| 56 | #include <X11/Xaw/TextSrcP.h> |
| 57 | #include <X11/Xmu/Xmu.h> |
| 58 | |
| 59 | #ifndef OLDXAW |
| 60 | |
| 61 | #define XAW_TPROP_FONT (1<<0) |
| 62 | #define XAW_TPROP_FONTSET (1<<1) |
| 63 | |
| 64 | |
| 65 | #define XAW_TPROP_FOREGROUND (1<<2) |
| 66 | #define XAW_TPROP_BACKGROUND (1<<3) |
| 67 | #define XAW_TPROP_FPIXMAP (1<<4) |
| 68 | #define XAW_TPROP_BPIXMAP (1<<5) |
| 69 | #define XAW_TPROP_UNDERLINE (1<<6) |
| 70 | #define XAW_TPROP_OVERSTRIKE (1<<7) |
| 71 | #define XAW_TPROP_SUBSCRIPT (1<<8) |
| 72 | #define XAW_TPROP_SUPERSCRIPT (1<<9) |
| 73 | |
| 74 | |
| 75 | #define XAW_TPROP_FOUNDRY (1<<0) |
| 76 | #define XAW_TPROP_FAMILY (1<<1) |
| 77 | #define XAW_TPROP_WEIGHT (1<<2) |
| 78 | #define XAW_TPROP_SLANT (1<<3) |
| 79 | #define XAW_TPROP_SETWIDTH (1<<4) |
| 80 | #define XAW_TPROP_ADDSTYLE (1<<5) |
| 81 | #define XAW_TPROP_PIXELSIZE (1<<6) |
| 82 | #define XAW_TPROP_POINTSIZE (1<<7) |
| 83 | #define XAW_TPROP_RESX (1<<8) |
| 84 | #define XAW_TPROP_RESY (1<<9) |
| 85 | #define XAW_TPROP_SPACING (1<<10) |
| 86 | #define XAW_TPROP_AVGWIDTH (1<<11) |
| 87 | #define XAW_TPROP_REGISTRY (1<<12) |
| 88 | #define XAW_TPROP_ENCODING (1<<13) |
| 89 | struct _XawTextProperty { |
| 90 | XrmQuark identifier, code; |
| 91 | unsigned long mask; |
| 92 | XFontStruct *font; |
| 93 | XFontSet fontset; |
| 94 | Pixel foreground, background; |
| 95 | Pixmap foreground_pixmap, background_pixmap; |
| 96 | XrmQuark xlfd; |
| 97 | |
| 98 | unsigned long xlfd_mask; |
| 99 | XrmQuark foundry, family, weight, slant, setwidth, addstyle, pixel_size, |
| 100 | point_size, res_x, res_y, spacing, avgwidth, registry, encoding; |
| 101 | |
| 102 | short underline_position, underline_thickness; |
| 103 | }; |
| 104 | |
| 105 | struct _XawTextPropertyList { |
| 106 | XrmQuark identifier; |
| 107 | Screen *screen; |
| 108 | Colormap colormap; |
| 109 | int depth; |
| 110 | XawTextProperty **properties; |
| 111 | Cardinal num_properties; |
| 112 | XawTextPropertyList *next; |
| 113 | }; |
| 114 | |
| 115 | typedef struct _XawTextPaintStruct XawTextPaintStruct; |
| 116 | struct _XawTextPaintStruct { |
| 117 | XawTextPaintStruct *next; |
| 118 | int x, y, width; |
| 119 | char *text; |
| 120 | Cardinal length; |
| 121 | XawTextProperty *property; |
| 122 | int max_ascent, max_descent; |
| 123 | XmuArea *backtabs; |
| 124 | Boolean highlight; |
| 125 | }; |
| 126 | |
| 127 | typedef struct { |
| 128 | XmuArea *clip, *hightabs; |
| 129 | XawTextPaintStruct *paint, *bearings; |
| 130 | } XawTextPaintList; |
| 131 | |
| 132 | typedef struct { |
| 133 | XtPointer next_extension; |
| 134 | XrmQuark record_type; |
| 135 | long version; |
| 136 | Cardinal record_size; |
| 137 | Bool (*BeginPaint)(Widget); |
| 138 | void (*PreparePaint)(Widget, int, int, |
| 139 | XawTextPosition, XawTextPosition, Bool); |
| 140 | void (*DoPaint)(Widget); |
| 141 | Bool (*EndPaint)(Widget); |
| 142 | } TextSinkExtRec, *TextSinkExt; |
| 143 | #endif |
| 144 | |
| 145 | typedef void (*_XawSinkDisplayTextProc) |
| 146 | (Widget, int, int, XawTextPosition, XawTextPosition, Bool); |
| 147 | |
| 148 | typedef void (*_XawSinkInsertCursorProc) |
| 149 | (Widget, int, int, XawTextInsertState); |
| 150 | |
| 151 | typedef void (*_XawSinkClearToBackgroundProc) |
| 152 | (Widget, int, int, unsigned int, unsigned int); |
| 153 | |
| 154 | typedef void (*_XawSinkFindPositionProc) |
| 155 | (Widget, XawTextPosition, int, int, Bool, XawTextPosition*, int*, int*); |
| 156 | |
| 157 | typedef void (*_XawSinkFindDistanceProc) |
| 158 | (Widget, XawTextPosition, int, XawTextPosition, int*, |
| 159 | XawTextPosition*, int*); |
| 160 | |
| 161 | typedef void (*_XawSinkResolveProc) |
| 162 | (Widget, XawTextPosition, int, int, XawTextPosition*); |
| 163 | |
| 164 | typedef int (*_XawSinkMaxLinesProc) |
| 165 | (Widget, unsigned int); |
| 166 | |
| 167 | typedef int (*_XawSinkMaxHeightProc) |
| 168 | (Widget, int); |
| 169 | |
| 170 | typedef void (*_XawSinkSetTabsProc) |
| 171 | (Widget, int, short*); |
| 172 | |
| 173 | typedef void (*_XawSinkGetCursorBoundsProc) |
| 174 | (Widget, XRectangle*); |
| 175 | |
| 176 | typedef struct _TextSinkClassPart { |
| 177 | _XawSinkDisplayTextProc DisplayText; |
| 178 | _XawSinkInsertCursorProc InsertCursor; |
| 179 | _XawSinkClearToBackgroundProc ClearToBackground; |
| 180 | _XawSinkFindPositionProc FindPosition; |
| 181 | _XawSinkFindDistanceProc FindDistance; |
| 182 | _XawSinkResolveProc Resolve; |
| 183 | _XawSinkMaxLinesProc MaxLines; |
| 184 | _XawSinkMaxHeightProc MaxHeight; |
| 185 | _XawSinkSetTabsProc SetTabs; |
| 186 | _XawSinkGetCursorBoundsProc GetCursorBounds; |
| 187 | #ifndef OLDXAW |
| 188 | TextSinkExt extension; |
| 189 | #endif |
| 190 | } TextSinkClassPart; |
| 191 | |
| 192 | |
| 193 | typedef struct _TextSinkClassRec { |
| 194 | ObjectClassPart object_class; |
| 195 | TextSinkClassPart text_sink_class; |
| 196 | } TextSinkClassRec; |
| 197 | |
| 198 | extern TextSinkClassRec textSinkClassRec; |
| 199 | |
| 200 | |
| 201 | typedef struct { |
| 202 | |
| 203 | Pixel foreground; |
| 204 | Pixel background; |
| 205 | |
| 206 | |
| 207 | Position *tabs; |
| 208 | short *char_tabs; |
| 209 | int tab_count; |
| 210 | |
| 211 | #ifndef OLDXAW |
| 212 | |
| 213 | Pixel cursor_color; |
| 214 | XawTextPropertyList *properties; |
| 215 | XawTextPaintList *paint; |
| 216 | XtPointer pad[2]; |
| 217 | #endif |
| 218 | } TextSinkPart; |
| 219 | |
| 220 | |
| 221 | typedef struct _TextSinkRec { |
| 222 | ObjectPart object; |
| 223 | TextSinkPart text_sink; |
| 224 | } TextSinkRec; |
| 225 | |
| 226 | |
| 227 | #ifndef OLDXAW |
| 228 | XawTextPropertyList *XawTextSinkConvertPropertyList |
| 229 | ( |
| 230 | String name, |
| 231 | String spec, |
| 232 | Screen *screen, |
| 233 | Colormap Colormap, |
| 234 | int depth |
| 235 | ); |
| 236 | |
| 237 | XawTextProperty *XawTextSinkGetProperty |
| 238 | ( |
| 239 | Widget w, |
| 240 | XrmQuark property |
| 241 | ); |
| 242 | |
| 243 | XawTextProperty *XawTextSinkCopyProperty |
| 244 | ( |
| 245 | Widget w, |
| 246 | XrmQuark property |
| 247 | ); |
| 248 | |
| 249 | XawTextProperty *XawTextSinkAddProperty |
| 250 | ( |
| 251 | Widget w, |
| 252 | XawTextProperty *property |
| 253 | ); |
| 254 | |
| 255 | XawTextProperty *XawTextSinkCombineProperty |
| 256 | ( |
| 257 | Widget w, |
| 258 | XawTextProperty *result_in_out, |
| 259 | XawTextProperty *property, |
| 260 | Bool override |
| 261 | ); |
| 262 | |
| 263 | Bool XawTextSinkBeginPaint |
| 264 | ( |
| 265 | Widget w |
| 266 | ); |
| 267 | |
| 268 | void XawTextSinkPreparePaint |
| 269 | ( |
| 270 | Widget w, |
| 271 | int y, |
| 272 | int line, |
| 273 | XawTextPosition from, |
| 274 | XawTextPosition to, |
| 275 | Bool highlight |
| 276 | ); |
| 277 | |
| 278 | void XawTextSinkDoPaint |
| 279 | ( |
| 280 | Widget w |
| 281 | ); |
| 282 | |
| 283 | Bool XawTextSinkEndPaint |
| 284 | ( |
| 285 | Widget w |
| 286 | ); |
| 287 | #endif |
| 288 | |
| 289 | #define XtInheritDisplayText ((_XawSinkDisplayTextProc)_XtInherit) |
| 290 | #define XtInheritInsertCursor ((_XawSinkInsertCursorProc)_XtInherit) |
| 291 | #define XtInheritClearToBackground ((_XawSinkClearToBackgroundProc)_XtInherit) |
| 292 | #define XtInheritFindPosition ((_XawSinkFindPositionProc)_XtInherit) |
| 293 | #define XtInheritFindDistance ((_XawSinkFindDistanceProc)_XtInherit) |
| 294 | #define XtInheritResolve ((_XawSinkResolveProc)_XtInherit) |
| 295 | #define XtInheritMaxLines ((_XawSinkMaxLinesProc)_XtInherit) |
| 296 | #define XtInheritMaxHeight ((_XawSinkMaxHeightProc)_XtInherit) |
| 297 | #define XtInheritSetTabs ((_XawSinkSetTabsProc)_XtInherit) |
| 298 | #define XtInheritGetCursorBounds ((_XawSinkGetCursorBoundsProc)_XtInherit) |
| 299 | |
| 300 | #endif |