Text.h

Go to the documentation of this file.
00001 /* $XConsortium: Text.h,v 1.45 94/04/17 20:13:05 kaleb Exp $ */
00002 
00003 /***********************************************************
00004 
00005 Copyright (c) 1987, 1988, 1994  X Consortium
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a copy
00008 of this software and associated documentation files (the "Software"), to deal
00009 in the Software without restriction, including without limitation the rights
00010 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00011 copies of the Software, and to permit persons to whom the Software is
00012 furnished to do so, subject to the following conditions:
00013 
00014 The above copyright notice and this permission notice shall be included in
00015 all copies or substantial portions of the Software.
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00020 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023 
00024 Except as contained in this notice, the name of the X Consortium shall not be
00025 used in advertising or otherwise to promote the sale, use or other dealings
00026 in this Software without prior written authorization from the X Consortium.
00027 
00028 
00029 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
00030 
00031                         All Rights Reserved
00032 
00033 Permission to use, copy, modify, and distribute this software and its 
00034 documentation for any purpose and without fee is hereby granted, 
00035 provided that the above copyright notice appear in all copies and that
00036 both that copyright notice and this permission notice appear in 
00037 supporting documentation, and that the name of Digital not be
00038 used in advertising or publicity pertaining to distribution of the
00039 software without specific, written prior permission.  
00040 
00041 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
00042 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
00043 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00044 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00045 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
00046 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00047 SOFTWARE.
00048 
00049 ******************************************************************/
00050 
00051 #ifndef _XawText_h
00052 #define _XawText_h
00053 
00054 #include <X11/Xaw3d/Simple.h>
00055 
00056 /*
00057  Text widget
00058 
00059  Class:         textWidgetClass
00060  Class Name:    Text
00061  Superclass:    Simple
00062 
00063  Resources added by the Text widget:
00064 
00065  Name                Class           RepType            Default Value
00066  ----                -----           -------            -------------
00067  autoFill           AutoFill         Boolean            False
00068  bottomMargin       Margin           Position           2
00069  displayPosition    TextPosition     XawTextPosition    0
00070  insertPosition     TextPosition     XawTextPosition    0
00071  leftMargin         Margin           Position           2
00072  resize             Resize           XawTextResizeMode  XawTextResizeNever
00073  rightMargin        Margin           Position           4
00074  scrollHorizontal   Scroll           XawTextScrollMode  XawtextScrollNever
00075  scrollVertical     Scroll           XawTextScrollMode  XawtextScrollNever
00076  selectTypes        SelectTypes      Pointer            see documentation
00077  textSink           TextSink         Widget             NULL
00078  textSource         TextSource       Widget             NULL
00079  topMargin          Margin           Position           2
00080  unrealizeCallback  Callback         Callback           NULL
00081  wrap               Wrap             XawTextWrapMode    XawTextWrapNever
00082 
00083 */
00084 
00085 typedef long XawTextPosition;
00086 
00087 typedef enum { XawtextScrollNever,
00088                XawtextScrollWhenNeeded, XawtextScrollAlways} XawTextScrollMode;
00089 
00090 typedef enum { XawtextWrapNever, 
00091                XawtextWrapLine, XawtextWrapWord} XawTextWrapMode;
00092 
00093 typedef enum { XawtextResizeNever, XawtextResizeWidth,
00094                XawtextResizeHeight, XawtextResizeBoth} XawTextResizeMode;
00095 
00096 typedef enum {XawsdLeft, XawsdRight} XawTextScanDirection;
00097 typedef enum {XawtextRead, XawtextAppend, XawtextEdit} XawTextEditType;
00098 typedef enum {XawselectNull, XawselectPosition, XawselectChar, XawselectWord,
00099     XawselectLine, XawselectParagraph, XawselectAll} XawTextSelectType;
00100 
00101 typedef struct {
00102     int  firstPos;
00103     int  length;
00104     char *ptr;
00105     unsigned long format;
00106     } XawTextBlock, *XawTextBlockPtr; 
00107 
00108 #include <X11/Xaw3d/TextSink.h>
00109 #include <X11/Xaw3d/TextSrc.h>
00110 
00111 #define XtEtextScrollNever "never"
00112 #define XtEtextScrollWhenNeeded "whenneeded"
00113 #define XtEtextScrollAlways "always"
00114 
00115 #define XtEtextWrapNever "never"
00116 #define XtEtextWrapLine "line"
00117 #define XtEtextWrapWord "word"
00118 
00119 #define XtEtextResizeNever "never"
00120 #define XtEtextResizeWidth "width"
00121 #define XtEtextResizeHeight "height"
00122 #define XtEtextResizeBoth "both"
00123 
00124 #define XtNautoFill "autoFill"
00125 #define XtNbottomMargin "bottomMargin"
00126 #define XtNdialogHOffset "dialogHOffset"
00127 #define XtNdialogVOffset "dialogVOffset"
00128 #define XtNdisplayCaret "displayCaret"
00129 #define XtNdisplayPosition "displayPosition"
00130 #define XtNleftMargin "leftMargin"
00131 #define XtNrightMargin "rightMargin"
00132 #define XtNscrollVertical "scrollVertical"
00133 #define XtNscrollHorizontal "scrollHorizontal"
00134 #define XtNselectTypes "selectTypes"
00135 #define XtNtopMargin "topMargin"
00136 #define XtNwrap "wrap"
00137 
00138 #define XtCAutoFill "AutoFill"
00139 #define XtCScroll "Scroll"
00140 #define XtCSelectTypes "SelectTypes"
00141 #define XtCWrap "Wrap"
00142 
00143 #ifndef _XtStringDefs_h_
00144 #define XtNinsertPosition "insertPosition"
00145 #define XtNresize "resize"
00146 #define XtNselection "selection"
00147 #define XtCResize "Resize"
00148 #endif
00149 
00150 /* Return Error code for XawTextSearch */
00151 
00152 #define XawTextSearchError      (-12345L)
00153 
00154 /* Return codes from XawTextReplace */
00155 
00156 #define XawReplaceError        -1
00157 #define XawEditDone             0
00158 #define XawEditError            1
00159 #define XawPositionError        2
00160 
00161 extern unsigned long FMT8BIT;
00162 extern unsigned long XawFmt8Bit;
00163 extern unsigned long XawFmtWide;
00164 
00165 /* Class record constants */
00166 
00167 extern WidgetClass textWidgetClass;
00168 
00169 typedef struct _TextClassRec *TextWidgetClass;
00170 typedef struct _TextRec      *TextWidget;
00171 
00172 _XFUNCPROTOBEGIN
00173 
00174 extern XrmQuark _XawTextFormat(
00175 #if NeedFunctionPrototypes
00176     TextWidget          /* tw */
00177 #endif
00178 );
00179 
00180 extern void XawTextDisplay(
00181 #if NeedFunctionPrototypes
00182     Widget              /* w */
00183 #endif
00184 ); 
00185 
00186 extern void XawTextEnableRedisplay(
00187 #if NeedFunctionPrototypes
00188     Widget              /* w */
00189 #endif
00190 );
00191 
00192 extern void XawTextDisableRedisplay(
00193 #if NeedFunctionPrototypes
00194     Widget              /* w */
00195 #endif
00196 );
00197 
00198 extern void XawTextSetSelectionArray(
00199 #if NeedFunctionPrototypes
00200     Widget              /* w */,
00201     XawTextSelectType*  /* sarray */
00202 #endif
00203 );
00204 
00205 extern void XawTextGetSelectionPos(
00206 #if NeedFunctionPrototypes
00207     Widget              /* w */,
00208     XawTextPosition*    /* begin_return */,
00209     XawTextPosition*    /* end_return */
00210 #endif
00211 );
00212 
00213 extern void XawTextSetSource(
00214 #if NeedFunctionPrototypes
00215     Widget              /* w */,
00216     Widget              /* source */,
00217     XawTextPosition     /* position */
00218 #endif
00219 );
00220 
00221 extern int XawTextReplace(
00222 #if NeedFunctionPrototypes
00223     Widget              /* w */,
00224     XawTextPosition     /* start */,
00225     XawTextPosition     /* end */,
00226     XawTextBlock*       /* text */
00227 #endif
00228 );
00229 
00230 extern XawTextPosition XawTextTopPosition(
00231 #if NeedFunctionPrototypes
00232     Widget              /* w */
00233 #endif
00234 );
00235 
00236 extern void XawTextSetInsertionPoint(
00237 #if NeedFunctionPrototypes
00238     Widget              /* w */,
00239     XawTextPosition     /* position */
00240 #endif
00241 );
00242 
00243 extern XawTextPosition XawTextGetInsertionPoint(
00244 #if NeedFunctionPrototypes
00245     Widget              /* w */
00246 #endif
00247 );
00248 
00249 extern void XawTextUnsetSelection(
00250 #if NeedFunctionPrototypes
00251     Widget              /* w */
00252 #endif
00253 );
00254 
00255 extern void XawTextSetSelection(
00256 #if NeedFunctionPrototypes
00257     Widget              /* w */,
00258     XawTextPosition     /* left */,
00259     XawTextPosition     /* right */
00260 #endif
00261 );
00262 
00263 extern void XawTextInvalidate(
00264 #if NeedFunctionPrototypes
00265     Widget              /* w */,
00266     XawTextPosition     /* from */,
00267     XawTextPosition     /* to */
00268 #endif
00269 );
00270 
00271 extern Widget XawTextGetSource(
00272 #if NeedFunctionPrototypes
00273     Widget              /* w */
00274 #endif
00275 );
00276 
00277 extern XawTextPosition XawTextSearch(
00278 #if NeedFunctionPrototypes
00279     Widget                      /* w */,
00280 #if NeedWidePrototypes
00281     /* XawTextScanDirection */ int /* dir */,
00282 #else
00283     XawTextScanDirection        /* dir */,
00284 #endif
00285     XawTextBlock*               /* text */
00286 #endif
00287 );
00288 
00289 extern void XawTextDisplayCaret(
00290 #if NeedFunctionPrototypes
00291     Widget              /* w */,
00292 #if NeedWidePrototypes
00293     /* Boolean */ int   /* visible */
00294 #else
00295     Boolean             /* visible */
00296 #endif
00297 #endif
00298 );
00299 
00300 _XFUNCPROTOEND
00301 
00302 /*
00303  * For R3 compatability only. 
00304  */
00305 
00306 #include <X11/Xaw3d/AsciiSrc.h>
00307 #include <X11/Xaw3d/AsciiSink.h>
00308 
00309 #endif /* _XawText_h */
00310 /* DON'T ADD STUFF AFTER THIS #endif */

Generated on Sun Mar 4 15:03:55 2007 for Scilab [trunk] by  doxygen 1.5.1