Mercurial > hg > xemacs-beta
comparison src/device-tty.c @ 5118:e0db3c197671 ben-lisp-object
merge up to latest default branch, doesn't compile yet
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 21:18:49 -0600 |
parents | e34711681f30 |
children | d1247f3cc363 |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
39 #include "console-stream.h" | 39 #include "console-stream.h" |
40 | 40 |
41 #include "sysfile.h" | 41 #include "sysfile.h" |
42 #include "syssignal.h" /* for SIGWINCH */ | 42 #include "syssignal.h" /* for SIGWINCH */ |
43 | 43 |
44 Lisp_Object Qinit_pre_tty_win, Qinit_post_tty_win; | 44 Lisp_Object Qmake_device_early_tty_entry_point; |
45 | 45 |
46 | 46 |
47 #ifdef NEW_GC | |
48 static const struct memory_description tty_device_data_description_1 [] = { | |
49 { XD_END } | |
50 }; | |
51 | |
52 DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("tty-device", tty_device, | |
53 0, tty_device_data_description_1, | |
54 Lisp_Tty_Device); | |
55 #endif /* NEW_GC */ | |
56 | |
47 static void | 57 static void |
48 allocate_tty_device_struct (struct device *d) | 58 allocate_tty_device_struct (struct device *d) |
49 { | 59 { |
60 #ifdef NEW_GC | |
61 d->device_data = alloc_lrecord_type (struct tty_device, &lrecord_tty_device); | |
62 #else /* not NEW_GC */ | |
50 d->device_data = xnew_and_zero (struct tty_device); | 63 d->device_data = xnew_and_zero (struct tty_device); |
64 #endif /* not NEW_GC */ | |
51 } | 65 } |
52 | 66 |
53 static void | 67 static void |
54 tty_init_device (struct device *d, Lisp_Object UNUSED (props)) | 68 tty_init_device (struct device *d, Lisp_Object UNUSED (props)) |
55 { | 69 { |
56 struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); | 70 struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); |
57 Lisp_Object terminal_type = CONSOLE_TTY_DATA (con)->terminal_type; | 71 Lisp_Object terminal_type = CONSOLE_TTY_DATA (con)->terminal_type; |
72 | |
73 /* Run part of the elisp side of the TTY device initialization. | |
74 The post-init is run in the tty_finish_init_device() method. */ | |
75 call0 (Qmake_device_early_tty_entry_point); | |
58 | 76 |
59 DEVICE_INFD (d) = CONSOLE_TTY_DATA (con)->infd; | 77 DEVICE_INFD (d) = CONSOLE_TTY_DATA (con)->infd; |
60 DEVICE_OUTFD (d) = CONSOLE_TTY_DATA (con)->outfd; | 78 DEVICE_OUTFD (d) = CONSOLE_TTY_DATA (con)->outfd; |
61 | 79 |
62 allocate_tty_device_struct (d); | 80 allocate_tty_device_struct (d); |
89 default: | 107 default: |
90 ABORT (); | 108 ABORT (); |
91 } | 109 } |
92 | 110 |
93 init_one_device (d); | 111 init_one_device (d); |
94 | 112 } |
95 /* Run part of the elisp side of the TTY device initialization. | 113 |
96 The post-init is run in the tty_after_init_frame() method. */ | 114 #ifndef NEW_GC |
97 call0 (Qinit_pre_tty_win); | |
98 } | |
99 | |
100 static void | 115 static void |
101 free_tty_device_struct (struct device *d) | 116 free_tty_device_struct (struct device *d) |
102 { | 117 { |
103 if (d->device_data) | 118 if (d->device_data) |
104 xfree (d->device_data, void *); | 119 xfree (d->device_data, void *); |
107 static void | 122 static void |
108 tty_delete_device (struct device *d) | 123 tty_delete_device (struct device *d) |
109 { | 124 { |
110 free_tty_device_struct (d); | 125 free_tty_device_struct (d); |
111 } | 126 } |
127 #endif /* not NEW_GC */ | |
112 | 128 |
113 #ifdef SIGWINCH | 129 #ifdef SIGWINCH |
114 | 130 |
115 static SIGTYPE | 131 static SIGTYPE |
116 tty_device_size_change_signal (int UNUSED (signo)) | 132 tty_device_size_change_signal (int UNUSED (signo)) |
187 /************************************************************************/ | 203 /************************************************************************/ |
188 | 204 |
189 void | 205 void |
190 syms_of_device_tty (void) | 206 syms_of_device_tty (void) |
191 { | 207 { |
192 DEFSYMBOL (Qinit_pre_tty_win); | 208 #ifdef NEW_GC |
193 DEFSYMBOL (Qinit_post_tty_win); | 209 INIT_LISP_OBJECT (tty_device); |
210 #endif /* NEW_GC */ | |
211 | |
212 DEFSYMBOL (Qmake_device_early_tty_entry_point); | |
194 } | 213 } |
195 | 214 |
196 void | 215 void |
197 console_type_create_device_tty (void) | 216 console_type_create_device_tty (void) |
198 { | 217 { |
199 /* device methods */ | 218 /* device methods */ |
200 CONSOLE_HAS_METHOD (tty, init_device); | 219 CONSOLE_HAS_METHOD (tty, init_device); |
220 #ifndef NEW_GC | |
201 CONSOLE_HAS_METHOD (tty, delete_device); | 221 CONSOLE_HAS_METHOD (tty, delete_device); |
222 #endif /* not NEW_GC */ | |
202 #ifdef SIGWINCH | 223 #ifdef SIGWINCH |
203 CONSOLE_HAS_METHOD (tty, asynch_device_change); | 224 CONSOLE_HAS_METHOD (tty, asynch_device_change); |
204 #endif /* SIGWINCH */ | 225 #endif /* SIGWINCH */ |
205 CONSOLE_HAS_METHOD (tty, device_system_metrics); | 226 CONSOLE_HAS_METHOD (tty, device_system_metrics); |
206 } | 227 } |