annotate src/device-tty.c @ 155:43dd3413c7c7 r20-3b4

Import from CVS: tag r20-3b4
author cvs
date Mon, 13 Aug 2007 09:39:39 +0200
parents 538048ae2ab8
children 3d6bfa290dbd
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 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 d->device_data =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (struct tty_device *) xmalloc (sizeof (struct tty_device));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 /* zero out all slots. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 memset (d->device_data, 0, sizeof (struct tty_device));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 tty_init_device (struct device *d, Lisp_Object props)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 Lisp_Object terminal_type = CONSOLE_TTY_DATA (con)->terminal_type;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 DEVICE_INFD (d) = CONSOLE_TTY_DATA (con)->infd;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 DEVICE_OUTFD (d) = CONSOLE_TTY_DATA (con)->outfd;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 allocate_tty_device_struct (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 init_baud_rate (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
72 switch (init_tty_for_redisplay (d, (char *) XSTRING_DATA (terminal_type)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 case TTY_UNABLE_OPEN_DATABASE:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 suppress_early_backtrace = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 error ("Can't access terminal information database");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 case TTY_TYPE_UNDEFINED:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 suppress_early_backtrace = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 error ("Terminal type `%s' undefined (or can't access database?)",
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
83 XSTRING_DATA (terminal_type));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 case TTY_TYPE_INSUFFICIENT:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 suppress_early_backtrace = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 error ("Terminal type `%s' not powerful enough to run Emacs",
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
88 XSTRING_DATA (terminal_type));
0
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_SIZE_UNSPECIFIED:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 suppress_early_backtrace = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 error ("Can't determine window size of terminal");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 case TTY_INIT_SUCCESS:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 default:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 abort ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 init_one_device (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 /* Run part of the elisp side of the TTY device initialization.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 The post-init is run in the tty_after_init_frame() method. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 call0 (Qinit_pre_tty_win);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 free_tty_device_struct (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 struct tty_device *td = (struct tty_device *) d->device_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 if (td)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 xfree (td);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 tty_delete_device (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 free_tty_device_struct (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 #ifdef SIGWINCH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 static SIGTYPE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 tty_device_size_change_signal (int signo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 int old_errno = errno;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 asynch_device_change_pending++;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 signal_fake_event ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 EMACS_REESTABLISH_SIGNAL (SIGWINCH, tty_device_size_change_signal);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 errno = old_errno;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 SIGRETURN;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 /* frame_change_signal does nothing but set a flag that it was called.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 When redisplay is called, it will notice that the flag is set and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 call handle_pending_device_size_change to do the actual work. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 tty_asynch_device_change (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 Lisp_Object 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 DEVICE_LOOP_NO_BREAK (devcons, concons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 int width, height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 Lisp_Object tail;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 struct device *d = XDEVICE (XCAR (devcons));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 if (!DEVICE_TTY_P (d))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 continue;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 get_tty_device_size (d, &width, &height);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 14
diff changeset
153 if (width > 0 && height > 0
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 14
diff changeset
154 && (CONSOLE_TTY_DATA (con)->width != width
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 14
diff changeset
155 || CONSOLE_TTY_DATA (con)->height != height))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 CONSOLE_TTY_DATA (con)->width = width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 CONSOLE_TTY_DATA (con)->height = height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
160 #ifdef HAVE_GPM
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
161 /* We need to tell GPM how big our screen is now
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
162 ** I am pretty sure the GPM library will get incredibly confused
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
163 ** if you try to connect to more than one mouse-capable device,
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
164 ** 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
165 */
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
166 gpm_mx = width;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
167 gpm_my = height;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 149
diff changeset
168 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 for (tail = DEVICE_FRAME_LIST (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 !NILP (tail);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 tail = XCDR (tail))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 struct frame *f = XFRAME (XCAR (tail));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 /* We know the frame is tty because we made sure that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 device is tty. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 change_frame_size (f, height, width, 1);
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 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 #endif /* SIGWINCH */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 tty_device_pixel_width (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 return CONSOLE_TTY_DATA (con)->width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 tty_device_pixel_height (struct device *d)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 return CONSOLE_TTY_DATA (con)->height;
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 /* initialization */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 syms_of_device_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 defsymbol (&Qinit_pre_tty_win, "init-pre-tty-win");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 defsymbol (&Qinit_post_tty_win, "init-post-tty-win");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 console_type_create_device_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 /* device methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 CONSOLE_HAS_METHOD (tty, init_device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 CONSOLE_HAS_METHOD (tty, delete_device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 #ifdef SIGWINCH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 CONSOLE_HAS_METHOD (tty, asynch_device_change);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 #endif /* SIGWINCH */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 CONSOLE_HAS_METHOD (tty, device_pixel_width);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 CONSOLE_HAS_METHOD (tty, device_pixel_height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 init_device_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 #ifdef SIGWINCH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 if (initialized && !noninteractive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 signal (SIGWINCH, tty_device_size_change_signal);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 #endif /* SIGWINCH */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 }