Mercurial > hg > xemacs-beta
comparison src/console-stream.c @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | de805c49cfc1 |
children | 11054d720c21 |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
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 /* #### We don't currently do coding-system translation on | 72 fopen ((char *) XSTRING_DATA (tty), "r+"); |
73 this descriptor. */ | |
74 fopen ((char *) XSTRING_DATA (tty), READ_PLUS_TEXT); | |
75 if (!stream_con->in) | 73 if (!stream_con->in) |
76 error ("Unable to open tty %s", XSTRING_DATA (tty)); | 74 error ("Unable to open tty %s", XSTRING_DATA (tty)); |
77 } | 75 } |
78 } | 76 } |
79 | 77 |
171 } | 169 } |
172 | 170 |
173 | 171 |
174 static int | 172 static int |
175 stream_text_width (struct frame *f, struct face_cachel *cachel, | 173 stream_text_width (struct frame *f, struct face_cachel *cachel, |
176 const Emchar *str, Charcount len) | 174 CONST Emchar *str, Charcount len) |
177 { | 175 { |
178 return len; | 176 return len; |
179 } | 177 } |
180 | 178 |
181 static int | 179 static int |
198 | 196 |
199 static int | 197 static int |
200 stream_eol_cursor_width (void) | 198 stream_eol_cursor_width (void) |
201 { | 199 { |
202 return 1; | 200 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 { | |
203 } | 211 } |
204 | 212 |
205 static void | 213 static void |
206 stream_output_display_block (struct window *w, struct display_line *dl, | 214 stream_output_display_block (struct window *w, struct display_line *dl, |
207 int block, int start, int end, | 215 int block, int start, int end, |
209 int cursor_width, int cursor_height) | 217 int cursor_width, int cursor_height) |
210 { | 218 { |
211 } | 219 } |
212 | 220 |
213 static void | 221 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 | |
214 stream_clear_region (Lisp_Object window, struct device* d, struct frame * f, | 232 stream_clear_region (Lisp_Object window, struct device* d, struct frame * f, |
215 face_index findex, int x, int y, | 233 face_index findex, int x, int y, |
216 int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, | 234 int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, |
217 Lisp_Object background_pixmap) | 235 Lisp_Object background_pixmap) |
236 { | |
237 } | |
238 | |
239 static void | |
240 stream_clear_frame (struct frame *f) | |
218 { | 241 { |
219 } | 242 } |
220 | 243 |
221 static int | 244 static int |
222 stream_flash (struct device *d) | 245 stream_flash (struct device *d) |
260 /* redisplay methods */ | 283 /* redisplay methods */ |
261 CONSOLE_HAS_METHOD (stream, left_margin_width); | 284 CONSOLE_HAS_METHOD (stream, left_margin_width); |
262 CONSOLE_HAS_METHOD (stream, right_margin_width); | 285 CONSOLE_HAS_METHOD (stream, right_margin_width); |
263 CONSOLE_HAS_METHOD (stream, text_width); | 286 CONSOLE_HAS_METHOD (stream, text_width); |
264 CONSOLE_HAS_METHOD (stream, output_display_block); | 287 CONSOLE_HAS_METHOD (stream, output_display_block); |
288 CONSOLE_HAS_METHOD (stream, output_vertical_divider); | |
265 CONSOLE_HAS_METHOD (stream, divider_height); | 289 CONSOLE_HAS_METHOD (stream, divider_height); |
266 CONSOLE_HAS_METHOD (stream, eol_cursor_width); | 290 CONSOLE_HAS_METHOD (stream, eol_cursor_width); |
291 CONSOLE_HAS_METHOD (stream, clear_to_window_end); | |
267 CONSOLE_HAS_METHOD (stream, clear_region); | 292 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); | |
268 CONSOLE_HAS_METHOD (stream, flash); | 296 CONSOLE_HAS_METHOD (stream, flash); |
269 CONSOLE_HAS_METHOD (stream, ring_bell); | 297 CONSOLE_HAS_METHOD (stream, ring_bell); |
270 } | |
271 | |
272 void | |
273 reinit_console_type_create_stream (void) | |
274 { | |
275 REINITIALIZE_CONSOLE_TYPE (stream); | |
276 } | 298 } |
277 | 299 |
278 void | 300 void |
279 vars_of_console_stream (void) | 301 vars_of_console_stream (void) |
280 { | 302 { |
296 /* Moved from console-tty.c */ | 318 /* Moved from console-tty.c */ |
297 Vstdio_str = build_string ("stdio"); | 319 Vstdio_str = build_string ("stdio"); |
298 staticpro (&Vstdio_str); | 320 staticpro (&Vstdio_str); |
299 } | 321 } |
300 | 322 |
301 #ifndef PDUMP | |
302 void | 323 void |
303 init_console_stream (int reinit) | 324 init_console_stream (void) |
304 { | 325 { |
305 /* This function can GC */ | 326 /* This function can GC */ |
306 if (!initialized) | 327 if (!initialized) |
307 { | 328 { |
308 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); | 329 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); |
316 stream_init_console (XCONSOLE (Vterminal_console), Qnil); | 337 stream_init_console (XCONSOLE (Vterminal_console), Qnil); |
317 if (noninteractive) | 338 if (noninteractive) |
318 event_stream_select_console (XCONSOLE (Vterminal_console)); | 339 event_stream_select_console (XCONSOLE (Vterminal_console)); |
319 } | 340 } |
320 } | 341 } |
321 | |
322 #else | |
323 | |
324 void | |
325 init_console_stream (int reinit) | |
326 { | |
327 /* This function can GC */ | |
328 if (!reinit) | |
329 { | |
330 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); | |
331 Vterminal_console = Fdevice_console (Vterminal_device); | |
332 Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); | |
333 minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; | |
334 } | |
335 if (initialized) | |
336 { | |
337 stream_init_console (XCONSOLE (Vterminal_console), Qnil); | |
338 if (noninteractive) | |
339 event_stream_select_console (XCONSOLE (Vterminal_console)); | |
340 } | |
341 } | |
342 #endif |