diff options
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/src/xterm.c b/src/xterm.c index 5da3f422f80..b784b560fc4 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -338,15 +338,15 @@ void x_raise_frame P_ ((struct frame *)); | |||
| 338 | void x_set_window_size P_ ((struct frame *, int, int, int)); | 338 | void x_set_window_size P_ ((struct frame *, int, int, int)); |
| 339 | void x_wm_set_window_state P_ ((struct frame *, int)); | 339 | void x_wm_set_window_state P_ ((struct frame *, int)); |
| 340 | void x_wm_set_icon_pixmap P_ ((struct frame *, int)); | 340 | void x_wm_set_icon_pixmap P_ ((struct frame *, int)); |
| 341 | struct device *x_create_device P_ ((struct x_display_info *)); | 341 | static struct terminal *x_create_terminal P_ ((struct x_display_info *)); |
| 342 | void x_delete_device P_ ((struct device *)); | 342 | void x_delete_terminal P_ ((struct terminal *)); |
| 343 | void x_initialize P_ ((void)); | 343 | void x_initialize P_ ((void)); |
| 344 | static void x_font_min_bounds P_ ((XFontStruct *, int *, int *)); | 344 | static void x_font_min_bounds P_ ((XFontStruct *, int *, int *)); |
| 345 | static int x_compute_min_glyph_bounds P_ ((struct frame *)); | 345 | static int x_compute_min_glyph_bounds P_ ((struct frame *)); |
| 346 | static void x_update_end P_ ((struct frame *)); | 346 | static void x_update_end P_ ((struct frame *)); |
| 347 | static void XTframe_up_to_date P_ ((struct frame *)); | 347 | static void XTframe_up_to_date P_ ((struct frame *)); |
| 348 | static void XTset_terminal_modes P_ ((struct device *)); | 348 | static void XTset_terminal_modes P_ ((struct terminal *)); |
| 349 | static void XTreset_terminal_modes P_ ((struct device *)); | 349 | static void XTreset_terminal_modes P_ ((struct terminal *)); |
| 350 | static void x_clear_frame P_ ((struct frame *)); | 350 | static void x_clear_frame P_ ((struct frame *)); |
| 351 | static void frame_highlight P_ ((struct frame *)); | 351 | static void frame_highlight P_ ((struct frame *)); |
| 352 | static void frame_unhighlight P_ ((struct frame *)); | 352 | static void frame_unhighlight P_ ((struct frame *)); |
| @@ -806,7 +806,7 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 806 | rarely happens). */ | 806 | rarely happens). */ |
| 807 | 807 | ||
| 808 | static void | 808 | static void |
| 809 | XTset_terminal_modes (struct device *device) | 809 | XTset_terminal_modes (struct terminal *terminal) |
| 810 | { | 810 | { |
| 811 | } | 811 | } |
| 812 | 812 | ||
| @@ -814,7 +814,7 @@ XTset_terminal_modes (struct device *device) | |||
| 814 | the X-windows go away, and suspending requires no action. */ | 814 | the X-windows go away, and suspending requires no action. */ |
| 815 | 815 | ||
| 816 | static void | 816 | static void |
| 817 | XTreset_terminal_modes (struct device *device) | 817 | XTreset_terminal_modes (struct terminal *terminal) |
| 818 | { | 818 | { |
| 819 | } | 819 | } |
| 820 | 820 | ||
| @@ -5673,7 +5673,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 5673 | int count = 0; | 5673 | int count = 0; |
| 5674 | int do_help = 0; | 5674 | int do_help = 0; |
| 5675 | int nbytes = 0; | 5675 | int nbytes = 0; |
| 5676 | struct frame *f; | 5676 | struct frame *f = NULL; |
| 5677 | struct coding_system coding; | 5677 | struct coding_system coding; |
| 5678 | XEvent event = *eventp; | 5678 | XEvent event = *eventp; |
| 5679 | 5679 | ||
| @@ -6923,8 +6923,8 @@ x_dispatch_event (event, display) | |||
| 6923 | EXPECTED is nonzero if the caller knows input is available. */ | 6923 | EXPECTED is nonzero if the caller knows input is available. */ |
| 6924 | 6924 | ||
| 6925 | static int | 6925 | static int |
| 6926 | XTread_socket (device, expected, hold_quit) | 6926 | XTread_socket (terminal, expected, hold_quit) |
| 6927 | struct device *device; | 6927 | struct terminal *terminal; |
| 6928 | int expected; | 6928 | int expected; |
| 6929 | struct input_event *hold_quit; | 6929 | struct input_event *hold_quit; |
| 6930 | { | 6930 | { |
| @@ -6987,7 +6987,7 @@ XTread_socket (device, expected, hold_quit) | |||
| 6987 | 6987 | ||
| 6988 | #ifdef HAVE_X_SM | 6988 | #ifdef HAVE_X_SM |
| 6989 | /* Only check session manager input for the primary display. */ | 6989 | /* Only check session manager input for the primary display. */ |
| 6990 | if (device->id == 1 && x_session_have_connection ()) | 6990 | if (terminal->id == 1 && x_session_have_connection ()) |
| 6991 | { | 6991 | { |
| 6992 | struct input_event inev; | 6992 | struct input_event inev; |
| 6993 | BLOCK_INPUT; | 6993 | BLOCK_INPUT; |
| @@ -7656,7 +7656,7 @@ x_connection_closed (dpy, error_message) | |||
| 7656 | /* Protect display from being closed when we delete the last | 7656 | /* Protect display from being closed when we delete the last |
| 7657 | frame on it. */ | 7657 | frame on it. */ |
| 7658 | dpyinfo->reference_count++; | 7658 | dpyinfo->reference_count++; |
| 7659 | dpyinfo->device->reference_count++; | 7659 | dpyinfo->terminal->reference_count++; |
| 7660 | } | 7660 | } |
| 7661 | 7661 | ||
| 7662 | /* First delete frames whose mini-buffers are on frames | 7662 | /* First delete frames whose mini-buffers are on frames |
| @@ -7724,7 +7724,7 @@ x_connection_closed (dpy, error_message) | |||
| 7724 | dpyinfo->display = 0; | 7724 | dpyinfo->display = 0; |
| 7725 | 7725 | ||
| 7726 | dpyinfo->reference_count--; | 7726 | dpyinfo->reference_count--; |
| 7727 | dpyinfo->device->reference_count--; | 7727 | dpyinfo->terminal->reference_count--; |
| 7728 | if (dpyinfo->reference_count != 0) | 7728 | if (dpyinfo->reference_count != 0) |
| 7729 | /* We have just closed all frames on this display. */ | 7729 | /* We have just closed all frames on this display. */ |
| 7730 | abort (); | 7730 | abort (); |
| @@ -7734,7 +7734,7 @@ x_connection_closed (dpy, error_message) | |||
| 7734 | 7734 | ||
| 7735 | x_uncatch_errors (dpy, count); | 7735 | x_uncatch_errors (dpy, count); |
| 7736 | 7736 | ||
| 7737 | if (device_list == 0) | 7737 | if (terminal_list == 0) |
| 7738 | { | 7738 | { |
| 7739 | fprintf (stderr, "%s\n", error_msg); | 7739 | fprintf (stderr, "%s\n", error_msg); |
| 7740 | shut_down_emacs (0, 0, Qnil); | 7740 | shut_down_emacs (0, 0, Qnil); |
| @@ -10121,7 +10121,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10121 | { | 10121 | { |
| 10122 | int connection; | 10122 | int connection; |
| 10123 | Display *dpy; | 10123 | Display *dpy; |
| 10124 | struct device *device; | 10124 | struct terminal *terminal; |
| 10125 | struct x_display_info *dpyinfo; | 10125 | struct x_display_info *dpyinfo; |
| 10126 | XrmDatabase xrdb; | 10126 | XrmDatabase xrdb; |
| 10127 | 10127 | ||
| @@ -10268,7 +10268,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10268 | dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); | 10268 | dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); |
| 10269 | bzero (dpyinfo, sizeof *dpyinfo); | 10269 | bzero (dpyinfo, sizeof *dpyinfo); |
| 10270 | 10270 | ||
| 10271 | device = x_create_device (dpyinfo); | 10271 | terminal = x_create_terminal (dpyinfo); |
| 10272 | 10272 | ||
| 10273 | #ifdef MULTI_KBOARD | 10273 | #ifdef MULTI_KBOARD |
| 10274 | { | 10274 | { |
| @@ -10281,30 +10281,30 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10281 | SDATA (display_name))) | 10281 | SDATA (display_name))) |
| 10282 | break; | 10282 | break; |
| 10283 | if (share) | 10283 | if (share) |
| 10284 | device->kboard = share->device->kboard; | 10284 | terminal->kboard = share->terminal->kboard; |
| 10285 | else | 10285 | else |
| 10286 | { | 10286 | { |
| 10287 | device->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); | 10287 | terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); |
| 10288 | init_kboard (device->kboard); | 10288 | init_kboard (terminal->kboard); |
| 10289 | if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) | 10289 | if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) |
| 10290 | { | 10290 | { |
| 10291 | char *vendor = ServerVendor (dpy); | 10291 | char *vendor = ServerVendor (dpy); |
| 10292 | UNBLOCK_INPUT; | 10292 | UNBLOCK_INPUT; |
| 10293 | device->kboard->Vsystem_key_alist | 10293 | terminal->kboard->Vsystem_key_alist |
| 10294 | = call1 (Qvendor_specific_keysyms, | 10294 | = call1 (Qvendor_specific_keysyms, |
| 10295 | build_string (vendor ? vendor : "")); | 10295 | build_string (vendor ? vendor : "")); |
| 10296 | BLOCK_INPUT; | 10296 | BLOCK_INPUT; |
| 10297 | } | 10297 | } |
| 10298 | 10298 | ||
| 10299 | device->kboard->next_kboard = all_kboards; | 10299 | terminal->kboard->next_kboard = all_kboards; |
| 10300 | all_kboards = device->kboard; | 10300 | all_kboards = terminal->kboard; |
| 10301 | /* Don't let the initial kboard remain current longer than necessary. | 10301 | /* Don't let the initial kboard remain current longer than necessary. |
| 10302 | That would cause problems if a file loaded on startup tries to | 10302 | That would cause problems if a file loaded on startup tries to |
| 10303 | prompt in the mini-buffer. */ | 10303 | prompt in the mini-buffer. */ |
| 10304 | if (current_kboard == initial_kboard) | 10304 | if (current_kboard == initial_kboard) |
| 10305 | current_kboard = device->kboard; | 10305 | current_kboard = terminal->kboard; |
| 10306 | } | 10306 | } |
| 10307 | device->kboard->reference_count++; | 10307 | terminal->kboard->reference_count++; |
| 10308 | } | 10308 | } |
| 10309 | #endif | 10309 | #endif |
| 10310 | 10310 | ||
| @@ -10319,10 +10319,10 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10319 | 10319 | ||
| 10320 | dpyinfo->display = dpy; | 10320 | dpyinfo->display = dpy; |
| 10321 | 10321 | ||
| 10322 | /* Set the name of the device. */ | 10322 | /* Set the name of the terminal. */ |
| 10323 | device->name = (char *) xmalloc (SBYTES (display_name) + 1); | 10323 | terminal->name = (char *) xmalloc (SBYTES (display_name) + 1); |
| 10324 | strncpy (device->name, SDATA (display_name), SBYTES (display_name)); | 10324 | strncpy (terminal->name, SDATA (display_name), SBYTES (display_name)); |
| 10325 | device->name[SBYTES (display_name)] = 0; | 10325 | terminal->name[SBYTES (display_name)] = 0; |
| 10326 | 10326 | ||
| 10327 | #if 0 | 10327 | #if 0 |
| 10328 | XSetAfterFunction (x_current_display, x_trace_wire); | 10328 | XSetAfterFunction (x_current_display, x_trace_wire); |
| @@ -10614,7 +10614,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10614 | /* Only do this for the very first display in the Emacs session. | 10614 | /* Only do this for the very first display in the Emacs session. |
| 10615 | Ignore X session management when Emacs was first started on a | 10615 | Ignore X session management when Emacs was first started on a |
| 10616 | tty. */ | 10616 | tty. */ |
| 10617 | if (device->id == 1) | 10617 | if (terminal->id == 1) |
| 10618 | x_session_initialize (dpyinfo); | 10618 | x_session_initialize (dpyinfo); |
| 10619 | #endif | 10619 | #endif |
| 10620 | 10620 | ||
| @@ -10631,17 +10631,17 @@ x_delete_display (dpyinfo) | |||
| 10631 | struct x_display_info *dpyinfo; | 10631 | struct x_display_info *dpyinfo; |
| 10632 | { | 10632 | { |
| 10633 | int i; | 10633 | int i; |
| 10634 | struct device *d; | 10634 | struct terminal *t; |
| 10635 | 10635 | ||
| 10636 | /* Delete the generic struct device for this X display. */ | 10636 | /* Delete the generic struct terminal for this X display. */ |
| 10637 | for (d = device_list; d; d = d->next_device) | 10637 | for (t = terminal_list; t; t = t->next_terminal) |
| 10638 | if (d->type == output_x_window && d->display_info.x == dpyinfo) | 10638 | if (t->type == output_x_window && t->display_info.x == dpyinfo) |
| 10639 | { | 10639 | { |
| 10640 | /* Close X session management when we close its display. */ | 10640 | /* Close X session management when we close its display. */ |
| 10641 | if (d->id == 1 && x_session_have_connection ()) | 10641 | if (t->id == 1 && x_session_have_connection ()) |
| 10642 | x_session_close(); | 10642 | x_session_close(); |
| 10643 | 10643 | ||
| 10644 | delete_device (d); | 10644 | delete_terminal (t); |
| 10645 | break; | 10645 | break; |
| 10646 | } | 10646 | } |
| 10647 | 10647 | ||
| @@ -10776,9 +10776,9 @@ static struct redisplay_interface x_redisplay_interface = | |||
| 10776 | 10776 | ||
| 10777 | /* This function is called when the last frame on a display is deleted. */ | 10777 | /* This function is called when the last frame on a display is deleted. */ |
| 10778 | void | 10778 | void |
| 10779 | x_delete_device (struct device *device) | 10779 | x_delete_terminal (struct terminal *terminal) |
| 10780 | { | 10780 | { |
| 10781 | struct x_display_info *dpyinfo = device->display_info.x; | 10781 | struct x_display_info *dpyinfo = terminal->display_info.x; |
| 10782 | int i; | 10782 | int i; |
| 10783 | 10783 | ||
| 10784 | BLOCK_INPUT; | 10784 | BLOCK_INPUT; |
| @@ -10807,50 +10807,50 @@ x_delete_device (struct device *device) | |||
| 10807 | } | 10807 | } |
| 10808 | 10808 | ||
| 10809 | 10809 | ||
| 10810 | struct device * | 10810 | static struct terminal * |
| 10811 | x_create_device (struct x_display_info *dpyinfo) | 10811 | x_create_terminal (struct x_display_info *dpyinfo) |
| 10812 | { | 10812 | { |
| 10813 | struct device *device; | 10813 | struct terminal *terminal; |
| 10814 | 10814 | ||
| 10815 | device = create_device (); | 10815 | terminal = create_terminal (); |
| 10816 | 10816 | ||
| 10817 | device->type = output_x_window; | 10817 | terminal->type = output_x_window; |
| 10818 | device->display_info.x = dpyinfo; | 10818 | terminal->display_info.x = dpyinfo; |
| 10819 | dpyinfo->device = device; | 10819 | dpyinfo->terminal = terminal; |
| 10820 | 10820 | ||
| 10821 | /* kboard is initialized in x_term_init. */ | 10821 | /* kboard is initialized in x_term_init. */ |
| 10822 | 10822 | ||
| 10823 | device->clear_frame_hook = x_clear_frame; | 10823 | terminal->clear_frame_hook = x_clear_frame; |
| 10824 | device->ins_del_lines_hook = x_ins_del_lines; | 10824 | terminal->ins_del_lines_hook = x_ins_del_lines; |
| 10825 | device->delete_glyphs_hook = x_delete_glyphs; | 10825 | terminal->delete_glyphs_hook = x_delete_glyphs; |
| 10826 | device->ring_bell_hook = XTring_bell; | 10826 | terminal->ring_bell_hook = XTring_bell; |
| 10827 | device->reset_terminal_modes_hook = XTreset_terminal_modes; | 10827 | terminal->reset_terminal_modes_hook = XTreset_terminal_modes; |
| 10828 | device->set_terminal_modes_hook = XTset_terminal_modes; | 10828 | terminal->set_terminal_modes_hook = XTset_terminal_modes; |
| 10829 | device->update_begin_hook = x_update_begin; | 10829 | terminal->update_begin_hook = x_update_begin; |
| 10830 | device->update_end_hook = x_update_end; | 10830 | terminal->update_end_hook = x_update_end; |
| 10831 | device->set_terminal_window_hook = XTset_terminal_window; | 10831 | terminal->set_terminal_window_hook = XTset_terminal_window; |
| 10832 | device->read_socket_hook = XTread_socket; | 10832 | terminal->read_socket_hook = XTread_socket; |
| 10833 | device->frame_up_to_date_hook = XTframe_up_to_date; | 10833 | terminal->frame_up_to_date_hook = XTframe_up_to_date; |
| 10834 | device->mouse_position_hook = XTmouse_position; | 10834 | terminal->mouse_position_hook = XTmouse_position; |
| 10835 | device->frame_rehighlight_hook = XTframe_rehighlight; | 10835 | terminal->frame_rehighlight_hook = XTframe_rehighlight; |
| 10836 | device->frame_raise_lower_hook = XTframe_raise_lower; | 10836 | terminal->frame_raise_lower_hook = XTframe_raise_lower; |
| 10837 | device->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; | 10837 | terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; |
| 10838 | device->condemn_scroll_bars_hook = XTcondemn_scroll_bars; | 10838 | terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars; |
| 10839 | device->redeem_scroll_bar_hook = XTredeem_scroll_bar; | 10839 | terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar; |
| 10840 | device->judge_scroll_bars_hook = XTjudge_scroll_bars; | 10840 | terminal->judge_scroll_bars_hook = XTjudge_scroll_bars; |
| 10841 | 10841 | ||
| 10842 | device->delete_frame_hook = x_destroy_window; | 10842 | terminal->delete_frame_hook = x_destroy_window; |
| 10843 | device->delete_device_hook = x_delete_device; | 10843 | terminal->delete_terminal_hook = x_delete_terminal; |
| 10844 | 10844 | ||
| 10845 | device->rif = &x_redisplay_interface; | 10845 | terminal->rif = &x_redisplay_interface; |
| 10846 | device->scroll_region_ok = 1; /* We'll scroll partial frames. */ | 10846 | terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */ |
| 10847 | device->char_ins_del_ok = 1; | 10847 | terminal->char_ins_del_ok = 1; |
| 10848 | device->line_ins_del_ok = 1; /* We'll just blt 'em. */ | 10848 | terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */ |
| 10849 | device->fast_clear_end_of_line = 1; /* X does this well. */ | 10849 | terminal->fast_clear_end_of_line = 1; /* X does this well. */ |
| 10850 | device->memory_below_frame = 0; /* We don't remember what scrolls | 10850 | terminal->memory_below_frame = 0; /* We don't remember what scrolls |
| 10851 | off the bottom. */ | 10851 | off the bottom. */ |
| 10852 | 10852 | ||
| 10853 | return device; | 10853 | return terminal; |
| 10854 | } | 10854 | } |
| 10855 | 10855 | ||
| 10856 | void | 10856 | void |