gtk+3: fix dependencies for new gnome/accessibility/at-spi2-core
[oi-userland.git] / components / x11 / libXaw5 / src / X11 / TextSink.h
bloba59608dcfe69afd6109875c006b9a704a8dc5a1c
1 /*
2 * $XConsortium: TextSink.h,v 1.10 94/04/17 20:13:12 kaleb Exp $
3 */
5 /***********************************************************
7 Copyright (c) 1987, 1988, 1994 X Consortium
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
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 X CONSORTIUM 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 X Consortium 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 X Consortium.
31 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
33 All Rights Reserved
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
49 SOFTWARE.
51 ******************************************************************/
53 #ifndef _XawTextSink_h
54 #define _XawTextSink_h
56 #include <X11/Xaw/Text.h>
58 /***********************************************************************
60 * TextSink Object
62 ***********************************************************************/
64 /* Resources:
66 Name Class RepType Default Value
67 ---- ----- ------- -------------
68 font Font XFontStruct * XtDefaultFont
69 foreground Foreground Pixel XtDefaultForeground
70 background Background Pixel XtDefaultBackground
74 /* Class record constants */
76 extern WidgetClass textSinkObjectClass;
78 typedef struct _TextSinkClassRec *TextSinkObjectClass;
79 typedef struct _TextSinkRec *TextSinkObject;
81 typedef enum {XawisOn, XawisOff} XawTextInsertState;
83 /************************************************************
85 * Public Functions.
87 ************************************************************/
89 _XFUNCPROTOBEGIN
91 /* Function Name: XawTextSinkDisplayText
92 * Description: Stub function that in subclasses will display text.
93 * Arguments: w - the TextSink Object.
94 * x, y - location to start drawing text.
95 * pos1, pos2 - location of starting and ending points
96 * in the text buffer.
97 * highlight - hightlight this text?
98 * Returns: none.
100 * This function doesn't actually display anything, it is only a place
101 * holder.
104 extern void XawTextSinkDisplayText(
105 #if NeedFunctionPrototypes
106 Widget /* w */,
107 #if NeedWidePrototypes
108 /* Position */ int /* x */,
109 /* Position */ int /* y */,
110 #else
111 Position /* x */,
112 Position /* y */,
113 #endif
114 XawTextPosition /* pos1 */,
115 XawTextPosition /* pos2 */,
116 #if NeedWidePrototypes
117 /* Boolean */ int /* highlight */
118 #else
119 Boolean /* highlight */
120 #endif
121 #endif
124 /* Function Name: XawTextSinkInsertCursor
125 * Description: Places the InsertCursor.
126 * Arguments: w - the TextSink Object.
127 * x, y - location for the cursor.
128 * staye - whether to turn the cursor on, or off.
129 * Returns: none.
131 * This function doesn't actually display anything, it is only a place
132 * holder.
135 extern void XawTextSinkInsertCursor(
136 #if NeedFunctionPrototypes
137 Widget /* w */,
138 #if NeedWidePrototypes
139 /* Position */ int /* x */,
140 /* Position */ int /* y */,
141 /* XawTextInsertState */ int /* state */
142 #else
143 Position /* x */,
144 Position /* y */,
145 XawTextInsertState /* state */
146 #endif
147 #endif
150 /* Function Name: XawTextSinkClearToBackground
151 * Description: Clears a region of the sink to the background color.
152 * Arguments: w - the TextSink Object.
153 * x, y - location of area to clear.
154 * width, height - size of area to clear
155 * Returns: void.
157 * This function doesn't actually display anything, it is only a place
158 * holder.
161 extern void XawTextSinkClearToBackground(
162 #if NeedFunctionPrototypes
163 Widget /* w */,
164 #if NeedWidePrototypes
165 /* Position */ int /* x */,
166 /* Position */ int /* y */,
167 /* Dimension */ int /* width */,
168 /* Dimension */ int /* height */
169 #else
170 Position /* x */,
171 Position /* y */,
172 Dimension /* width */,
173 Dimension /* height */
174 #endif
175 #endif
178 /* Function Name: XawTextSinkFindPosition
179 * Description: Finds a position in the text.
180 * Arguments: w - the TextSink Object.
181 * fromPos - reference position.
182 * fromX - reference location.
183 * width, - width of section to paint text.
184 * stopAtWordBreak - returned position is a word break?
185 * resPos - Position to return. *** RETURNED ***
186 * resWidth - Width actually used. *** RETURNED ***
187 * resHeight - Height actually used. *** RETURNED ***
188 * Returns: none (see above).
191 extern void XawTextSinkFindPosition(
192 #if NeedFunctionPrototypes
193 Widget /* w */,
194 XawTextPosition /* fromPos */,
195 int /* fromX */,
196 int /* width */,
197 #if NeedWidePrototypes
198 /* Boolean */ int /* stopAtWordBreak */,
199 #else
200 Boolean /* stopAtWordBreak */,
201 #endif
202 XawTextPosition* /* pos_return */,
203 int* /* width_return */,
204 int* /* height_return */
205 #endif
208 /* Function Name: XawTextSinkFindDistance
209 * Description: Find the Pixel Distance between two text Positions.
210 * Arguments: w - the TextSink Object.
211 * fromPos - starting Position.
212 * fromX - x location of starting Position.
213 * toPos - end Position.
214 * resWidth - Distance between fromPos and toPos.
215 * resPos - Acutal toPos used.
216 * resHeight - Height required by this text.
217 * Returns: none.
220 extern void XawTextSinkFindDistance (
221 #if NeedFunctionPrototypes
222 Widget /* w */,
223 XawTextPosition /* fromPos */,
224 int /* fromX */,
225 XawTextPosition /* toPos */,
226 int* /* width_return */,
227 XawTextPosition* /* pos_return */,
228 int* /* height_return */
229 #endif
232 /* Function Name: XawTextSinkResolve
233 * Description: Resloves a location to a position.
234 * Arguments: w - the TextSink Object.
235 * pos - a reference Position.
236 * fromx - a reference Location.
237 * width - width to move.
238 * resPos - the resulting position.
239 * Returns: none
242 extern void XawTextSinkResolve(
243 #if NeedFunctionPrototypes
244 Widget /* w */,
245 XawTextPosition /* fromPos */,
246 int /* fromX */,
247 int /* width */,
248 XawTextPosition* /* pos_return */
249 #endif
252 /* Function Name: XawTextSinkMaxLines
253 * Description: Finds the Maximum number of lines that will fit in
254 * a given height.
255 * Arguments: w - the TextSink Object.
256 * height - height to fit lines into.
257 * Returns: the number of lines that will fit.
260 extern int XawTextSinkMaxLines(
261 #if NeedFunctionPrototypes
262 Widget /* w */,
263 #if NeedWidePrototypes
264 /* Dimension */ int /* height */
265 #else
266 Dimension /* height */
267 #endif
268 #endif
271 /* Function Name: XawTextSinkMaxHeight
272 * Description: Finds the Minium height that will contain a given number
273 * lines.
274 * Arguments: w - the TextSink Object.
275 * lines - the number of lines.
276 * Returns: the height.
279 extern int XawTextSinkMaxHeight(
280 #if NeedFunctionPrototypes
281 Widget /* w */,
282 int /* lines */
283 #endif
286 /* Function Name: XawTextSinkSetTabs
287 * Description: Sets the Tab stops.
288 * Arguments: w - the TextSink Object.
289 * tab_count - the number of tabs in the list.
290 * tabs - the text positions of the tabs.
291 * Returns: none
294 extern void XawTextSinkSetTabs(
295 #if NeedFunctionPrototypes
296 Widget /* w */,
297 int /* tab_count */,
298 int* /* tabs */
299 #endif
302 /* Function Name: XawTextSinkGetCursorBounds
303 * Description: Finds the bounding box for the insert curor (caret).
304 * Arguments: w - the TextSinkObject.
305 * rect - an X rectance containing the cursor bounds.
306 * Returns: none (fills in rect).
309 extern void XawTextSinkGetCursorBounds(
310 #if NeedFunctionPrototypes
311 Widget /* w */,
312 XRectangle* /* rect_return */
313 #endif
316 _XFUNCPROTOEND
318 #endif /* _XawTextSrc_h */