rust/cargo-c: update to 0.10.7+cargo-0.84.0
[oi-userland.git] / components / x11 / libXaw4 / src / Xaw3_1TextSink.h
blobc2ad36b6a5503b713bb1e35aaa748bc1358c89a3
1 /*
2 * $XConsortium: TextSink.h,v 1.5 89/11/01 17:28:26 kit Exp $
3 */
5 /***********************************************************
6 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
7 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
9 All Rights Reserved
11 Permission to use, copy, modify, and distribute this software and its
12 documentation for any purpose and without fee is hereby granted,
13 provided that the above copyright notice appear in all copies and that
14 both that copyright notice and this permission notice appear in
15 supporting documentation, and that the names of Digital or MIT not be
16 used in advertising or publicity pertaining to distribution of the
17 software without specific, written prior permission.
19 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
20 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
21 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
22 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
23 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
25 SOFTWARE.
27 ******************************************************************/
29 #ifndef _XawTextSink_h
30 #define _XawTextSink_h
32 /***********************************************************************
34 * TextSink Object
36 ***********************************************************************/
38 #include <X11/Object.h>
40 /* Resources:
42 Name Class RepType Default Value
43 ---- ----- ------- -------------
44 font Font XFontStruct * XtDefaultFont
45 foreground Foreground Pixel XtDefaultForeground
46 background Background Pixel XtDefaultBackground
50 /* Class record constants */
52 extern WidgetClass textSinkObjectClass;
54 typedef struct _TextSinkClassRec *TextSinkObjectClass;
55 typedef struct _TextSinkRec *TextSinkObject;
57 typedef enum {XawisOn, XawisOff} XawTextInsertState;
59 /************************************************************
61 * Public Functions.
63 ************************************************************/
65 /* Function Name: XawTextSinkDisplayText
66 * Description: Stub function that in subclasses will display text.
67 * Arguments: w - the TextSink Object.
68 * x, y - location to start drawing text.
69 * pos1, pos2 - location of starting and ending points
70 * in the text buffer.
71 * highlight - hightlight this text?
72 * Returns: none.
74 * This function doesn't actually display anything, it is only a place
75 * holder.
78 void XawTextSinkDisplayText(/* w, x, y, pos1, pos2, highlight */);
80 Widget w;
81 Position x, y;
82 Boolean highlight;
83 XawTextPosition pos1, pos2;
86 /* Function Name: XawTextSinkInsertCursor
87 * Description: Places the InsertCursor.
88 * Arguments: w - the TextSink Object.
89 * x, y - location for the cursor.
90 * staye - whether to turn the cursor on, or off.
91 * Returns: none.
93 * This function doesn't actually display anything, it is only a place
94 * holder.
97 void XawTextSinkInsertCursor( /* w, x, y, state */ );
99 Widget w;
100 Position x, y;
101 XawTextInsertState state;
104 /* Function Name: XawTextSinkClearToBackground
105 * Description: Clears a region of the sink to the background color.
106 * Arguments: w - the TextSink Object.
107 * x, y - location of area to clear.
108 * width, height - size of area to clear
109 * Returns: void.
111 * This function doesn't actually display anything, it is only a place
112 * holder.
115 void XawTextSinkClearToBackground (/* w, x, y, width, height */);
117 Widget w;
118 Position x, y;
119 Dimension width, height;
122 /* Function Name: XawTextSinkFindPosition
123 * Description: Finds a position in the text.
124 * Arguments: w - the TextSink Object.
125 * fromPos - reference position.
126 * fromX - reference location.
127 * width, - width of section to paint text.
128 * stopAtWordBreak - returned position is a word break?
129 * resPos - Position to return. *** RETURNED ***
130 * resWidth - Width actually used. *** RETURNED ***
131 * resHeight - Height actually used. *** RETURNED ***
132 * Returns: none (see above).
135 void XawTextSinkFindPosition(/* w, fromPos, fromx, width, stopAtWordBreak,
136 resPos, resWidth, resHeight */ );
138 Widget w;
139 XawTextPosition fromPos;
140 int fromx, width;
141 Boolean stopAtWordBreak;
142 XawTextPosition *resPos;
143 int *resWidth, *resHeight;
146 /* Function Name: XawTextSinkFindDistance
147 * Description: Find the Pixel Distance between two text Positions.
148 * Arguments: w - the TextSink Object.
149 * fromPos - starting Position.
150 * fromX - x location of starting Position.
151 * toPos - end Position.
152 * resWidth - Distance between fromPos and toPos.
153 * resPos - Acutal toPos used.
154 * resHeight - Height required by this text.
155 * Returns: none.
158 void XawTextSinkFindDistance (/* w, fromPos, fromx,
159 toPos, resWidth, resPos, resHeight */);
161 Widget w;
162 XawTextPosition fromPos, toPos, *resPos;
163 int fromx, *resWidth, *resHeight;
166 /* Function Name: XawTextSinkResolve
167 * Description: Resloves a location to a position.
168 * Arguments: w - the TextSink Object.
169 * pos - a reference Position.
170 * fromx - a reference Location.
171 * width - width to move.
172 * resPos - the resulting position.
173 * Returns: none
176 void XawTextSinkResolve(/* w, pos, fromx, width, resPos */);
178 Widget w;
179 XawTextPosition pos;
180 int fromx, width;
181 XawTextPosition *resPos;
184 /* Function Name: XawTextSinkMaxLines
185 * Description: Finds the Maximum number of lines that will fit in
186 * a given height.
187 * Arguments: w - the TextSink Object.
188 * height - height to fit lines into.
189 * Returns: the number of lines that will fit.
192 int XawTextSinkMaxLines(/* w, height */);
194 Widget w;
195 Dimension height;
198 /* Function Name: XawTextSinkMaxHeight
199 * Description: Finds the Minium height that will contain a given number
200 * lines.
201 * Arguments: w - the TextSink Object.
202 * lines - the number of lines.
203 * Returns: the height.
206 int XawTextSinkMaxHeight(/* w, lines */);
208 Widget w;
209 int lines;
212 /* Function Name: XawTextSinkSetTabs
213 * Description: Sets the Tab stops.
214 * Arguments: w - the TextSink Object.
215 * tab_count - the number of tabs in the list.
216 * tabs - the text positions of the tabs.
217 * Returns: none
220 void XawTextSinkSetTabs(/* w, tab_count, tabs */);
222 Widget w;
223 int tab_count, *tabs;
226 /* Function Name: XawTextSinkGetCursorBounds
227 * Description: Finds the bounding box for the insert curor (caret).
228 * Arguments: w - the TextSinkObject.
229 * rect - an X rectance containing the cursor bounds.
230 * Returns: none (fills in rect).
233 void XawTextSinkGetCursorBounds(/* w, rect */);
235 Widget w;
236 XRectangle * rect;
239 #endif /* _XawTextSrc_h -- DON'T ADD STUFF AFTER THIS #endif */