1 /*************************************<+>*************************************
2 *****************************************************************************
8 ** Description: TextEdit widget private include file
10 *****************************************************************************
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
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.
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
34 *****************************************************************************
35 *************************************<+>*************************************/
37 #ifndef _XtTextEditPrivate_h
38 #define _XtTextEditPrivate_h
41 /****************************************************************
43 * TextEdit widget private
45 ****************************************************************/
47 #define MAXCUT 30000 /* Maximum number of characters that can be cut. */
57 #define isNewline(c) (c=='\n')
58 #define isWhiteSpace(c) ( c==' ' || c=='\t' || c=='\n' || c=='\r' )
60 #include <Xw/TextEdit.h>
62 typedef int XwTextLineRange
;
67 /* NOTE: more of the following information will eventually be moved
68 to the files TESourceP.h and TEDisplayP.h.
71 /* Private TextEdit Definitions */
73 typedef int (*ActionProc
)();
75 typedef XwSelectType SelectionArray
[20];
78 unsigned char *string
;
83 /*************************************************************************
85 * New fields for the TextEdit widget class record
87 ************************************************************************/
89 unsigned char* (*copy_substring
)();
90 unsigned char* (*copy_selection
)();
91 XtWidgetProc unset_selection
;
92 XwSetSProc set_selection
;
93 XwEditResult (*replace_text
)();
94 XtWidgetProc redraw_text
;
95 } XwTextEditClassPart
;
97 /*************************************************************************
99 * Full class record declaration for TextEdit class
101 ************************************************************************/
102 typedef struct _XwTextEditClassRec
{
103 CoreClassPart core_class
;
104 XwPrimitiveClassPart primitive_class
;
105 XwTextEditClassPart textedit_class
;
106 } XwTextEditClassRec
;
108 extern XwTextEditClassRec XwtexteditClassRec
;
110 /*************************************************************************
112 * New fields for the TextEdit widget instance record
114 ************************************************************************/
115 typedef struct _XwTextEditPart
{
116 XwSourceType srctype
; /* used by args & rm to set source */
117 XwTextSource
*source
;
120 XwTextPosition insertPos
;
121 XwTextPosition oldinsert
;
123 XwScanDirection extendDir
;
124 XwTextSelection origSel
; /* the selection being modified */
125 SelectionArray sarray
; /* Array to cycle for selections. */
126 Dimension leftmargin
; /* Width of left margin. */
127 Dimension rightmargin
; /* Width of right margin. */
128 Dimension topmargin
; /* Width of top margin. */
129 Dimension bottommargin
; /* Width of bottom margin. */
130 int options
; /* wordbreak, scroll, etc. */
131 Time lasttime
; /* timestamp of last processed action */
132 Time time
; /* time of last key or button action */
133 Position ev_x
, ev_y
; /* x, y coords for key or button action */
134 XwTextPosition
*updateFrom
; /* Array of start positions for update. */
135 XwTextPosition
*updateTo
; /* Array of end positions for update. */
136 int numranges
; /* How many update ranges there are. */
137 int maxranges
; /* How many ranges we have space for */
138 Boolean showposition
; /* True if we need to show the position. */
140 Boolean hasfocus
; /* TRUE if we currently have input focus.*/
141 XtCallbackList motion_verification
;
142 XtCallbackList modify_verification
;
143 XtCallbackList leave_verification
;
145 XwWrapForm wrap_form
;
146 XwWrapBreak wrap_break
;
147 XwScroll scroll_mode
;
148 XwScroll scroll_state
;
150 XwGrow grow_state
; /* tells whether further growth should
152 Dimension prevW
, prevH
; /* prev values of window width, height */
153 Boolean visible_insertion
;
154 Boolean update_flag
; /* turn updates on and off */
155 XtCallbackList execute
; /* Execute callback list */
158 /****************************************************************
160 * Full instance record declaration
162 ****************************************************************/
164 typedef struct _XwTextEditRec
{
166 XwPrimitivePart primitive
;
172 /* DON'T ADD STUFF AFTER THIS #endif */