comparison src/frame.c @ 83342:9216636c02fc

Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly. * src/termhooks.h (struct device): Rename to `struct device'. Rename member `next_display' to `next_device'. Rename member `delete_display_hook' to `delete_device_hook'. (FRAME_DISPLAY): Rename to FRAME_DEVICE. (DISPLAY_ACTIVE_P): Rename to DEVICE_ACTIVE_P. (DISPLAY_TERMINAL_CODING): Rename to DEVICE_TERMINAL_CODING. (DISPLAY_KEYBOARD_CODING): Rename to DEVICE_KEYBOARD_CODING. * src/frame.h (stuct frame): Rename `display' member to `device'. * src/xterm.h (x_display_info): Rename member `frame_display' to `device'. * src/termchar.h (struct tty_display_info): Rename `display' member to `device'. * src/keyboard.c (push_display_kboard): Rename to push_device_kboard. * lisp/frame.el (make-frame): Rename frame parameter `display-id' to `device'. * src/frame.c (Fmake_terminal_frame): Ditto. * src/xfns.c (Fx_create_frame): Ditto. * src/term.c (display_list): Rename to device_list. * src/term.c (initial_display): Rename to initial_device. * src/term.c (next_display_id): Rename to next_device_id. * src/term.c (get_display): Rename to get_device. * src/term.c (get_tty_display): Rename to get_tty_device. * src/term.c (get_named_tty_display): Rename to get_named_tty. * src/term.c (init_initial_display): Rename to init_initial_device. * src/term.c (delete_initial_display): Rename to delete_initial_device. * src/term.c (create_display): Rename to create_device. * src/term.c (delete_display): Rename to delete_device. * src/xfns.c (check_x_display_info): Document that the function allows display ids as well. * src/xterm.c (x_delete_frame_display): Rename to x_delete_device. * src/xterm.c (x_create_frame_display): Rename to x_create_device. * src/coding.c: Update. * src/dispextern.h: Update. * src/data.c: Update. * src/dispnew.c: Update. * src/frame.c: Update. * src/frame.h: Update. * src/keyboard.c: Update. * src/keyboard.h: Update. * src/lisp.h: Update. * src/sysdep.c: Update. * src/term.c: Update. * src/xdisp.c: Update. * src/xselect.c: Update. * src/xterm.c: Update. * src/prefix-args.c: Include stdlib.h for exit. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-382
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 11 Jul 2005 00:05:55 +0000
parents 76e51706154e
children 532e0a9335a9
comparison
equal deleted inserted replaced
83341:76e51706154e 83342:9216636c02fc
74 Lisp_Object Qbackground_mode; 74 Lisp_Object Qbackground_mode;
75 Lisp_Object Qinhibit_default_face_x_resources; 75 Lisp_Object Qinhibit_default_face_x_resources;
76 76
77 Lisp_Object Qx_frame_parameter; 77 Lisp_Object Qx_frame_parameter;
78 Lisp_Object Qx_resource_name; 78 Lisp_Object Qx_resource_name;
79 Lisp_Object Qdisplay_id; 79 Lisp_Object Qdevice;
80 Lisp_Object Qdisplay_live_p; 80 Lisp_Object Qdisplay_live_p;
81 81
82 /* Frame parameters (set or reported). */ 82 /* Frame parameters (set or reported). */
83 83
84 Lisp_Object Qauto_raise, Qauto_lower; 84 Lisp_Object Qauto_raise, Qauto_lower;
420 if (!NILP (mini_window)) 420 if (!NILP (mini_window))
421 CHECK_LIVE_WINDOW (mini_window); 421 CHECK_LIVE_WINDOW (mini_window);
422 422
423 #ifdef MULTI_KBOARD 423 #ifdef MULTI_KBOARD
424 if (!NILP (mini_window) 424 if (!NILP (mini_window)
425 && XFRAME (XWINDOW (mini_window)->frame)->display->kboard != kb) 425 && XFRAME (XWINDOW (mini_window)->frame)->device->kboard != kb)
426 error ("Frame and minibuffer must be on the same display"); 426 error ("Frame and minibuffer must be on the same display");
427 #endif 427 #endif
428 428
429 /* Make a frame containing just a root window. */ 429 /* Make a frame containing just a root window. */
430 f = make_frame (0); 430 f = make_frame (0);
505 505
506 struct frame * 506 struct frame *
507 make_initial_frame (void) 507 make_initial_frame (void)
508 { 508 {
509 struct frame *f; 509 struct frame *f;
510 struct display *display; 510 struct device *device;
511 Lisp_Object frame; 511 Lisp_Object frame;
512 512
513 #ifdef MULTI_KBOARD 513 #ifdef MULTI_KBOARD
514 /* Create the initial keyboard. */ 514 /* Create the initial keyboard. */
515 if (!initial_kboard) 515 if (!initial_kboard)
523 523
524 /* The first call must initialize Vframe_list. */ 524 /* The first call must initialize Vframe_list. */
525 if (! (NILP (Vframe_list) || CONSP (Vframe_list))) 525 if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
526 Vframe_list = Qnil; 526 Vframe_list = Qnil;
527 527
528 display = init_initial_display (); 528 device = init_initial_device ();
529 529
530 f = make_frame (1); 530 f = make_frame (1);
531 XSETFRAME (frame, f); 531 XSETFRAME (frame, f);
532 532
533 Vframe_list = Fcons (frame, Vframe_list); 533 Vframe_list = Fcons (frame, Vframe_list);
536 f->name = build_string ("F1"); 536 f->name = build_string ("F1");
537 537
538 f->visible = 1; 538 f->visible = 1;
539 f->async_visible = 1; 539 f->async_visible = 1;
540 540
541 f->output_method = display->type; 541 f->output_method = device->type;
542 f->display = display; 542 f->device = device;
543 f->display->reference_count++; 543 f->device->reference_count++;
544 f->output_data.nothing = 0; 544 f->output_data.nothing = 0;
545 545
546 FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR; 546 FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
547 FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR; 547 FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
548 548
552 return f; 552 return f;
553 } 553 }
554 554
555 555
556 struct frame * 556 struct frame *
557 make_terminal_frame (struct display *display) 557 make_terminal_frame (struct device *device)
558 { 558 {
559 register struct frame *f; 559 register struct frame *f;
560 Lisp_Object frame; 560 Lisp_Object frame;
561 char name[20]; 561 char name[20];
562 562
603 #ifdef MAC_OS8 603 #ifdef MAC_OS8
604 make_mac_terminal_frame (f); 604 make_mac_terminal_frame (f);
605 #else 605 #else
606 { 606 {
607 f->output_method = output_termcap; 607 f->output_method = output_termcap;
608 f->display = display; 608 f->device = device;
609 f->display->reference_count++; 609 f->device->reference_count++;
610 create_tty_output (f); 610 create_tty_output (f);
611 611
612 FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR; 612 FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
613 FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR; 613 FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
614 614
656 affects all frames on the same terminal device. */) 656 affects all frames on the same terminal device. */)
657 (parms) 657 (parms)
658 Lisp_Object parms; 658 Lisp_Object parms;
659 { 659 {
660 struct frame *f; 660 struct frame *f;
661 struct display *d = NULL; 661 struct device *d = NULL;
662 Lisp_Object frame, tem; 662 Lisp_Object frame, tem;
663 struct frame *sf = SELECTED_FRAME (); 663 struct frame *sf = SELECTED_FRAME ();
664 664
665 #ifdef MSDOS 665 #ifdef MSDOS
666 if (sf->output_method != output_msdos_raw 666 if (sf->output_method != output_msdos_raw
680 #endif /* not MSDOS */ 680 #endif /* not MSDOS */
681 681
682 { 682 {
683 Lisp_Object display_device; 683 Lisp_Object display_device;
684 684
685 display_device = Fassq (Qdisplay_id, parms); 685 display_device = Fassq (Qdevice, parms);
686 if (!NILP (display_device)) 686 if (!NILP (display_device))
687 { 687 {
688 display_device = XCDR (display_device); 688 display_device = XCDR (display_device);
689 CHECK_NUMBER (display_device); 689 CHECK_NUMBER (display_device);
690 d = get_display (XINT (display_device), 1); 690 d = get_device (XINT (display_device), 1);
691 } 691 }
692 } 692 }
693 693
694 if (!d) 694 if (!d)
695 { 695 {
1051 1051
1052 The display device is represented by its integer identifier. */) 1052 The display device is represented by its integer identifier. */)
1053 (frame) 1053 (frame)
1054 Lisp_Object frame; 1054 Lisp_Object frame;
1055 { 1055 {
1056 struct display *d; 1056 struct device *d;
1057 1057
1058 if (NILP (frame)) 1058 if (NILP (frame))
1059 frame = selected_frame; 1059 frame = selected_frame;
1060 1060
1061 CHECK_LIVE_FRAME (frame); 1061 CHECK_LIVE_FRAME (frame);
1062 1062
1063 d = get_display (frame, 0); 1063 d = get_device (frame, 0);
1064 1064
1065 if (!d) 1065 if (!d)
1066 return Qnil; 1066 return Qnil;
1067 else 1067 else
1068 return make_number (d->id); 1068 return make_number (d->id);
1500 an event for f at any time; if we zero out the frame's display 1500 an event for f at any time; if we zero out the frame's display
1501 now, then we may trip up the event-handling code. Instead, we'll 1501 now, then we may trip up the event-handling code. Instead, we'll
1502 promise that the display of the frame must be valid until we have 1502 promise that the display of the frame must be valid until we have
1503 called the window-system-dependent frame destruction routine. */ 1503 called the window-system-dependent frame destruction routine. */
1504 1504
1505 if (FRAME_DISPLAY (f)->delete_frame_hook) 1505 if (FRAME_DEVICE (f)->delete_frame_hook)
1506 (*FRAME_DISPLAY (f)->delete_frame_hook) (f); 1506 (*FRAME_DEVICE (f)->delete_frame_hook) (f);
1507 1507
1508 { 1508 {
1509 struct display *display = FRAME_DISPLAY (f); 1509 struct device *device = FRAME_DEVICE (f);
1510 f->output_data.nothing = 0; 1510 f->output_data.nothing = 0;
1511 f->display = 0; /* Now the frame is dead. */ 1511 f->device = 0; /* Now the frame is dead. */
1512 1512
1513 /* If needed, delete the device that this frame was on. 1513 /* If needed, delete the device that this frame was on.
1514 (This must be done after the frame is killed.) */ 1514 (This must be done after the frame is killed.) */
1515 display->reference_count--; 1515 device->reference_count--;
1516 if (display->reference_count == 0) 1516 if (device->reference_count == 0)
1517 { 1517 {
1518 kb = NULL; 1518 kb = NULL;
1519 if (display->delete_display_hook) 1519 if (device->delete_device_hook)
1520 (*display->delete_display_hook) (display); 1520 (*device->delete_device_hook) (device);
1521 else 1521 else
1522 delete_display (display); 1522 delete_device (device);
1523 } 1523 }
1524 else 1524 else
1525 kb = display->kboard; 1525 kb = device->kboard;
1526 } 1526 }
1527 1527
1528 /* If we've deleted the last_nonminibuf_frame, then try to find 1528 /* If we've deleted the last_nonminibuf_frame, then try to find
1529 another one. */ 1529 another one. */
1530 if (f == last_nonminibuf_frame) 1530 if (f == last_nonminibuf_frame)
1667 f = SELECTED_FRAME (); 1667 f = SELECTED_FRAME ();
1668 x = y = Qnil; 1668 x = y = Qnil;
1669 1669
1670 #ifdef HAVE_MOUSE 1670 #ifdef HAVE_MOUSE
1671 /* It's okay for the hook to refrain from storing anything. */ 1671 /* It's okay for the hook to refrain from storing anything. */
1672 if (FRAME_DISPLAY (f)->mouse_position_hook) 1672 if (FRAME_DEVICE (f)->mouse_position_hook)
1673 (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, -1, 1673 (*FRAME_DEVICE (f)->mouse_position_hook) (&f, -1,
1674 &lispy_dummy, &party_dummy, 1674 &lispy_dummy, &party_dummy,
1675 &x, &y, 1675 &x, &y,
1676 &long_dummy); 1676 &long_dummy);
1677 if (! NILP (x)) 1677 if (! NILP (x))
1678 { 1678 {
1710 f = SELECTED_FRAME (); 1710 f = SELECTED_FRAME ();
1711 x = y = Qnil; 1711 x = y = Qnil;
1712 1712
1713 #ifdef HAVE_MOUSE 1713 #ifdef HAVE_MOUSE
1714 /* It's okay for the hook to refrain from storing anything. */ 1714 /* It's okay for the hook to refrain from storing anything. */
1715 if (FRAME_DISPLAY (f)->mouse_position_hook) 1715 if (FRAME_DEVICE (f)->mouse_position_hook)
1716 (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, -1, 1716 (*FRAME_DEVICE (f)->mouse_position_hook) (&f, -1,
1717 &lispy_dummy, &party_dummy, 1717 &lispy_dummy, &party_dummy,
1718 &x, &y, 1718 &x, &y,
1719 &long_dummy); 1719 &long_dummy);
1720 #endif 1720 #endif
1721 XSETFRAME (lispy_dummy, f); 1721 XSETFRAME (lispy_dummy, f);
1991 f = XFRAME (frame); 1991 f = XFRAME (frame);
1992 1992
1993 /* Do like the documentation says. */ 1993 /* Do like the documentation says. */
1994 Fmake_frame_visible (frame); 1994 Fmake_frame_visible (frame);
1995 1995
1996 if (FRAME_DISPLAY (f)->frame_raise_lower_hook) 1996 if (FRAME_DEVICE (f)->frame_raise_lower_hook)
1997 (*FRAME_DISPLAY (f)->frame_raise_lower_hook) (f, 1); 1997 (*FRAME_DEVICE (f)->frame_raise_lower_hook) (f, 1);
1998 1998
1999 return Qnil; 1999 return Qnil;
2000 } 2000 }
2001 2001
2002 /* Should we have a corresponding function called Flower_Power? */ 2002 /* Should we have a corresponding function called Flower_Power? */
2015 2015
2016 CHECK_LIVE_FRAME (frame); 2016 CHECK_LIVE_FRAME (frame);
2017 2017
2018 f = XFRAME (frame); 2018 f = XFRAME (frame);
2019 2019
2020 if (FRAME_DISPLAY (f)->frame_raise_lower_hook) 2020 if (FRAME_DEVICE (f)->frame_raise_lower_hook)
2021 (*FRAME_DISPLAY (f)->frame_raise_lower_hook) (f, 0); 2021 (*FRAME_DEVICE (f)->frame_raise_lower_hook) (f, 0);
2022 2022
2023 return Qnil; 2023 return Qnil;
2024 } 2024 }
2025 2025
2026 2026
2064 2064
2065 f = XFRAME (frame); 2065 f = XFRAME (frame);
2066 2066
2067 f->focus_frame = focus_frame; 2067 f->focus_frame = focus_frame;
2068 2068
2069 if (FRAME_DISPLAY (f)->frame_rehighlight_hook) 2069 if (FRAME_DEVICE (f)->frame_rehighlight_hook)
2070 (*FRAME_DISPLAY (f)->frame_rehighlight_hook) (f); 2070 (*FRAME_DEVICE (f)->frame_rehighlight_hook) (f);
2071 2071
2072 return Qnil; 2072 return Qnil;
2073 } 2073 }
2074 2074
2075 2075
4221 staticpro (&Qx_resource_name); 4221 staticpro (&Qx_resource_name);
4222 4222
4223 Qx_frame_parameter = intern ("x-frame-parameter"); 4223 Qx_frame_parameter = intern ("x-frame-parameter");
4224 staticpro (&Qx_frame_parameter); 4224 staticpro (&Qx_frame_parameter);
4225 4225
4226 Qdisplay_id = intern ("display-id"); 4226 Qdevice = intern ("device");
4227 staticpro (&Qdisplay_id); 4227 staticpro (&Qdevice);
4228 Qdisplay_live_p = intern ("display-live-p"); 4228 Qdisplay_live_p = intern ("display-live-p");
4229 staticpro (&Qdisplay_live_p); 4229 staticpro (&Qdisplay_live_p);
4230 4230
4231 { 4231 {
4232 int i; 4232 int i;