1 /* $XConsortium: Text.h,v 1.45 94/04/17 20:13:05 kaleb Exp $ */
3 /***********************************************************
5 Copyright (c) 1987, 1988, 1994 X Consortium
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
29 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
33 Permission to use, copy, modify, and distribute this software and its
34 documentation for any purpose and without fee is hereby granted,
35 provided that the above copyright notice appear in all copies and that
36 both that copyright notice and this permission notice appear in
37 supporting documentation, and that the name of Digital not be
38 used in advertising or publicity pertaining to distribution of the
39 software without specific, written prior permission.
41 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
42 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
43 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
44 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
46 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
49 ******************************************************************/
54 #include <X11/Xaw/Simple.h>
59 Class: textWidgetClass
63 Resources added by the Text widget:
65 Name Class RepType Default Value
66 ---- ----- ------- -------------
67 autoFill AutoFill Boolean False
68 bottomMargin Margin Position 2
69 displayPosition TextPosition XawTextPosition 0
70 insertPosition TextPosition XawTextPosition 0
71 leftMargin Margin Position 2
72 resize Resize XawTextResizeMode XawTextResizeNever
73 rightMargin Margin Position 4
74 scrollHorizontal Scroll XawTextScrollMode XawtextScrollNever
75 scrollVertical Scroll XawTextScrollMode XawtextScrollNever
76 selectTypes SelectTypes Pointer see documentation
77 textSink TextSink Widget NULL
78 textSource TextSource Widget NULL
79 topMargin Margin Position 2
80 unrealizeCallback Callback Callback NULL
81 wrap Wrap XawTextWrapMode XawTextWrapNever
85 typedef long XawTextPosition
;
87 typedef enum { XawtextScrollNever
,
88 XawtextScrollWhenNeeded
, XawtextScrollAlways
} XawTextScrollMode
;
90 typedef enum { XawtextWrapNever
,
91 XawtextWrapLine
, XawtextWrapWord
} XawTextWrapMode
;
93 typedef enum { XawtextResizeNever
, XawtextResizeWidth
,
94 XawtextResizeHeight
, XawtextResizeBoth
} XawTextResizeMode
;
96 typedef enum {XawsdLeft
, XawsdRight
} XawTextScanDirection
;
97 typedef enum {XawtextRead
, XawtextAppend
, XawtextEdit
} XawTextEditType
;
98 typedef enum {XawselectNull
, XawselectPosition
, XawselectChar
, XawselectWord
,
99 XawselectLine
, XawselectParagraph
, XawselectAll
} XawTextSelectType
;
105 unsigned long format
;
106 } XawTextBlock
, *XawTextBlockPtr
;
108 #include <X11/Xaw/TextSink.h>
109 #include <X11/Xaw/TextSrc.h>
111 #define XtEtextScrollNever "never"
112 #define XtEtextScrollWhenNeeded "whenneeded"
113 #define XtEtextScrollAlways "always"
115 #define XtEtextWrapNever "never"
116 #define XtEtextWrapLine "line"
117 #define XtEtextWrapWord "word"
119 #define XtEtextResizeNever "never"
120 #define XtEtextResizeWidth "width"
121 #define XtEtextResizeHeight "height"
122 #define XtEtextResizeBoth "both"
124 #define XtNautoFill "autoFill"
125 #define XtNbottomMargin "bottomMargin"
126 #define XtNdialogHOffset "dialogHOffset"
127 #define XtNdialogVOffset "dialogVOffset"
128 #define XtNdisplayCaret "displayCaret"
129 #define XtNdisplayPosition "displayPosition"
130 #define XtNleftMargin "leftMargin"
131 #define XtNrightMargin "rightMargin"
132 #define XtNscrollVertical "scrollVertical"
133 #define XtNscrollHorizontal "scrollHorizontal"
134 #define XtNselectTypes "selectTypes"
135 #define XtNtopMargin "topMargin"
136 #define XtNwrap "wrap"
138 #define XtCAutoFill "AutoFill"
139 #define XtCScroll "Scroll"
140 #define XtCSelectTypes "SelectTypes"
141 #define XtCWrap "Wrap"
143 #ifndef _XtStringDefs_h_
144 #define XtNinsertPosition "insertPosition"
145 #define XtNresize "resize"
146 #define XtNselection "selection"
147 #define XtCResize "Resize"
150 /* Return Error code for XawTextSearch */
152 #define XawTextSearchError (-12345L)
154 /* Return codes from XawTextReplace */
156 #define XawReplaceError -1
157 #define XawEditDone 0
158 #define XawEditError 1
159 #define XawPositionError 2
161 extern unsigned long FMT8BIT
;
162 extern unsigned long XawFmt8Bit
;
163 extern unsigned long XawFmtWide
;
165 /* Class record constants */
167 extern WidgetClass textWidgetClass
;
169 typedef struct _TextClassRec
*TextWidgetClass
;
170 typedef struct _TextRec
*TextWidget
;
174 extern XrmQuark
_XawTextFormat(
175 #if NeedFunctionPrototypes
180 extern void XawTextDisplay(
181 #if NeedFunctionPrototypes
186 extern void XawTextEnableRedisplay(
187 #if NeedFunctionPrototypes
192 extern void XawTextDisableRedisplay(
193 #if NeedFunctionPrototypes
198 extern void XawTextSetSelectionArray(
199 #if NeedFunctionPrototypes
201 XawTextSelectType
* /* sarray */
205 extern void XawTextGetSelectionPos(
206 #if NeedFunctionPrototypes
208 XawTextPosition
* /* begin_return */,
209 XawTextPosition
* /* end_return */
213 extern void XawTextSetSource(
214 #if NeedFunctionPrototypes
217 XawTextPosition
/* position */
221 extern int XawTextReplace(
222 #if NeedFunctionPrototypes
224 XawTextPosition
/* start */,
225 XawTextPosition
/* end */,
226 XawTextBlock
* /* text */
230 extern XawTextPosition
XawTextTopPosition(
231 #if NeedFunctionPrototypes
236 extern void XawTextSetInsertionPoint(
237 #if NeedFunctionPrototypes
239 XawTextPosition
/* position */
243 extern XawTextPosition
XawTextGetInsertionPoint(
244 #if NeedFunctionPrototypes
249 extern void XawTextUnsetSelection(
250 #if NeedFunctionPrototypes
255 extern void XawTextSetSelection(
256 #if NeedFunctionPrototypes
258 XawTextPosition
/* left */,
259 XawTextPosition
/* right */
263 extern void XawTextInvalidate(
264 #if NeedFunctionPrototypes
266 XawTextPosition
/* from */,
267 XawTextPosition
/* to */
271 extern Widget
XawTextGetSource(
272 #if NeedFunctionPrototypes
277 extern XawTextPosition
XawTextSearch(
278 #if NeedFunctionPrototypes
280 #if NeedWidePrototypes
281 /* XawTextScanDirection */ int /* dir */,
283 XawTextScanDirection
/* dir */,
285 XawTextBlock
* /* text */
289 extern void XawTextDisplayCaret(
290 #if NeedFunctionPrototypes
292 #if NeedWidePrototypes
293 /* Boolean */ int /* visible */
295 Boolean
/* visible */
303 * For R3 compatability only.
306 #include <X11/Xaw/AsciiSrc.h>
307 #include <X11/Xaw/AsciiSink.h>
309 #endif /* _XawText_h */
310 /* DON'T ADD STUFF AFTER THIS #endif */