annotate src/console-tty.h @ 149:538048ae2ab8 r20-3b1

Import from CVS: tag r20-3b1
author cvs
date Mon, 13 Aug 2007 09:36:16 +0200
parents d2f30a177268
children 25f70ba0133c
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;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 74
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
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
61 /* The count of frame number. */
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
62 int frame_count;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
63
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 /* flags indicating presence, absence or value of various features */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 unsigned int must_write_spaces :1;/* terminal inserts nulls, not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 spaces to fill whitespace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 on screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 unsigned int insert_mode_motion :1;/* cursor movement commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 work while in insert mode */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 unsigned int standout_motion :1; /* cursor movement is graceful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 in standout or underline mode */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 unsigned int memory_above_frame :1;/* display retained above screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 unsigned int memory_below_frame :1;/* display retained below screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 unsigned int meta_key :2; /* 0 == mask off top bit;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 1 == top bit is meta;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 2 == top bit is useful as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 character info */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 unsigned int flow_control :1; /* Nonzero means use ^S/^Q as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 cretinous flow control. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 int standout_width; /* # of spaces printed when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 change to standout mode */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 int underline_width; /* # of spaces printed when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 change to underline mode */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 } flags;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 /* cursor motion entries - each entry is commented with the terminfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 and the termcap entry */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 /* local cursor movement */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 CONST char *up; /* cuu1, up */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 CONST char *down; /* cud1, do */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 CONST char *left; /* cub1, le */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 CONST char *right; /* cuf1, nd */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 CONST char *home; /* home, ho */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 CONST char *low_left; /* ll, ll */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 CONST char *car_return; /* cr, cr */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 /* parameterized local cursor movement */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 CONST char *multi_up; /* cuu, UP */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 CONST char *multi_down; /* cud, DO */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 CONST char *multi_left; /* cub, LE */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 CONST char *multi_right; /* cuf, RI */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 /* absolute cursor motion */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 CONST char *abs; /* cup, cm */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 CONST char *hor_abs; /* hpa, ch */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 CONST char *ver_abs; /* vpa, cv */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 /* scrolling */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 CONST char *scroll_forw; /* ind, sf */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 CONST char *scroll_back; /* ri, sr */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 CONST char *multi_scroll_forw; /* indn, SF */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 CONST char *multi_scroll_back; /* rin, SR */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 CONST char *set_scroll_region; /* csr, cs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 } cm;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 /* screen editing entries - each entry is commented with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 terminfo and the termcap entry */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 /* adding to the screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 CONST char *ins_line; /* il1, al */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 CONST char *multi_ins_line; /* il, AL */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 CONST char *repeat; /* rep, rp */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 CONST char *begin_ins_mode; /* smir, im */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 CONST char *end_ins_mode; /* rmir, ei */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 CONST char *ins_char; /* ich1, ic */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 CONST char *multi_ins_char; /* ich, IC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 CONST char *insert_pad; /* ip, ip */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 /* deleting from the screen */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 CONST char *clr_frame; /* clear, cl */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 CONST char *clr_from_cursor; /* ed, cd */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 CONST char *clr_to_eol; /* el, ce */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 CONST char *del_line; /* dl1, dl */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 CONST char *multi_del_line; /* dl, DL */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 CONST char *del_char; /* dch1, dc */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 CONST char *multi_del_char; /* dch, DC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 CONST char *begin_del_mode; /* smdc, dm */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 CONST char *end_del_mode; /* rmdc, ed */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 CONST char *erase_at_cursor; /* ech, ec */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 } se;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 /* screen display entries - each entry is commented with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 terminfo and termcap entry */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 CONST char *begin_standout; /* smso, so */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 CONST char *end_standout; /* rmso, se */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 CONST char *begin_underline; /* smul, us */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 CONST char *end_underline; /* rmul, ue */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 CONST char *begin_alternate; /* smacs, as */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 CONST char *end_alternate; /* rmacs, ae */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 CONST char *turn_on_reverse; /* rev, mr */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 CONST char *turn_on_blinking; /* blink, mb */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 CONST char *turn_on_bold; /* bold, md */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 CONST char *turn_on_dim; /* dim, mh */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 CONST char *turn_off_attributes; /* sgr0, me */
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 *visual_bell; /* flash, vb */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 CONST char *audio_bell; /* bel, bl */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 CONST char *cursor_visible; /* cvvis, vs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 CONST char *cursor_normal; /* cnorm, ve */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 CONST char *init_motion; /* smcup, ti */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 CONST char *end_motion; /* rmcup, te */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 CONST char *keypad_on; /* smkx, ks */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 CONST char *keypad_off; /* rmkx, ke */
122
d2f30a177268 Import from CVS: tag r20-1b14
cvs
parents: 108
diff changeset
173
d2f30a177268 Import from CVS: tag r20-1b14
cvs
parents: 108
diff changeset
174 CONST char *orig_pair; /* op, op */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 } sd;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 /* costs of various operations */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 int cm_up;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 int cm_down;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 int cm_left;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 int cm_right;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 int cm_home;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 int cm_low_left;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 int cm_car_return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 int cm_abs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 int cm_hor_abs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 int cm_ver_abs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 } cost;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 /* The initial tty mode bits */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 struct emacs_tty old_tty;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 /* Is this TTY our controlling terminal? */
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
196 unsigned int controlling_terminal :1;
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
197 unsigned int is_stdio :1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 #define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 #define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 #define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 #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
204 #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
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 #define TTY_CM(c) (CONSOLE_TTY_DATA (c)->cm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 #define TTY_SE(c) (CONSOLE_TTY_DATA (c)->se)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 #define TTY_SD(c) (CONSOLE_TTY_DATA (c)->sd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 #define TTY_FLAGS(c) (CONSOLE_TTY_DATA (c)->flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 #define TTY_COST(c) (CONSOLE_TTY_DATA (c)->cost)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 #define TTY_INC_CURSOR_X(c, n) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 do \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 int __tempn__ = (n); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 assert (CONSOLE_TTY_CURSOR_X (c) == CONSOLE_TTY_REAL_CURSOR_X (c)); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 CONSOLE_TTY_CURSOR_X (c) += __tempn__; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 CONSOLE_TTY_REAL_CURSOR_X (c) += __tempn__; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 #define TTY_INC_CURSOR_Y(c, n) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 do \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 int __tempn__ = (n); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 CONSOLE_TTY_CURSOR_Y (c) += __tempn__; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 CONSOLE_TTY_REAL_CURSOR_Y (c) += __tempn__; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 struct tty_device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 #ifdef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 speed_t ospeed; /* Output speed (from sg_ospeed) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 short ospeed; /* Output speed (from sg_ospeed) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 #define DEVICE_TTY_DATA(d) DEVICE_TYPE_DATA (d, tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 /* termcap requires this to be global */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 #ifndef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 extern short ospeed; /* Output speed (from sg_ospeed) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 extern FILE *termscript;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 /****************** Prototypes from cm.c *******************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 /* #### Verify that all of these are still needed. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 extern void cm_cost_init (struct console *c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 extern void cmputc (int c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 extern void cmgoto (struct frame *f, int row, int col);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 extern struct console *cmputc_console;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 void send_string_to_tty_console (struct console *c, unsigned char *str,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 int len);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 /*************** Prototypes from event-tty.c ****************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 extern void init_event_tty_late (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 /*************** Prototypes from redisplay-tty.c ****************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 enum term_init_status
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 TTY_UNABLE_OPEN_DATABASE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 TTY_TYPE_UNDEFINED,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 TTY_TYPE_INSUFFICIENT,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 TTY_SIZE_UNSPECIFIED,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 TTY_INIT_SUCCESS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 extern int init_tty_for_redisplay (struct device *d, char *terminal_type);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 /* #### These should probably be methods. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 void set_tty_modes (struct console *c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 void reset_tty_modes (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 /* Used in sysdep.c to properly clear and position the cursor when exiting. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 extern void tty_redisplay_shutdown (struct console *c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 /* called from console-stream.c */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 Lisp_Object tty_semi_canonicalize_console_connection (Lisp_Object connection,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 Lisp_Object tty_canonicalize_console_connection (Lisp_Object connection,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 Lisp_Object tty_semi_canonicalize_device_connection (Lisp_Object connection,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 Lisp_Object tty_canonicalize_device_connection (Lisp_Object connection,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 #endif /* _XEMACS_CONSOLE_TTY_H_ */