comparison src/frame.c @ 83008:040dd41ed7d0

Hookified termcap devices, added bootstrap display device, plus many bugfixes. lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells. lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells. src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations. (get_named_tty_display): New prototype. (tty_clear_end_of_line, term_init): Updated to new prototype. (initial_term_init): Renamed to init_initial_display. src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call. (update_frame): Don't flush the tty of there is no tty. (init_display): Set up a termcap display on the controlling tty and change the initial frame to use that. Delete the initial display. src/frame.c (Fframep): Return t for the initial frame. (make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init. (make_terminal_frame): Removed special cases for creating the initial frame. src/frame.h (enum output_method): New entry: output_initial for the bootstrap display. (FRAME_INITIAL_P): New macro. (make_initial_frame): New prototype. src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment. (init_keyboard): Added comment about exiting on SIGINT. (Fset_input_mode): A termcap frame is never the initial frame anymore. src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype. (reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call. src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes. src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook. src/term.c (initial_display): New variable. (tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to) (tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line) (tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions. (ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to) (clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs) (delete_glyphs, ins_del_lines): Removed special casing of termcap displays. (get_tty_display): New function. (Ftty_display_color_p, Ftty_display_color_cells): Use it. (get_named_tty_display): Removed static. (tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter instead of tty_display_info for hook compatibility. (set_terminal_modes, reset_terminal_modes): Removed. (initial_term_init): Renamed to init_initial_display. Set up an output_initial device, not a termcap display. (delete_initial_display): New function. (maybe_fatal): New function, for private use of term_init. (term_init): New parameter for choosing between fatal and simple errors. Removed incomprehensible special casing for the second initialization of the controlling tty. Use maybe_fatal for error handling. Initialize termcap display hooks in the new device. Initialize the display pointer in the tty_display_info structure. (delete_tty): Replace order of reset_sys_modes and delete_display. src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame. src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device. src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 09 Jan 2004 18:57:53 +0000
parents 7900111db01c
children b2b37c85b00a
comparison
equal deleted inserted replaced
83007:c0cb35d94ea7 83008:040dd41ed7d0
200 { 200 {
201 if (!FRAMEP (object)) 201 if (!FRAMEP (object))
202 return Qnil; 202 return Qnil;
203 switch (XFRAME (object)->output_method) 203 switch (XFRAME (object)->output_method)
204 { 204 {
205 case output_initial: /* The initial frame is like a termcap frame. */
205 case output_termcap: 206 case output_termcap:
206 return Qt; 207 return Qt;
207 case output_x_window: 208 case output_x_window:
208 return Qx; 209 return Qx;
209 case output_w32: 210 case output_w32:
500 /* Construct a frame that refers to a terminal. */ 501 /* Construct a frame that refers to a terminal. */
501 502
502 static int terminal_frame_count; 503 static int terminal_frame_count;
503 504
504 struct frame * 505 struct frame *
506 make_initial_frame (void)
507 {
508 struct frame *f;
509 struct display *display;
510 Lisp_Object frame;
511
512 #ifdef MULTI_KBOARD
513 /* Create the initial keyboard. */
514 if (!initial_kboard)
515 {
516 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
517 init_kboard (initial_kboard);
518 initial_kboard->next_kboard = all_kboards;
519 all_kboards = initial_kboard;
520 }
521 #endif
522
523 /* The first call must initialize Vframe_list. */
524 if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
525 Vframe_list = Qnil;
526
527 display = init_initial_display ();
528
529 f = make_frame (1);
530 XSETFRAME (frame, f);
531
532 Vframe_list = Fcons (frame, Vframe_list);
533
534 terminal_frame_count = 1;
535 f->name = build_string ("F1");
536
537 f->visible = 1;
538 f->async_visible = 1;
539
540 f->output_method = display->type;
541 f->display = display;
542 f->display->reference_count++;
543 f->output_data.nothing = 0;
544
545 FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
546 FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
547
548 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
549 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
550
551 #ifdef MULTI_KBOARD
552 f->kboard = initial_kboard;
553 #endif
554
555 return f;
556 }
557
558
559 struct frame *
505 make_terminal_frame (tty_name, tty_type) 560 make_terminal_frame (tty_name, tty_type)
506 char *tty_name; 561 char *tty_name;
507 char *tty_type; 562 char *tty_type;
508 { 563 {
509 register struct frame *f; 564 register struct frame *f;
510 struct display *display; 565 struct display *display;
511 Lisp_Object frame; 566 Lisp_Object frame;
512 char name[20]; 567 char name[20];
513 568
514 #ifdef MULTI_KBOARD
515 /* Create the initial keyboard. */
516 if (!initial_kboard)
517 {
518 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
519 init_kboard (initial_kboard);
520 initial_kboard->next_kboard = all_kboards;
521 all_kboards = initial_kboard;
522 }
523 #endif
524
525 /* The first call must initialize Vframe_list. */
526 if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
527 Vframe_list = Qnil;
528
529 /* Open the display before creating the new frame, because 569 /* Open the display before creating the new frame, because
530 create_tty_display might throw an error. */ 570 create_tty_display might throw an error. */
531 if (initialized) 571 display = term_init (tty_name, tty_type, 0); /* Errors are not fatal. */
532 display = term_init (tty_name, tty_type);
533 else
534 display = initial_term_init ();
535 572
536 f = make_frame (1); 573 f = make_frame (1);
537 574
538 XSETFRAME (frame, f); 575 XSETFRAME (frame, f);
539 Vframe_list = Fcons (frame, Vframe_list); 576 Vframe_list = Fcons (frame, Vframe_list);