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 _XawTextSinkP_h
0049 #define _XawTextSinkP_h
0050
0051
0052
0053
0054 #include <X11/Xaw/TextSink.h>
0055 #include <X11/Xaw/TextP.h> /* This sink works with the Text widget */
0056 #include <X11/Xaw/TextSrcP.h> /* This sink works with the Text Source */
0057 #include <X11/Xmu/Xmu.h>
0058
0059 #ifndef OLDXAW
0060
0061 #define XAW_TPROP_FONT (1<<0)
0062 #define XAW_TPROP_FONTSET (1<<1)
0063
0064
0065 #define XAW_TPROP_FOREGROUND (1<<2)
0066 #define XAW_TPROP_BACKGROUND (1<<3)
0067 #define XAW_TPROP_FPIXMAP (1<<4)
0068 #define XAW_TPROP_BPIXMAP (1<<5)
0069 #define XAW_TPROP_UNDERLINE (1<<6)
0070 #define XAW_TPROP_OVERSTRIKE (1<<7)
0071 #define XAW_TPROP_SUBSCRIPT (1<<8)
0072 #define XAW_TPROP_SUPERSCRIPT (1<<9)
0073
0074
0075 #define XAW_TPROP_FOUNDRY (1<<0)
0076 #define XAW_TPROP_FAMILY (1<<1)
0077 #define XAW_TPROP_WEIGHT (1<<2)
0078 #define XAW_TPROP_SLANT (1<<3)
0079 #define XAW_TPROP_SETWIDTH (1<<4)
0080 #define XAW_TPROP_ADDSTYLE (1<<5)
0081 #define XAW_TPROP_PIXELSIZE (1<<6)
0082 #define XAW_TPROP_POINTSIZE (1<<7)
0083 #define XAW_TPROP_RESX (1<<8)
0084 #define XAW_TPROP_RESY (1<<9)
0085 #define XAW_TPROP_SPACING (1<<10)
0086 #define XAW_TPROP_AVGWIDTH (1<<11)
0087 #define XAW_TPROP_REGISTRY (1<<12)
0088 #define XAW_TPROP_ENCODING (1<<13)
0089 struct _XawTextProperty {
0090 XrmQuark identifier, code;
0091 unsigned long mask;
0092 XFontStruct *font;
0093 XFontSet fontset;
0094 Pixel foreground, background;
0095 Pixmap foreground_pixmap, background_pixmap;
0096 XrmQuark xlfd;
0097
0098 unsigned long xlfd_mask;
0099 XrmQuark foundry, family, weight, slant, setwidth, addstyle, pixel_size,
0100 point_size, res_x, res_y, spacing, avgwidth, registry, encoding;
0101
0102 short underline_position, underline_thickness;
0103 };
0104
0105 struct _XawTextPropertyList {
0106 XrmQuark identifier;
0107 Screen *screen;
0108 Colormap colormap;
0109 int depth;
0110 XawTextProperty **properties;
0111 Cardinal num_properties;
0112 XawTextPropertyList *next;
0113 };
0114
0115 typedef struct _XawTextPaintStruct XawTextPaintStruct;
0116 struct _XawTextPaintStruct {
0117 XawTextPaintStruct *next;
0118 int x, y, width;
0119 char *text;
0120 Cardinal length;
0121 XawTextProperty *property;
0122 int max_ascent, max_descent;
0123 XmuArea *backtabs;
0124 Boolean highlight;
0125 };
0126
0127 typedef struct {
0128 XmuArea *clip, *hightabs;
0129 XawTextPaintStruct *paint, *bearings;
0130 } XawTextPaintList;
0131
0132 typedef struct {
0133 XtPointer next_extension;
0134 XrmQuark record_type;
0135 long version;
0136 Cardinal record_size;
0137 Bool (*BeginPaint)(Widget);
0138 void (*PreparePaint)(Widget, int, int,
0139 XawTextPosition, XawTextPosition, Bool);
0140 void (*DoPaint)(Widget);
0141 Bool (*EndPaint)(Widget);
0142 } TextSinkExtRec, *TextSinkExt;
0143 #endif
0144
0145 typedef void (*_XawSinkDisplayTextProc)
0146 (Widget, int, int, XawTextPosition, XawTextPosition, Bool);
0147
0148 typedef void (*_XawSinkInsertCursorProc)
0149 (Widget, int, int, XawTextInsertState);
0150
0151 typedef void (*_XawSinkClearToBackgroundProc)
0152 (Widget, int, int, unsigned int, unsigned int);
0153
0154 typedef void (*_XawSinkFindPositionProc)
0155 (Widget, XawTextPosition, int, int, Bool, XawTextPosition*, int*, int*);
0156
0157 typedef void (*_XawSinkFindDistanceProc)
0158 (Widget, XawTextPosition, int, XawTextPosition, int*,
0159 XawTextPosition*, int*);
0160
0161 typedef void (*_XawSinkResolveProc)
0162 (Widget, XawTextPosition, int, int, XawTextPosition*);
0163
0164 typedef int (*_XawSinkMaxLinesProc)
0165 (Widget, unsigned int);
0166
0167 typedef int (*_XawSinkMaxHeightProc)
0168 (Widget, int);
0169
0170 typedef void (*_XawSinkSetTabsProc)
0171 (Widget, int, short*);
0172
0173 typedef void (*_XawSinkGetCursorBoundsProc)
0174 (Widget, XRectangle*);
0175
0176 typedef struct _TextSinkClassPart {
0177 _XawSinkDisplayTextProc DisplayText;
0178 _XawSinkInsertCursorProc InsertCursor;
0179 _XawSinkClearToBackgroundProc ClearToBackground;
0180 _XawSinkFindPositionProc FindPosition;
0181 _XawSinkFindDistanceProc FindDistance;
0182 _XawSinkResolveProc Resolve;
0183 _XawSinkMaxLinesProc MaxLines;
0184 _XawSinkMaxHeightProc MaxHeight;
0185 _XawSinkSetTabsProc SetTabs;
0186 _XawSinkGetCursorBoundsProc GetCursorBounds;
0187 #ifndef OLDXAW
0188 TextSinkExt extension;
0189 #endif
0190 } TextSinkClassPart;
0191
0192
0193 typedef struct _TextSinkClassRec {
0194 ObjectClassPart object_class;
0195 TextSinkClassPart text_sink_class;
0196 } TextSinkClassRec;
0197
0198 extern TextSinkClassRec textSinkClassRec;
0199
0200
0201 typedef struct {
0202
0203 Pixel foreground;
0204 Pixel background;
0205
0206
0207 Position *tabs;
0208 short *char_tabs;
0209 int tab_count;
0210
0211 #ifndef OLDXAW
0212
0213 Pixel cursor_color;
0214 XawTextPropertyList *properties;
0215 XawTextPaintList *paint;
0216 XtPointer pad[2];
0217 #endif
0218 } TextSinkPart;
0219
0220
0221 typedef struct _TextSinkRec {
0222 ObjectPart object;
0223 TextSinkPart text_sink;
0224 } TextSinkRec;
0225
0226
0227 #ifndef OLDXAW
0228 XawTextPropertyList *XawTextSinkConvertPropertyList
0229 (
0230 String name,
0231 String spec,
0232 Screen *screen,
0233 Colormap Colormap,
0234 int depth
0235 );
0236
0237 XawTextProperty *XawTextSinkGetProperty
0238 (
0239 Widget w,
0240 XrmQuark property
0241 );
0242
0243 XawTextProperty *XawTextSinkCopyProperty
0244 (
0245 Widget w,
0246 XrmQuark property
0247 );
0248
0249 XawTextProperty *XawTextSinkAddProperty
0250 (
0251 Widget w,
0252 XawTextProperty *property
0253 );
0254
0255 XawTextProperty *XawTextSinkCombineProperty
0256 (
0257 Widget w,
0258 XawTextProperty *result_in_out,
0259 XawTextProperty *property,
0260 Bool override
0261 );
0262
0263 Bool XawTextSinkBeginPaint
0264 (
0265 Widget w
0266 );
0267
0268 void XawTextSinkPreparePaint
0269 (
0270 Widget w,
0271 int y,
0272 int line,
0273 XawTextPosition from,
0274 XawTextPosition to,
0275 Bool highlight
0276 );
0277
0278 void XawTextSinkDoPaint
0279 (
0280 Widget w
0281 );
0282
0283 Bool XawTextSinkEndPaint
0284 (
0285 Widget w
0286 );
0287 #endif
0288
0289 #define XtInheritDisplayText ((_XawSinkDisplayTextProc)_XtInherit)
0290 #define XtInheritInsertCursor ((_XawSinkInsertCursorProc)_XtInherit)
0291 #define XtInheritClearToBackground ((_XawSinkClearToBackgroundProc)_XtInherit)
0292 #define XtInheritFindPosition ((_XawSinkFindPositionProc)_XtInherit)
0293 #define XtInheritFindDistance ((_XawSinkFindDistanceProc)_XtInherit)
0294 #define XtInheritResolve ((_XawSinkResolveProc)_XtInherit)
0295 #define XtInheritMaxLines ((_XawSinkMaxLinesProc)_XtInherit)
0296 #define XtInheritMaxHeight ((_XawSinkMaxHeightProc)_XtInherit)
0297 #define XtInheritSetTabs ((_XawSinkSetTabsProc)_XtInherit)
0298 #define XtInheritGetCursorBounds ((_XawSinkGetCursorBoundsProc)_XtInherit)
0299
0300 #endif