annotate src/device-tty.c @ 267:966663fcf606 r20-5b32

Import from CVS: tag r20-5b32
author cvs
date Mon, 13 Aug 2007 10:26:29 +0200
parents 2c611d1463a6
children c5d627a313b1
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 /* TTY device functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1994, 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 Copyright (C) 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 /* Authors: Ben Wing and Chuck Thompson. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include "lisp.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #include "console-tty.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #include "console-stream.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include "events.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #include "faces.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #include "frame.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #include "lstream.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #include "redisplay.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #include "sysdep.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 #include "syssignal.h" /* for SIGWINCH */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
41 #ifdef HAVE_GPM
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
42 #include <gpm.h>
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
43 #endif
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
44
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 #include <errno.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 Lisp_Object Qinit_pre_tty_win, Qinit_post_tty_win;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 allocate_tty_device_struct (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 {
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 155
diff changeset
53 d->device_data = xnew_and_zero (struct tty_device);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 tty_init_device (struct device *d, Lisp_Object props)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 Lisp_Object terminal_type = CONSOLE_TTY_DATA (con)->terminal_type;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 DEVICE_INFD (d) = CONSOLE_TTY_DATA (con)->infd;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 DEVICE_OUTFD (d) = CONSOLE_TTY_DATA (con)->outfd;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 allocate_tty_device_struct (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 init_baud_rate (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
68 switch (init_tty_for_redisplay (d, (char *) XSTRING_DATA (terminal_type)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 case TTY_UNABLE_OPEN_DATABASE:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 suppress_early_backtrace = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 error ("Can't access terminal information database");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 case TTY_TYPE_UNDEFINED:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 suppress_early_backtrace = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 error ("Terminal type `%s' undefined (or can't access database?)",
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
79 XSTRING_DATA (terminal_type));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 case TTY_TYPE_INSUFFICIENT:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 suppress_early_backtrace = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 error ("Terminal type `%s' not powerful enough to run Emacs",
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
84 XSTRING_DATA (terminal_type));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 case TTY_SIZE_UNSPECIFIED:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 suppress_early_backtrace = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 error ("Can't determine window size of terminal");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 case TTY_INIT_SUCCESS:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 default:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 abort ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 init_one_device (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 /* Run part of the elisp side of the TTY device initialization.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 The post-init is run in the tty_after_init_frame() method. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 call0 (Qinit_pre_tty_win);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 free_tty_device_struct (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 struct tty_device *td = (struct tty_device *) d->device_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 if (td)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 xfree (td);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 tty_delete_device (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 free_tty_device_struct (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 #ifdef SIGWINCH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 static SIGTYPE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 tty_device_size_change_signal (int signo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 int old_errno = errno;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 asynch_device_change_pending++;
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 185
diff changeset
124 #ifdef HAVE_UNIXOID_EVENT_LOOP
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 signal_fake_event ();
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 185
diff changeset
126 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 EMACS_REESTABLISH_SIGNAL (SIGWINCH, tty_device_size_change_signal);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 errno = old_errno;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 SIGRETURN;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 /* frame_change_signal does nothing but set a flag that it was called.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 When redisplay is called, it will notice that the flag is set and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 call handle_pending_device_size_change to do the actual work. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 tty_asynch_device_change (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 Lisp_Object devcons, concons;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 DEVICE_LOOP_NO_BREAK (devcons, concons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 int width, height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 Lisp_Object tail;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 struct device *d = XDEVICE (XCAR (devcons));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 if (!DEVICE_TTY_P (d))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 continue;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 get_tty_device_size (d, &width, &height);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 14
diff changeset
151 if (width > 0 && height > 0
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 14
diff changeset
152 && (CONSOLE_TTY_DATA (con)->width != width
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 14
diff changeset
153 || CONSOLE_TTY_DATA (con)->height != height))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 CONSOLE_TTY_DATA (con)->width = width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 CONSOLE_TTY_DATA (con)->height = height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
158 #ifdef HAVE_GPM
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
159 /* We need to tell GPM how big our screen is now
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
160 ** I am pretty sure the GPM library will get incredibly confused
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
161 ** if you try to connect to more than one mouse-capable device,
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
162 ** so I don't think it will cause any more damage in that case.
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
163 */
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
164 gpm_mx = width;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
165 gpm_my = height;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
166 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 for (tail = DEVICE_FRAME_LIST (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 !NILP (tail);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 tail = XCDR (tail))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 struct frame *f = XFRAME (XCAR (tail));
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 155
diff changeset
172
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 /* We know the frame is tty because we made sure that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 device is tty. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 change_frame_size (f, height, width, 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 #endif /* SIGWINCH */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 tty_device_pixel_width (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 return CONSOLE_TTY_DATA (con)->width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 tty_device_pixel_height (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 return CONSOLE_TTY_DATA (con)->height;
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 /* initialization */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 syms_of_device_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 defsymbol (&Qinit_pre_tty_win, "init-pre-tty-win");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 defsymbol (&Qinit_post_tty_win, "init-post-tty-win");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 console_type_create_device_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 /* device methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 CONSOLE_HAS_METHOD (tty, init_device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 CONSOLE_HAS_METHOD (tty, delete_device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 #ifdef SIGWINCH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 CONSOLE_HAS_METHOD (tty, asynch_device_change);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 #endif /* SIGWINCH */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 CONSOLE_HAS_METHOD (tty, device_pixel_width);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 CONSOLE_HAS_METHOD (tty, device_pixel_height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 init_device_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 #ifdef SIGWINCH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 if (initialized && !noninteractive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 signal (SIGWINCH, tty_device_size_change_signal);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 #endif /* SIGWINCH */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 }