Mercurial > hg > xemacs-beta
comparison src/console-stream.c @ 442:abe6d1db359e r21-2-36
Import from CVS: tag r21-2-36
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:35:02 +0200 |
parents | 3ecd8885ac67 |
children | 576fb035e263 |
comparison
equal
deleted
inserted
replaced
441:72a7cfa4a488 | 442:abe6d1db359e |
---|---|
67 } | 67 } |
68 else | 68 else |
69 { | 69 { |
70 CHECK_STRING (tty); | 70 CHECK_STRING (tty); |
71 stream_con->in = stream_con->out = stream_con->err = | 71 stream_con->in = stream_con->out = stream_con->err = |
72 fopen ((char *) XSTRING_DATA (tty), "r+"); | 72 /* #### We don't currently do coding-system translation on |
73 this descriptor. */ | |
74 fopen ((char *) XSTRING_DATA (tty), READ_PLUS_TEXT); | |
73 if (!stream_con->in) | 75 if (!stream_con->in) |
74 error ("Unable to open tty %s", XSTRING_DATA (tty)); | 76 error ("Unable to open tty %s", XSTRING_DATA (tty)); |
75 } | 77 } |
76 } | 78 } |
77 | 79 |
169 } | 171 } |
170 | 172 |
171 | 173 |
172 static int | 174 static int |
173 stream_text_width (struct frame *f, struct face_cachel *cachel, | 175 stream_text_width (struct frame *f, struct face_cachel *cachel, |
174 CONST Emchar *str, Charcount len) | 176 const Emchar *str, Charcount len) |
175 { | 177 { |
176 return len; | 178 return len; |
177 } | 179 } |
178 | 180 |
179 static int | 181 static int |
196 | 198 |
197 static int | 199 static int |
198 stream_eol_cursor_width (void) | 200 stream_eol_cursor_width (void) |
199 { | 201 { |
200 return 1; | 202 return 1; |
201 } | |
202 | |
203 static void | |
204 stream_output_begin (struct device *d) | |
205 { | |
206 } | |
207 | |
208 static void | |
209 stream_output_end (struct device *d) | |
210 { | |
211 } | 203 } |
212 | 204 |
213 static void | 205 static void |
214 stream_output_display_block (struct window *w, struct display_line *dl, | 206 stream_output_display_block (struct window *w, struct display_line *dl, |
215 int block, int start, int end, | 207 int block, int start, int end, |
217 int cursor_width, int cursor_height) | 209 int cursor_width, int cursor_height) |
218 { | 210 { |
219 } | 211 } |
220 | 212 |
221 static void | 213 static void |
222 stream_output_vertical_divider (struct window *w, int clear) | |
223 { | |
224 } | |
225 | |
226 static void | |
227 stream_clear_to_window_end (struct window *w, int ypos1, int ypos2) | |
228 { | |
229 } | |
230 | |
231 static void | |
232 stream_clear_region (Lisp_Object window, struct device* d, struct frame * f, | 214 stream_clear_region (Lisp_Object window, struct device* d, struct frame * f, |
233 face_index findex, int x, int y, | 215 face_index findex, int x, int y, |
234 int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, | 216 int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, |
235 Lisp_Object background_pixmap) | 217 Lisp_Object background_pixmap) |
236 { | |
237 } | |
238 | |
239 static void | |
240 stream_clear_frame (struct frame *f) | |
241 { | 218 { |
242 } | 219 } |
243 | 220 |
244 static int | 221 static int |
245 stream_flash (struct device *d) | 222 stream_flash (struct device *d) |
283 /* redisplay methods */ | 260 /* redisplay methods */ |
284 CONSOLE_HAS_METHOD (stream, left_margin_width); | 261 CONSOLE_HAS_METHOD (stream, left_margin_width); |
285 CONSOLE_HAS_METHOD (stream, right_margin_width); | 262 CONSOLE_HAS_METHOD (stream, right_margin_width); |
286 CONSOLE_HAS_METHOD (stream, text_width); | 263 CONSOLE_HAS_METHOD (stream, text_width); |
287 CONSOLE_HAS_METHOD (stream, output_display_block); | 264 CONSOLE_HAS_METHOD (stream, output_display_block); |
288 CONSOLE_HAS_METHOD (stream, output_vertical_divider); | |
289 CONSOLE_HAS_METHOD (stream, divider_height); | 265 CONSOLE_HAS_METHOD (stream, divider_height); |
290 CONSOLE_HAS_METHOD (stream, eol_cursor_width); | 266 CONSOLE_HAS_METHOD (stream, eol_cursor_width); |
291 CONSOLE_HAS_METHOD (stream, clear_to_window_end); | |
292 CONSOLE_HAS_METHOD (stream, clear_region); | 267 CONSOLE_HAS_METHOD (stream, clear_region); |
293 CONSOLE_HAS_METHOD (stream, clear_frame); | |
294 CONSOLE_HAS_METHOD (stream, output_begin); | |
295 CONSOLE_HAS_METHOD (stream, output_end); | |
296 CONSOLE_HAS_METHOD (stream, flash); | 268 CONSOLE_HAS_METHOD (stream, flash); |
297 CONSOLE_HAS_METHOD (stream, ring_bell); | 269 CONSOLE_HAS_METHOD (stream, ring_bell); |
298 } | 270 } |
299 | 271 |
300 void | 272 void |
326 staticpro (&Vstdio_str); | 298 staticpro (&Vstdio_str); |
327 } | 299 } |
328 | 300 |
329 #ifndef PDUMP | 301 #ifndef PDUMP |
330 void | 302 void |
331 init_console_stream (void) | 303 init_console_stream (int reinit) |
332 { | 304 { |
333 /* This function can GC */ | 305 /* This function can GC */ |
334 if (!initialized) | 306 if (!initialized) |
335 { | 307 { |
336 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); | 308 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); |
348 } | 320 } |
349 | 321 |
350 #else | 322 #else |
351 | 323 |
352 void | 324 void |
353 init_console_stream (void) | 325 init_console_stream (int reinit) |
354 { | 326 { |
355 /* This function can GC */ | 327 /* This function can GC */ |
356 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); | 328 if (!reinit) |
357 Vterminal_console = Fdevice_console (Vterminal_device); | 329 { |
358 Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); | 330 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); |
359 minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; | 331 Vterminal_console = Fdevice_console (Vterminal_device); |
332 Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); | |
333 minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; | |
334 } | |
360 if (initialized) | 335 if (initialized) |
361 { | 336 { |
362 stream_init_console (XCONSOLE (Vterminal_console), Qnil); | 337 stream_init_console (XCONSOLE (Vterminal_console), Qnil); |
363 if (noninteractive) | 338 if (noninteractive) |
364 event_stream_select_console (XCONSOLE (Vterminal_console)); | 339 event_stream_select_console (XCONSOLE (Vterminal_console)); |