2
* $Xorg: TextSinkP.h,v 1.4 2001/02/09 02:03:46 xorgcvs Exp $
6
/***********************************************************
8
Copyright 1987, 1988, 1994, 1998 The Open Group
10
Permission to use, copy, modify, distribute, and sell this software and its
11
documentation for any purpose is hereby granted without fee, provided that
12
the above copyright notice appear in all copies and that both that
13
copyright notice and this permission notice appear in supporting
16
The above copyright notice and this permission notice shall be included in
17
all copies or substantial portions of the Software.
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
Except as contained in this notice, the name of The Open Group shall not be
27
used in advertising or otherwise to promote the sale, use or other dealings
28
in this Software without prior written authorization from The Open Group.
31
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
35
Permission to use, copy, modify, and distribute this software and its
36
documentation for any purpose and without fee is hereby granted,
37
provided that the above copyright notice appear in all copies and that
38
both that copyright notice and this permission notice appear in
39
supporting documentation, and that the name of Digital not be
40
used in advertising or publicity pertaining to distribution of the
41
software without specific, written prior permission.
43
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
44
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
45
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
46
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
47
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
48
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
51
******************************************************************/
52
/* $XFree86: xc/lib/Xaw/TextSinkP.h,v 1.12 2001/12/14 19:54:45 dawes Exp $ */
54
#ifndef _XawTextSinkP_h
55
#define _XawTextSinkP_h
58
* TextSink Object Private Data
60
#include <X11/Xaw/TextSink.h>
61
#include <X11/Xaw/TextP.h> /* This sink works with the Text widget */
62
#include <X11/Xaw/TextSrcP.h> /* This sink works with the Text Source */
63
#include <X11/Xmu/Xmu.h>
66
/* font/fontset defined? */
67
#define XAW_TPROP_FONT (1<<0)
68
#define XAW_TPROP_FONTSET (1<<1)
70
/* extra attributes */
71
#define XAW_TPROP_FOREGROUND (1<<2)
72
#define XAW_TPROP_BACKGROUND (1<<3)
73
#define XAW_TPROP_FPIXMAP (1<<4)
74
#define XAW_TPROP_BPIXMAP (1<<5)
75
#define XAW_TPROP_UNDERLINE (1<<6)
76
#define XAW_TPROP_OVERSTRIKE (1<<7)
77
#define XAW_TPROP_SUBSCRIPT (1<<8)
78
#define XAW_TPROP_SUPERSCRIPT (1<<9)
81
#define XAW_TPROP_FOUNDRY (1<<0)
82
#define XAW_TPROP_FAMILY (1<<1)
83
#define XAW_TPROP_WEIGHT (1<<2)
84
#define XAW_TPROP_SLANT (1<<3)
85
#define XAW_TPROP_SETWIDTH (1<<4)
86
#define XAW_TPROP_ADDSTYLE (1<<5)
87
#define XAW_TPROP_PIXELSIZE (1<<6)
88
#define XAW_TPROP_POINTSIZE (1<<7)
89
#define XAW_TPROP_RESX (1<<8)
90
#define XAW_TPROP_RESY (1<<9)
91
#define XAW_TPROP_SPACING (1<<10)
92
#define XAW_TPROP_AVGWIDTH (1<<11)
93
#define XAW_TPROP_REGISTRY (1<<12)
94
#define XAW_TPROP_ENCODING (1<<13)
95
struct _XawTextProperty { /* to be extended/modified */
96
XrmQuark identifier, code;
100
Pixel foreground, background;
101
Pixmap foreground_pixmap, background_pixmap;
104
unsigned long xlfd_mask;
105
XrmQuark foundry, family, weight, slant, setwidth, addstyle, pixel_size,
106
point_size, res_x, res_y, spacing, avgwidth, registry, encoding;
108
short underline_position, underline_thickness;
111
struct _XawTextPropertyList {
116
XawTextProperty **properties;
117
Cardinal num_properties;
118
XawTextPropertyList *next;
121
typedef struct _XawTextPaintStruct XawTextPaintStruct;
122
struct _XawTextPaintStruct {
123
XawTextPaintStruct *next;
125
char *text; /* formatted text */
126
Cardinal length; /* length of text */
127
XawTextProperty *property;
128
int max_ascent, max_descent;
134
XmuArea *clip, *hightabs; /* clip list */
135
XawTextPaintStruct *paint, *bearings; /* drawing information */
139
XtPointer next_extension;
140
XrmQuark record_type;
142
Cardinal record_size;
143
Bool (*BeginPaint)(Widget);
144
void (*PreparePaint)(Widget, int, int,
145
XawTextPosition, XawTextPosition, Bool);
146
void (*DoPaint)(Widget);
147
Bool (*EndPaint)(Widget);
148
} TextSinkExtRec, *TextSinkExt;
151
typedef void (*_XawSinkDisplayTextProc)
152
(Widget, int, int, XawTextPosition, XawTextPosition, Bool);
154
typedef void (*_XawSinkInsertCursorProc)
155
(Widget, int, int, XawTextInsertState);
157
typedef void (*_XawSinkClearToBackgroundProc)
158
(Widget, int, int, unsigned int, unsigned int);
160
typedef void (*_XawSinkFindPositionProc)
161
(Widget, XawTextPosition, int, int, Bool, XawTextPosition*, int*, int*);
163
typedef void (*_XawSinkFindDistanceProc)
164
(Widget, XawTextPosition, int, XawTextPosition, int*,
165
XawTextPosition*, int*);
167
typedef void (*_XawSinkResolveProc)
168
(Widget, XawTextPosition, int, int, XawTextPosition*);
170
typedef int (*_XawSinkMaxLinesProc)
171
(Widget, unsigned int);
173
typedef int (*_XawSinkMaxHeightProc)
176
typedef void (*_XawSinkSetTabsProc)
177
(Widget, int, short*);
179
typedef void (*_XawSinkGetCursorBoundsProc)
180
(Widget, XRectangle*);
182
typedef struct _TextSinkClassPart {
183
_XawSinkDisplayTextProc DisplayText;
184
_XawSinkInsertCursorProc InsertCursor;
185
_XawSinkClearToBackgroundProc ClearToBackground;
186
_XawSinkFindPositionProc FindPosition;
187
_XawSinkFindDistanceProc FindDistance;
188
_XawSinkResolveProc Resolve;
189
_XawSinkMaxLinesProc MaxLines;
190
_XawSinkMaxHeightProc MaxHeight;
191
_XawSinkSetTabsProc SetTabs;
192
_XawSinkGetCursorBoundsProc GetCursorBounds;
194
TextSinkExt extension;
198
/* Full class record */
199
typedef struct _TextSinkClassRec {
200
ObjectClassPart object_class;
201
TextSinkClassPart text_sink_class;
204
extern TextSinkClassRec textSinkClassRec;
206
/* New fields for the TextSink object */
209
Pixel foreground; /* Foreground color */
210
Pixel background; /* Background color */
213
Position *tabs; /* The tab stops as pixel values */
214
short *char_tabs; /* The tabs stops as character values */
215
int tab_count; /* number of items in tabs */
220
XawTextPropertyList *properties;
221
XawTextPaintList *paint;
222
XtPointer pad[2]; /* for future use and keep binary compatability */
226
/* Full instance record */
227
typedef struct _TextSinkRec {
229
TextSinkPart text_sink;
232
/* Semi private routines */
234
XawTextPropertyList *XawTextSinkConvertPropertyList
243
XawTextProperty *XawTextSinkGetProperty
249
XawTextProperty *XawTextSinkCopyProperty
255
XawTextProperty *XawTextSinkAddProperty
258
XawTextProperty *property
261
XawTextProperty *XawTextSinkCombineProperty
264
XawTextProperty *result_in_out,
265
XawTextProperty *property,
269
Bool XawTextSinkBeginPaint
274
void XawTextSinkPreparePaint
279
XawTextPosition from,
284
void XawTextSinkDoPaint
289
Bool XawTextSinkEndPaint
295
#define XtInheritDisplayText ((_XawSinkDisplayTextProc)_XtInherit)
296
#define XtInheritInsertCursor ((_XawSinkInsertCursorProc)_XtInherit)
297
#define XtInheritClearToBackground ((_XawSinkClearToBackgroundProc)_XtInherit)
298
#define XtInheritFindPosition ((_XawSinkFindPositionProc)_XtInherit)
299
#define XtInheritFindDistance ((_XawSinkFindDistanceProc)_XtInherit)
300
#define XtInheritResolve ((_XawSinkResolveProc)_XtInherit)
301
#define XtInheritMaxLines ((_XawSinkMaxLinesProc)_XtInherit)
302
#define XtInheritMaxHeight ((_XawSinkMaxHeightProc)_XtInherit)
303
#define XtInheritSetTabs ((_XawSinkSetTabsProc)_XtInherit)
304
#define XtInheritGetCursorBounds ((_XawSinkGetCursorBoundsProc)_XtInherit)
306
#endif /* _XawTextSinkP_h */