File:  [Research Unix] / researchv9 / X11 / src / X.V11R1 / lib / oldXtk / TextDisp.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:22:00 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

/* $Header: /var/lib/cvsd/repos/research/researchv9/X11/src/X.V11R1/lib/oldXtk/TextDisp.h,v 1.1.1.1 2018/04/24 17:22:00 root Exp $ */
/*
 *	sccsid:	@(#)TextDisp.h	1.14	2/25/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.
 */

/* File: TextDisp.h */

#define MAXCUT	30000	/* Maximum number of characters that can be cut. */

#define LF	0x0a
#define CR	0x0d
#define TAB	0x09
#define BS	0x08
#define SP	0x20
#define DEL	0x7f
#define BSLASH	'\\'

#define EDITDONE 0
#define EDITERROR 1
#define POSITIONERROR 2

typedef enum {XtsdLeft, XtsdRight} ScanDirection;
typedef enum {XtstPositions, XtstWhiteSpace, XtstEOL, XtstParagraph, XtstFile} ScanType;

typedef struct {
    int  firstPos;
    int  length;
    char *ptr;
    } XtTextBlock, *TextBlockPtr;

typedef struct {
    int		    (*read)();
    int		    (*replace)();
    XtTextPosition  (*getLastPos)();
    int		    (*setLastPos)();
    XtTextPosition  (*scan)();
    XtEditType      (*editType)();
    int		    *data;
    } XtTextSource, *TextSourcePtr;

typedef struct {
    Display *dpy;
    int (*display)();
    int (*insertCursor)();
    int (*clearToBackground)();
    int (*findPosition)();
    int (*findDistance)();
    int (*resolve)();
    int (*maxLines)();
    int (*maxHeight)();
    int *data;
    } XtTextSink, *TextSinkPtr;

/* displayable text management data structures */

typedef struct {
    XtTextPosition position;
    Position x, y, endX;
    } LineTableEntry, *LineTableEntryPtr;

/* Line Tables are n+1 long - last position displayed is in last lt entry */
typedef struct {
    XtTextPosition  top;	/* Top of the displayed text.		*/
    int		    lines;	/* How many lines in this table.	*/
    LineTableEntry  *info;	/* A dynamic array, one entry per line  */
    } LineTable, *LineTablePtr;

typedef enum {XtisOn, XtisOff} InsertState;

typedef enum {XtselectNull, XtselectPosition, XtselectChar, XtselectWord,
    XtselectLine, XtselectParagraph, XtselectAll} XtSelectType;

typedef enum {XtsmTextSelect, XtsmTextExtend} SelectionMode;

typedef enum {XtactionStart, XtactionAdjust, XtactionEnd} SelectionAction;

typedef struct {
    XtTextPosition left, right;
    XtSelectType  type;
} TextSelection;

#define IsPositionVisible(ctx, pos)	(pos >= ctx->lt.info[0].position && \
	    pos <= ctx->lt.info[ctx->lt.lines].position)

/* Private Text Definitions */

typedef int (*ActionProc)();

typedef XtSelectType SelectionArray[20];

typedef struct  {
    Display	    *dpy;
    XtTextSource    *source;
    XtTextSink      *sink;
    LineTable       lt;
    XtTextPosition  insertPos;
    TextSelection   s;
    ScanDirection   extendDir;
    TextSelection   origSel;	    /* the selection being modified */
    SelectionArray  sarray;	    /* Array to cycle for selections. */
    Dimension       width, height;  /* Dimensions of the text subwindow */
    Dimension 	    leftmargin;     /* Width of left margin. */
    int		    options;	    /* wordbreak, scroll, etc. */
    unsigned short  lasttime;       /* timestamp of last processed action */
    unsigned short  time;	    /* timestamp of last key or button action */
    Position	    x, y;	    /* x, y coords for key or button action */
    Window	    sbar;	    /* The vertical scroll bar (none = 0).  */
    Window	    outer;	    /* Parent of scrollbar & text (if any) */
    Window	    w;		    /* Actual window containing text.  */
    XtTextPosition  *updateFrom;    /* Array of start positions for update. */
    XtTextPosition  *updateTo;      /* Array of end positions for update. */
    int		    numranges;      /* How many update ranges there are. */
    int		    maxranges;      /* How many update ranges we've space for */
    Boolean	    showposition;   /* True if we need to show the position. */
    XtTextPosition  lastPos;	    /* Last position of source. */
    Window	    dialog;	    /* Window containing dialog, if any. */
    Dimension 	    borderWidth;    /* width of window border (if any) */
    XtEventsPtr     eventTable;     /* Table for translation mgr. */
    caddr_t	    state;	    /* translation manager state handle */
    Pixel	    border, background;	    /* window colors */
    GC 		    gc;
    Boolean	    hasfocus;	/* TRUE if we currently have input focus. */
} TextContext, *TextContextPtr;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.