Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:26:36

0001 /***********************************************************
0002 
0003 Copyright 1987, 1988, 1994, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024 
0025 
0026 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
0027 
0028                         All Rights Reserved
0029 
0030 Permission to use, copy, modify, and distribute this software and its
0031 documentation for any purpose and without fee is hereby granted,
0032 provided that the above copyright notice appear in all copies and that
0033 both that copyright notice and this permission notice appear in
0034 supporting documentation, and that the name of Digital not be
0035 used in advertising or publicity pertaining to distribution of the
0036 software without specific, written prior permission.
0037 
0038 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
0039 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
0040 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
0041 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
0042 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
0043 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
0044 SOFTWARE.
0045 
0046 ******************************************************************/
0047 
0048 #ifndef _XawText_h
0049 #define _XawText_h
0050 
0051 #include <X11/Xaw/Simple.h>
0052 
0053 /*
0054 
0055  Class:     textWidgetClass
0056  Class Name:    Text
0057  Superclass:    Simple
0058 
0059  Resources added by the Text widget:
0060 
0061  Name            Class       RepType        Default Value
0062  ----            -----       -------        -------------
0063  autoFill       AutoFill         Boolean        False
0064  bottomMargin       Margin       Position       2
0065  displayPosition    TextPosition     XawTextPosition    0
0066  insertPosition     TextPosition     XawTextPosition    0
0067  justify        JustifyMode      JustifyMode    left
0068  leftColumn     Column       Column     0
0069  rightColumn        Column       Column     0
0070  leftMargin     Margin       Position       2
0071  rightMargin        Margin       Position       4
0072  positionCallback   Callback         Callback       NULL
0073  scrollHorizontal   Scroll       Boolean        False
0074  scrollVertical     Scroll       Boolean        False
0075  selectTypes        SelectTypes      Pointer            see documentation
0076  textSink       TextSink         Widget     NULL
0077  textSource     TextSource       Widget     NULL
0078  topMargin      Margin       Position       2
0079  unrealizeCallback  Callback         Callback       NULL
0080  wrap           Wrap         XawTextWrapMode    XawTextWrapNever
0081 
0082 */
0083 
0084 typedef long XawTextPosition;
0085 
0086 #ifndef notdef
0087 typedef enum {
0088   XawtextScrollNever,
0089   XawtextScrollWhenNeeded,
0090   XawtextScrollAlways
0091 } XawTextScrollMode;
0092 
0093 typedef enum {
0094   XawtextResizeNever,
0095   XawtextResizeWidth,
0096   XawtextResizeHeight,
0097   XawtextResizeBoth
0098 } XawTextResizeMode;
0099 #endif
0100 
0101 typedef enum {
0102   XawtextWrapNever,
0103   XawtextWrapLine,
0104   XawtextWrapWord
0105 } XawTextWrapMode;
0106 
0107 typedef enum {
0108   XawsdLeft,
0109   XawsdRight
0110 } XawTextScanDirection;
0111 
0112 typedef enum {
0113   XawtextRead,
0114   XawtextAppend,
0115   XawtextEdit
0116 } XawTextEditType;
0117 
0118 typedef enum {
0119   XawselectNull,
0120   XawselectPosition,
0121   XawselectChar,
0122   XawselectWord,
0123   XawselectLine,
0124   XawselectParagraph,
0125   XawselectAll,
0126   XawselectAlphaNumeric
0127 } XawTextSelectType;
0128 
0129 typedef enum {
0130     XawjustifyLeft,
0131     XawjustifyRight,
0132     XawjustifyCenter,
0133     XawjustifyFull
0134 } XawTextJustifyMode;
0135 
0136 typedef struct {
0137     int  firstPos;
0138     int  length;
0139     char *ptr;
0140     unsigned long format;
0141 } XawTextBlock, *XawTextBlockPtr;
0142 
0143 #ifndef OLDXAW
0144 typedef struct {
0145     int line_number;
0146     int column_number;
0147     XawTextPosition insert_position;
0148     XawTextPosition last_position;
0149     Boolean overwrite_mode;
0150 } XawTextPositionInfo;
0151 
0152 typedef struct {
0153     XawTextPosition left, right;
0154     XawTextBlock *block;
0155 } XawTextPropertyInfo;
0156 
0157 typedef struct _XawTextAnchor XawTextAnchor;
0158 typedef struct _XawTextEntity XawTextEntity;
0159 typedef struct _XawTextProperty XawTextProperty;
0160 typedef struct _XawTextPropertyList XawTextPropertyList;
0161 #endif
0162 
0163 #include <X11/Xaw/TextSink.h>
0164 #include <X11/Xaw/TextSrc.h>
0165 
0166 #define XtEtextScrollNever "never"
0167 #define XtEtextScrollWhenNeeded "whenneeded"
0168 #define XtEtextScrollAlways "always"
0169 #define XtEtextResizeNever "never"
0170 #define XtEtextResizeWidth "width"
0171 #define XtEtextResizeHeight "height"
0172 #define XtEtextResizeBoth "both"
0173 
0174 #define XtEtextWrapNever    "never"
0175 #define XtEtextWrapLine     "line"
0176 #define XtEtextWrapWord     "word"
0177 
0178 #define XtNautoFill "autoFill"
0179 #define XtNbottomMargin "bottomMargin"
0180 #define XtNdialogHOffset "dialogHOffset"
0181 #define XtNdialogVOffset "dialogVOffset"
0182 #define XtNdisplayCaret "displayCaret"
0183 #define XtNdisplayPosition "displayPosition"
0184 #define XtNleftMargin "leftMargin"
0185 #define XtNrightMargin "rightMargin"
0186 #define XtNpositionCallback "positionCallback"
0187 #define XtNscrollVertical "scrollVertical"
0188 #define XtNscrollHorizontal "scrollHorizontal"
0189 #define XtNselectTypes "selectTypes"
0190 #define XtNtopMargin "topMargin"
0191 #define XtNwrap "wrap"
0192 
0193 #define XtCColumn       "Column"
0194 #define XtNleftColumn       "leftColumn"
0195 #define XtNrightColumn      "rightColumn"
0196 
0197 #define XtCJustifyMode      XtCJustify
0198 #define XtNjustifyMode      XtNjustify
0199 #define XtEtextJustifyLeft  "left"
0200 #define XtEtextJustifyRight "right"
0201 #define XtEtextJustifyCenter    "center"
0202 #define XtEtextJustifyFull  "full"
0203 
0204 #define XtCAutoFill "AutoFill"
0205 #define XtCSelectTypes "SelectTypes"
0206 #define XtCWrap "Wrap"
0207 #ifndef notdef
0208 #define XtCScroll       "Scroll"
0209 #endif
0210 
0211 #ifndef _XtStringDefs_h_
0212 #define XtNinsertPosition "insertPosition"
0213 #ifndef notdef
0214 #define XtNresize "resize"
0215 #define XtCResize "Resize"
0216 #endif
0217 #define XtNselection        "selection"
0218 #endif
0219 
0220 /* return Error code for XawTextSearch */
0221 #define XawTextSearchError      (-12345L)
0222 
0223 /* return codes from XawTextReplace */
0224 #define XawReplaceError        -1
0225 #define XawEditDone     0
0226 #define XawEditError        1
0227 #define XawPositionError    2
0228 
0229 /* XrmQuark is not unsigned long */
0230 #define XawTextFormat(tw,fmt) ((unsigned long)_XawTextFormat(tw) == (fmt))
0231 
0232 extern unsigned long FMT8BIT;
0233 extern unsigned long XawFmt8Bit;
0234 extern unsigned long XawFmtWide;
0235 
0236 extern WidgetClass textWidgetClass;
0237 
0238 typedef struct _TextClassRec *TextWidgetClass;
0239 typedef struct _TextRec      *TextWidget;
0240 
0241 _XFUNCPROTOBEGIN
0242 
0243 XrmQuark _XawTextFormat
0244 (
0245  TextWidget     tw
0246  );
0247 
0248 void XawTextDisplay
0249 (
0250  Widget         w
0251  );
0252 
0253 void XawTextEnableRedisplay
0254 (
0255  Widget         w
0256  );
0257 
0258 void XawTextDisableRedisplay
0259 (
0260  Widget         w
0261  );
0262 
0263 void XawTextSetSelectionArray
0264 (
0265  Widget         w,
0266  XawTextSelectType  *sarray
0267  );
0268 
0269 void XawTextGetSelectionPos
0270 (
0271  Widget         w,
0272  XawTextPosition    *begin_return,
0273  XawTextPosition    *end_return
0274  );
0275 
0276 void XawTextSetSource
0277 (
0278  Widget         w,
0279  Widget         source,
0280  XawTextPosition    top
0281  );
0282 
0283 int XawTextReplace
0284 (
0285  Widget         w,
0286  XawTextPosition    start,
0287  XawTextPosition    end,
0288  XawTextBlock       *text
0289  );
0290 
0291 XawTextPosition XawTextTopPosition
0292 (
0293  Widget         w
0294  );
0295 
0296 XawTextPosition XawTextLastPosition
0297 (
0298  Widget         w
0299  );
0300 
0301 void XawTextSetInsertionPoint
0302 (
0303  Widget         w,
0304  XawTextPosition    position
0305  );
0306 
0307 XawTextPosition XawTextGetInsertionPoint
0308 (
0309  Widget         w
0310  );
0311 
0312 void XawTextUnsetSelection
0313 (
0314  Widget         w
0315  );
0316 
0317 void XawTextSetSelection
0318 (
0319  Widget         w,
0320  XawTextPosition    left,
0321  XawTextPosition    right
0322  );
0323 
0324 void XawTextInvalidate
0325 (
0326  Widget         w,
0327  XawTextPosition    from,
0328  XawTextPosition    to
0329 );
0330 
0331 Widget XawTextGetSource
0332 (
0333  Widget         w
0334  );
0335 
0336 Widget XawTextGetSink
0337 (
0338  Widget         w
0339  );
0340 
0341 XawTextPosition XawTextSearch
0342 (
0343  Widget         w,
0344 #if NeedWidePrototypes
0345  int            dir,
0346 #else
0347  XawTextScanDirection   dir,
0348 #endif
0349  XawTextBlock       *text
0350  );
0351 
0352 void XawTextDisplayCaret
0353 (
0354  Widget         w,
0355 #if NeedWidePrototypes
0356  int            visible
0357 #else
0358  Boolean        visible
0359 #endif
0360  );
0361 
0362 _XFUNCPROTOEND
0363 
0364 /*
0365  * For R3 compatibility only
0366  */
0367 #include <X11/Xaw/AsciiSrc.h>
0368 #include <X11/Xaw/AsciiSink.h>
0369 
0370 #endif /* _XawText_h */