Realized what the underlying cause of crashing on undefined "dpy"
[xcircuit.git] / Xw / TextEditP.h
blob9228a61d9239dcec7fd3efdd149fd0a5f78c05e9
1 /*************************************<+>*************************************
2 *****************************************************************************
3 **
4 ** File: TextEditP.h
5 **
6 ** Project: X Widgets
7 **
8 ** Description: TextEdit widget private include file
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 *************************************<+>*************************************/
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. */
49 #define LF 0x0a
50 #define CR 0x0d
51 #define TAB 0x09
52 #define BS 0x08
53 #define SP 0x20
54 #define DEL 0x7f
55 #define BSLASH '\\'
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 ;
64 #include "SourceP.h"
65 #include "DisplayP.h"
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];
77 typedef struct {
78 unsigned char *string;
79 int value;
80 } XwSetValuePair;
83 /*************************************************************************
85 * New fields for the TextEdit widget class record
87 ************************************************************************/
88 typedef struct {
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;
118 XwTextSink *sink;
119 XwLineTable lt;
120 XwTextPosition insertPos;
121 XwTextPosition oldinsert;
122 XwTextSelection s;
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. */
139 GC gc;
140 Boolean hasfocus; /* TRUE if we currently have input focus.*/
141 XtCallbackList motion_verification;
142 XtCallbackList modify_verification;
143 XtCallbackList leave_verification;
144 XwWrap wrap_mode;
145 XwWrapForm wrap_form;
146 XwWrapBreak wrap_break;
147 XwScroll scroll_mode;
148 XwScroll scroll_state;
149 XwGrow grow_mode;
150 XwGrow grow_state; /* tells whether further growth should
151 be attempted */
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 */
156 } XwTextEditPart;
158 /****************************************************************
160 * Full instance record declaration
162 ****************************************************************/
164 typedef struct _XwTextEditRec {
165 CorePart core;
166 XwPrimitivePart primitive;
167 XwTextEditPart text;
168 } XwTextEditRec;
171 #endif
172 /* DON'T ADD STUFF AFTER THIS #endif */