annotate src/console-tty.h @ 394:7d59cb494b73 r21-2-12

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