/*
 *	sccsid:	@(#)Text.h	1.6	6/8/87
 */

/*
 * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
 * 
 *                         All Rights Reserved
 * 
 * Permission to use, copy, modify, and distribute this software and its 
 * documentation for any purpose and without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and that
 * both that copyright notice and this permission notice appear in 
 * supporting documentation, and that the name of Digital Equipment
 * Corporation not be used in advertising or publicity pertaining to
 * distribution of the software without specific, written prior permission.  
 * 
 * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 * SOFTWARE.
 */

#ifndef _Text_h
#define _Text_h

/****************************************************************
 *
 * Text widget
 *
 ****************************************************************/

/*
 * Atoms.
 */
#define XtNwindow		"window"
#define XtNeditType		"editType"
#define XtNtextOptions		"textOptions"
#define XtNdisplayPosition      "displayPosition"
#define XtNinsertPosition	"insertPosition"
#define XtNleftMargin		"leftMargin"
#define XtNselectionArray	"selectionArray"
#define XtNforeground		"foreground"
#define XtNbackground		"background"
#define XtNborder		"border"
#define XtNborderWidth		"borderWidth"
#define XtNfile			"file"
#define XtNstring		"string"
#define XtNlength		"length"
#define XtNfont			"font"
#define XtNeventBindings	"eventBindings"
#define XtNtextSource		"textSource"
#define XtNtextSink		"textSink"
#define XtNselection		"selection"
#define XtNwidth		"width"
#define XtNheight		"height"
#define XtNname			"name"

/* 
 * typedefs
 */
typedef struct {
    int  firstPos;
    int  length;
    char *ptr;
    } XtTextBlock, *TextBlockPtr;
typedef long XtTextPosition;
typedef enum {XttextRead, XttextAppend, XttextEdit} XtEditType;
typedef enum {XtselectNull, XtselectPosition, XtselectChar,
              XtselectWord, XtselectLine, XtselectParagraph, 
	      XtselectAll}  XtSelectType;

#define wordBreak		0x01
#define scrollVertical		0x02
/* #define scrollHorizontal	0x04 */
#define scrollOnOverflow	0x08 
#define resizeWidth		0x10
#define resizeHeight		0x20

/*
 * Procedures 
 */
extern Window XtTextDiskCreate(); /* parent, args, argCount */
    /* Window   parent;     */
    /* ArgList  args;    */
    /* int      argCount;   */

extern Window XtTextStringCreate(); /* parent, args, argCount */
    /* Window   parent;     */
    /* ArgList  args;    */
    /* int      argCount;   */

extern void XtTextGetValues(); /* w, args, argCount */
    /* Window w; */
    /* ArgList  args;    */
    /* int      argCount;   */

extern void XtTextSetValues(); /* w, args, argCount */
    /* Window w; */
    /* ArgList  args;    */
    /* int      argCount;   */

extern void XtTextDisplay(); /* w */
    /* Window w; */

extern void XtTextSetSelectionArray(); /* w, sarray */
    /* Window        w;		*/
    /* SelectionType *sarray;   */

extern void XtTextSetLastPos(); /* w, lastPos */
    /* Window         w;	*/
    /* XtTextPosition lastPos;  */

extern void XtTextGetSelectionPos(); /* w, left, right */
    /* Window         w;		*/
    /* XtTextPosition *left, *right;    */

extern void XtTextNewSource(); /* w, source, startPos */
    /* Window         w;	    */
    /* XtTextSource   *source;      */
    /* XtTextPosition startPos;     */

extern int XtTextReplace(); /* w, startPos, endPos, text */
    /* Window		w; */
    /* XtTextPosition   startPos, endPos; */
    /* XtTextBlock      *text; */

extern XtTextPosition XtTextTopPosition(); /* w */
    /* Window w; */

extern void XtTextSetInsertionPoint(); /* w, position */
    /* Window         w; */
    /* XtTextPosition position; */

extern XtTextPosition XtTextGetInsertionPoint(); /* w */
    /* Window w; */

extern void XtTextUnsetSelection(); /* w */
    /* Window w; */

extern void XtTextChangeOptions(); /* w, options */
    /* Window w; */
    /* int    options; */

extern int XtTextGetOptions(); /* w */
    /* Window w; */

extern void XtTextSetNewSelection(); /* w, left, right */
    /* Window         w; */
    /* XtTextPosition left, right; */

extern void XtTextInvalidate(); /* w, from, to */
    /* Window w; */
    /* XtTextPosition from, to; */

/*
 * The following procedures are only used by applications
 * that wish to create their own sources and sinks.
 * They should create a sink, create a source, and then
 * call XtTextCreate.
 */

extern Window XtTextCreate(); /* parent, args, argCount */
    /* Window   parent;     */
    /* ArgList  args;    */
    /* int      argCount;   */


/*
 * procedures for AsciiSink
 */

extern caddr_t XtAsciiSinkCreate(); /* font, ink, background */
    /* XFontStruct  *font; */
    /* int	    ink, background */

extern void XtAsciiSinkDestroy(); /* sink */
    /* XtTextSink *sink */

/*
 * Procedures for Sources
 */
extern int *XtStringSourceCreate(); /* str, maxLength, mode*/
    /* char 	*str;    */
    /* int 	maxLength; */
    /* XtEditType	mode; */

extern void XtStringSourceDestroy(); /* src */
    /* XtTextSource *src; */

extern int *XtDiskSourceCreate(); /* name, mode */
    /* char       *name; */
    /* XtEditType mode; */

extern void XtDiskSourceDestroy(); /* src */
    /* XtTextSource *src; */


#endif _Text_h
/* DON'T ADD STUFF AFTER THIS #endif */
