Corrected a long-standing error in which ending text with a literal
[xcircuit.git] / Xw / DisplayP.h
blob205e87ad69d5dc68d8dd53340e48f62472e32874
1 /*************************************<+>*************************************
2 *****************************************************************************
3 **
4 ** File: DisplayP.h
5 **
6 ** Project: X Widgets
7 **
8 ** Description: Private include file for TextEdit widget ascii sink
9 **
10 *****************************************************************************
11 **
12 ** Copyright (c) 1988 by Hewlett-Packard Company
13 ** Copyright (c) 1987, 1988 by Digital Equipment Corporation, Maynard,
14 ** Massachusetts, and the Massachusetts Institute of Technology,
15 ** Cambridge, Massachusetts
16 **
17 ** Permission to use, copy, modify, and distribute this software
18 ** and its documentation for any purpose and without fee is hereby
19 ** granted, provided that the above copyright notice appear in all
20 ** copies and that both that copyright notice and this permission
21 ** notice appear in supporting documentation, and that the names of
22 ** Hewlett-Packard, Digital or M.I.T. not be used in advertising or
23 ** publicity pertaining to distribution of the software without
24 ** written prior permission.
25 **
26 ** DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
27 ** ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
28 ** DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
29 ** ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30 ** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
31 ** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
32 ** SOFTWARE.
33 **
34 *****************************************************************************
35 *************************************<+>*************************************/
38 #ifndef _XwTextEditDisplayPrivate_h
39 #define _XwTextEditDisplayPrivate_h
41 /*****************************************************************************
43 * Constants
45 *****************************************************************************/
47 #define INFINITE_WIDTH 32767
49 #define applyDisplay(method) (*(self->text.sink->method))
51 /*****************************************************************************
53 * Displayable text management data structures (LineTable)
55 *****************************************************************************/
57 #define RequiredCursorMargin 3
59 typedef struct {
60 XwTextPosition position, drawPos;
61 Position x, y, endX;
62 TextFit fit ;
63 } XwLineTableEntry, *XwLineTableEntryPtr;
65 /* Line Tables are n+1 long - last position displayed is in last lt entry */
66 typedef struct {
67 XwTextPosition top; /* Top of the displayed text. */
68 XwTextPosition lines; /* How many lines in this table. */
69 XwLineTableEntry *info; /* A dynamic array, one entry per line */
70 } XwLineTable, *XwLineTablePtr;
72 typedef enum {XwisOn, XwisOff} XwInsertState;
74 typedef enum {XwselectNull, XwselectPosition, XwselectChar, XwselectWord,
75 XwselectLine, XwselectParagraph, XwselectAll} XwSelectType;
77 typedef enum {XwsmTextSelect, XwsmTextExtend} XwSelectionMode;
79 typedef enum {XwactionStart, XwactionAdjust, XwactionEnd} XwSelectionAction;
81 typedef struct {
82 XwTextPosition left, right;
83 XwSelectType type;
84 } XwTextSelection;
86 #define IsPositionVisible(ctx, pos)\
87 (pos >= ctx->text.lt.info[0].position && \
88 pos <= ctx->text.lt.info[ctx->text.lt.lines].position)
91 #endif
92 /* DON'T ADD STUFF AFTER THIS #endif */