annotate src/console-tty.h @ 64:a01e7a40045c r19-16-pre7

Import from CVS: tag r19-16-pre7
author cvs
date Mon, 13 Aug 2007 08:59:30 +0200
parents 56c54cf7c5b6
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Define TTY specific console, device, and frame object for XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1995 Board of Trustees, University of Illinois.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 /* Written by Chuck Thompson and Ben Wing. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 /* NOTE: Currently each TTY console can have only one device.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 Therefore, all stuff for both input and output is lumped into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 the console structure. If it ever becomes meaningful to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 have more than one device on a TTY console, the output stuff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 will have to get separated out. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #ifndef _XEMACS_CONSOLE_TTY_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #define _XEMACS_CONSOLE_TTY_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #include "console.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #include "syssignal.h" /* Always include before systty.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #include "systty.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 DECLARE_CONSOLE_TYPE (tty);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 struct tty_console
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 int infd, outfd;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 Lisp_Object instream, outstream;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 Lisp_Object terminal_type;
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 16
diff changeset
46 Lisp_Object controlling_process;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 char *term_entry_buffer;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 /* Physical location of cursor on this console. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 int cursor_x;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 int cursor_y;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 /* The real location of the cursor. The above physical location may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 be ahead of where we really are. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 int real_cursor_x;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 int real_cursor_y;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 int height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 int width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 /* flags indicating presence, absence or value of various features */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 unsigned int must_write_spaces :1;/* terminal inserts nulls, not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 spaces to fill whitespace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 on screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 unsigned int insert_mode_motion :1;/* cursor movement commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 work while in insert mode */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 unsigned int standout_motion :1; /* cursor movement is graceful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 in standout or underline mode */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 unsigned int memory_above_frame :1;/* display retained above screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 unsigned int memory_below_frame :1;/* display retained below screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 unsigned int meta_key :2; /* 0 == mask off top bit;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 1 == top bit is meta;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 2 == top bit is useful as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 character info */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 unsigned int flow_control :1; /* Nonzero means use ^S/^Q as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 cretinous flow control. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 int standout_width; /* # of spaces printed when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 change to standout mode */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 int underline_width; /* # of spaces printed when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 change to underline mode */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 } flags;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 /* cursor motion entries - each entry is commented with the terminfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 and the termcap entry */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 /* local cursor movement */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 CONST char *up; /* cuu1, up */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 CONST char *down; /* cud1, do */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 CONST char *left; /* cub1, le */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 CONST char *right; /* cuf1, nd */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 CONST char *home; /* home, ho */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 CONST char *low_left; /* ll, ll */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 CONST char *car_return; /* cr, cr */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 /* parameterized local cursor movement */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 CONST char *multi_up; /* cuu, UP */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 CONST char *multi_down; /* cud, DO */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 CONST char *multi_left; /* cub, LE */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 CONST char *multi_right; /* cuf, RI */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 /* absolute cursor motion */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 CONST char *abs; /* cup, cm */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 CONST char *hor_abs; /* hpa, ch */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 CONST char *ver_abs; /* vpa, cv */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 /* scrolling */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 CONST char *scroll_forw; /* ind, sf */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 CONST char *scroll_back; /* ri, sr */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 CONST char *multi_scroll_forw; /* indn, SF */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 CONST char *multi_scroll_back; /* rin, SR */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 CONST char *set_scroll_region; /* csr, cs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 } cm;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 /* screen editing entries - each entry is commented with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 terminfo and the termcap entry */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 /* adding to the screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 CONST char *ins_line; /* il1, al */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 CONST char *multi_ins_line; /* il, AL */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 CONST char *repeat; /* rep, rp */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 CONST char *begin_ins_mode; /* smir, im */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 CONST char *end_ins_mode; /* rmir, ei */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 CONST char *ins_char; /* ich1, ic */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 CONST char *multi_ins_char; /* ich, IC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 CONST char *insert_pad; /* ip, ip */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 /* deleting from the screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 CONST char *clr_frame; /* clear, cl */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 CONST char *clr_from_cursor; /* ed, cd */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 CONST char *clr_to_eol; /* el, ce */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 CONST char *del_line; /* dl1, dl */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 CONST char *multi_del_line; /* dl, DL */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 CONST char *del_char; /* dch1, dc */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 CONST char *multi_del_char; /* dch, DC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 CONST char *begin_del_mode; /* smdc, dm */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 CONST char *end_del_mode; /* rmdc, ed */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 CONST char *erase_at_cursor; /* ech, ec */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 } se;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 /* screen display entries - each entry is commented with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 terminfo and termcap entry */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 CONST char *begin_standout; /* smso, so */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 CONST char *end_standout; /* rmso, se */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 CONST char *begin_underline; /* smul, us */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 CONST char *end_underline; /* rmul, ue */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 CONST char *begin_alternate; /* smacs, as */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 CONST char *end_alternate; /* rmacs, ae */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 CONST char *turn_on_reverse; /* rev, mr */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 CONST char *turn_on_blinking; /* blink, mb */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 CONST char *turn_on_bold; /* bold, md */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 CONST char *turn_on_dim; /* dim, mh */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 CONST char *turn_off_attributes; /* sgr0, me */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 CONST char *visual_bell; /* flash, vb */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 CONST char *audio_bell; /* bel, bl */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 CONST char *cursor_visible; /* cvvis, vs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 CONST char *cursor_normal; /* cnorm, ve */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 CONST char *init_motion; /* smcup, ti */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 CONST char *end_motion; /* rmcup, te */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 CONST char *keypad_on; /* smkx, ks */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 CONST char *keypad_off; /* rmkx, ke */
48
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents: 30
diff changeset
170
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents: 30
diff changeset
171 CONST char *orig_pair; /* op, op */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 } sd;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 /* costs of various operations */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 int cm_up;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 int cm_down;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 int cm_left;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 int cm_right;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 int cm_home;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 int cm_low_left;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 int cm_car_return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 int cm_abs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 int cm_hor_abs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 int cm_ver_abs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 } cost;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 /* The initial tty mode bits */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 struct emacs_tty old_tty;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 /* Is this TTY our controlling terminal? */
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
193 unsigned int controlling_terminal :1;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
194 unsigned int is_stdio :1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 #define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 #define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 #define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 #define CONSOLE_TTY_REAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->real_cursor_x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 #define CONSOLE_TTY_REAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->real_cursor_y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 #define TTY_CM(c) (CONSOLE_TTY_DATA (c)->cm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 #define TTY_SE(c) (CONSOLE_TTY_DATA (c)->se)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 #define TTY_SD(c) (CONSOLE_TTY_DATA (c)->sd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 #define TTY_FLAGS(c) (CONSOLE_TTY_DATA (c)->flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 #define TTY_COST(c) (CONSOLE_TTY_DATA (c)->cost)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 #define TTY_INC_CURSOR_X(c, n) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 do \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 int __tempn__ = (n); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 assert (CONSOLE_TTY_CURSOR_X (c) == CONSOLE_TTY_REAL_CURSOR_X (c)); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 CONSOLE_TTY_CURSOR_X (c) += __tempn__; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 CONSOLE_TTY_REAL_CURSOR_X (c) += __tempn__; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 #define TTY_INC_CURSOR_Y(c, n) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 do \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 int __tempn__ = (n); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 CONSOLE_TTY_CURSOR_Y (c) += __tempn__; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 CONSOLE_TTY_REAL_CURSOR_Y (c) += __tempn__; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 struct tty_device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 #ifdef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 speed_t ospeed; /* Output speed (from sg_ospeed) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 short ospeed; /* Output speed (from sg_ospeed) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 #define DEVICE_TTY_DATA(d) DEVICE_TYPE_DATA (d, tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 /* termcap requires this to be global */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 #ifndef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 extern short ospeed; /* Output speed (from sg_ospeed) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 extern FILE *termscript;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 /****************** Prototypes from cm.c *******************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 /* #### Verify that all of these are still needed. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 extern void cm_cost_init (struct console *c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 extern void cmputc (int c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 extern void cmgoto (struct frame *f, int row, int col);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 extern struct console *cmputc_console;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 void send_string_to_tty_console (struct console *c, unsigned char *str,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 int len);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 /*************** Prototypes from event-tty.c ****************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 extern void init_event_tty_late (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 /*************** Prototypes from redisplay-tty.c ****************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 enum term_init_status
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 TTY_UNABLE_OPEN_DATABASE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 TTY_TYPE_UNDEFINED,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 TTY_TYPE_INSUFFICIENT,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 TTY_SIZE_UNSPECIFIED,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 TTY_INIT_SUCCESS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 extern int init_tty_for_redisplay (struct device *d, char *terminal_type);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 /* #### These should probably be methods. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 void set_tty_modes (struct console *c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 void reset_tty_modes (struct console *c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 /* Used in sysdep.c to properly clear and position the cursor when exiting. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 extern void tty_redisplay_shutdown (struct console *c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 /* called from console-stream.c */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 Lisp_Object tty_semi_canonicalize_console_connection (Lisp_Object connection,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 Lisp_Object tty_canonicalize_console_connection (Lisp_Object connection,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 Lisp_Object tty_semi_canonicalize_device_connection (Lisp_Object connection,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 Lisp_Object tty_canonicalize_device_connection (Lisp_Object connection,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 #endif /* _XEMACS_CONSOLE_TTY_H_ */