diff options
| author | Joakim Verona | 2010-08-27 10:58:44 +0200 |
|---|---|---|
| committer | Joakim Verona | 2010-08-27 10:58:44 +0200 |
| commit | 362120833bcbbaea94976b6701633e2ed75f6051 (patch) | |
| tree | 632690a24a934bb51a32303add5172d63b6b9e00 /src/xterm.c | |
| parent | 1800c4865b15a9e1154bf1f03d87d1aaf750a527 (diff) | |
| parent | 1a868076f51b5d6f1cf78117463e6f9c614551ec (diff) | |
| download | emacs-362120833bcbbaea94976b6701633e2ed75f6051.tar.gz emacs-362120833bcbbaea94976b6701633e2ed75f6051.zip | |
merge from trunk, fix conflicts
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 1159 |
1 files changed, 386 insertions, 773 deletions
diff --git a/src/xterm.c b/src/xterm.c index ac6ee55954b..a07279f987e 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -22,11 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 22 | /* Xt features made by Fred Pierresteguy. */ | 22 | /* Xt features made by Fred Pierresteguy. */ |
| 23 | 23 | ||
| 24 | #include <config.h> | 24 | #include <config.h> |
| 25 | |||
| 26 | /* On 4.3 these lose if they come after xterm.h. */ | ||
| 27 | /* Putting these at the beginning seems to be standard for other .c files. */ | ||
| 28 | #include <signal.h> | 25 | #include <signal.h> |
| 29 | |||
| 30 | #include <stdio.h> | 26 | #include <stdio.h> |
| 31 | #include <setjmp.h> | 27 | #include <setjmp.h> |
| 32 | 28 | ||
| @@ -105,13 +101,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 105 | #endif | 101 | #endif |
| 106 | 102 | ||
| 107 | #ifdef USE_LUCID | 103 | #ifdef USE_LUCID |
| 108 | extern int xlwmenu_window_p P_ ((Widget w, Window window)); | 104 | #include "../lwlib/xlwmenu.h" |
| 109 | extern void xlwmenu_redisplay P_ ((Widget)); | ||
| 110 | #endif | ||
| 111 | |||
| 112 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | ||
| 113 | |||
| 114 | extern void free_frame_menubar P_ ((struct frame *)); | ||
| 115 | #endif | 105 | #endif |
| 116 | 106 | ||
| 117 | #ifdef USE_X_TOOLKIT | 107 | #ifdef USE_X_TOOLKIT |
| @@ -295,23 +285,6 @@ static int input_signal_count; | |||
| 295 | 285 | ||
| 296 | static int x_noop_count; | 286 | static int x_noop_count; |
| 297 | 287 | ||
| 298 | /* Initial values of argv and argc. */ | ||
| 299 | |||
| 300 | extern char **initial_argv; | ||
| 301 | extern int initial_argc; | ||
| 302 | |||
| 303 | extern Lisp_Object Vcommand_line_args, Vsystem_name; | ||
| 304 | |||
| 305 | /* Tells if a window manager is present or not. */ | ||
| 306 | |||
| 307 | extern Lisp_Object Vx_no_window_manager; | ||
| 308 | |||
| 309 | extern Lisp_Object Qeql; | ||
| 310 | |||
| 311 | /* A mask of extra modifier bits to put into every keyboard char. */ | ||
| 312 | |||
| 313 | extern EMACS_INT extra_keyboard_modifiers; | ||
| 314 | |||
| 315 | /* The keysyms to use for the various modifiers. */ | 288 | /* The keysyms to use for the various modifiers. */ |
| 316 | 289 | ||
| 317 | Lisp_Object Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym, Vx_super_keysym; | 290 | Lisp_Object Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym, Vx_super_keysym; |
| @@ -329,65 +302,66 @@ static Lisp_Object xg_default_icon_file; | |||
| 329 | Lisp_Object Qx_gtk_map_stock; | 302 | Lisp_Object Qx_gtk_map_stock; |
| 330 | #endif | 303 | #endif |
| 331 | 304 | ||
| 305 | /* Some functions take this as char *, not const char *. */ | ||
| 306 | static char emacs_class[] = EMACS_CLASS; | ||
| 307 | |||
| 332 | /* Used in x_flush. */ | 308 | /* Used in x_flush. */ |
| 333 | 309 | ||
| 334 | extern Lisp_Object Vinhibit_redisplay; | 310 | extern XrmDatabase x_load_resources (Display *, const char *, const char *, |
| 335 | 311 | const char *); | |
| 336 | extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *)); | 312 | extern int x_bitmap_mask (FRAME_PTR, int); |
| 337 | extern int x_bitmap_mask P_ ((FRAME_PTR, int)); | 313 | |
| 338 | 314 | static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *); | |
| 339 | static int x_alloc_nearest_color_1 P_ ((Display *, Colormap, XColor *)); | 315 | static void x_set_window_size_1 (struct frame *, int, int, int); |
| 340 | static void x_set_window_size_1 P_ ((struct frame *, int, int, int)); | 316 | static const XColor *x_color_cells (Display *, int *); |
| 341 | static const XColor *x_color_cells P_ ((Display *, int *)); | 317 | static void x_update_window_end (struct window *, int, int); |
| 342 | static void x_update_window_end P_ ((struct window *, int, int)); | 318 | |
| 343 | 319 | static int x_io_error_quitter (Display *); | |
| 344 | static int x_io_error_quitter P_ ((Display *)); | 320 | static struct terminal *x_create_terminal (struct x_display_info *); |
| 345 | static struct terminal *x_create_terminal P_ ((struct x_display_info *)); | 321 | void x_delete_terminal (struct terminal *); |
| 346 | void x_delete_terminal P_ ((struct terminal *)); | 322 | static void x_update_end (struct frame *); |
| 347 | static void x_update_end P_ ((struct frame *)); | 323 | static void XTframe_up_to_date (struct frame *); |
| 348 | static void XTframe_up_to_date P_ ((struct frame *)); | 324 | static void XTset_terminal_modes (struct terminal *); |
| 349 | static void XTset_terminal_modes P_ ((struct terminal *)); | 325 | static void XTreset_terminal_modes (struct terminal *); |
| 350 | static void XTreset_terminal_modes P_ ((struct terminal *)); | 326 | static void x_clear_frame (struct frame *); |
| 351 | static void x_clear_frame P_ ((struct frame *)); | 327 | static void frame_highlight (struct frame *); |
| 352 | static void frame_highlight P_ ((struct frame *)); | 328 | static void frame_unhighlight (struct frame *); |
| 353 | static void frame_unhighlight P_ ((struct frame *)); | 329 | static void x_new_focus_frame (struct x_display_info *, struct frame *); |
| 354 | static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *)); | 330 | static void x_focus_changed (int, int, struct x_display_info *, |
| 355 | static void x_focus_changed P_ ((int, int, struct x_display_info *, | 331 | struct frame *, struct input_event *); |
| 356 | struct frame *, struct input_event *)); | 332 | static void x_detect_focus_change (struct x_display_info *, |
| 357 | static void x_detect_focus_change P_ ((struct x_display_info *, | 333 | XEvent *, struct input_event *); |
| 358 | XEvent *, struct input_event *)); | 334 | static void XTframe_rehighlight (struct frame *); |
| 359 | static void XTframe_rehighlight P_ ((struct frame *)); | 335 | static void x_frame_rehighlight (struct x_display_info *); |
| 360 | static void x_frame_rehighlight P_ ((struct x_display_info *)); | 336 | static void x_draw_hollow_cursor (struct window *, struct glyph_row *); |
| 361 | static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); | 337 | static void x_draw_bar_cursor (struct window *, struct glyph_row *, int, |
| 362 | static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, | 338 | enum text_cursor_kinds); |
| 363 | enum text_cursor_kinds)); | 339 | |
| 364 | 340 | static void x_clip_to_row (struct window *, struct glyph_row *, int, GC); | |
| 365 | static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC)); | 341 | static void x_flush (struct frame *f); |
| 366 | static void x_flush P_ ((struct frame *f)); | 342 | static void x_update_begin (struct frame *); |
| 367 | static void x_update_begin P_ ((struct frame *)); | 343 | static void x_update_window_begin (struct window *); |
| 368 | static void x_update_window_begin P_ ((struct window *)); | 344 | static void x_after_update_window_line (struct glyph_row *); |
| 369 | static void x_after_update_window_line P_ ((struct glyph_row *)); | 345 | static struct scroll_bar *x_window_to_scroll_bar (Display *, Window); |
| 370 | static struct scroll_bar *x_window_to_scroll_bar P_ ((Display *, Window)); | 346 | static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *, |
| 371 | static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *, | 347 | enum scroll_bar_part *, |
| 372 | enum scroll_bar_part *, | 348 | Lisp_Object *, Lisp_Object *, |
| 373 | Lisp_Object *, Lisp_Object *, | 349 | unsigned long *); |
| 374 | unsigned long *)); | 350 | static void x_handle_net_wm_state (struct frame *, XPropertyEvent *); |
| 375 | static void x_handle_net_wm_state P_ ((struct frame *, XPropertyEvent *)); | 351 | static void x_check_fullscreen (struct frame *); |
| 376 | static void x_check_fullscreen P_ ((struct frame *)); | 352 | static void x_check_expected_move (struct frame *, int, int); |
| 377 | static void x_check_expected_move P_ ((struct frame *, int, int)); | 353 | static void x_sync_with_move (struct frame *, int, int, int); |
| 378 | static void x_sync_with_move P_ ((struct frame *, int, int, int)); | 354 | static int handle_one_xevent (struct x_display_info *, XEvent *, |
| 379 | static int handle_one_xevent P_ ((struct x_display_info *, XEvent *, | 355 | int *, struct input_event *); |
| 380 | int *, struct input_event *)); | ||
| 381 | /* Don't declare this NO_RETURN because we want no | 356 | /* Don't declare this NO_RETURN because we want no |
| 382 | interference with debugging failing X calls. */ | 357 | interference with debugging failing X calls. */ |
| 383 | static SIGTYPE x_connection_closed P_ ((Display *, char *)); | 358 | static SIGTYPE x_connection_closed (Display *, const char *); |
| 384 | 359 | ||
| 385 | 360 | ||
| 386 | /* Flush display of frame F, or of all frames if F is null. */ | 361 | /* Flush display of frame F, or of all frames if F is null. */ |
| 387 | 362 | ||
| 388 | static void | 363 | static void |
| 389 | x_flush (f) | 364 | x_flush (struct frame *f) |
| 390 | struct frame *f; | ||
| 391 | { | 365 | { |
| 392 | /* Don't call XFlush when it is not safe to redisplay; the X | 366 | /* Don't call XFlush when it is not safe to redisplay; the X |
| 393 | connection may be broken. */ | 367 | connection may be broken. */ |
| @@ -456,8 +430,7 @@ record_event (locus, type) | |||
| 456 | /* Return the struct x_display_info corresponding to DPY. */ | 430 | /* Return the struct x_display_info corresponding to DPY. */ |
| 457 | 431 | ||
| 458 | struct x_display_info * | 432 | struct x_display_info * |
| 459 | x_display_info_for_display (dpy) | 433 | x_display_info_for_display (Display *dpy) |
| 460 | Display *dpy; | ||
| 461 | { | 434 | { |
| 462 | struct x_display_info *dpyinfo; | 435 | struct x_display_info *dpyinfo; |
| 463 | 436 | ||
| @@ -472,8 +445,7 @@ x_display_info_for_display (dpy) | |||
| 472 | #define OPACITY "_NET_WM_WINDOW_OPACITY" | 445 | #define OPACITY "_NET_WM_WINDOW_OPACITY" |
| 473 | 446 | ||
| 474 | void | 447 | void |
| 475 | x_set_frame_alpha (f) | 448 | x_set_frame_alpha (struct frame *f) |
| 476 | struct frame *f; | ||
| 477 | { | 449 | { |
| 478 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 450 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 479 | Display *dpy = FRAME_X_DISPLAY (f); | 451 | Display *dpy = FRAME_X_DISPLAY (f); |
| @@ -485,7 +457,7 @@ x_set_frame_alpha (f) | |||
| 485 | if (FRAME_X_DISPLAY_INFO (f)->root_window != FRAME_X_OUTPUT (f)->parent_desc) | 457 | if (FRAME_X_DISPLAY_INFO (f)->root_window != FRAME_X_OUTPUT (f)->parent_desc) |
| 486 | /* Since the WM decoration lies under the FRAME_OUTER_WINDOW, | 458 | /* Since the WM decoration lies under the FRAME_OUTER_WINDOW, |
| 487 | we must treat the former instead of the latter. */ | 459 | we must treat the former instead of the latter. */ |
| 488 | win = FRAME_X_OUTPUT(f)->parent_desc; | 460 | win = FRAME_X_OUTPUT (f)->parent_desc; |
| 489 | 461 | ||
| 490 | if (dpyinfo->x_highlight_frame == f) | 462 | if (dpyinfo->x_highlight_frame == f) |
| 491 | alpha = f->alpha[0]; | 463 | alpha = f->alpha[0]; |
| @@ -514,10 +486,10 @@ x_set_frame_alpha (f) | |||
| 514 | unsigned long n, left; | 486 | unsigned long n, left; |
| 515 | 487 | ||
| 516 | x_catch_errors (dpy); | 488 | x_catch_errors (dpy); |
| 517 | rc = XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False), | 489 | rc = XGetWindowProperty (dpy, win, XInternAtom(dpy, OPACITY, False), |
| 518 | 0L, 1L, False, XA_CARDINAL, | 490 | 0L, 1L, False, XA_CARDINAL, |
| 519 | &actual, &format, &n, &left, | 491 | &actual, &format, &n, &left, |
| 520 | &data); | 492 | &data); |
| 521 | 493 | ||
| 522 | if (rc == Success && actual != None) | 494 | if (rc == Success && actual != None) |
| 523 | if (*(unsigned long *)data == opac) | 495 | if (*(unsigned long *)data == opac) |
| @@ -539,15 +511,13 @@ x_set_frame_alpha (f) | |||
| 539 | } | 511 | } |
| 540 | 512 | ||
| 541 | int | 513 | int |
| 542 | x_display_pixel_height (dpyinfo) | 514 | x_display_pixel_height (struct x_display_info *dpyinfo) |
| 543 | struct x_display_info *dpyinfo; | ||
| 544 | { | 515 | { |
| 545 | return HeightOfScreen (dpyinfo->screen); | 516 | return HeightOfScreen (dpyinfo->screen); |
| 546 | } | 517 | } |
| 547 | 518 | ||
| 548 | int | 519 | int |
| 549 | x_display_pixel_width (dpyinfo) | 520 | x_display_pixel_width (struct x_display_info *dpyinfo) |
| 550 | struct x_display_info *dpyinfo; | ||
| 551 | { | 521 | { |
| 552 | return WidthOfScreen (dpyinfo->screen); | 522 | return WidthOfScreen (dpyinfo->screen); |
| 553 | } | 523 | } |
| @@ -564,8 +534,7 @@ x_display_pixel_width (dpyinfo) | |||
| 564 | because all interesting stuff is done on a window basis. */ | 534 | because all interesting stuff is done on a window basis. */ |
| 565 | 535 | ||
| 566 | static void | 536 | static void |
| 567 | x_update_begin (f) | 537 | x_update_begin (struct frame *f) |
| 568 | struct frame *f; | ||
| 569 | { | 538 | { |
| 570 | /* Nothing to do. */ | 539 | /* Nothing to do. */ |
| 571 | } | 540 | } |
| @@ -576,8 +545,7 @@ x_update_begin (f) | |||
| 576 | position of W. */ | 545 | position of W. */ |
| 577 | 546 | ||
| 578 | static void | 547 | static void |
| 579 | x_update_window_begin (w) | 548 | x_update_window_begin (struct window *w) |
| 580 | struct window *w; | ||
| 581 | { | 549 | { |
| 582 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 550 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 583 | struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f); | 551 | struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f); |
| @@ -605,9 +573,7 @@ x_update_window_begin (w) | |||
| 605 | /* Draw a vertical window border from (x,y0) to (x,y1) */ | 573 | /* Draw a vertical window border from (x,y0) to (x,y1) */ |
| 606 | 574 | ||
| 607 | static void | 575 | static void |
| 608 | x_draw_vertical_window_border (w, x, y0, y1) | 576 | x_draw_vertical_window_border (struct window *w, int x, int y0, int y1) |
| 609 | struct window *w; | ||
| 610 | int x, y0, y1; | ||
| 611 | { | 577 | { |
| 612 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 578 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 613 | struct face *face; | 579 | struct face *face; |
| @@ -635,9 +601,7 @@ x_draw_vertical_window_border (w, x, y0, y1) | |||
| 635 | here. */ | 601 | here. */ |
| 636 | 602 | ||
| 637 | static void | 603 | static void |
| 638 | x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) | 604 | x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) |
| 639 | struct window *w; | ||
| 640 | int cursor_on_p, mouse_face_overwritten_p; | ||
| 641 | { | 605 | { |
| 642 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); | 606 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); |
| 643 | 607 | ||
| @@ -673,8 +637,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) | |||
| 673 | update_end. */ | 637 | update_end. */ |
| 674 | 638 | ||
| 675 | static void | 639 | static void |
| 676 | x_update_end (f) | 640 | x_update_end (struct frame *f) |
| 677 | struct frame *f; | ||
| 678 | { | 641 | { |
| 679 | /* Mouse highlight may be displayed again. */ | 642 | /* Mouse highlight may be displayed again. */ |
| 680 | FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0; | 643 | FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0; |
| @@ -692,8 +655,7 @@ x_update_end (f) | |||
| 692 | updated_window is not available here. */ | 655 | updated_window is not available here. */ |
| 693 | 656 | ||
| 694 | static void | 657 | static void |
| 695 | XTframe_up_to_date (f) | 658 | XTframe_up_to_date (struct frame *f) |
| 696 | struct frame *f; | ||
| 697 | { | 659 | { |
| 698 | if (FRAME_X_P (f)) | 660 | if (FRAME_X_P (f)) |
| 699 | { | 661 | { |
| @@ -722,8 +684,7 @@ XTframe_up_to_date (f) | |||
| 722 | between bitmaps to be drawn between current row and DESIRED_ROW. */ | 684 | between bitmaps to be drawn between current row and DESIRED_ROW. */ |
| 723 | 685 | ||
| 724 | static void | 686 | static void |
| 725 | x_after_update_window_line (desired_row) | 687 | x_after_update_window_line (struct glyph_row *desired_row) |
| 726 | struct glyph_row *desired_row; | ||
| 727 | { | 688 | { |
| 728 | struct window *w = updated_window; | 689 | struct window *w = updated_window; |
| 729 | struct frame *f; | 690 | struct frame *f; |
| @@ -761,34 +722,16 @@ x_after_update_window_line (desired_row) | |||
| 761 | } | 722 | } |
| 762 | 723 | ||
| 763 | static void | 724 | static void |
| 764 | x_draw_fringe_bitmap (w, row, p) | 725 | x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fringe_bitmap_params *p) |
| 765 | struct window *w; | ||
| 766 | struct glyph_row *row; | ||
| 767 | struct draw_fringe_bitmap_params *p; | ||
| 768 | { | 726 | { |
| 769 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 727 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 770 | Display *display = FRAME_X_DISPLAY (f); | 728 | Display *display = FRAME_X_DISPLAY (f); |
| 771 | Window window = FRAME_X_WINDOW (f); | 729 | Window window = FRAME_X_WINDOW (f); |
| 772 | GC gc = f->output_data.x->normal_gc; | 730 | GC gc = f->output_data.x->normal_gc; |
| 773 | struct face *face = p->face; | 731 | struct face *face = p->face; |
| 774 | int rowY; | ||
| 775 | 732 | ||
| 776 | /* Must clip because of partially visible lines. */ | 733 | /* Must clip because of partially visible lines. */ |
| 777 | rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); | 734 | x_clip_to_row (w, row, -1, gc); |
| 778 | if (p->y < rowY) | ||
| 779 | { | ||
| 780 | /* Adjust position of "bottom aligned" bitmap on partially | ||
| 781 | visible last row. */ | ||
| 782 | int oldY = row->y; | ||
| 783 | int oldVH = row->visible_height; | ||
| 784 | row->visible_height = p->h; | ||
| 785 | row->y -= rowY - p->y; | ||
| 786 | x_clip_to_row (w, row, -1, gc); | ||
| 787 | row->y = oldY; | ||
| 788 | row->visible_height = oldVH; | ||
| 789 | } | ||
| 790 | else | ||
| 791 | x_clip_to_row (w, row, -1, gc); | ||
| 792 | 735 | ||
| 793 | if (!p->overlay_p) | 736 | if (!p->overlay_p) |
| 794 | { | 737 | { |
| @@ -932,37 +875,37 @@ XTreset_terminal_modes (struct terminal *terminal) | |||
| 932 | 875 | ||
| 933 | 876 | ||
| 934 | 877 | ||
| 935 | static void x_set_glyph_string_clipping P_ ((struct glyph_string *)); | 878 | static void x_set_glyph_string_clipping (struct glyph_string *); |
| 936 | static void x_set_glyph_string_gc P_ ((struct glyph_string *)); | 879 | static void x_set_glyph_string_gc (struct glyph_string *); |
| 937 | static void x_draw_glyph_string_background P_ ((struct glyph_string *, | 880 | static void x_draw_glyph_string_background (struct glyph_string *, |
| 938 | int)); | 881 | int); |
| 939 | static void x_draw_glyph_string_foreground P_ ((struct glyph_string *)); | 882 | static void x_draw_glyph_string_foreground (struct glyph_string *); |
| 940 | static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *)); | 883 | static void x_draw_composite_glyph_string_foreground (struct glyph_string *); |
| 941 | static void x_draw_glyph_string_box P_ ((struct glyph_string *)); | 884 | static void x_draw_glyph_string_box (struct glyph_string *); |
| 942 | static void x_draw_glyph_string P_ ((struct glyph_string *)); | 885 | static void x_draw_glyph_string (struct glyph_string *); |
| 943 | static void x_compute_glyph_string_overhangs P_ ((struct glyph_string *)); | 886 | static void x_compute_glyph_string_overhangs (struct glyph_string *); |
| 944 | static void x_set_cursor_gc P_ ((struct glyph_string *)); | 887 | static void x_set_cursor_gc (struct glyph_string *); |
| 945 | static void x_set_mode_line_face_gc P_ ((struct glyph_string *)); | 888 | static void x_set_mode_line_face_gc (struct glyph_string *); |
| 946 | static void x_set_mouse_face_gc P_ ((struct glyph_string *)); | 889 | static void x_set_mouse_face_gc (struct glyph_string *); |
| 947 | static int x_alloc_lighter_color P_ ((struct frame *, Display *, Colormap, | 890 | static int x_alloc_lighter_color (struct frame *, Display *, Colormap, |
| 948 | unsigned long *, double, int)); | 891 | unsigned long *, double, int); |
| 949 | static void x_setup_relief_color P_ ((struct frame *, struct relief *, | 892 | static void x_setup_relief_color (struct frame *, struct relief *, |
| 950 | double, int, unsigned long)); | 893 | double, int, unsigned long); |
| 951 | static void x_setup_relief_colors P_ ((struct glyph_string *)); | 894 | static void x_setup_relief_colors (struct glyph_string *); |
| 952 | static void x_draw_image_glyph_string P_ ((struct glyph_string *)); | 895 | static void x_draw_image_glyph_string (struct glyph_string *); |
| 953 | static void x_draw_image_relief P_ ((struct glyph_string *)); | 896 | static void x_draw_image_relief (struct glyph_string *); |
| 954 | static void x_draw_image_foreground P_ ((struct glyph_string *)); | 897 | static void x_draw_image_foreground (struct glyph_string *); |
| 955 | static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap)); | 898 | static void x_draw_image_foreground_1 (struct glyph_string *, Pixmap); |
| 956 | static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, | 899 | static void x_clear_glyph_string_rect (struct glyph_string *, int, |
| 957 | int, int, int)); | 900 | int, int, int); |
| 958 | static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int, | 901 | static void x_draw_relief_rect (struct frame *, int, int, int, int, |
| 959 | int, int, int, int, int, int, | 902 | int, int, int, int, int, int, |
| 960 | XRectangle *)); | 903 | XRectangle *); |
| 961 | static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, | 904 | static void x_draw_box_rect (struct glyph_string *, int, int, int, int, |
| 962 | int, int, int, XRectangle *)); | 905 | int, int, int, XRectangle *); |
| 963 | 906 | ||
| 964 | #if GLYPH_DEBUG | 907 | #if GLYPH_DEBUG |
| 965 | static void x_check_font P_ ((struct frame *, struct font *)); | 908 | static void x_check_font (struct frame *, struct font *); |
| 966 | #endif | 909 | #endif |
| 967 | 910 | ||
| 968 | 911 | ||
| @@ -970,8 +913,7 @@ static void x_check_font P_ ((struct frame *, struct font *)); | |||
| 970 | face. */ | 913 | face. */ |
| 971 | 914 | ||
| 972 | static void | 915 | static void |
| 973 | x_set_cursor_gc (s) | 916 | x_set_cursor_gc (struct glyph_string *s) |
| 974 | struct glyph_string *s; | ||
| 975 | { | 917 | { |
| 976 | if (s->font == FRAME_FONT (s->f) | 918 | if (s->font == FRAME_FONT (s->f) |
| 977 | && s->face->background == FRAME_BACKGROUND_PIXEL (s->f) | 919 | && s->face->background == FRAME_BACKGROUND_PIXEL (s->f) |
| @@ -1022,8 +964,7 @@ x_set_cursor_gc (s) | |||
| 1022 | /* Set up S->gc of glyph string S for drawing text in mouse face. */ | 964 | /* Set up S->gc of glyph string S for drawing text in mouse face. */ |
| 1023 | 965 | ||
| 1024 | static void | 966 | static void |
| 1025 | x_set_mouse_face_gc (s) | 967 | x_set_mouse_face_gc (struct glyph_string *s) |
| 1026 | struct glyph_string *s; | ||
| 1027 | { | 968 | { |
| 1028 | int face_id; | 969 | int face_id; |
| 1029 | struct face *face; | 970 | struct face *face; |
| @@ -1074,8 +1015,7 @@ x_set_mouse_face_gc (s) | |||
| 1074 | matrix was built, so there isn't much to do, here. */ | 1015 | matrix was built, so there isn't much to do, here. */ |
| 1075 | 1016 | ||
| 1076 | static INLINE void | 1017 | static INLINE void |
| 1077 | x_set_mode_line_face_gc (s) | 1018 | x_set_mode_line_face_gc (struct glyph_string *s) |
| 1078 | struct glyph_string *s; | ||
| 1079 | { | 1019 | { |
| 1080 | s->gc = s->face->gc; | 1020 | s->gc = s->face->gc; |
| 1081 | } | 1021 | } |
| @@ -1086,8 +1026,7 @@ x_set_mode_line_face_gc (s) | |||
| 1086 | pattern. */ | 1026 | pattern. */ |
| 1087 | 1027 | ||
| 1088 | static INLINE void | 1028 | static INLINE void |
| 1089 | x_set_glyph_string_gc (s) | 1029 | x_set_glyph_string_gc (struct glyph_string *s) |
| 1090 | struct glyph_string *s; | ||
| 1091 | { | 1030 | { |
| 1092 | PREPARE_FACE_FOR_DISPLAY (s->f, s->face); | 1031 | PREPARE_FACE_FOR_DISPLAY (s->f, s->face); |
| 1093 | 1032 | ||
| @@ -1132,8 +1071,7 @@ x_set_glyph_string_gc (s) | |||
| 1132 | line or menu if we don't have X toolkit support. */ | 1071 | line or menu if we don't have X toolkit support. */ |
| 1133 | 1072 | ||
| 1134 | static INLINE void | 1073 | static INLINE void |
| 1135 | x_set_glyph_string_clipping (s) | 1074 | x_set_glyph_string_clipping (struct glyph_string *s) |
| 1136 | struct glyph_string *s; | ||
| 1137 | { | 1075 | { |
| 1138 | XRectangle *r = s->clip; | 1076 | XRectangle *r = s->clip; |
| 1139 | int n = get_glyph_string_clip_rects (s, r, 2); | 1077 | int n = get_glyph_string_clip_rects (s, r, 2); |
| @@ -1149,8 +1087,7 @@ x_set_glyph_string_clipping (s) | |||
| 1149 | the area of SRC. */ | 1087 | the area of SRC. */ |
| 1150 | 1088 | ||
| 1151 | static void | 1089 | static void |
| 1152 | x_set_glyph_string_clipping_exactly (src, dst) | 1090 | x_set_glyph_string_clipping_exactly (struct glyph_string *src, struct glyph_string *dst) |
| 1153 | struct glyph_string *src, *dst; | ||
| 1154 | { | 1091 | { |
| 1155 | XRectangle r; | 1092 | XRectangle r; |
| 1156 | 1093 | ||
| @@ -1168,8 +1105,7 @@ x_set_glyph_string_clipping_exactly (src, dst) | |||
| 1168 | Compute left and right overhang of glyph string S. */ | 1105 | Compute left and right overhang of glyph string S. */ |
| 1169 | 1106 | ||
| 1170 | static void | 1107 | static void |
| 1171 | x_compute_glyph_string_overhangs (s) | 1108 | x_compute_glyph_string_overhangs (struct glyph_string *s) |
| 1172 | struct glyph_string *s; | ||
| 1173 | { | 1109 | { |
| 1174 | if (s->cmp == NULL | 1110 | if (s->cmp == NULL |
| 1175 | && (s->first_glyph->type == CHAR_GLYPH | 1111 | && (s->first_glyph->type == CHAR_GLYPH |
| @@ -1208,9 +1144,7 @@ x_compute_glyph_string_overhangs (s) | |||
| 1208 | /* Fill rectangle X, Y, W, H with background color of glyph string S. */ | 1144 | /* Fill rectangle X, Y, W, H with background color of glyph string S. */ |
| 1209 | 1145 | ||
| 1210 | static INLINE void | 1146 | static INLINE void |
| 1211 | x_clear_glyph_string_rect (s, x, y, w, h) | 1147 | x_clear_glyph_string_rect (struct glyph_string *s, int x, int y, int w, int h) |
| 1212 | struct glyph_string *s; | ||
| 1213 | int x, y, w, h; | ||
| 1214 | { | 1148 | { |
| 1215 | XGCValues xgcv; | 1149 | XGCValues xgcv; |
| 1216 | XGetGCValues (s->display, s->gc, GCForeground | GCBackground, &xgcv); | 1150 | XGetGCValues (s->display, s->gc, GCForeground | GCBackground, &xgcv); |
| @@ -1227,9 +1161,7 @@ x_clear_glyph_string_rect (s, x, y, w, h) | |||
| 1227 | contains the first component of a composition. */ | 1161 | contains the first component of a composition. */ |
| 1228 | 1162 | ||
| 1229 | static void | 1163 | static void |
| 1230 | x_draw_glyph_string_background (s, force_p) | 1164 | x_draw_glyph_string_background (struct glyph_string *s, int force_p) |
| 1231 | struct glyph_string *s; | ||
| 1232 | int force_p; | ||
| 1233 | { | 1165 | { |
| 1234 | /* Nothing to do if background has already been drawn or if it | 1166 | /* Nothing to do if background has already been drawn or if it |
| 1235 | shouldn't be drawn in the first place. */ | 1167 | shouldn't be drawn in the first place. */ |
| @@ -1265,8 +1197,7 @@ x_draw_glyph_string_background (s, force_p) | |||
| 1265 | /* Draw the foreground of glyph string S. */ | 1197 | /* Draw the foreground of glyph string S. */ |
| 1266 | 1198 | ||
| 1267 | static void | 1199 | static void |
| 1268 | x_draw_glyph_string_foreground (s) | 1200 | x_draw_glyph_string_foreground (struct glyph_string *s) |
| 1269 | struct glyph_string *s; | ||
| 1270 | { | 1201 | { |
| 1271 | int i, x; | 1202 | int i, x; |
| 1272 | 1203 | ||
| @@ -1314,8 +1245,7 @@ x_draw_glyph_string_foreground (s) | |||
| 1314 | /* Draw the foreground of composite glyph string S. */ | 1245 | /* Draw the foreground of composite glyph string S. */ |
| 1315 | 1246 | ||
| 1316 | static void | 1247 | static void |
| 1317 | x_draw_composite_glyph_string_foreground (s) | 1248 | x_draw_composite_glyph_string_foreground (struct glyph_string *s) |
| 1318 | struct glyph_string *s; | ||
| 1319 | { | 1249 | { |
| 1320 | int i, j, x; | 1250 | int i, j, x; |
| 1321 | struct font *font = s->font; | 1251 | struct font *font = s->font; |
| @@ -1402,19 +1332,18 @@ x_draw_composite_glyph_string_foreground (s) | |||
| 1402 | 1332 | ||
| 1403 | #ifdef USE_X_TOOLKIT | 1333 | #ifdef USE_X_TOOLKIT |
| 1404 | 1334 | ||
| 1405 | static struct frame *x_frame_of_widget P_ ((Widget)); | 1335 | static struct frame *x_frame_of_widget (Widget); |
| 1406 | static Boolean cvt_string_to_pixel P_ ((Display *, XrmValue *, Cardinal *, | 1336 | static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *, |
| 1407 | XrmValue *, XrmValue *, XtPointer *)); | 1337 | XrmValue *, XrmValue *, XtPointer *); |
| 1408 | static void cvt_pixel_dtor P_ ((XtAppContext, XrmValue *, XtPointer, | 1338 | static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer, |
| 1409 | XrmValue *, Cardinal *)); | 1339 | XrmValue *, Cardinal *); |
| 1410 | 1340 | ||
| 1411 | 1341 | ||
| 1412 | /* Return the frame on which widget WIDGET is used.. Abort if frame | 1342 | /* Return the frame on which widget WIDGET is used.. Abort if frame |
| 1413 | cannot be determined. */ | 1343 | cannot be determined. */ |
| 1414 | 1344 | ||
| 1415 | static struct frame * | 1345 | static struct frame * |
| 1416 | x_frame_of_widget (widget) | 1346 | x_frame_of_widget (Widget widget) |
| 1417 | Widget widget; | ||
| 1418 | { | 1347 | { |
| 1419 | struct x_display_info *dpyinfo; | 1348 | struct x_display_info *dpyinfo; |
| 1420 | Lisp_Object tail; | 1349 | Lisp_Object tail; |
| @@ -1450,10 +1379,7 @@ x_frame_of_widget (widget) | |||
| 1450 | if successful. This is called from lwlib. */ | 1379 | if successful. This is called from lwlib. */ |
| 1451 | 1380 | ||
| 1452 | int | 1381 | int |
| 1453 | x_alloc_nearest_color_for_widget (widget, cmap, color) | 1382 | x_alloc_nearest_color_for_widget (Widget widget, Colormap cmap, XColor *color) |
| 1454 | Widget widget; | ||
| 1455 | Colormap cmap; | ||
| 1456 | XColor *color; | ||
| 1457 | { | 1383 | { |
| 1458 | struct frame *f = x_frame_of_widget (widget); | 1384 | struct frame *f = x_frame_of_widget (widget); |
| 1459 | return x_alloc_nearest_color (f, cmap, color); | 1385 | return x_alloc_nearest_color (f, cmap, color); |
| @@ -1468,13 +1394,8 @@ x_alloc_nearest_color_for_widget (widget, cmap, color) | |||
| 1468 | Value is non-zero if successful. */ | 1394 | Value is non-zero if successful. */ |
| 1469 | 1395 | ||
| 1470 | int | 1396 | int |
| 1471 | x_alloc_lighter_color_for_widget (widget, display, cmap, pixel, factor, delta) | 1397 | x_alloc_lighter_color_for_widget (Widget widget, Display *display, Colormap cmap, |
| 1472 | Widget widget; | 1398 | unsigned long *pixel, double factor, int delta) |
| 1473 | Display *display; | ||
| 1474 | Colormap cmap; | ||
| 1475 | unsigned long *pixel; | ||
| 1476 | double factor; | ||
| 1477 | int delta; | ||
| 1478 | { | 1399 | { |
| 1479 | struct frame *f = x_frame_of_widget (widget); | 1400 | struct frame *f = x_frame_of_widget (widget); |
| 1480 | return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta); | 1401 | return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta); |
| @@ -1517,12 +1438,9 @@ static Pixel cvt_string_to_pixel_value; | |||
| 1517 | Value is True if successful, False otherwise. */ | 1438 | Value is True if successful, False otherwise. */ |
| 1518 | 1439 | ||
| 1519 | static Boolean | 1440 | static Boolean |
| 1520 | cvt_string_to_pixel (dpy, args, nargs, from, to, closure_ret) | 1441 | cvt_string_to_pixel (Display *dpy, XrmValue *args, Cardinal *nargs, |
| 1521 | Display *dpy; | 1442 | XrmValue *from, XrmValue *to, |
| 1522 | XrmValue *args; | 1443 | XtPointer *closure_ret) |
| 1523 | Cardinal *nargs; | ||
| 1524 | XrmValue *from, *to; | ||
| 1525 | XtPointer *closure_ret; | ||
| 1526 | { | 1444 | { |
| 1527 | Screen *screen; | 1445 | Screen *screen; |
| 1528 | Colormap cmap; | 1446 | Colormap cmap; |
| @@ -1606,12 +1524,8 @@ cvt_string_to_pixel (dpy, args, nargs, from, to, closure_ret) | |||
| 1606 | ARGS and NARGS are like for cvt_string_to_pixel. */ | 1524 | ARGS and NARGS are like for cvt_string_to_pixel. */ |
| 1607 | 1525 | ||
| 1608 | static void | 1526 | static void |
| 1609 | cvt_pixel_dtor (app, to, closure, args, nargs) | 1527 | cvt_pixel_dtor (XtAppContext app, XrmValuePtr to, XtPointer closure, XrmValuePtr args, |
| 1610 | XtAppContext app; | 1528 | Cardinal *nargs) |
| 1611 | XrmValuePtr to; | ||
| 1612 | XtPointer closure; | ||
| 1613 | XrmValuePtr args; | ||
| 1614 | Cardinal *nargs; | ||
| 1615 | { | 1529 | { |
| 1616 | if (*nargs != 2) | 1530 | if (*nargs != 2) |
| 1617 | { | 1531 | { |
| @@ -1640,9 +1554,7 @@ cvt_pixel_dtor (app, to, closure, args, nargs) | |||
| 1640 | say a 24-bit TrueColor map. */ | 1554 | say a 24-bit TrueColor map. */ |
| 1641 | 1555 | ||
| 1642 | static const XColor * | 1556 | static const XColor * |
| 1643 | x_color_cells (dpy, ncells) | 1557 | x_color_cells (Display *dpy, int *ncells) |
| 1644 | Display *dpy; | ||
| 1645 | int *ncells; | ||
| 1646 | { | 1558 | { |
| 1647 | struct x_display_info *dpyinfo = x_display_info_for_display (dpy); | 1559 | struct x_display_info *dpyinfo = x_display_info_for_display (dpy); |
| 1648 | 1560 | ||
| @@ -1673,10 +1585,7 @@ x_color_cells (dpy, ncells) | |||
| 1673 | colors in COLORS. Use cached information, if available. */ | 1585 | colors in COLORS. Use cached information, if available. */ |
| 1674 | 1586 | ||
| 1675 | void | 1587 | void |
| 1676 | x_query_colors (f, colors, ncolors) | 1588 | x_query_colors (struct frame *f, XColor *colors, int ncolors) |
| 1677 | struct frame *f; | ||
| 1678 | XColor *colors; | ||
| 1679 | int ncolors; | ||
| 1680 | { | 1589 | { |
| 1681 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 1590 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 1682 | 1591 | ||
| @@ -1700,9 +1609,7 @@ x_query_colors (f, colors, ncolors) | |||
| 1700 | COLOR. Use cached information, if available. */ | 1609 | COLOR. Use cached information, if available. */ |
| 1701 | 1610 | ||
| 1702 | void | 1611 | void |
| 1703 | x_query_color (f, color) | 1612 | x_query_color (struct frame *f, XColor *color) |
| 1704 | struct frame *f; | ||
| 1705 | XColor *color; | ||
| 1706 | { | 1613 | { |
| 1707 | x_query_colors (f, color, 1); | 1614 | x_query_colors (f, color, 1); |
| 1708 | } | 1615 | } |
| @@ -1714,10 +1621,7 @@ x_query_color (f, color) | |||
| 1714 | allocated. */ | 1621 | allocated. */ |
| 1715 | 1622 | ||
| 1716 | static int | 1623 | static int |
| 1717 | x_alloc_nearest_color_1 (dpy, cmap, color) | 1624 | x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color) |
| 1718 | Display *dpy; | ||
| 1719 | Colormap cmap; | ||
| 1720 | XColor *color; | ||
| 1721 | { | 1625 | { |
| 1722 | int rc; | 1626 | int rc; |
| 1723 | 1627 | ||
| @@ -1787,10 +1691,7 @@ x_alloc_nearest_color_1 (dpy, cmap, color) | |||
| 1787 | allocated. */ | 1691 | allocated. */ |
| 1788 | 1692 | ||
| 1789 | int | 1693 | int |
| 1790 | x_alloc_nearest_color (f, cmap, color) | 1694 | x_alloc_nearest_color (struct frame *f, Colormap cmap, XColor *color) |
| 1791 | struct frame *f; | ||
| 1792 | Colormap cmap; | ||
| 1793 | XColor *color; | ||
| 1794 | { | 1695 | { |
| 1795 | gamma_correct (f, color); | 1696 | gamma_correct (f, color); |
| 1796 | return x_alloc_nearest_color_1 (FRAME_X_DISPLAY (f), cmap, color); | 1697 | return x_alloc_nearest_color_1 (FRAME_X_DISPLAY (f), cmap, color); |
| @@ -1802,9 +1703,7 @@ x_alloc_nearest_color (f, cmap, color) | |||
| 1802 | get color reference counts right. */ | 1703 | get color reference counts right. */ |
| 1803 | 1704 | ||
| 1804 | unsigned long | 1705 | unsigned long |
| 1805 | x_copy_color (f, pixel) | 1706 | x_copy_color (struct frame *f, long unsigned int pixel) |
| 1806 | struct frame *f; | ||
| 1807 | unsigned long pixel; | ||
| 1808 | { | 1707 | { |
| 1809 | XColor color; | 1708 | XColor color; |
| 1810 | 1709 | ||
| @@ -1825,10 +1724,7 @@ x_copy_color (f, pixel) | |||
| 1825 | get color reference counts right. */ | 1724 | get color reference counts right. */ |
| 1826 | 1725 | ||
| 1827 | unsigned long | 1726 | unsigned long |
| 1828 | x_copy_dpy_color (dpy, cmap, pixel) | 1727 | x_copy_dpy_color (Display *dpy, Colormap cmap, long unsigned int pixel) |
| 1829 | Display *dpy; | ||
| 1830 | Colormap cmap; | ||
| 1831 | unsigned long pixel; | ||
| 1832 | { | 1728 | { |
| 1833 | XColor color; | 1729 | XColor color; |
| 1834 | 1730 | ||
| @@ -1866,13 +1762,7 @@ x_copy_dpy_color (dpy, cmap, pixel) | |||
| 1866 | Value is non-zero if successful. */ | 1762 | Value is non-zero if successful. */ |
| 1867 | 1763 | ||
| 1868 | static int | 1764 | static int |
| 1869 | x_alloc_lighter_color (f, display, cmap, pixel, factor, delta) | 1765 | x_alloc_lighter_color (struct frame *f, Display *display, Colormap cmap, long unsigned int *pixel, double factor, int delta) |
| 1870 | struct frame *f; | ||
| 1871 | Display *display; | ||
| 1872 | Colormap cmap; | ||
| 1873 | unsigned long *pixel; | ||
| 1874 | double factor; | ||
| 1875 | int delta; | ||
| 1876 | { | 1766 | { |
| 1877 | XColor color, new; | 1767 | XColor color, new; |
| 1878 | long bright; | 1768 | long bright; |
| @@ -1948,12 +1838,7 @@ x_alloc_lighter_color (f, display, cmap, pixel, factor, delta) | |||
| 1948 | be allocated, use DEFAULT_PIXEL, instead. */ | 1838 | be allocated, use DEFAULT_PIXEL, instead. */ |
| 1949 | 1839 | ||
| 1950 | static void | 1840 | static void |
| 1951 | x_setup_relief_color (f, relief, factor, delta, default_pixel) | 1841 | x_setup_relief_color (struct frame *f, struct relief *relief, double factor, int delta, long unsigned int default_pixel) |
| 1952 | struct frame *f; | ||
| 1953 | struct relief *relief; | ||
| 1954 | double factor; | ||
| 1955 | int delta; | ||
| 1956 | unsigned long default_pixel; | ||
| 1957 | { | 1842 | { |
| 1958 | XGCValues xgcv; | 1843 | XGCValues xgcv; |
| 1959 | struct x_output *di = f->output_data.x; | 1844 | struct x_output *di = f->output_data.x; |
| @@ -2001,8 +1886,7 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel) | |||
| 2001 | /* Set up colors for the relief lines around glyph string S. */ | 1886 | /* Set up colors for the relief lines around glyph string S. */ |
| 2002 | 1887 | ||
| 2003 | static void | 1888 | static void |
| 2004 | x_setup_relief_colors (s) | 1889 | x_setup_relief_colors (struct glyph_string *s) |
| 2005 | struct glyph_string *s; | ||
| 2006 | { | 1890 | { |
| 2007 | struct x_output *di = s->f->output_data.x; | 1891 | struct x_output *di = s->f->output_data.x; |
| 2008 | unsigned long color; | 1892 | unsigned long color; |
| @@ -2043,12 +1927,10 @@ x_setup_relief_colors (s) | |||
| 2043 | when drawing. */ | 1927 | when drawing. */ |
| 2044 | 1928 | ||
| 2045 | static void | 1929 | static void |
| 2046 | x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, | 1930 | x_draw_relief_rect (struct frame *f, |
| 2047 | raised_p, top_p, bot_p, left_p, right_p, clip_rect) | 1931 | int left_x, int top_y, int right_x, int bottom_y, int width, |
| 2048 | struct frame *f; | 1932 | int raised_p, int top_p, int bot_p, int left_p, int right_p, |
| 2049 | int left_x, top_y, right_x, bottom_y, width; | 1933 | XRectangle *clip_rect) |
| 2050 | int top_p, bot_p, left_p, right_p, raised_p; | ||
| 2051 | XRectangle *clip_rect; | ||
| 2052 | { | 1934 | { |
| 2053 | Display *dpy = FRAME_X_DISPLAY (f); | 1935 | Display *dpy = FRAME_X_DISPLAY (f); |
| 2054 | Window window = FRAME_X_WINDOW (f); | 1936 | Window window = FRAME_X_WINDOW (f); |
| @@ -2106,11 +1988,9 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, | |||
| 2106 | rectangle to use when drawing. */ | 1988 | rectangle to use when drawing. */ |
| 2107 | 1989 | ||
| 2108 | static void | 1990 | static void |
| 2109 | x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, | 1991 | x_draw_box_rect (struct glyph_string *s, |
| 2110 | left_p, right_p, clip_rect) | 1992 | int left_x, int top_y, int right_x, int bottom_y, int width, |
| 2111 | struct glyph_string *s; | 1993 | int left_p, int right_p, XRectangle *clip_rect) |
| 2112 | int left_x, top_y, right_x, bottom_y, width, left_p, right_p; | ||
| 2113 | XRectangle *clip_rect; | ||
| 2114 | { | 1994 | { |
| 2115 | XGCValues xgcv; | 1995 | XGCValues xgcv; |
| 2116 | 1996 | ||
| @@ -2144,8 +2024,7 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, | |||
| 2144 | /* Draw a box around glyph string S. */ | 2024 | /* Draw a box around glyph string S. */ |
| 2145 | 2025 | ||
| 2146 | static void | 2026 | static void |
| 2147 | x_draw_glyph_string_box (s) | 2027 | x_draw_glyph_string_box (struct glyph_string *s) |
| 2148 | struct glyph_string *s; | ||
| 2149 | { | 2028 | { |
| 2150 | int width, left_x, right_x, top_y, bottom_y, last_x, raised_p; | 2029 | int width, left_x, right_x, top_y, bottom_y, last_x, raised_p; |
| 2151 | int left_p, right_p; | 2030 | int left_p, right_p; |
| @@ -2196,8 +2075,7 @@ x_draw_glyph_string_box (s) | |||
| 2196 | /* Draw foreground of image glyph string S. */ | 2075 | /* Draw foreground of image glyph string S. */ |
| 2197 | 2076 | ||
| 2198 | static void | 2077 | static void |
| 2199 | x_draw_image_foreground (s) | 2078 | x_draw_image_foreground (struct glyph_string *s) |
| 2200 | struct glyph_string *s; | ||
| 2201 | { | 2079 | { |
| 2202 | int x = s->x; | 2080 | int x = s->x; |
| 2203 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); | 2081 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
| @@ -2287,8 +2165,7 @@ x_draw_image_foreground (s) | |||
| 2287 | /* Draw a relief around the image glyph string S. */ | 2165 | /* Draw a relief around the image glyph string S. */ |
| 2288 | 2166 | ||
| 2289 | static void | 2167 | static void |
| 2290 | x_draw_image_relief (s) | 2168 | x_draw_image_relief (struct glyph_string *s) |
| 2291 | struct glyph_string *s; | ||
| 2292 | { | 2169 | { |
| 2293 | int x0, y0, x1, y1, thick, raised_p, extra; | 2170 | int x0, y0, x1, y1, thick, raised_p, extra; |
| 2294 | XRectangle r; | 2171 | XRectangle r; |
| @@ -2323,7 +2200,7 @@ x_draw_image_relief (s) | |||
| 2323 | 2200 | ||
| 2324 | extra = s->face->id == TOOL_BAR_FACE_ID | 2201 | extra = s->face->id == TOOL_BAR_FACE_ID |
| 2325 | ? XINT (Vtool_bar_button_margin) : 0; | 2202 | ? XINT (Vtool_bar_button_margin) : 0; |
| 2326 | 2203 | ||
| 2327 | x0 = x - thick - extra; | 2204 | x0 = x - thick - extra; |
| 2328 | y0 = y - thick - extra; | 2205 | y0 = y - thick - extra; |
| 2329 | x1 = x + s->slice.width + thick - 1 + extra; | 2206 | x1 = x + s->slice.width + thick - 1 + extra; |
| @@ -2343,9 +2220,7 @@ x_draw_image_relief (s) | |||
| 2343 | /* Draw the foreground of image glyph string S to PIXMAP. */ | 2220 | /* Draw the foreground of image glyph string S to PIXMAP. */ |
| 2344 | 2221 | ||
| 2345 | static void | 2222 | static void |
| 2346 | x_draw_image_foreground_1 (s, pixmap) | 2223 | x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap) |
| 2347 | struct glyph_string *s; | ||
| 2348 | Pixmap pixmap; | ||
| 2349 | { | 2224 | { |
| 2350 | int x = 0; | 2225 | int x = 0; |
| 2351 | int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice); | 2226 | int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice); |
| @@ -2420,10 +2295,8 @@ x_draw_image_foreground_1 (s, pixmap) | |||
| 2420 | /* Draw part of the background of glyph string S. X, Y, W, and H | 2295 | /* Draw part of the background of glyph string S. X, Y, W, and H |
| 2421 | give the rectangle to draw. */ | 2296 | give the rectangle to draw. */ |
| 2422 | 2297 | ||
| 2423 | void | 2298 | static void |
| 2424 | x_draw_glyph_string_bg_rect (s, x, y, w, h) | 2299 | x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h) |
| 2425 | struct glyph_string *s; | ||
| 2426 | int x, y, w, h; | ||
| 2427 | { | 2300 | { |
| 2428 | if (s->stippled_p) | 2301 | if (s->stippled_p) |
| 2429 | { | 2302 | { |
| @@ -2452,8 +2325,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h) | |||
| 2452 | */ | 2325 | */ |
| 2453 | 2326 | ||
| 2454 | static void | 2327 | static void |
| 2455 | x_draw_image_glyph_string (s) | 2328 | x_draw_image_glyph_string (struct glyph_string *s) |
| 2456 | struct glyph_string *s; | ||
| 2457 | { | 2329 | { |
| 2458 | int box_line_hwidth = eabs (s->face->box_line_width); | 2330 | int box_line_hwidth = eabs (s->face->box_line_width); |
| 2459 | int box_line_vwidth = max (s->face->box_line_width, 0); | 2331 | int box_line_vwidth = max (s->face->box_line_width, 0); |
| @@ -2557,25 +2429,41 @@ x_draw_image_glyph_string (s) | |||
| 2557 | /* Draw stretch glyph string S. */ | 2429 | /* Draw stretch glyph string S. */ |
| 2558 | 2430 | ||
| 2559 | static void | 2431 | static void |
| 2560 | x_draw_stretch_glyph_string (s) | 2432 | x_draw_stretch_glyph_string (struct glyph_string *s) |
| 2561 | struct glyph_string *s; | ||
| 2562 | { | 2433 | { |
| 2563 | xassert (s->first_glyph->type == STRETCH_GLYPH); | 2434 | xassert (s->first_glyph->type == STRETCH_GLYPH); |
| 2564 | 2435 | ||
| 2565 | if (s->hl == DRAW_CURSOR | 2436 | if (s->hl == DRAW_CURSOR |
| 2566 | && !x_stretch_cursor_p) | 2437 | && !x_stretch_cursor_p) |
| 2567 | { | 2438 | { |
| 2568 | /* If `x-stretch-block-cursor' is nil, don't draw a block cursor | 2439 | /* If `x-stretch-cursor' is nil, don't draw a block cursor as |
| 2569 | as wide as the stretch glyph. */ | 2440 | wide as the stretch glyph. */ |
| 2570 | int width, background_width = s->background_width; | 2441 | int width, background_width = s->background_width; |
| 2571 | int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); | 2442 | int x = s->x; |
| 2572 | 2443 | ||
| 2573 | if (x < left_x) | 2444 | if (!s->row->reversed_p) |
| 2574 | { | 2445 | { |
| 2575 | background_width -= left_x - x; | 2446 | int left_x = window_box_left_offset (s->w, TEXT_AREA); |
| 2576 | x = left_x; | 2447 | |
| 2448 | if (x < left_x) | ||
| 2449 | { | ||
| 2450 | background_width -= left_x - x; | ||
| 2451 | x = left_x; | ||
| 2452 | } | ||
| 2453 | } | ||
| 2454 | else | ||
| 2455 | { | ||
| 2456 | /* In R2L rows, draw the cursor on the right edge of the | ||
| 2457 | stretch glyph. */ | ||
| 2458 | int right_x = window_box_right_offset (s->w, TEXT_AREA); | ||
| 2459 | |||
| 2460 | if (x + background_width > right_x) | ||
| 2461 | background_width -= x - right_x; | ||
| 2462 | x += background_width; | ||
| 2577 | } | 2463 | } |
| 2578 | width = min (FRAME_COLUMN_WIDTH (s->f), background_width); | 2464 | width = min (FRAME_COLUMN_WIDTH (s->f), background_width); |
| 2465 | if (s->row->reversed_p) | ||
| 2466 | x -= width; | ||
| 2579 | 2467 | ||
| 2580 | /* Draw cursor. */ | 2468 | /* Draw cursor. */ |
| 2581 | x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height); | 2469 | x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height); |
| @@ -2588,7 +2476,10 @@ x_draw_stretch_glyph_string (s) | |||
| 2588 | XRectangle r; | 2476 | XRectangle r; |
| 2589 | GC gc; | 2477 | GC gc; |
| 2590 | 2478 | ||
| 2591 | x += width; | 2479 | if (!s->row->reversed_p) |
| 2480 | x += width; | ||
| 2481 | else | ||
| 2482 | x = s->x; | ||
| 2592 | if (s->row->mouse_face_p | 2483 | if (s->row->mouse_face_p |
| 2593 | && cursor_in_mouse_face_p (s->w)) | 2484 | && cursor_in_mouse_face_p (s->w)) |
| 2594 | { | 2485 | { |
| @@ -2641,8 +2532,7 @@ x_draw_stretch_glyph_string (s) | |||
| 2641 | /* Draw glyph string S. */ | 2532 | /* Draw glyph string S. */ |
| 2642 | 2533 | ||
| 2643 | static void | 2534 | static void |
| 2644 | x_draw_glyph_string (s) | 2535 | x_draw_glyph_string (struct glyph_string *s) |
| 2645 | struct glyph_string *s; | ||
| 2646 | { | 2536 | { |
| 2647 | int relief_drawn_p = 0; | 2537 | int relief_drawn_p = 0; |
| 2648 | 2538 | ||
| @@ -2902,9 +2792,7 @@ x_draw_glyph_string (s) | |||
| 2902 | /* Shift display to make room for inserted glyphs. */ | 2792 | /* Shift display to make room for inserted glyphs. */ |
| 2903 | 2793 | ||
| 2904 | void | 2794 | void |
| 2905 | x_shift_glyphs_for_insert (f, x, y, width, height, shift_by) | 2795 | x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height, int shift_by) |
| 2906 | struct frame *f; | ||
| 2907 | int x, y, width, height, shift_by; | ||
| 2908 | { | 2796 | { |
| 2909 | XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_X_WINDOW (f), | 2797 | XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_X_WINDOW (f), |
| 2910 | f->output_data.x->normal_gc, | 2798 | f->output_data.x->normal_gc, |
| @@ -2916,9 +2804,7 @@ x_shift_glyphs_for_insert (f, x, y, width, height, shift_by) | |||
| 2916 | for X frames. */ | 2804 | for X frames. */ |
| 2917 | 2805 | ||
| 2918 | static void | 2806 | static void |
| 2919 | x_delete_glyphs (f, n) | 2807 | x_delete_glyphs (struct frame *f, register int n) |
| 2920 | struct frame *f; | ||
| 2921 | register int n; | ||
| 2922 | { | 2808 | { |
| 2923 | abort (); | 2809 | abort (); |
| 2924 | } | 2810 | } |
| @@ -2928,12 +2814,7 @@ x_delete_glyphs (f, n) | |||
| 2928 | If they are <= 0, this is probably an error. */ | 2814 | If they are <= 0, this is probably an error. */ |
| 2929 | 2815 | ||
| 2930 | void | 2816 | void |
| 2931 | x_clear_area (dpy, window, x, y, width, height, exposures) | 2817 | x_clear_area (Display *dpy, Window window, int x, int y, int width, int height, int exposures) |
| 2932 | Display *dpy; | ||
| 2933 | Window window; | ||
| 2934 | int x, y; | ||
| 2935 | int width, height; | ||
| 2936 | int exposures; | ||
| 2937 | { | 2818 | { |
| 2938 | xassert (width > 0 && height > 0); | 2819 | xassert (width > 0 && height > 0); |
| 2939 | XClearArea (dpy, window, x, y, width, height, exposures); | 2820 | XClearArea (dpy, window, x, y, width, height, exposures); |
| @@ -2963,9 +2844,10 @@ x_clear_frame (struct frame *f) | |||
| 2963 | #if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS) | 2844 | #if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS) |
| 2964 | /* Make sure scroll bars are redrawn. As they aren't redrawn by | 2845 | /* Make sure scroll bars are redrawn. As they aren't redrawn by |
| 2965 | redisplay, do it here. */ | 2846 | redisplay, do it here. */ |
| 2966 | gtk_widget_queue_draw (FRAME_GTK_WIDGET (f)); | 2847 | if (FRAME_GTK_WIDGET (f)) |
| 2848 | gtk_widget_queue_draw (FRAME_GTK_WIDGET (f)); | ||
| 2967 | #endif | 2849 | #endif |
| 2968 | 2850 | ||
| 2969 | XFlush (FRAME_X_DISPLAY (f)); | 2851 | XFlush (FRAME_X_DISPLAY (f)); |
| 2970 | 2852 | ||
| 2971 | UNBLOCK_INPUT; | 2853 | UNBLOCK_INPUT; |
| @@ -2985,8 +2867,7 @@ x_clear_frame (struct frame *f) | |||
| 2985 | *RESULT. Return 1 if the difference is negative, otherwise 0. */ | 2867 | *RESULT. Return 1 if the difference is negative, otherwise 0. */ |
| 2986 | 2868 | ||
| 2987 | static int | 2869 | static int |
| 2988 | timeval_subtract (result, x, y) | 2870 | timeval_subtract (struct timeval *result, struct timeval x, struct timeval y) |
| 2989 | struct timeval *result, x, y; | ||
| 2990 | { | 2871 | { |
| 2991 | /* Perform the carry for the later subtraction by updating y. This | 2872 | /* Perform the carry for the later subtraction by updating y. This |
| 2992 | is safer because on some systems the tv_sec member is unsigned. */ | 2873 | is safer because on some systems the tv_sec member is unsigned. */ |
| @@ -3015,8 +2896,7 @@ timeval_subtract (result, x, y) | |||
| 3015 | } | 2896 | } |
| 3016 | 2897 | ||
| 3017 | void | 2898 | void |
| 3018 | XTflash (f) | 2899 | XTflash (struct frame *f) |
| 3019 | struct frame *f; | ||
| 3020 | { | 2900 | { |
| 3021 | BLOCK_INPUT; | 2901 | BLOCK_INPUT; |
| 3022 | 2902 | ||
| @@ -3024,18 +2904,16 @@ XTflash (f) | |||
| 3024 | #ifdef USE_GTK | 2904 | #ifdef USE_GTK |
| 3025 | /* Use Gdk routines to draw. This way, we won't draw over scroll bars | 2905 | /* Use Gdk routines to draw. This way, we won't draw over scroll bars |
| 3026 | when the scroll bars and the edit widget share the same X window. */ | 2906 | when the scroll bars and the edit widget share the same X window. */ |
| 2907 | GdkWindow *window = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); | ||
| 3027 | GdkGCValues vals; | 2908 | GdkGCValues vals; |
| 3028 | GdkGC *gc; | 2909 | GdkGC *gc; |
| 3029 | vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f) | 2910 | vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f) |
| 3030 | ^ FRAME_BACKGROUND_PIXEL (f)); | 2911 | ^ FRAME_BACKGROUND_PIXEL (f)); |
| 3031 | vals.function = GDK_XOR; | 2912 | vals.function = GDK_XOR; |
| 3032 | gc = gdk_gc_new_with_values (FRAME_GTK_WIDGET (f)->window, | 2913 | gc = gdk_gc_new_with_values (window, |
| 3033 | &vals, | 2914 | &vals, GDK_GC_FUNCTION | GDK_GC_FOREGROUND); |
| 3034 | GDK_GC_FUNCTION | ||
| 3035 | | GDK_GC_FOREGROUND); | ||
| 3036 | #define XFillRectangle(d, win, gc, x, y, w, h) \ | 2915 | #define XFillRectangle(d, win, gc, x, y, w, h) \ |
| 3037 | gdk_draw_rectangle (FRAME_GTK_WIDGET (f)->window, \ | 2916 | gdk_draw_rectangle (window, gc, TRUE, x, y, w, h) |
| 3038 | gc, TRUE, x, y, w, h) | ||
| 3039 | #else | 2917 | #else |
| 3040 | GC gc; | 2918 | GC gc; |
| 3041 | 2919 | ||
| @@ -3173,12 +3051,10 @@ XTflash (f) | |||
| 3173 | 3051 | ||
| 3174 | 3052 | ||
| 3175 | static void | 3053 | static void |
| 3176 | XTtoggle_invisible_pointer (f, invisible) | 3054 | XTtoggle_invisible_pointer (FRAME_PTR f, int invisible) |
| 3177 | FRAME_PTR f; | ||
| 3178 | int invisible; | ||
| 3179 | { | 3055 | { |
| 3180 | BLOCK_INPUT; | 3056 | BLOCK_INPUT; |
| 3181 | if (invisible) | 3057 | if (invisible) |
| 3182 | { | 3058 | { |
| 3183 | if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0) | 3059 | if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0) |
| 3184 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 3060 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| @@ -3195,10 +3071,8 @@ XTtoggle_invisible_pointer (f, invisible) | |||
| 3195 | /* Make audible bell. */ | 3071 | /* Make audible bell. */ |
| 3196 | 3072 | ||
| 3197 | void | 3073 | void |
| 3198 | XTring_bell () | 3074 | XTring_bell (struct frame *f) |
| 3199 | { | 3075 | { |
| 3200 | struct frame *f = SELECTED_FRAME (); | ||
| 3201 | |||
| 3202 | if (FRAME_X_DISPLAY (f)) | 3076 | if (FRAME_X_DISPLAY (f)) |
| 3203 | { | 3077 | { |
| 3204 | #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) | 3078 | #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) |
| @@ -3222,8 +3096,7 @@ XTring_bell () | |||
| 3222 | that is bounded by calls to x_update_begin and x_update_end. */ | 3096 | that is bounded by calls to x_update_begin and x_update_end. */ |
| 3223 | 3097 | ||
| 3224 | static void | 3098 | static void |
| 3225 | XTset_terminal_window (n) | 3099 | XTset_terminal_window (struct frame *f, int n) |
| 3226 | register int n; | ||
| 3227 | { | 3100 | { |
| 3228 | /* This function intentionally left blank. */ | 3101 | /* This function intentionally left blank. */ |
| 3229 | } | 3102 | } |
| @@ -3238,9 +3111,7 @@ XTset_terminal_window (n) | |||
| 3238 | lines or deleting -N lines at vertical position VPOS. */ | 3111 | lines or deleting -N lines at vertical position VPOS. */ |
| 3239 | 3112 | ||
| 3240 | static void | 3113 | static void |
| 3241 | x_ins_del_lines (f, vpos, n) | 3114 | x_ins_del_lines (struct frame *f, int vpos, int n) |
| 3242 | struct frame *f; | ||
| 3243 | int vpos, n; | ||
| 3244 | { | 3115 | { |
| 3245 | abort (); | 3116 | abort (); |
| 3246 | } | 3117 | } |
| @@ -3249,9 +3120,7 @@ x_ins_del_lines (f, vpos, n) | |||
| 3249 | /* Scroll part of the display as described by RUN. */ | 3120 | /* Scroll part of the display as described by RUN. */ |
| 3250 | 3121 | ||
| 3251 | static void | 3122 | static void |
| 3252 | x_scroll_run (w, run) | 3123 | x_scroll_run (struct window *w, struct run *run) |
| 3253 | struct window *w; | ||
| 3254 | struct run *run; | ||
| 3255 | { | 3124 | { |
| 3256 | struct frame *f = XFRAME (w->frame); | 3125 | struct frame *f = XFRAME (w->frame); |
| 3257 | int x, y, width, height, from_y, to_y, bottom_y; | 3126 | int x, y, width, height, from_y, to_y, bottom_y; |
| @@ -3308,8 +3177,7 @@ x_scroll_run (w, run) | |||
| 3308 | 3177 | ||
| 3309 | 3178 | ||
| 3310 | static void | 3179 | static void |
| 3311 | frame_highlight (f) | 3180 | frame_highlight (struct frame *f) |
| 3312 | struct frame *f; | ||
| 3313 | { | 3181 | { |
| 3314 | /* We used to only do this if Vx_no_window_manager was non-nil, but | 3182 | /* We used to only do this if Vx_no_window_manager was non-nil, but |
| 3315 | the ICCCM (section 4.1.6) says that the window's border pixmap | 3183 | the ICCCM (section 4.1.6) says that the window's border pixmap |
| @@ -3324,8 +3192,7 @@ frame_highlight (f) | |||
| 3324 | } | 3192 | } |
| 3325 | 3193 | ||
| 3326 | static void | 3194 | static void |
| 3327 | frame_unhighlight (f) | 3195 | frame_unhighlight (struct frame *f) |
| 3328 | struct frame *f; | ||
| 3329 | { | 3196 | { |
| 3330 | /* We used to only do this if Vx_no_window_manager was non-nil, but | 3197 | /* We used to only do this if Vx_no_window_manager was non-nil, but |
| 3331 | the ICCCM (section 4.1.6) says that the window's border pixmap | 3198 | the ICCCM (section 4.1.6) says that the window's border pixmap |
| @@ -3346,9 +3213,7 @@ frame_unhighlight (f) | |||
| 3346 | Lisp code can tell when the switch took place by examining the events. */ | 3213 | Lisp code can tell when the switch took place by examining the events. */ |
| 3347 | 3214 | ||
| 3348 | static void | 3215 | static void |
| 3349 | x_new_focus_frame (dpyinfo, frame) | 3216 | x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame) |
| 3350 | struct x_display_info *dpyinfo; | ||
| 3351 | struct frame *frame; | ||
| 3352 | { | 3217 | { |
| 3353 | struct frame *old_focus = dpyinfo->x_focus_frame; | 3218 | struct frame *old_focus = dpyinfo->x_focus_frame; |
| 3354 | 3219 | ||
| @@ -3375,12 +3240,7 @@ x_new_focus_frame (dpyinfo, frame) | |||
| 3375 | a FOCUS_IN_EVENT into *BUFP. */ | 3240 | a FOCUS_IN_EVENT into *BUFP. */ |
| 3376 | 3241 | ||
| 3377 | static void | 3242 | static void |
| 3378 | x_focus_changed (type, state, dpyinfo, frame, bufp) | 3243 | x_focus_changed (int type, int state, struct x_display_info *dpyinfo, struct frame *frame, struct input_event *bufp) |
| 3379 | int type; | ||
| 3380 | int state; | ||
| 3381 | struct x_display_info *dpyinfo; | ||
| 3382 | struct frame *frame; | ||
| 3383 | struct input_event *bufp; | ||
| 3384 | { | 3244 | { |
| 3385 | if (type == FocusIn) | 3245 | if (type == FocusIn) |
| 3386 | { | 3246 | { |
| @@ -3432,10 +3292,7 @@ x_focus_changed (type, state, dpyinfo, frame, bufp) | |||
| 3432 | Returns FOCUS_IN_EVENT event in *BUFP. */ | 3292 | Returns FOCUS_IN_EVENT event in *BUFP. */ |
| 3433 | 3293 | ||
| 3434 | static void | 3294 | static void |
| 3435 | x_detect_focus_change (dpyinfo, event, bufp) | 3295 | x_detect_focus_change (struct x_display_info *dpyinfo, XEvent *event, struct input_event *bufp) |
| 3436 | struct x_display_info *dpyinfo; | ||
| 3437 | XEvent *event; | ||
| 3438 | struct input_event *bufp; | ||
| 3439 | { | 3296 | { |
| 3440 | struct frame *frame; | 3297 | struct frame *frame; |
| 3441 | 3298 | ||
| @@ -3484,8 +3341,7 @@ x_detect_focus_change (dpyinfo, event, bufp) | |||
| 3484 | /* Handle an event saying the mouse has moved out of an Emacs frame. */ | 3341 | /* Handle an event saying the mouse has moved out of an Emacs frame. */ |
| 3485 | 3342 | ||
| 3486 | void | 3343 | void |
| 3487 | x_mouse_leave (dpyinfo) | 3344 | x_mouse_leave (struct x_display_info *dpyinfo) |
| 3488 | struct x_display_info *dpyinfo; | ||
| 3489 | { | 3345 | { |
| 3490 | x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame); | 3346 | x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame); |
| 3491 | } | 3347 | } |
| @@ -3499,15 +3355,13 @@ x_mouse_leave (dpyinfo) | |||
| 3499 | the appropriate X display info. */ | 3355 | the appropriate X display info. */ |
| 3500 | 3356 | ||
| 3501 | static void | 3357 | static void |
| 3502 | XTframe_rehighlight (frame) | 3358 | XTframe_rehighlight (struct frame *frame) |
| 3503 | struct frame *frame; | ||
| 3504 | { | 3359 | { |
| 3505 | x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame)); | 3360 | x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame)); |
| 3506 | } | 3361 | } |
| 3507 | 3362 | ||
| 3508 | static void | 3363 | static void |
| 3509 | x_frame_rehighlight (dpyinfo) | 3364 | x_frame_rehighlight (struct x_display_info *dpyinfo) |
| 3510 | struct x_display_info *dpyinfo; | ||
| 3511 | { | 3365 | { |
| 3512 | struct frame *old_highlight = dpyinfo->x_highlight_frame; | 3366 | struct frame *old_highlight = dpyinfo->x_highlight_frame; |
| 3513 | 3367 | ||
| @@ -3541,8 +3395,7 @@ x_frame_rehighlight (dpyinfo) | |||
| 3541 | 3395 | ||
| 3542 | /* Initialize mode_switch_bit and modifier_meaning. */ | 3396 | /* Initialize mode_switch_bit and modifier_meaning. */ |
| 3543 | static void | 3397 | static void |
| 3544 | x_find_modifier_meanings (dpyinfo) | 3398 | x_find_modifier_meanings (struct x_display_info *dpyinfo) |
| 3545 | struct x_display_info *dpyinfo; | ||
| 3546 | { | 3399 | { |
| 3547 | int min_code, max_code; | 3400 | int min_code, max_code; |
| 3548 | KeySym *syms; | 3401 | KeySym *syms; |
| @@ -3653,9 +3506,7 @@ x_find_modifier_meanings (dpyinfo) | |||
| 3653 | Emacs uses. */ | 3506 | Emacs uses. */ |
| 3654 | 3507 | ||
| 3655 | unsigned int | 3508 | unsigned int |
| 3656 | x_x_to_emacs_modifiers (dpyinfo, state) | 3509 | x_x_to_emacs_modifiers (struct x_display_info *dpyinfo, unsigned int state) |
| 3657 | struct x_display_info *dpyinfo; | ||
| 3658 | unsigned int state; | ||
| 3659 | { | 3510 | { |
| 3660 | EMACS_UINT mod_meta = meta_modifier; | 3511 | EMACS_UINT mod_meta = meta_modifier; |
| 3661 | EMACS_UINT mod_alt = alt_modifier; | 3512 | EMACS_UINT mod_alt = alt_modifier; |
| @@ -3682,9 +3533,7 @@ x_x_to_emacs_modifiers (dpyinfo, state) | |||
| 3682 | } | 3533 | } |
| 3683 | 3534 | ||
| 3684 | static unsigned int | 3535 | static unsigned int |
| 3685 | x_emacs_to_x_modifiers (dpyinfo, state) | 3536 | x_emacs_to_x_modifiers (struct x_display_info *dpyinfo, unsigned int state) |
| 3686 | struct x_display_info *dpyinfo; | ||
| 3687 | unsigned int state; | ||
| 3688 | { | 3537 | { |
| 3689 | EMACS_UINT mod_meta = meta_modifier; | 3538 | EMACS_UINT mod_meta = meta_modifier; |
| 3690 | EMACS_UINT mod_alt = alt_modifier; | 3539 | EMACS_UINT mod_alt = alt_modifier; |
| @@ -3714,8 +3563,7 @@ x_emacs_to_x_modifiers (dpyinfo, state) | |||
| 3714 | /* Convert a keysym to its name. */ | 3563 | /* Convert a keysym to its name. */ |
| 3715 | 3564 | ||
| 3716 | char * | 3565 | char * |
| 3717 | x_get_keysym_name (keysym) | 3566 | x_get_keysym_name (int keysym) |
| 3718 | KeySym keysym; | ||
| 3719 | { | 3567 | { |
| 3720 | char *value; | 3568 | char *value; |
| 3721 | 3569 | ||
| @@ -3736,10 +3584,7 @@ x_get_keysym_name (keysym) | |||
| 3736 | the mouse. */ | 3584 | the mouse. */ |
| 3737 | 3585 | ||
| 3738 | static Lisp_Object | 3586 | static Lisp_Object |
| 3739 | construct_mouse_click (result, event, f) | 3587 | construct_mouse_click (struct input_event *result, XButtonEvent *event, struct frame *f) |
| 3740 | struct input_event *result; | ||
| 3741 | XButtonEvent *event; | ||
| 3742 | struct frame *f; | ||
| 3743 | { | 3588 | { |
| 3744 | /* Make the event type NO_EVENT; we'll change that when we decide | 3589 | /* Make the event type NO_EVENT; we'll change that when we decide |
| 3745 | otherwise. */ | 3590 | otherwise. */ |
| @@ -3772,9 +3617,7 @@ static XMotionEvent last_mouse_motion_event; | |||
| 3772 | static Lisp_Object last_mouse_motion_frame; | 3617 | static Lisp_Object last_mouse_motion_frame; |
| 3773 | 3618 | ||
| 3774 | static int | 3619 | static int |
| 3775 | note_mouse_movement (frame, event) | 3620 | note_mouse_movement (FRAME_PTR frame, XMotionEvent *event) |
| 3776 | FRAME_PTR frame; | ||
| 3777 | XMotionEvent *event; | ||
| 3778 | { | 3621 | { |
| 3779 | last_mouse_movement_time = event->time; | 3622 | last_mouse_movement_time = event->time; |
| 3780 | last_mouse_motion_event = *event; | 3623 | last_mouse_motion_event = *event; |
| @@ -3818,7 +3661,7 @@ note_mouse_movement (frame, event) | |||
| 3818 | ************************************************************************/ | 3661 | ************************************************************************/ |
| 3819 | 3662 | ||
| 3820 | static void | 3663 | static void |
| 3821 | redo_mouse_highlight () | 3664 | redo_mouse_highlight (void) |
| 3822 | { | 3665 | { |
| 3823 | if (!NILP (last_mouse_motion_frame) | 3666 | if (!NILP (last_mouse_motion_frame) |
| 3824 | && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame))) | 3667 | && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame))) |
| @@ -3850,13 +3693,7 @@ redo_mouse_highlight () | |||
| 3850 | movement. */ | 3693 | movement. */ |
| 3851 | 3694 | ||
| 3852 | static void | 3695 | static void |
| 3853 | XTmouse_position (fp, insist, bar_window, part, x, y, time) | 3696 | XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, long unsigned int *time) |
| 3854 | FRAME_PTR *fp; | ||
| 3855 | int insist; | ||
| 3856 | Lisp_Object *bar_window; | ||
| 3857 | enum scroll_bar_part *part; | ||
| 3858 | Lisp_Object *x, *y; | ||
| 3859 | unsigned long *time; | ||
| 3860 | { | 3697 | { |
| 3861 | FRAME_PTR f1; | 3698 | FRAME_PTR f1; |
| 3862 | 3699 | ||
| @@ -4058,9 +3895,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) | |||
| 4058 | bits. */ | 3895 | bits. */ |
| 4059 | 3896 | ||
| 4060 | static struct scroll_bar * | 3897 | static struct scroll_bar * |
| 4061 | x_window_to_scroll_bar (display, window_id) | 3898 | x_window_to_scroll_bar (Display *display, Window window_id) |
| 4062 | Display *display; | ||
| 4063 | Window window_id; | ||
| 4064 | { | 3899 | { |
| 4065 | Lisp_Object tail; | 3900 | Lisp_Object tail; |
| 4066 | 3901 | ||
| @@ -4105,8 +3940,7 @@ x_window_to_scroll_bar (display, window_id) | |||
| 4105 | if WINDOW is not part of a menu bar. */ | 3940 | if WINDOW is not part of a menu bar. */ |
| 4106 | 3941 | ||
| 4107 | static Widget | 3942 | static Widget |
| 4108 | x_window_to_menu_bar (window) | 3943 | x_window_to_menu_bar (Window window) |
| 4109 | Window window; | ||
| 4110 | { | 3944 | { |
| 4111 | Lisp_Object tail; | 3945 | Lisp_Object tail; |
| 4112 | 3946 | ||
| @@ -4134,12 +3968,12 @@ x_window_to_menu_bar (window) | |||
| 4134 | 3968 | ||
| 4135 | #ifdef USE_TOOLKIT_SCROLL_BARS | 3969 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 4136 | 3970 | ||
| 4137 | static void x_scroll_bar_to_input_event P_ ((XEvent *, struct input_event *)); | 3971 | static void x_scroll_bar_to_input_event (XEvent *, struct input_event *); |
| 4138 | static void x_send_scroll_bar_event P_ ((Lisp_Object, int, int, int)); | 3972 | static void x_send_scroll_bar_event (Lisp_Object, int, int, int); |
| 4139 | static void x_create_toolkit_scroll_bar P_ ((struct frame *, | 3973 | static void x_create_toolkit_scroll_bar (struct frame *, |
| 4140 | struct scroll_bar *)); | 3974 | struct scroll_bar *); |
| 4141 | static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *, | 3975 | static void x_set_toolkit_scroll_bar_thumb (struct scroll_bar *, |
| 4142 | int, int, int)); | 3976 | int, int, int); |
| 4143 | 3977 | ||
| 4144 | 3978 | ||
| 4145 | /* Lisp window being scrolled. Set when starting to interact with | 3979 | /* Lisp window being scrolled. Set when starting to interact with |
| @@ -4173,14 +4007,8 @@ static Boolean xaw3d_pick_top; | |||
| 4173 | a `end-scroll' SCROLL_BAR_CLICK_EVENT' event if so. */ | 4007 | a `end-scroll' SCROLL_BAR_CLICK_EVENT' event if so. */ |
| 4174 | 4008 | ||
| 4175 | static void | 4009 | static void |
| 4176 | xt_action_hook (widget, client_data, action_name, event, params, | 4010 | xt_action_hook (Widget widget, XtPointer client_data, String action_name, |
| 4177 | num_params) | 4011 | XEvent *event, String *params, Cardinal *num_params) |
| 4178 | Widget widget; | ||
| 4179 | XtPointer client_data; | ||
| 4180 | String action_name; | ||
| 4181 | XEvent *event; | ||
| 4182 | String *params; | ||
| 4183 | Cardinal *num_params; | ||
| 4184 | { | 4012 | { |
| 4185 | int scroll_bar_p; | 4013 | int scroll_bar_p; |
| 4186 | char *end_action; | 4014 | char *end_action; |
| @@ -4231,9 +4059,7 @@ static int scroll_bar_windows_size; | |||
| 4231 | amount to scroll of a whole of WHOLE. */ | 4059 | amount to scroll of a whole of WHOLE. */ |
| 4232 | 4060 | ||
| 4233 | static void | 4061 | static void |
| 4234 | x_send_scroll_bar_event (window, part, portion, whole) | 4062 | x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole) |
| 4235 | Lisp_Object window; | ||
| 4236 | int part, portion, whole; | ||
| 4237 | { | 4063 | { |
| 4238 | XEvent event; | 4064 | XEvent event; |
| 4239 | XClientMessageEvent *ev = (XClientMessageEvent *) &event; | 4065 | XClientMessageEvent *ev = (XClientMessageEvent *) &event; |
| @@ -4266,7 +4092,7 @@ x_send_scroll_bar_event (window, part, portion, whole) | |||
| 4266 | 4092 | ||
| 4267 | scroll_bar_windows = (struct window **) xrealloc (scroll_bar_windows, | 4093 | scroll_bar_windows = (struct window **) xrealloc (scroll_bar_windows, |
| 4268 | nbytes); | 4094 | nbytes); |
| 4269 | bzero (&scroll_bar_windows[i], nbytes - old_nbytes); | 4095 | memset (&scroll_bar_windows[i], 0, nbytes - old_nbytes); |
| 4270 | scroll_bar_windows_size = new_size; | 4096 | scroll_bar_windows_size = new_size; |
| 4271 | } | 4097 | } |
| 4272 | 4098 | ||
| @@ -4295,9 +4121,7 @@ x_send_scroll_bar_event (window, part, portion, whole) | |||
| 4295 | in *IEVENT. */ | 4121 | in *IEVENT. */ |
| 4296 | 4122 | ||
| 4297 | static void | 4123 | static void |
| 4298 | x_scroll_bar_to_input_event (event, ievent) | 4124 | x_scroll_bar_to_input_event (XEvent *event, struct input_event *ievent) |
| 4299 | XEvent *event; | ||
| 4300 | struct input_event *ievent; | ||
| 4301 | { | 4125 | { |
| 4302 | XClientMessageEvent *ev = (XClientMessageEvent *) event; | 4126 | XClientMessageEvent *ev = (XClientMessageEvent *) event; |
| 4303 | Lisp_Object window; | 4127 | Lisp_Object window; |
| @@ -4338,9 +4162,7 @@ x_scroll_bar_to_input_event (event, ievent) | |||
| 4338 | CALL_DATA is a pointer to a XmScrollBarCallbackStruct. */ | 4162 | CALL_DATA is a pointer to a XmScrollBarCallbackStruct. */ |
| 4339 | 4163 | ||
| 4340 | static void | 4164 | static void |
| 4341 | xm_scroll_callback (widget, client_data, call_data) | 4165 | xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data) |
| 4342 | Widget widget; | ||
| 4343 | XtPointer client_data, call_data; | ||
| 4344 | { | 4166 | { |
| 4345 | struct scroll_bar *bar = (struct scroll_bar *) client_data; | 4167 | struct scroll_bar *bar = (struct scroll_bar *) client_data; |
| 4346 | XmScrollBarCallbackStruct *cs = (XmScrollBarCallbackStruct *) call_data; | 4168 | XmScrollBarCallbackStruct *cs = (XmScrollBarCallbackStruct *) call_data; |
| @@ -4435,7 +4257,8 @@ xg_scroll_callback (GtkRange *range, | |||
| 4435 | && FRAME_X_DISPLAY_INFO (f)->grabbed < (1 << 4)) | 4257 | && FRAME_X_DISPLAY_INFO (f)->grabbed < (1 << 4)) |
| 4436 | { | 4258 | { |
| 4437 | part = scroll_bar_handle; | 4259 | part = scroll_bar_handle; |
| 4438 | whole = adj->upper - adj->page_size; | 4260 | whole = gtk_adjustment_get_upper (adj) - |
| 4261 | gtk_adjustment_get_page_size (adj); | ||
| 4439 | portion = min ((int)position, whole); | 4262 | portion = min ((int)position, whole); |
| 4440 | bar->dragging = make_number ((int)portion); | 4263 | bar->dragging = make_number ((int)portion); |
| 4441 | } | 4264 | } |
| @@ -4496,9 +4319,7 @@ xg_end_scroll_callback (GtkWidget *widget, | |||
| 4496 | the thumb is. */ | 4319 | the thumb is. */ |
| 4497 | 4320 | ||
| 4498 | static void | 4321 | static void |
| 4499 | xaw_jump_callback (widget, client_data, call_data) | 4322 | xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data) |
| 4500 | Widget widget; | ||
| 4501 | XtPointer client_data, call_data; | ||
| 4502 | { | 4323 | { |
| 4503 | struct scroll_bar *bar = (struct scroll_bar *) client_data; | 4324 | struct scroll_bar *bar = (struct scroll_bar *) client_data; |
| 4504 | float top = *(float *) call_data; | 4325 | float top = *(float *) call_data; |
| @@ -4540,9 +4361,7 @@ xaw_jump_callback (widget, client_data, call_data) | |||
| 4540 | Values < height of scroll bar mean line-wise movement. */ | 4361 | Values < height of scroll bar mean line-wise movement. */ |
| 4541 | 4362 | ||
| 4542 | static void | 4363 | static void |
| 4543 | xaw_scroll_callback (widget, client_data, call_data) | 4364 | xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data) |
| 4544 | Widget widget; | ||
| 4545 | XtPointer client_data, call_data; | ||
| 4546 | { | 4365 | { |
| 4547 | struct scroll_bar *bar = (struct scroll_bar *) client_data; | 4366 | struct scroll_bar *bar = (struct scroll_bar *) client_data; |
| 4548 | /* The position really is stored cast to a pointer. */ | 4367 | /* The position really is stored cast to a pointer. */ |
| @@ -4580,11 +4399,9 @@ xaw_scroll_callback (widget, client_data, call_data) | |||
| 4580 | 4399 | ||
| 4581 | #ifdef USE_GTK | 4400 | #ifdef USE_GTK |
| 4582 | static void | 4401 | static void |
| 4583 | x_create_toolkit_scroll_bar (f, bar) | 4402 | x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) |
| 4584 | struct frame *f; | ||
| 4585 | struct scroll_bar *bar; | ||
| 4586 | { | 4403 | { |
| 4587 | char *scroll_bar_name = SCROLL_BAR_NAME; | 4404 | const char *scroll_bar_name = SCROLL_BAR_NAME; |
| 4588 | 4405 | ||
| 4589 | BLOCK_INPUT; | 4406 | BLOCK_INPUT; |
| 4590 | xg_create_scroll_bar (f, bar, G_CALLBACK (xg_scroll_callback), | 4407 | xg_create_scroll_bar (f, bar, G_CALLBACK (xg_scroll_callback), |
| @@ -4596,9 +4413,7 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4596 | #else /* not USE_GTK */ | 4413 | #else /* not USE_GTK */ |
| 4597 | 4414 | ||
| 4598 | static void | 4415 | static void |
| 4599 | x_create_toolkit_scroll_bar (f, bar) | 4416 | x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) |
| 4600 | struct frame *f; | ||
| 4601 | struct scroll_bar *bar; | ||
| 4602 | { | 4417 | { |
| 4603 | Window xwindow; | 4418 | Window xwindow; |
| 4604 | Widget widget; | 4419 | Widget widget; |
| @@ -4691,7 +4506,7 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4691 | if (f->output_data.x->scroll_bar_top_shadow_pixel == -1) | 4506 | if (f->output_data.x->scroll_bar_top_shadow_pixel == -1) |
| 4692 | { | 4507 | { |
| 4693 | pixel = f->output_data.x->scroll_bar_background_pixel; | 4508 | pixel = f->output_data.x->scroll_bar_background_pixel; |
| 4694 | if (pixel != -1) | 4509 | if (pixel != -1) |
| 4695 | { | 4510 | { |
| 4696 | if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), | 4511 | if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), |
| 4697 | FRAME_X_COLORMAP (f), | 4512 | FRAME_X_COLORMAP (f), |
| @@ -4703,7 +4518,7 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4703 | if (f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) | 4518 | if (f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) |
| 4704 | { | 4519 | { |
| 4705 | pixel = f->output_data.x->scroll_bar_background_pixel; | 4520 | pixel = f->output_data.x->scroll_bar_background_pixel; |
| 4706 | if (pixel != -1) | 4521 | if (pixel != -1) |
| 4707 | { | 4522 | { |
| 4708 | if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), | 4523 | if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), |
| 4709 | FRAME_X_COLORMAP (f), | 4524 | FRAME_X_COLORMAP (f), |
| @@ -4719,8 +4534,11 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4719 | || f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) | 4534 | || f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) |
| 4720 | /* We tried to allocate a color for the top/bottom shadow, and | 4535 | /* We tried to allocate a color for the top/bottom shadow, and |
| 4721 | failed, so tell Xaw3d to use dithering instead. */ | 4536 | failed, so tell Xaw3d to use dithering instead. */ |
| 4537 | /* But only if we have a small colormap. Xaw3d can allocate nice | ||
| 4538 | colors itself. */ | ||
| 4722 | { | 4539 | { |
| 4723 | XtSetArg (av[ac], XtNbeNiceToColormap, True); | 4540 | XtSetArg (av[ac], XtNbeNiceToColormap, |
| 4541 | DefaultDepthOfScreen (FRAME_X_SCREEN (f)) < 16); | ||
| 4724 | ++ac; | 4542 | ++ac; |
| 4725 | } | 4543 | } |
| 4726 | else | 4544 | else |
| @@ -4798,18 +4616,15 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4798 | 4616 | ||
| 4799 | #ifdef USE_GTK | 4617 | #ifdef USE_GTK |
| 4800 | static void | 4618 | static void |
| 4801 | x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | 4619 | x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole) |
| 4802 | struct scroll_bar *bar; | ||
| 4803 | int portion, position, whole; | ||
| 4804 | { | 4620 | { |
| 4805 | xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); | 4621 | xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); |
| 4806 | } | 4622 | } |
| 4807 | 4623 | ||
| 4808 | #else /* not USE_GTK */ | 4624 | #else /* not USE_GTK */ |
| 4809 | static void | 4625 | static void |
| 4810 | x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | 4626 | x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, |
| 4811 | struct scroll_bar *bar; | 4627 | int whole) |
| 4812 | int portion, position, whole; | ||
| 4813 | { | 4628 | { |
| 4814 | struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 4629 | struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
| 4815 | Widget widget = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar); | 4630 | Widget widget = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar); |
| @@ -4924,9 +4739,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 4924 | scroll bar. */ | 4739 | scroll bar. */ |
| 4925 | 4740 | ||
| 4926 | static struct scroll_bar * | 4741 | static struct scroll_bar * |
| 4927 | x_scroll_bar_create (w, top, left, width, height) | 4742 | x_scroll_bar_create (struct window *w, int top, int left, int width, int height) |
| 4928 | struct window *w; | ||
| 4929 | int top, left, width, height; | ||
| 4930 | { | 4743 | { |
| 4931 | struct frame *f = XFRAME (w->frame); | 4744 | struct frame *f = XFRAME (w->frame); |
| 4932 | struct scroll_bar *bar | 4745 | struct scroll_bar *bar |
| @@ -5040,10 +4853,7 @@ x_scroll_bar_create (w, top, left, width, height) | |||
| 5040 | to move to the very end of the buffer. */ | 4853 | to move to the very end of the buffer. */ |
| 5041 | 4854 | ||
| 5042 | static void | 4855 | static void |
| 5043 | x_scroll_bar_set_handle (bar, start, end, rebuild) | 4856 | x_scroll_bar_set_handle (struct scroll_bar *bar, int start, int end, int rebuild) |
| 5044 | struct scroll_bar *bar; | ||
| 5045 | int start, end; | ||
| 5046 | int rebuild; | ||
| 5047 | { | 4857 | { |
| 5048 | int dragging = ! NILP (bar->dragging); | 4858 | int dragging = ! NILP (bar->dragging); |
| 5049 | Window w = bar->x_window; | 4859 | Window w = bar->x_window; |
| @@ -5141,8 +4951,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild) | |||
| 5141 | nil. */ | 4951 | nil. */ |
| 5142 | 4952 | ||
| 5143 | static void | 4953 | static void |
| 5144 | x_scroll_bar_remove (bar) | 4954 | x_scroll_bar_remove (struct scroll_bar *bar) |
| 5145 | struct scroll_bar *bar; | ||
| 5146 | { | 4955 | { |
| 5147 | struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 4956 | struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
| 5148 | BLOCK_INPUT; | 4957 | BLOCK_INPUT; |
| @@ -5170,9 +4979,7 @@ x_scroll_bar_remove (bar) | |||
| 5170 | create one. */ | 4979 | create one. */ |
| 5171 | 4980 | ||
| 5172 | static void | 4981 | static void |
| 5173 | XTset_vertical_scroll_bar (w, portion, whole, position) | 4982 | XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position) |
| 5174 | struct window *w; | ||
| 5175 | int portion, whole, position; | ||
| 5176 | { | 4983 | { |
| 5177 | struct frame *f = XFRAME (w->frame); | 4984 | struct frame *f = XFRAME (w->frame); |
| 5178 | struct scroll_bar *bar; | 4985 | struct scroll_bar *bar; |
| @@ -5389,8 +5196,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 5389 | `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ | 5196 | `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ |
| 5390 | 5197 | ||
| 5391 | static void | 5198 | static void |
| 5392 | XTcondemn_scroll_bars (frame) | 5199 | XTcondemn_scroll_bars (FRAME_PTR frame) |
| 5393 | FRAME_PTR frame; | ||
| 5394 | { | 5200 | { |
| 5395 | /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ | 5201 | /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ |
| 5396 | while (! NILP (FRAME_SCROLL_BARS (frame))) | 5202 | while (! NILP (FRAME_SCROLL_BARS (frame))) |
| @@ -5411,8 +5217,7 @@ XTcondemn_scroll_bars (frame) | |||
| 5411 | Note that WINDOW isn't necessarily condemned at all. */ | 5217 | Note that WINDOW isn't necessarily condemned at all. */ |
| 5412 | 5218 | ||
| 5413 | static void | 5219 | static void |
| 5414 | XTredeem_scroll_bar (window) | 5220 | XTredeem_scroll_bar (struct window *window) |
| 5415 | struct window *window; | ||
| 5416 | { | 5221 | { |
| 5417 | struct scroll_bar *bar; | 5222 | struct scroll_bar *bar; |
| 5418 | struct frame *f; | 5223 | struct frame *f; |
| @@ -5457,8 +5262,7 @@ XTredeem_scroll_bar (window) | |||
| 5457 | last call to `*condemn_scroll_bars_hook'. */ | 5262 | last call to `*condemn_scroll_bars_hook'. */ |
| 5458 | 5263 | ||
| 5459 | static void | 5264 | static void |
| 5460 | XTjudge_scroll_bars (f) | 5265 | XTjudge_scroll_bars (FRAME_PTR f) |
| 5461 | FRAME_PTR f; | ||
| 5462 | { | 5266 | { |
| 5463 | Lisp_Object bar, next; | 5267 | Lisp_Object bar, next; |
| 5464 | 5268 | ||
| @@ -5491,9 +5295,7 @@ XTjudge_scroll_bars (f) | |||
| 5491 | mark bits. */ | 5295 | mark bits. */ |
| 5492 | 5296 | ||
| 5493 | static void | 5297 | static void |
| 5494 | x_scroll_bar_expose (bar, event) | 5298 | x_scroll_bar_expose (struct scroll_bar *bar, XEvent *event) |
| 5495 | struct scroll_bar *bar; | ||
| 5496 | XEvent *event; | ||
| 5497 | { | 5299 | { |
| 5498 | Window w = bar->x_window; | 5300 | Window w = bar->x_window; |
| 5499 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 5301 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
| @@ -5535,10 +5337,7 @@ x_scroll_bar_expose (bar, event) | |||
| 5535 | 5337 | ||
| 5536 | 5338 | ||
| 5537 | static void | 5339 | static void |
| 5538 | x_scroll_bar_handle_click (bar, event, emacs_event) | 5340 | x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_event *emacs_event) |
| 5539 | struct scroll_bar *bar; | ||
| 5540 | XEvent *event; | ||
| 5541 | struct input_event *emacs_event; | ||
| 5542 | { | 5341 | { |
| 5543 | if (! WINDOWP (bar->window)) | 5342 | if (! WINDOWP (bar->window)) |
| 5544 | abort (); | 5343 | abort (); |
| @@ -5596,9 +5395,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event) | |||
| 5596 | mark bits. */ | 5395 | mark bits. */ |
| 5597 | 5396 | ||
| 5598 | static void | 5397 | static void |
| 5599 | x_scroll_bar_note_movement (bar, event) | 5398 | x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) |
| 5600 | struct scroll_bar *bar; | ||
| 5601 | XEvent *event; | ||
| 5602 | { | 5399 | { |
| 5603 | FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); | 5400 | FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); |
| 5604 | 5401 | ||
| @@ -5628,12 +5425,7 @@ x_scroll_bar_note_movement (bar, event) | |||
| 5628 | on the scroll bar. */ | 5425 | on the scroll bar. */ |
| 5629 | 5426 | ||
| 5630 | static void | 5427 | static void |
| 5631 | x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) | 5428 | x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, long unsigned int *time) |
| 5632 | FRAME_PTR *fp; | ||
| 5633 | Lisp_Object *bar_window; | ||
| 5634 | enum scroll_bar_part *part; | ||
| 5635 | Lisp_Object *x, *y; | ||
| 5636 | unsigned long *time; | ||
| 5637 | { | 5429 | { |
| 5638 | struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); | 5430 | struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); |
| 5639 | Window w = bar->x_window; | 5431 | Window w = bar->x_window; |
| @@ -5705,8 +5497,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) | |||
| 5705 | redraw them. */ | 5497 | redraw them. */ |
| 5706 | 5498 | ||
| 5707 | void | 5499 | void |
| 5708 | x_scroll_bar_clear (f) | 5500 | x_scroll_bar_clear (FRAME_PTR f) |
| 5709 | FRAME_PTR f; | ||
| 5710 | { | 5501 | { |
| 5711 | #ifndef USE_TOOLKIT_SCROLL_BARS | 5502 | #ifndef USE_TOOLKIT_SCROLL_BARS |
| 5712 | Lisp_Object bar; | 5503 | Lisp_Object bar; |
| @@ -5759,22 +5550,18 @@ struct x_display_info *XTread_socket_fake_io_error; | |||
| 5759 | 5550 | ||
| 5760 | static struct x_display_info *next_noop_dpyinfo; | 5551 | static struct x_display_info *next_noop_dpyinfo; |
| 5761 | 5552 | ||
| 5762 | #define SET_SAVED_MENU_EVENT(size) \ | 5553 | #define SET_SAVED_BUTTON_EVENT \ |
| 5763 | do \ | 5554 | do \ |
| 5764 | { \ | 5555 | { \ |
| 5765 | if (f->output_data.x->saved_menu_event == 0) \ | 5556 | if (f->output_data.x->saved_menu_event == 0) \ |
| 5766 | f->output_data.x->saved_menu_event \ | 5557 | f->output_data.x->saved_menu_event \ |
| 5767 | = (XEvent *) xmalloc (sizeof (XEvent)); \ | 5558 | = (XEvent *) xmalloc (sizeof (XEvent)); \ |
| 5768 | bcopy (&event, f->output_data.x->saved_menu_event, size); \ | 5559 | *f->output_data.x->saved_menu_event = event; \ |
| 5769 | inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \ | 5560 | inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \ |
| 5770 | XSETFRAME (inev.ie.frame_or_window, f); \ | 5561 | XSETFRAME (inev.ie.frame_or_window, f); \ |
| 5771 | } \ | 5562 | } \ |
| 5772 | while (0) | 5563 | while (0) |
| 5773 | 5564 | ||
| 5774 | #define SET_SAVED_BUTTON_EVENT SET_SAVED_MENU_EVENT (sizeof (XButtonEvent)) | ||
| 5775 | #define SET_SAVED_KEY_EVENT SET_SAVED_MENU_EVENT (sizeof (XKeyEvent)) | ||
| 5776 | |||
| 5777 | |||
| 5778 | enum | 5565 | enum |
| 5779 | { | 5566 | { |
| 5780 | X_EVENT_NORMAL, | 5567 | X_EVENT_NORMAL, |
| @@ -5792,9 +5579,7 @@ enum | |||
| 5792 | 5579 | ||
| 5793 | #ifdef HAVE_X_I18N | 5580 | #ifdef HAVE_X_I18N |
| 5794 | static int | 5581 | static int |
| 5795 | x_filter_event (dpyinfo, event) | 5582 | x_filter_event (struct x_display_info *dpyinfo, XEvent *event) |
| 5796 | struct x_display_info *dpyinfo; | ||
| 5797 | XEvent *event; | ||
| 5798 | { | 5583 | { |
| 5799 | /* XFilterEvent returns non-zero if the input method has | 5584 | /* XFilterEvent returns non-zero if the input method has |
| 5800 | consumed the event. We pass the frame's X window to | 5585 | consumed the event. We pass the frame's X window to |
| @@ -5817,10 +5602,7 @@ static struct input_event *current_hold_quit; | |||
| 5817 | It is invoked before the XEvent is translated to a GdkEvent, | 5602 | It is invoked before the XEvent is translated to a GdkEvent, |
| 5818 | so we have a chance to act on the event before GTK. */ | 5603 | so we have a chance to act on the event before GTK. */ |
| 5819 | static GdkFilterReturn | 5604 | static GdkFilterReturn |
| 5820 | event_handler_gdk (gxev, ev, data) | 5605 | event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data) |
| 5821 | GdkXEvent *gxev; | ||
| 5822 | GdkEvent *ev; | ||
| 5823 | gpointer data; | ||
| 5824 | { | 5606 | { |
| 5825 | XEvent *xev = (XEvent *) gxev; | 5607 | XEvent *xev = (XEvent *) gxev; |
| 5826 | 5608 | ||
| @@ -5873,11 +5655,7 @@ event_handler_gdk (gxev, ev, data) | |||
| 5873 | We return the number of characters stored into the buffer. */ | 5655 | We return the number of characters stored into the buffer. */ |
| 5874 | 5656 | ||
| 5875 | static int | 5657 | static int |
| 5876 | handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | 5658 | handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, struct input_event *hold_quit) |
| 5877 | struct x_display_info *dpyinfo; | ||
| 5878 | XEvent *eventp; | ||
| 5879 | int *finish; | ||
| 5880 | struct input_event *hold_quit; | ||
| 5881 | { | 5659 | { |
| 5882 | union { | 5660 | union { |
| 5883 | struct input_event ie; | 5661 | struct input_event ie; |
| @@ -5913,7 +5691,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 5913 | 5691 | ||
| 5914 | if (pending_event_wait.eventtype == event.type) | 5692 | if (pending_event_wait.eventtype == event.type) |
| 5915 | pending_event_wait.eventtype = 0; /* Indicates we got it. */ | 5693 | pending_event_wait.eventtype = 0; /* Indicates we got it. */ |
| 5916 | 5694 | ||
| 5917 | switch (event.type) | 5695 | switch (event.type) |
| 5918 | { | 5696 | { |
| 5919 | case ClientMessage: | 5697 | case ClientMessage: |
| @@ -6430,7 +6208,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6430 | this enables ComposeCharacter to work whether or | 6208 | this enables ComposeCharacter to work whether or |
| 6431 | not it is combined with Meta. */ | 6209 | not it is combined with Meta. */ |
| 6432 | if (modifiers & dpyinfo->meta_mod_mask) | 6210 | if (modifiers & dpyinfo->meta_mod_mask) |
| 6433 | bzero (&compose_status, sizeof (compose_status)); | 6211 | memset (&compose_status, 0, sizeof (compose_status)); |
| 6434 | 6212 | ||
| 6435 | #ifdef HAVE_X_I18N | 6213 | #ifdef HAVE_X_I18N |
| 6436 | if (FRAME_XIC (f)) | 6214 | if (FRAME_XIC (f)) |
| @@ -6478,7 +6256,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6478 | if (compose_status.chars_matched > 0 && nbytes == 0) | 6256 | if (compose_status.chars_matched > 0 && nbytes == 0) |
| 6479 | break; | 6257 | break; |
| 6480 | 6258 | ||
| 6481 | bzero (&compose_status, sizeof (compose_status)); | 6259 | memset (&compose_status, 0, sizeof (compose_status)); |
| 6482 | orig_keysym = keysym; | 6260 | orig_keysym = keysym; |
| 6483 | 6261 | ||
| 6484 | /* Common for all keysym input events. */ | 6262 | /* Common for all keysym input events. */ |
| @@ -6837,7 +6615,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6837 | event.xconfigure.height); | 6615 | event.xconfigure.height); |
| 6838 | f = 0; | 6616 | f = 0; |
| 6839 | } | 6617 | } |
| 6840 | #endif | 6618 | #endif |
| 6841 | if (f) | 6619 | if (f) |
| 6842 | { | 6620 | { |
| 6843 | #ifndef USE_X_TOOLKIT | 6621 | #ifndef USE_X_TOOLKIT |
| @@ -6871,7 +6649,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6871 | /* GTK creates windows but doesn't map them. | 6649 | /* GTK creates windows but doesn't map them. |
| 6872 | Only get real positions when mapped. */ | 6650 | Only get real positions when mapped. */ |
| 6873 | if (FRAME_GTK_OUTER_WIDGET (f) | 6651 | if (FRAME_GTK_OUTER_WIDGET (f) |
| 6874 | && GTK_WIDGET_MAPPED (FRAME_GTK_OUTER_WIDGET (f))) | 6652 | && gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f))) |
| 6875 | #endif | 6653 | #endif |
| 6876 | { | 6654 | { |
| 6877 | x_real_positions (f, &f->left_pos, &f->top_pos); | 6655 | x_real_positions (f, &f->left_pos, &f->top_pos); |
| @@ -6892,7 +6670,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6892 | by the rest of Emacs, we put it here. */ | 6670 | by the rest of Emacs, we put it here. */ |
| 6893 | int tool_bar_p = 0; | 6671 | int tool_bar_p = 0; |
| 6894 | 6672 | ||
| 6895 | bzero (&compose_status, sizeof (compose_status)); | 6673 | memset (&compose_status, 0, sizeof (compose_status)); |
| 6896 | last_mouse_glyph_frame = 0; | 6674 | last_mouse_glyph_frame = 0; |
| 6897 | last_user_time = event.xbutton.time; | 6675 | last_user_time = event.xbutton.time; |
| 6898 | 6676 | ||
| @@ -6990,20 +6768,18 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6990 | f->mouse_moved = 0; | 6768 | f->mouse_moved = 0; |
| 6991 | 6769 | ||
| 6992 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | 6770 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
| 6993 | f = x_menubar_window_to_frame (dpyinfo, event.xbutton.window); | 6771 | f = x_menubar_window_to_frame (dpyinfo, &event); |
| 6994 | /* For a down-event in the menu bar, | 6772 | /* For a down-event in the menu bar, |
| 6995 | don't pass it to Xt right now. | 6773 | don't pass it to Xt right now. |
| 6996 | Instead, save it away | 6774 | Instead, save it away |
| 6997 | and we will pass it to Xt from kbd_buffer_get_event. | 6775 | and we will pass it to Xt from kbd_buffer_get_event. |
| 6998 | That way, we can run some Lisp code first. */ | 6776 | That way, we can run some Lisp code first. */ |
| 6999 | if ( | 6777 | if (! popup_activated () |
| 7000 | #ifdef USE_GTK | 6778 | #ifdef USE_GTK |
| 7001 | ! popup_activated () | ||
| 7002 | /* Gtk+ menus only react to the first three buttons. */ | 6779 | /* Gtk+ menus only react to the first three buttons. */ |
| 7003 | && event.xbutton.button < 3 | 6780 | && event.xbutton.button < 3 |
| 7004 | && | ||
| 7005 | #endif | 6781 | #endif |
| 7006 | f && event.type == ButtonPress | 6782 | && f && event.type == ButtonPress |
| 7007 | /* Verify the event is really within the menu bar | 6783 | /* Verify the event is really within the menu bar |
| 7008 | and not just sent to it due to grabbing. */ | 6784 | and not just sent to it due to grabbing. */ |
| 7009 | && event.xbutton.x >= 0 | 6785 | && event.xbutton.x >= 0 |
| @@ -7014,30 +6790,13 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 7014 | { | 6790 | { |
| 7015 | SET_SAVED_BUTTON_EVENT; | 6791 | SET_SAVED_BUTTON_EVENT; |
| 7016 | XSETFRAME (last_mouse_press_frame, f); | 6792 | XSETFRAME (last_mouse_press_frame, f); |
| 7017 | #ifdef USE_GTK | ||
| 7018 | *finish = X_EVENT_DROP; | 6793 | *finish = X_EVENT_DROP; |
| 7019 | #endif | ||
| 7020 | } | 6794 | } |
| 7021 | else if (event.type == ButtonPress) | 6795 | else if (event.type == ButtonPress) |
| 7022 | { | 6796 | { |
| 7023 | last_mouse_press_frame = Qnil; | 6797 | last_mouse_press_frame = Qnil; |
| 7024 | goto OTHER; | 6798 | goto OTHER; |
| 7025 | } | 6799 | } |
| 7026 | |||
| 7027 | #ifdef USE_MOTIF /* This should do not harm for Lucid, | ||
| 7028 | but I am trying to be cautious. */ | ||
| 7029 | else if (event.type == ButtonRelease) | ||
| 7030 | { | ||
| 7031 | if (!NILP (last_mouse_press_frame)) | ||
| 7032 | { | ||
| 7033 | f = XFRAME (last_mouse_press_frame); | ||
| 7034 | if (f->output_data.x) | ||
| 7035 | SET_SAVED_BUTTON_EVENT; | ||
| 7036 | } | ||
| 7037 | else | ||
| 7038 | goto OTHER; | ||
| 7039 | } | ||
| 7040 | #endif /* USE_MOTIF */ | ||
| 7041 | else | 6800 | else |
| 7042 | goto OTHER; | 6801 | goto OTHER; |
| 7043 | #endif /* USE_X_TOOLKIT || USE_GTK */ | 6802 | #endif /* USE_X_TOOLKIT || USE_GTK */ |
| @@ -7123,9 +6882,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 7123 | 6882 | ||
| 7124 | Returns the value handle_one_xevent sets in the finish argument. */ | 6883 | Returns the value handle_one_xevent sets in the finish argument. */ |
| 7125 | int | 6884 | int |
| 7126 | x_dispatch_event (event, display) | 6885 | x_dispatch_event (XEvent *event, Display *display) |
| 7127 | XEvent *event; | ||
| 7128 | Display *display; | ||
| 7129 | { | 6886 | { |
| 7130 | struct x_display_info *dpyinfo; | 6887 | struct x_display_info *dpyinfo; |
| 7131 | int finish = X_EVENT_NORMAL; | 6888 | int finish = X_EVENT_NORMAL; |
| @@ -7151,10 +6908,7 @@ x_dispatch_event (event, display) | |||
| 7151 | EXPECTED is nonzero if the caller knows input is available. */ | 6908 | EXPECTED is nonzero if the caller knows input is available. */ |
| 7152 | 6909 | ||
| 7153 | static int | 6910 | static int |
| 7154 | XTread_socket (terminal, expected, hold_quit) | 6911 | XTread_socket (struct terminal *terminal, int expected, struct input_event *hold_quit) |
| 7155 | struct terminal *terminal; | ||
| 7156 | int expected; | ||
| 7157 | struct input_event *hold_quit; | ||
| 7158 | { | 6912 | { |
| 7159 | int count = 0; | 6913 | int count = 0; |
| 7160 | XEvent event; | 6914 | XEvent event; |
| @@ -7305,11 +7059,7 @@ XTread_socket (terminal, expected, hold_quit) | |||
| 7305 | mode lines must be clipped to the whole window. */ | 7059 | mode lines must be clipped to the whole window. */ |
| 7306 | 7060 | ||
| 7307 | static void | 7061 | static void |
| 7308 | x_clip_to_row (w, row, area, gc) | 7062 | x_clip_to_row (struct window *w, struct glyph_row *row, int area, GC gc) |
| 7309 | struct window *w; | ||
| 7310 | struct glyph_row *row; | ||
| 7311 | int area; | ||
| 7312 | GC gc; | ||
| 7313 | { | 7063 | { |
| 7314 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 7064 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 7315 | XRectangle clip_rect; | 7065 | XRectangle clip_rect; |
| @@ -7330,9 +7080,7 @@ x_clip_to_row (w, row, area, gc) | |||
| 7330 | /* Draw a hollow box cursor on window W in glyph row ROW. */ | 7080 | /* Draw a hollow box cursor on window W in glyph row ROW. */ |
| 7331 | 7081 | ||
| 7332 | static void | 7082 | static void |
| 7333 | x_draw_hollow_cursor (w, row) | 7083 | x_draw_hollow_cursor (struct window *w, struct glyph_row *row) |
| 7334 | struct window *w; | ||
| 7335 | struct glyph_row *row; | ||
| 7336 | { | 7084 | { |
| 7337 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 7085 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 7338 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 7086 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| @@ -7377,11 +7125,7 @@ x_draw_hollow_cursor (w, row) | |||
| 7377 | --gerd. */ | 7125 | --gerd. */ |
| 7378 | 7126 | ||
| 7379 | static void | 7127 | static void |
| 7380 | x_draw_bar_cursor (w, row, width, kind) | 7128 | x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) |
| 7381 | struct window *w; | ||
| 7382 | struct glyph_row *row; | ||
| 7383 | int width; | ||
| 7384 | enum text_cursor_kinds kind; | ||
| 7385 | { | 7129 | { |
| 7386 | struct frame *f = XFRAME (w->frame); | 7130 | struct frame *f = XFRAME (w->frame); |
| 7387 | struct glyph *cursor_glyph; | 7131 | struct glyph *cursor_glyph; |
| @@ -7434,14 +7178,20 @@ x_draw_bar_cursor (w, row, width, kind) | |||
| 7434 | 7178 | ||
| 7435 | if (kind == BAR_CURSOR) | 7179 | if (kind == BAR_CURSOR) |
| 7436 | { | 7180 | { |
| 7181 | int x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); | ||
| 7182 | |||
| 7437 | if (width < 0) | 7183 | if (width < 0) |
| 7438 | width = FRAME_CURSOR_WIDTH (f); | 7184 | width = FRAME_CURSOR_WIDTH (f); |
| 7439 | width = min (cursor_glyph->pixel_width, width); | 7185 | width = min (cursor_glyph->pixel_width, width); |
| 7440 | 7186 | ||
| 7441 | w->phys_cursor_width = width; | 7187 | w->phys_cursor_width = width; |
| 7442 | 7188 | ||
| 7443 | XFillRectangle (dpy, window, gc, | 7189 | /* If the character under cursor is R2L, draw the bar cursor |
| 7444 | WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), | 7190 | on the right of its glyph, rather than on the left. */ |
| 7191 | if ((cursor_glyph->resolved_level & 1) != 0) | ||
| 7192 | x += cursor_glyph->pixel_width - width; | ||
| 7193 | |||
| 7194 | XFillRectangle (dpy, window, gc, x, | ||
| 7445 | WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), | 7195 | WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), |
| 7446 | width, row->height); | 7196 | width, row->height); |
| 7447 | } | 7197 | } |
| @@ -7472,9 +7222,7 @@ x_draw_bar_cursor (w, row, width, kind) | |||
| 7472 | /* RIF: Define cursor CURSOR on frame F. */ | 7222 | /* RIF: Define cursor CURSOR on frame F. */ |
| 7473 | 7223 | ||
| 7474 | static void | 7224 | static void |
| 7475 | x_define_frame_cursor (f, cursor) | 7225 | x_define_frame_cursor (struct frame *f, Cursor cursor) |
| 7476 | struct frame *f; | ||
| 7477 | Cursor cursor; | ||
| 7478 | { | 7226 | { |
| 7479 | if (!f->pointer_invisible | 7227 | if (!f->pointer_invisible |
| 7480 | && f->output_data.x->current_cursor != cursor) | 7228 | && f->output_data.x->current_cursor != cursor) |
| @@ -7486,9 +7234,7 @@ x_define_frame_cursor (f, cursor) | |||
| 7486 | /* RIF: Clear area on frame F. */ | 7234 | /* RIF: Clear area on frame F. */ |
| 7487 | 7235 | ||
| 7488 | static void | 7236 | static void |
| 7489 | x_clear_frame_area (f, x, y, width, height) | 7237 | x_clear_frame_area (struct frame *f, int x, int y, int width, int height) |
| 7490 | struct frame *f; | ||
| 7491 | int x, y, width, height; | ||
| 7492 | { | 7238 | { |
| 7493 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 7239 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 7494 | x, y, width, height, False); | 7240 | x, y, width, height, False); |
| @@ -7503,12 +7249,7 @@ x_clear_frame_area (f, x, y, width, height) | |||
| 7503 | /* RIF: Draw cursor on window W. */ | 7249 | /* RIF: Draw cursor on window W. */ |
| 7504 | 7250 | ||
| 7505 | static void | 7251 | static void |
| 7506 | x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p) | 7252 | x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int y, int cursor_type, int cursor_width, int on_p, int active_p) |
| 7507 | struct window *w; | ||
| 7508 | struct glyph_row *glyph_row; | ||
| 7509 | int x, y; | ||
| 7510 | int cursor_type, cursor_width; | ||
| 7511 | int on_p, active_p; | ||
| 7512 | { | 7253 | { |
| 7513 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 7254 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 7514 | 7255 | ||
| @@ -7572,9 +7313,7 @@ x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, activ | |||
| 7572 | /* Make the x-window of frame F use the gnu icon bitmap. */ | 7313 | /* Make the x-window of frame F use the gnu icon bitmap. */ |
| 7573 | 7314 | ||
| 7574 | int | 7315 | int |
| 7575 | x_bitmap_icon (f, file) | 7316 | x_bitmap_icon (struct frame *f, Lisp_Object file) |
| 7576 | struct frame *f; | ||
| 7577 | Lisp_Object file; | ||
| 7578 | { | 7317 | { |
| 7579 | int bitmap_id; | 7318 | int bitmap_id; |
| 7580 | 7319 | ||
| @@ -7651,9 +7390,7 @@ x_bitmap_icon (f, file) | |||
| 7651 | Use ICON_NAME as the text. */ | 7390 | Use ICON_NAME as the text. */ |
| 7652 | 7391 | ||
| 7653 | int | 7392 | int |
| 7654 | x_text_icon (f, icon_name) | 7393 | x_text_icon (struct frame *f, const char *icon_name) |
| 7655 | struct frame *f; | ||
| 7656 | char *icon_name; | ||
| 7657 | { | 7394 | { |
| 7658 | if (FRAME_X_WINDOW (f) == 0) | 7395 | if (FRAME_X_WINDOW (f) == 0) |
| 7659 | return 1; | 7396 | return 1; |
| @@ -7696,9 +7433,7 @@ static struct x_error_message_stack *x_error_message; | |||
| 7696 | x_catch_errors is in effect. */ | 7433 | x_catch_errors is in effect. */ |
| 7697 | 7434 | ||
| 7698 | static void | 7435 | static void |
| 7699 | x_error_catcher (display, error) | 7436 | x_error_catcher (Display *display, XErrorEvent *error) |
| 7700 | Display *display; | ||
| 7701 | XErrorEvent *error; | ||
| 7702 | { | 7437 | { |
| 7703 | XGetErrorText (display, error->error_code, | 7438 | XGetErrorText (display, error->error_code, |
| 7704 | x_error_message->string, | 7439 | x_error_message->string, |
| @@ -7718,11 +7453,10 @@ x_error_catcher (display, error) | |||
| 7718 | 7453 | ||
| 7719 | Calling x_uncatch_errors resumes the normal error handling. */ | 7454 | Calling x_uncatch_errors resumes the normal error handling. */ |
| 7720 | 7455 | ||
| 7721 | void x_check_errors (); | 7456 | void x_check_errors (Display *dpy, const char *format); |
| 7722 | 7457 | ||
| 7723 | void | 7458 | void |
| 7724 | x_catch_errors (dpy) | 7459 | x_catch_errors (Display *dpy) |
| 7725 | Display *dpy; | ||
| 7726 | { | 7460 | { |
| 7727 | struct x_error_message_stack *data = xmalloc (sizeof (*data)); | 7461 | struct x_error_message_stack *data = xmalloc (sizeof (*data)); |
| 7728 | 7462 | ||
| @@ -7739,7 +7473,7 @@ x_catch_errors (dpy) | |||
| 7739 | DPY should be the display that was passed to x_catch_errors. */ | 7473 | DPY should be the display that was passed to x_catch_errors. */ |
| 7740 | 7474 | ||
| 7741 | void | 7475 | void |
| 7742 | x_uncatch_errors () | 7476 | x_uncatch_errors (void) |
| 7743 | { | 7477 | { |
| 7744 | struct x_error_message_stack *tmp; | 7478 | struct x_error_message_stack *tmp; |
| 7745 | 7479 | ||
| @@ -7761,9 +7495,7 @@ x_uncatch_errors () | |||
| 7761 | sprintf (a buffer, FORMAT, the x error message text) as the text. */ | 7495 | sprintf (a buffer, FORMAT, the x error message text) as the text. */ |
| 7762 | 7496 | ||
| 7763 | void | 7497 | void |
| 7764 | x_check_errors (dpy, format) | 7498 | x_check_errors (Display *dpy, const char *format) |
| 7765 | Display *dpy; | ||
| 7766 | char *format; | ||
| 7767 | { | 7499 | { |
| 7768 | /* Make sure to catch any errors incurred so far. */ | 7500 | /* Make sure to catch any errors incurred so far. */ |
| 7769 | XSync (dpy, False); | 7501 | XSync (dpy, False); |
| @@ -7771,7 +7503,7 @@ x_check_errors (dpy, format) | |||
| 7771 | if (x_error_message->string[0]) | 7503 | if (x_error_message->string[0]) |
| 7772 | { | 7504 | { |
| 7773 | char string[X_ERROR_MESSAGE_SIZE]; | 7505 | char string[X_ERROR_MESSAGE_SIZE]; |
| 7774 | bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE); | 7506 | memcpy (string, x_error_message->string, X_ERROR_MESSAGE_SIZE); |
| 7775 | x_uncatch_errors (); | 7507 | x_uncatch_errors (); |
| 7776 | error (format, string); | 7508 | error (format, string); |
| 7777 | } | 7509 | } |
| @@ -7781,8 +7513,7 @@ x_check_errors (dpy, format) | |||
| 7781 | since we did x_catch_errors on DPY. */ | 7513 | since we did x_catch_errors on DPY. */ |
| 7782 | 7514 | ||
| 7783 | int | 7515 | int |
| 7784 | x_had_errors_p (dpy) | 7516 | x_had_errors_p (Display *dpy) |
| 7785 | Display *dpy; | ||
| 7786 | { | 7517 | { |
| 7787 | /* Make sure to catch any errors incurred so far. */ | 7518 | /* Make sure to catch any errors incurred so far. */ |
| 7788 | XSync (dpy, False); | 7519 | XSync (dpy, False); |
| @@ -7793,8 +7524,7 @@ x_had_errors_p (dpy) | |||
| 7793 | /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ | 7524 | /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ |
| 7794 | 7525 | ||
| 7795 | void | 7526 | void |
| 7796 | x_clear_errors (dpy) | 7527 | x_clear_errors (Display *dpy) |
| 7797 | Display *dpy; | ||
| 7798 | { | 7528 | { |
| 7799 | x_error_message->string[0] = 0; | 7529 | x_error_message->string[0] = 0; |
| 7800 | } | 7530 | } |
| @@ -7804,7 +7534,7 @@ x_clear_errors (dpy) | |||
| 7804 | /* Close off all unclosed x_catch_errors calls. */ | 7534 | /* Close off all unclosed x_catch_errors calls. */ |
| 7805 | 7535 | ||
| 7806 | void | 7536 | void |
| 7807 | x_fully_uncatch_errors () | 7537 | x_fully_uncatch_errors (void) |
| 7808 | { | 7538 | { |
| 7809 | while (x_error_message) | 7539 | while (x_error_message) |
| 7810 | x_uncatch_errors (); | 7540 | x_uncatch_errors (); |
| @@ -7814,14 +7544,14 @@ x_fully_uncatch_errors () | |||
| 7814 | /* Nonzero if x_catch_errors has been done and not yet canceled. */ | 7544 | /* Nonzero if x_catch_errors has been done and not yet canceled. */ |
| 7815 | 7545 | ||
| 7816 | int | 7546 | int |
| 7817 | x_catching_errors () | 7547 | x_catching_errors (void) |
| 7818 | { | 7548 | { |
| 7819 | return x_error_message != 0; | 7549 | return x_error_message != 0; |
| 7820 | } | 7550 | } |
| 7821 | 7551 | ||
| 7822 | #if 0 | 7552 | #if 0 |
| 7823 | static unsigned int x_wire_count; | 7553 | static unsigned int x_wire_count; |
| 7824 | x_trace_wire () | 7554 | x_trace_wire (void) |
| 7825 | { | 7555 | { |
| 7826 | fprintf (stderr, "Lib call: %d\n", ++x_wire_count); | 7556 | fprintf (stderr, "Lib call: %d\n", ++x_wire_count); |
| 7827 | } | 7557 | } |
| @@ -7835,8 +7565,8 @@ x_trace_wire () | |||
| 7835 | which will do the appropriate cleanup for us. */ | 7565 | which will do the appropriate cleanup for us. */ |
| 7836 | 7566 | ||
| 7837 | static SIGTYPE | 7567 | static SIGTYPE |
| 7838 | x_connection_signal (signalnum) /* If we don't have an argument, */ | 7568 | x_connection_signal (int signalnum) /* If we don't have an argument, */ |
| 7839 | int signalnum; /* some compilers complain in signal calls. */ | 7569 | /* some compilers complain in signal calls. */ |
| 7840 | { | 7570 | { |
| 7841 | #ifdef USG | 7571 | #ifdef USG |
| 7842 | /* USG systems forget handlers when they are used; | 7572 | /* USG systems forget handlers when they are used; |
| @@ -7859,7 +7589,7 @@ static char *error_msg; | |||
| 7859 | instead of dumping core when XtCloseDisplay fails. */ | 7589 | instead of dumping core when XtCloseDisplay fails. */ |
| 7860 | 7590 | ||
| 7861 | static void | 7591 | static void |
| 7862 | x_fatal_error_signal () | 7592 | x_fatal_error_signal (void) |
| 7863 | { | 7593 | { |
| 7864 | fprintf (stderr, "%s\n", error_msg); | 7594 | fprintf (stderr, "%s\n", error_msg); |
| 7865 | exit (70); | 7595 | exit (70); |
| @@ -7869,9 +7599,7 @@ x_fatal_error_signal () | |||
| 7869 | the text of an error message that lead to the connection loss. */ | 7599 | the text of an error message that lead to the connection loss. */ |
| 7870 | 7600 | ||
| 7871 | static SIGTYPE | 7601 | static SIGTYPE |
| 7872 | x_connection_closed (dpy, error_message) | 7602 | x_connection_closed (Display *dpy, const char *error_message) |
| 7873 | Display *dpy; | ||
| 7874 | char *error_message; | ||
| 7875 | { | 7603 | { |
| 7876 | struct x_display_info *dpyinfo = x_display_info_for_display (dpy); | 7604 | struct x_display_info *dpyinfo = x_display_info_for_display (dpy); |
| 7877 | Lisp_Object frame, tail; | 7605 | Lisp_Object frame, tail; |
| @@ -7946,7 +7674,6 @@ x_connection_closed (dpy, error_message) | |||
| 7946 | /* If DPYINFO is null, this means we didn't open the display | 7674 | /* If DPYINFO is null, this means we didn't open the display |
| 7947 | in the first place, so don't try to close it. */ | 7675 | in the first place, so don't try to close it. */ |
| 7948 | { | 7676 | { |
| 7949 | extern void (*fatal_error_signal_hook) P_ ((void)); | ||
| 7950 | fatal_error_signal_hook = x_fatal_error_signal; | 7677 | fatal_error_signal_hook = x_fatal_error_signal; |
| 7951 | XtCloseDisplay (dpy); | 7678 | XtCloseDisplay (dpy); |
| 7952 | fatal_error_signal_hook = NULL; | 7679 | fatal_error_signal_hook = NULL; |
| @@ -8007,15 +7734,13 @@ x_connection_closed (dpy, error_message) | |||
| 8007 | 7734 | ||
| 8008 | /* We specifically use it before defining it, so that gcc doesn't inline it, | 7735 | /* We specifically use it before defining it, so that gcc doesn't inline it, |
| 8009 | otherwise gdb doesn't know how to properly put a breakpoint on it. */ | 7736 | otherwise gdb doesn't know how to properly put a breakpoint on it. */ |
| 8010 | static void x_error_quitter P_ ((Display *, XErrorEvent *)); | 7737 | static void x_error_quitter (Display *, XErrorEvent *); |
| 8011 | 7738 | ||
| 8012 | /* This is the first-level handler for X protocol errors. | 7739 | /* This is the first-level handler for X protocol errors. |
| 8013 | It calls x_error_quitter or x_error_catcher. */ | 7740 | It calls x_error_quitter or x_error_catcher. */ |
| 8014 | 7741 | ||
| 8015 | static int | 7742 | static int |
| 8016 | x_error_handler (display, error) | 7743 | x_error_handler (Display *display, XErrorEvent *error) |
| 8017 | Display *display; | ||
| 8018 | XErrorEvent *error; | ||
| 8019 | { | 7744 | { |
| 8020 | if (x_error_message) | 7745 | if (x_error_message) |
| 8021 | x_error_catcher (display, error); | 7746 | x_error_catcher (display, error); |
| @@ -8046,9 +7771,7 @@ x_error_handler (display, error) | |||
| 8046 | after x_error_handler prevents inlining into the former. */ | 7771 | after x_error_handler prevents inlining into the former. */ |
| 8047 | 7772 | ||
| 8048 | static void NO_INLINE | 7773 | static void NO_INLINE |
| 8049 | x_error_quitter (display, error) | 7774 | x_error_quitter (Display *display, XErrorEvent *error) |
| 8050 | Display *display; | ||
| 8051 | XErrorEvent *error; | ||
| 8052 | { | 7775 | { |
| 8053 | char buf[256], buf1[356]; | 7776 | char buf[256], buf1[356]; |
| 8054 | 7777 | ||
| @@ -8073,8 +7796,7 @@ x_error_quitter (display, error) | |||
| 8073 | If that was the only one, it prints an error message and kills Emacs. */ | 7796 | If that was the only one, it prints an error message and kills Emacs. */ |
| 8074 | 7797 | ||
| 8075 | static int | 7798 | static int |
| 8076 | x_io_error_quitter (display) | 7799 | x_io_error_quitter (Display *display) |
| 8077 | Display *display; | ||
| 8078 | { | 7800 | { |
| 8079 | char buf[256]; | 7801 | char buf[256]; |
| 8080 | 7802 | ||
| @@ -8091,10 +7813,7 @@ x_io_error_quitter (display) | |||
| 8091 | FONT-OBJECT. */ | 7813 | FONT-OBJECT. */ |
| 8092 | 7814 | ||
| 8093 | Lisp_Object | 7815 | Lisp_Object |
| 8094 | x_new_font (f, font_object, fontset) | 7816 | x_new_font (struct frame *f, Lisp_Object font_object, int fontset) |
| 8095 | struct frame *f; | ||
| 8096 | Lisp_Object font_object; | ||
| 8097 | int fontset; | ||
| 8098 | { | 7817 | { |
| 8099 | struct font *font = XFONT_OBJECT (font_object); | 7818 | struct font *font = XFONT_OBJECT (font_object); |
| 8100 | 7819 | ||
| @@ -8163,10 +7882,7 @@ x_new_font (f, font_object, fontset) | |||
| 8163 | pointer to the x_display_info structure corresponding to XIM. */ | 7882 | pointer to the x_display_info structure corresponding to XIM. */ |
| 8164 | 7883 | ||
| 8165 | static void | 7884 | static void |
| 8166 | xim_destroy_callback (xim, client_data, call_data) | 7885 | xim_destroy_callback (XIM xim, XPointer client_data, XPointer call_data) |
| 8167 | XIM xim; | ||
| 8168 | XPointer client_data; | ||
| 8169 | XPointer call_data; | ||
| 8170 | { | 7886 | { |
| 8171 | struct x_display_info *dpyinfo = (struct x_display_info *) client_data; | 7887 | struct x_display_info *dpyinfo = (struct x_display_info *) client_data; |
| 8172 | Lisp_Object frame, tail; | 7888 | Lisp_Object frame, tail; |
| @@ -8194,16 +7910,14 @@ xim_destroy_callback (xim, client_data, call_data) | |||
| 8194 | 7910 | ||
| 8195 | #ifdef HAVE_X11R6 | 7911 | #ifdef HAVE_X11R6 |
| 8196 | /* This isn't prototyped in OSF 5.0 or 5.1a. */ | 7912 | /* This isn't prototyped in OSF 5.0 or 5.1a. */ |
| 8197 | extern char *XSetIMValues P_ ((XIM, ...)); | 7913 | extern char *XSetIMValues (XIM, ...); |
| 8198 | #endif | 7914 | #endif |
| 8199 | 7915 | ||
| 8200 | /* Open the connection to the XIM server on display DPYINFO. | 7916 | /* Open the connection to the XIM server on display DPYINFO. |
| 8201 | RESOURCE_NAME is the resource name Emacs uses. */ | 7917 | RESOURCE_NAME is the resource name Emacs uses. */ |
| 8202 | 7918 | ||
| 8203 | static void | 7919 | static void |
| 8204 | xim_open_dpy (dpyinfo, resource_name) | 7920 | xim_open_dpy (struct x_display_info *dpyinfo, char *resource_name) |
| 8205 | struct x_display_info *dpyinfo; | ||
| 8206 | char *resource_name; | ||
| 8207 | { | 7921 | { |
| 8208 | XIM xim; | 7922 | XIM xim; |
| 8209 | 7923 | ||
| @@ -8213,7 +7927,7 @@ xim_open_dpy (dpyinfo, resource_name) | |||
| 8213 | if (dpyinfo->xim) | 7927 | if (dpyinfo->xim) |
| 8214 | XCloseIM (dpyinfo->xim); | 7928 | XCloseIM (dpyinfo->xim); |
| 8215 | xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name, | 7929 | xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name, |
| 8216 | EMACS_CLASS); | 7930 | emacs_class); |
| 8217 | dpyinfo->xim = xim; | 7931 | dpyinfo->xim = xim; |
| 8218 | 7932 | ||
| 8219 | if (xim) | 7933 | if (xim) |
| @@ -8247,10 +7961,7 @@ xim_open_dpy (dpyinfo, resource_name) | |||
| 8247 | when the callback was registered. */ | 7961 | when the callback was registered. */ |
| 8248 | 7962 | ||
| 8249 | static void | 7963 | static void |
| 8250 | xim_instantiate_callback (display, client_data, call_data) | 7964 | xim_instantiate_callback (Display *display, XPointer client_data, XPointer call_data) |
| 8251 | Display *display; | ||
| 8252 | XPointer client_data; | ||
| 8253 | XPointer call_data; | ||
| 8254 | { | 7965 | { |
| 8255 | struct xim_inst_t *xim_inst = (struct xim_inst_t *) client_data; | 7966 | struct xim_inst_t *xim_inst = (struct xim_inst_t *) client_data; |
| 8256 | struct x_display_info *dpyinfo = xim_inst->dpyinfo; | 7967 | struct x_display_info *dpyinfo = xim_inst->dpyinfo; |
| @@ -8300,9 +8011,7 @@ xim_instantiate_callback (display, client_data, call_data) | |||
| 8300 | in the XIM instantiate callback function. */ | 8011 | in the XIM instantiate callback function. */ |
| 8301 | 8012 | ||
| 8302 | static void | 8013 | static void |
| 8303 | xim_initialize (dpyinfo, resource_name) | 8014 | xim_initialize (struct x_display_info *dpyinfo, char *resource_name) |
| 8304 | struct x_display_info *dpyinfo; | ||
| 8305 | char *resource_name; | ||
| 8306 | { | 8015 | { |
| 8307 | dpyinfo->xim = NULL; | 8016 | dpyinfo->xim = NULL; |
| 8308 | #ifdef HAVE_XIM | 8017 | #ifdef HAVE_XIM |
| @@ -8317,9 +8026,9 @@ xim_initialize (dpyinfo, resource_name) | |||
| 8317 | xim_inst->dpyinfo = dpyinfo; | 8026 | xim_inst->dpyinfo = dpyinfo; |
| 8318 | len = strlen (resource_name); | 8027 | len = strlen (resource_name); |
| 8319 | xim_inst->resource_name = (char *) xmalloc (len + 1); | 8028 | xim_inst->resource_name = (char *) xmalloc (len + 1); |
| 8320 | bcopy (resource_name, xim_inst->resource_name, len + 1); | 8029 | memcpy (xim_inst->resource_name, resource_name, len + 1); |
| 8321 | XRegisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, | 8030 | XRegisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, |
| 8322 | resource_name, EMACS_CLASS, | 8031 | resource_name, emacs_class, |
| 8323 | xim_instantiate_callback, | 8032 | xim_instantiate_callback, |
| 8324 | /* This is XPointer in XFree86 | 8033 | /* This is XPointer in XFree86 |
| 8325 | but (XPointer *) on Tru64, at | 8034 | but (XPointer *) on Tru64, at |
| @@ -8336,8 +8045,7 @@ xim_initialize (dpyinfo, resource_name) | |||
| 8336 | /* Close the connection to the XIM server on display DPYINFO. */ | 8045 | /* Close the connection to the XIM server on display DPYINFO. */ |
| 8337 | 8046 | ||
| 8338 | static void | 8047 | static void |
| 8339 | xim_close_dpy (dpyinfo) | 8048 | xim_close_dpy (struct x_display_info *dpyinfo) |
| 8340 | struct x_display_info *dpyinfo; | ||
| 8341 | { | 8049 | { |
| 8342 | #ifdef HAVE_XIM | 8050 | #ifdef HAVE_XIM |
| 8343 | if (use_xim) | 8051 | if (use_xim) |
| @@ -8345,7 +8053,7 @@ xim_close_dpy (dpyinfo) | |||
| 8345 | #ifdef HAVE_X11R6_XIM | 8053 | #ifdef HAVE_X11R6_XIM |
| 8346 | if (dpyinfo->display) | 8054 | if (dpyinfo->display) |
| 8347 | XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, | 8055 | XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, |
| 8348 | NULL, EMACS_CLASS, | 8056 | NULL, emacs_class, |
| 8349 | xim_instantiate_callback, NULL); | 8057 | xim_instantiate_callback, NULL); |
| 8350 | xfree (dpyinfo->xim_callback_data->resource_name); | 8058 | xfree (dpyinfo->xim_callback_data->resource_name); |
| 8351 | xfree (dpyinfo->xim_callback_data); | 8059 | xfree (dpyinfo->xim_callback_data); |
| @@ -8366,8 +8074,7 @@ xim_close_dpy (dpyinfo) | |||
| 8366 | from its current recorded position values and gravity. */ | 8074 | from its current recorded position values and gravity. */ |
| 8367 | 8075 | ||
| 8368 | void | 8076 | void |
| 8369 | x_calc_absolute_position (f) | 8077 | x_calc_absolute_position (struct frame *f) |
| 8370 | struct frame *f; | ||
| 8371 | { | 8078 | { |
| 8372 | int flags = f->size_hint_flags; | 8079 | int flags = f->size_hint_flags; |
| 8373 | 8080 | ||
| @@ -8419,10 +8126,7 @@ x_calc_absolute_position (f) | |||
| 8419 | which means, do adjust for borders but don't change the gravity. */ | 8126 | which means, do adjust for borders but don't change the gravity. */ |
| 8420 | 8127 | ||
| 8421 | void | 8128 | void |
| 8422 | x_set_offset (f, xoff, yoff, change_gravity) | 8129 | x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) |
| 8423 | struct frame *f; | ||
| 8424 | register int xoff, yoff; | ||
| 8425 | int change_gravity; | ||
| 8426 | { | 8130 | { |
| 8427 | int modified_top, modified_left; | 8131 | int modified_top, modified_left; |
| 8428 | 8132 | ||
| @@ -8491,9 +8195,7 @@ x_set_offset (f, xoff, yoff, change_gravity) | |||
| 8491 | http://freedesktop.org/wiki/Specifications/wm-spec. */ | 8195 | http://freedesktop.org/wiki/Specifications/wm-spec. */ |
| 8492 | 8196 | ||
| 8493 | static int | 8197 | static int |
| 8494 | wm_supports (f, atomname) | 8198 | wm_supports (struct frame *f, const char *atomname) |
| 8495 | struct frame *f; | ||
| 8496 | const char *atomname; | ||
| 8497 | { | 8199 | { |
| 8498 | Atom actual_type; | 8200 | Atom actual_type; |
| 8499 | unsigned long actual_size, bytes_remaining; | 8201 | unsigned long actual_size, bytes_remaining; |
| @@ -8582,11 +8284,7 @@ wm_supports (f, atomname) | |||
| 8582 | } | 8284 | } |
| 8583 | 8285 | ||
| 8584 | static void | 8286 | static void |
| 8585 | set_wm_state (frame, add, what, what2) | 8287 | set_wm_state (Lisp_Object frame, int add, const char *what, const char *what2) |
| 8586 | Lisp_Object frame; | ||
| 8587 | int add; | ||
| 8588 | const char *what; | ||
| 8589 | const char *what2; | ||
| 8590 | { | 8288 | { |
| 8591 | const char *atom = "_NET_WM_STATE"; | 8289 | const char *atom = "_NET_WM_STATE"; |
| 8592 | Fx_send_client_event (frame, make_number (0), frame, | 8290 | Fx_send_client_event (frame, make_number (0), frame, |
| @@ -8604,9 +8302,7 @@ set_wm_state (frame, add, what, what2) | |||
| 8604 | } | 8302 | } |
| 8605 | 8303 | ||
| 8606 | void | 8304 | void |
| 8607 | x_set_sticky (f, new_value, old_value) | 8305 | x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) |
| 8608 | struct frame *f; | ||
| 8609 | Lisp_Object new_value, old_value; | ||
| 8610 | { | 8306 | { |
| 8611 | Lisp_Object frame; | 8307 | Lisp_Object frame; |
| 8612 | 8308 | ||
| @@ -8618,8 +8314,7 @@ x_set_sticky (f, new_value, old_value) | |||
| 8618 | /* Do fullscreen as specified in extended window manager hints */ | 8314 | /* Do fullscreen as specified in extended window manager hints */ |
| 8619 | 8315 | ||
| 8620 | static int | 8316 | static int |
| 8621 | do_ewmh_fullscreen (f) | 8317 | do_ewmh_fullscreen (struct frame *f) |
| 8622 | struct frame *f; | ||
| 8623 | { | 8318 | { |
| 8624 | int have_net_atom = wm_supports (f, "_NET_WM_STATE"); | 8319 | int have_net_atom = wm_supports (f, "_NET_WM_STATE"); |
| 8625 | 8320 | ||
| @@ -8640,7 +8335,7 @@ do_ewmh_fullscreen (f) | |||
| 8640 | set_wm_state (frame, 0, fs, NULL); | 8335 | set_wm_state (frame, 0, fs, NULL); |
| 8641 | set_wm_state (frame, 0, fh, NULL); | 8336 | set_wm_state (frame, 0, fh, NULL); |
| 8642 | set_wm_state (frame, 0, fw, NULL); | 8337 | set_wm_state (frame, 0, fw, NULL); |
| 8643 | 8338 | ||
| 8644 | /* If there are _NET_ atoms we assume we have extended window manager | 8339 | /* If there are _NET_ atoms we assume we have extended window manager |
| 8645 | hints. */ | 8340 | hints. */ |
| 8646 | switch (f->want_fullscreen) | 8341 | switch (f->want_fullscreen) |
| @@ -8667,8 +8362,7 @@ do_ewmh_fullscreen (f) | |||
| 8667 | } | 8362 | } |
| 8668 | 8363 | ||
| 8669 | static void | 8364 | static void |
| 8670 | XTfullscreen_hook (f) | 8365 | XTfullscreen_hook (FRAME_PTR f) |
| 8671 | FRAME_PTR f; | ||
| 8672 | { | 8366 | { |
| 8673 | if (f->async_visible) | 8367 | if (f->async_visible) |
| 8674 | { | 8368 | { |
| @@ -8681,9 +8375,7 @@ XTfullscreen_hook (f) | |||
| 8681 | 8375 | ||
| 8682 | 8376 | ||
| 8683 | static void | 8377 | static void |
| 8684 | x_handle_net_wm_state (f, event) | 8378 | x_handle_net_wm_state (struct frame *f, XPropertyEvent *event) |
| 8685 | struct frame *f; | ||
| 8686 | XPropertyEvent *event; | ||
| 8687 | { | 8379 | { |
| 8688 | Atom actual_type; | 8380 | Atom actual_type; |
| 8689 | unsigned long actual_size, bytes_remaining; | 8381 | unsigned long actual_size, bytes_remaining; |
| @@ -8716,7 +8408,7 @@ x_handle_net_wm_state (f, event) | |||
| 8716 | for (i = 0; i < actual_size; ++i) | 8408 | for (i = 0; i < actual_size; ++i) |
| 8717 | { | 8409 | { |
| 8718 | Atom a = ((Atom*)tmp_data)[i]; | 8410 | Atom a = ((Atom*)tmp_data)[i]; |
| 8719 | if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) | 8411 | if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) |
| 8720 | { | 8412 | { |
| 8721 | if (value == FULLSCREEN_HEIGHT) | 8413 | if (value == FULLSCREEN_HEIGHT) |
| 8722 | value = FULLSCREEN_MAXIMIZED; | 8414 | value = FULLSCREEN_MAXIMIZED; |
| @@ -8737,7 +8429,7 @@ x_handle_net_wm_state (f, event) | |||
| 8737 | } | 8429 | } |
| 8738 | 8430 | ||
| 8739 | lval = Qnil; | 8431 | lval = Qnil; |
| 8740 | switch (value) | 8432 | switch (value) |
| 8741 | { | 8433 | { |
| 8742 | case FULLSCREEN_WIDTH: | 8434 | case FULLSCREEN_WIDTH: |
| 8743 | lval = Qfullwidth; | 8435 | lval = Qfullwidth; |
| @@ -8752,7 +8444,7 @@ x_handle_net_wm_state (f, event) | |||
| 8752 | lval = Qmaximized; | 8444 | lval = Qmaximized; |
| 8753 | break; | 8445 | break; |
| 8754 | } | 8446 | } |
| 8755 | 8447 | ||
| 8756 | store_frame_param (f, Qfullscreen, lval); | 8448 | store_frame_param (f, Qfullscreen, lval); |
| 8757 | store_frame_param (f, Qsticky, sticky ? Qt : Qnil); | 8449 | store_frame_param (f, Qsticky, sticky ? Qt : Qnil); |
| 8758 | 8450 | ||
| @@ -8763,8 +8455,7 @@ x_handle_net_wm_state (f, event) | |||
| 8763 | /* Check if we need to resize the frame due to a fullscreen request. | 8455 | /* Check if we need to resize the frame due to a fullscreen request. |
| 8764 | If so needed, resize the frame. */ | 8456 | If so needed, resize the frame. */ |
| 8765 | static void | 8457 | static void |
| 8766 | x_check_fullscreen (f) | 8458 | x_check_fullscreen (struct frame *f) |
| 8767 | struct frame *f; | ||
| 8768 | { | 8459 | { |
| 8769 | if (do_ewmh_fullscreen (f)) | 8460 | if (do_ewmh_fullscreen (f)) |
| 8770 | return; | 8461 | return; |
| @@ -8791,7 +8482,7 @@ x_check_fullscreen (f) | |||
| 8791 | case FULLSCREEN_HEIGHT: | 8482 | case FULLSCREEN_HEIGHT: |
| 8792 | height = x_display_pixel_height (dpyinfo); | 8483 | height = x_display_pixel_height (dpyinfo); |
| 8793 | } | 8484 | } |
| 8794 | 8485 | ||
| 8795 | if (FRAME_COLS (f) != width || FRAME_LINES (f) != height) | 8486 | if (FRAME_COLS (f) != width || FRAME_LINES (f) != height) |
| 8796 | { | 8487 | { |
| 8797 | change_frame_size (f, height, width, 0, 1, 0); | 8488 | change_frame_size (f, height, width, 0, 1, 0); |
| @@ -8810,10 +8501,7 @@ x_check_fullscreen (f) | |||
| 8810 | compensate by moving the window right and down by the proper amount. */ | 8501 | compensate by moving the window right and down by the proper amount. */ |
| 8811 | 8502 | ||
| 8812 | static void | 8503 | static void |
| 8813 | x_check_expected_move (f, expected_left, expected_top) | 8504 | x_check_expected_move (struct frame *f, int expected_left, int expected_top) |
| 8814 | struct frame *f; | ||
| 8815 | int expected_left; | ||
| 8816 | int expected_top; | ||
| 8817 | { | 8505 | { |
| 8818 | int current_left = 0, current_top = 0; | 8506 | int current_left = 0, current_top = 0; |
| 8819 | 8507 | ||
| @@ -8858,9 +8546,7 @@ x_check_expected_move (f, expected_left, expected_top) | |||
| 8858 | of an exact comparison. */ | 8546 | of an exact comparison. */ |
| 8859 | 8547 | ||
| 8860 | static void | 8548 | static void |
| 8861 | x_sync_with_move (f, left, top, fuzzy) | 8549 | x_sync_with_move (struct frame *f, int left, int top, int fuzzy) |
| 8862 | struct frame *f; | ||
| 8863 | int left, top, fuzzy; | ||
| 8864 | { | 8550 | { |
| 8865 | int count = 0; | 8551 | int count = 0; |
| 8866 | 8552 | ||
| @@ -8897,9 +8583,7 @@ x_sync_with_move (f, left, top, fuzzy) | |||
| 8897 | 8583 | ||
| 8898 | /* Wait for an event on frame F matching EVENTTYPE. */ | 8584 | /* Wait for an event on frame F matching EVENTTYPE. */ |
| 8899 | void | 8585 | void |
| 8900 | x_wait_for_event (f, eventtype) | 8586 | x_wait_for_event (struct frame *f, int eventtype) |
| 8901 | struct frame *f; | ||
| 8902 | int eventtype; | ||
| 8903 | { | 8587 | { |
| 8904 | int level = interrupt_input_blocked; | 8588 | int level = interrupt_input_blocked; |
| 8905 | 8589 | ||
| @@ -8926,7 +8610,7 @@ x_wait_for_event (f, eventtype) | |||
| 8926 | 8610 | ||
| 8927 | FD_ZERO (&fds); | 8611 | FD_ZERO (&fds); |
| 8928 | FD_SET (fd, &fds); | 8612 | FD_SET (fd, &fds); |
| 8929 | 8613 | ||
| 8930 | EMACS_GET_TIME (time_now); | 8614 | EMACS_GET_TIME (time_now); |
| 8931 | EMACS_SUB_TIME (tmo, tmo_at, time_now); | 8615 | EMACS_SUB_TIME (tmo, tmo_at, time_now); |
| 8932 | 8616 | ||
| @@ -8944,10 +8628,7 @@ x_wait_for_event (f, eventtype) | |||
| 8944 | size changes. Otherwise we leave the window gravity unchanged. */ | 8628 | size changes. Otherwise we leave the window gravity unchanged. */ |
| 8945 | 8629 | ||
| 8946 | static void | 8630 | static void |
| 8947 | x_set_window_size_1 (f, change_gravity, cols, rows) | 8631 | x_set_window_size_1 (struct frame *f, int change_gravity, int cols, int rows) |
| 8948 | struct frame *f; | ||
| 8949 | int change_gravity; | ||
| 8950 | int cols, rows; | ||
| 8951 | { | 8632 | { |
| 8952 | int pixelwidth, pixelheight; | 8633 | int pixelwidth, pixelheight; |
| 8953 | 8634 | ||
| @@ -8955,13 +8636,12 @@ x_set_window_size_1 (f, change_gravity, cols, rows) | |||
| 8955 | f->scroll_bar_actual_width | 8636 | f->scroll_bar_actual_width |
| 8956 | = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) | 8637 | = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
| 8957 | ? 0 | 8638 | ? 0 |
| 8958 | : FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0 | 8639 | : FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)); |
| 8959 | ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) | ||
| 8960 | : (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f))); | ||
| 8961 | 8640 | ||
| 8962 | compute_fringe_widths (f, 0); | 8641 | compute_fringe_widths (f, 0); |
| 8963 | 8642 | ||
| 8964 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); | 8643 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols) |
| 8644 | + FRAME_TOOLBAR_WIDTH (f); | ||
| 8965 | pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows) | 8645 | pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows) |
| 8966 | + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); | 8646 | + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); |
| 8967 | 8647 | ||
| @@ -9012,17 +8692,14 @@ x_set_window_size_1 (f, change_gravity, cols, rows) | |||
| 9012 | Otherwise we leave the window gravity unchanged. */ | 8692 | Otherwise we leave the window gravity unchanged. */ |
| 9013 | 8693 | ||
| 9014 | void | 8694 | void |
| 9015 | x_set_window_size (f, change_gravity, cols, rows) | 8695 | x_set_window_size (struct frame *f, int change_gravity, int cols, int rows) |
| 9016 | struct frame *f; | ||
| 9017 | int change_gravity; | ||
| 9018 | int cols, rows; | ||
| 9019 | { | 8696 | { |
| 9020 | BLOCK_INPUT; | 8697 | BLOCK_INPUT; |
| 9021 | 8698 | ||
| 9022 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) | 8699 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) |
| 9023 | { | 8700 | { |
| 9024 | int r, c; | 8701 | int r, c; |
| 9025 | 8702 | ||
| 9026 | /* When the frame is maximized/fullscreen or running under for | 8703 | /* When the frame is maximized/fullscreen or running under for |
| 9027 | example Xmonad, x_set_window_size_1 will be a no-op. | 8704 | example Xmonad, x_set_window_size_1 will be a no-op. |
| 9028 | In that case, the right thing to do is extend rows/cols to | 8705 | In that case, the right thing to do is extend rows/cols to |
| @@ -9071,9 +8748,7 @@ x_set_window_size (f, change_gravity, cols, rows) | |||
| 9071 | /* Mouse warping. */ | 8748 | /* Mouse warping. */ |
| 9072 | 8749 | ||
| 9073 | void | 8750 | void |
| 9074 | x_set_mouse_position (f, x, y) | 8751 | x_set_mouse_position (struct frame *f, int x, int y) |
| 9075 | struct frame *f; | ||
| 9076 | int x, y; | ||
| 9077 | { | 8752 | { |
| 9078 | int pix_x, pix_y; | 8753 | int pix_x, pix_y; |
| 9079 | 8754 | ||
| @@ -9096,9 +8771,7 @@ x_set_mouse_position (f, x, y) | |||
| 9096 | /* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */ | 8771 | /* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */ |
| 9097 | 8772 | ||
| 9098 | void | 8773 | void |
| 9099 | x_set_mouse_pixel_position (f, pix_x, pix_y) | 8774 | x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) |
| 9100 | struct frame *f; | ||
| 9101 | int pix_x, pix_y; | ||
| 9102 | { | 8775 | { |
| 9103 | BLOCK_INPUT; | 8776 | BLOCK_INPUT; |
| 9104 | 8777 | ||
| @@ -9110,8 +8783,7 @@ x_set_mouse_pixel_position (f, pix_x, pix_y) | |||
| 9110 | /* focus shifting, raising and lowering. */ | 8783 | /* focus shifting, raising and lowering. */ |
| 9111 | 8784 | ||
| 9112 | void | 8785 | void |
| 9113 | x_focus_on_frame (f) | 8786 | x_focus_on_frame (struct frame *f) |
| 9114 | struct frame *f; | ||
| 9115 | { | 8787 | { |
| 9116 | #if 0 | 8788 | #if 0 |
| 9117 | /* I don't think that the ICCCM allows programs to do things like this | 8789 | /* I don't think that the ICCCM allows programs to do things like this |
| @@ -9123,8 +8795,7 @@ x_focus_on_frame (f) | |||
| 9123 | } | 8795 | } |
| 9124 | 8796 | ||
| 9125 | void | 8797 | void |
| 9126 | x_unfocus_frame (f) | 8798 | x_unfocus_frame (struct frame *f) |
| 9127 | struct frame *f; | ||
| 9128 | { | 8799 | { |
| 9129 | #if 0 | 8800 | #if 0 |
| 9130 | /* Look at the remarks in x_focus_on_frame. */ | 8801 | /* Look at the remarks in x_focus_on_frame. */ |
| @@ -9137,8 +8808,7 @@ x_unfocus_frame (f) | |||
| 9137 | /* Raise frame F. */ | 8808 | /* Raise frame F. */ |
| 9138 | 8809 | ||
| 9139 | void | 8810 | void |
| 9140 | x_raise_frame (f) | 8811 | x_raise_frame (struct frame *f) |
| 9141 | struct frame *f; | ||
| 9142 | { | 8812 | { |
| 9143 | BLOCK_INPUT; | 8813 | BLOCK_INPUT; |
| 9144 | if (f->async_visible) | 8814 | if (f->async_visible) |
| @@ -9151,8 +8821,7 @@ x_raise_frame (f) | |||
| 9151 | /* Lower frame F. */ | 8821 | /* Lower frame F. */ |
| 9152 | 8822 | ||
| 9153 | void | 8823 | void |
| 9154 | x_lower_frame (f) | 8824 | x_lower_frame (struct frame *f) |
| 9155 | struct frame *f; | ||
| 9156 | { | 8825 | { |
| 9157 | if (f->async_visible) | 8826 | if (f->async_visible) |
| 9158 | { | 8827 | { |
| @@ -9166,8 +8835,7 @@ x_lower_frame (f) | |||
| 9166 | /* Activate frame with Extended Window Manager Hints */ | 8835 | /* Activate frame with Extended Window Manager Hints */ |
| 9167 | 8836 | ||
| 9168 | void | 8837 | void |
| 9169 | x_ewmh_activate_frame (f) | 8838 | x_ewmh_activate_frame (FRAME_PTR f) |
| 9170 | FRAME_PTR f; | ||
| 9171 | { | 8839 | { |
| 9172 | /* See Window Manager Specification/Extended Window Manager Hints at | 8840 | /* See Window Manager Specification/Extended Window Manager Hints at |
| 9173 | http://freedesktop.org/wiki/Specifications/wm-spec */ | 8841 | http://freedesktop.org/wiki/Specifications/wm-spec */ |
| @@ -9187,9 +8855,7 @@ x_ewmh_activate_frame (f) | |||
| 9187 | } | 8855 | } |
| 9188 | 8856 | ||
| 9189 | static void | 8857 | static void |
| 9190 | XTframe_raise_lower (f, raise_flag) | 8858 | XTframe_raise_lower (FRAME_PTR f, int raise_flag) |
| 9191 | FRAME_PTR f; | ||
| 9192 | int raise_flag; | ||
| 9193 | { | 8859 | { |
| 9194 | if (raise_flag) | 8860 | if (raise_flag) |
| 9195 | x_raise_frame (f); | 8861 | x_raise_frame (f); |
| @@ -9200,9 +8866,7 @@ XTframe_raise_lower (f, raise_flag) | |||
| 9200 | /* XEmbed implementation. */ | 8866 | /* XEmbed implementation. */ |
| 9201 | 8867 | ||
| 9202 | void | 8868 | void |
| 9203 | xembed_set_info (f, flags) | 8869 | xembed_set_info (struct frame *f, enum xembed_info flags) |
| 9204 | struct frame *f; | ||
| 9205 | enum xembed_info flags; | ||
| 9206 | { | 8870 | { |
| 9207 | Atom atom; | 8871 | Atom atom; |
| 9208 | unsigned long data[2]; | 8872 | unsigned long data[2]; |
| @@ -9217,13 +8881,7 @@ xembed_set_info (f, flags) | |||
| 9217 | } | 8881 | } |
| 9218 | 8882 | ||
| 9219 | void | 8883 | void |
| 9220 | xembed_send_message (f, time, message, detail, data1, data2) | 8884 | xembed_send_message (struct frame *f, Time time, enum xembed_message message, long int detail, long int data1, long int data2) |
| 9221 | struct frame *f; | ||
| 9222 | Time time; | ||
| 9223 | enum xembed_message message; | ||
| 9224 | long detail; | ||
| 9225 | long data1; | ||
| 9226 | long data2; | ||
| 9227 | { | 8885 | { |
| 9228 | XEvent event; | 8886 | XEvent event; |
| 9229 | 8887 | ||
| @@ -9252,8 +8910,7 @@ xembed_send_message (f, time, message, detail, data1, data2) | |||
| 9252 | finishes with it. */ | 8910 | finishes with it. */ |
| 9253 | 8911 | ||
| 9254 | void | 8912 | void |
| 9255 | x_make_frame_visible (f) | 8913 | x_make_frame_visible (struct frame *f) |
| 9256 | struct frame *f; | ||
| 9257 | { | 8914 | { |
| 9258 | Lisp_Object type; | 8915 | Lisp_Object type; |
| 9259 | int original_top, original_left; | 8916 | int original_top, original_left; |
| @@ -9384,7 +9041,6 @@ x_make_frame_visible (f) | |||
| 9384 | /* It could be confusing if a real alarm arrives while | 9041 | /* It could be confusing if a real alarm arrives while |
| 9385 | processing the fake one. Turn it off and let the | 9042 | processing the fake one. Turn it off and let the |
| 9386 | handler reset it. */ | 9043 | handler reset it. */ |
| 9387 | extern void poll_for_input_1 P_ ((void)); | ||
| 9388 | int old_poll_suppress_count = poll_suppress_count; | 9044 | int old_poll_suppress_count = poll_suppress_count; |
| 9389 | poll_suppress_count = 1; | 9045 | poll_suppress_count = 1; |
| 9390 | poll_for_input_1 (); | 9046 | poll_for_input_1 (); |
| @@ -9416,8 +9072,7 @@ x_make_frame_visible (f) | |||
| 9416 | /* Make the frame visible (mapped and not iconified). */ | 9072 | /* Make the frame visible (mapped and not iconified). */ |
| 9417 | 9073 | ||
| 9418 | void | 9074 | void |
| 9419 | x_make_frame_invisible (f) | 9075 | x_make_frame_invisible (struct frame *f) |
| 9420 | struct frame *f; | ||
| 9421 | { | 9076 | { |
| 9422 | Window window; | 9077 | Window window; |
| 9423 | 9078 | ||
| @@ -9474,8 +9129,7 @@ x_make_frame_invisible (f) | |||
| 9474 | /* Change window state from mapped to iconified. */ | 9129 | /* Change window state from mapped to iconified. */ |
| 9475 | 9130 | ||
| 9476 | void | 9131 | void |
| 9477 | x_iconify_frame (f) | 9132 | x_iconify_frame (struct frame *f) |
| 9478 | struct frame *f; | ||
| 9479 | { | 9133 | { |
| 9480 | int result; | 9134 | int result; |
| 9481 | Lisp_Object type; | 9135 | Lisp_Object type; |
| @@ -9601,8 +9255,7 @@ x_iconify_frame (f) | |||
| 9601 | /* Free X resources of frame F. */ | 9255 | /* Free X resources of frame F. */ |
| 9602 | 9256 | ||
| 9603 | void | 9257 | void |
| 9604 | x_free_frame_resources (f) | 9258 | x_free_frame_resources (struct frame *f) |
| 9605 | struct frame *f; | ||
| 9606 | { | 9259 | { |
| 9607 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 9260 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 9608 | Lisp_Object bar; | 9261 | Lisp_Object bar; |
| @@ -9655,14 +9308,7 @@ x_free_frame_resources (f) | |||
| 9655 | #else /* !USE_X_TOOLKIT */ | 9308 | #else /* !USE_X_TOOLKIT */ |
| 9656 | 9309 | ||
| 9657 | #ifdef USE_GTK | 9310 | #ifdef USE_GTK |
| 9658 | /* In the GTK version, tooltips are normal X | 9311 | xg_free_frame_widgets (f); |
| 9659 | frames. We must check and free both types. */ | ||
| 9660 | if (FRAME_GTK_OUTER_WIDGET (f)) | ||
| 9661 | { | ||
| 9662 | gtk_widget_destroy (FRAME_GTK_OUTER_WIDGET (f)); | ||
| 9663 | FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow below */ | ||
| 9664 | FRAME_GTK_OUTER_WIDGET (f) = 0; | ||
| 9665 | } | ||
| 9666 | #endif /* USE_GTK */ | 9312 | #endif /* USE_GTK */ |
| 9667 | 9313 | ||
| 9668 | if (FRAME_X_WINDOW (f)) | 9314 | if (FRAME_X_WINDOW (f)) |
| @@ -9725,8 +9371,7 @@ x_free_frame_resources (f) | |||
| 9725 | /* Destroy the X window of frame F. */ | 9371 | /* Destroy the X window of frame F. */ |
| 9726 | 9372 | ||
| 9727 | void | 9373 | void |
| 9728 | x_destroy_window (f) | 9374 | x_destroy_window (struct frame *f) |
| 9729 | struct frame *f; | ||
| 9730 | { | 9375 | { |
| 9731 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 9376 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 9732 | 9377 | ||
| @@ -9750,10 +9395,7 @@ x_destroy_window (f) | |||
| 9750 | 9395 | ||
| 9751 | #ifndef USE_GTK | 9396 | #ifndef USE_GTK |
| 9752 | void | 9397 | void |
| 9753 | x_wm_set_size_hint (f, flags, user_position) | 9398 | x_wm_set_size_hint (struct frame *f, long flags, int user_position) |
| 9754 | struct frame *f; | ||
| 9755 | long flags; | ||
| 9756 | int user_position; | ||
| 9757 | { | 9399 | { |
| 9758 | XSizeHints size_hints; | 9400 | XSizeHints size_hints; |
| 9759 | Window window = FRAME_OUTER_WINDOW (f); | 9401 | Window window = FRAME_OUTER_WINDOW (f); |
| @@ -9853,9 +9495,7 @@ x_wm_set_size_hint (f, flags, user_position) | |||
| 9853 | /* Used for IconicState or NormalState */ | 9495 | /* Used for IconicState or NormalState */ |
| 9854 | 9496 | ||
| 9855 | void | 9497 | void |
| 9856 | x_wm_set_window_state (f, state) | 9498 | x_wm_set_window_state (struct frame *f, int state) |
| 9857 | struct frame *f; | ||
| 9858 | int state; | ||
| 9859 | { | 9499 | { |
| 9860 | #ifdef USE_X_TOOLKIT | 9500 | #ifdef USE_X_TOOLKIT |
| 9861 | Arg al[1]; | 9501 | Arg al[1]; |
| @@ -9873,9 +9513,7 @@ x_wm_set_window_state (f, state) | |||
| 9873 | } | 9513 | } |
| 9874 | 9514 | ||
| 9875 | void | 9515 | void |
| 9876 | x_wm_set_icon_pixmap (f, pixmap_id) | 9516 | x_wm_set_icon_pixmap (struct frame *f, int pixmap_id) |
| 9877 | struct frame *f; | ||
| 9878 | int pixmap_id; | ||
| 9879 | { | 9517 | { |
| 9880 | Pixmap icon_pixmap, icon_mask; | 9518 | Pixmap icon_pixmap, icon_mask; |
| 9881 | 9519 | ||
| @@ -9923,9 +9561,7 @@ x_wm_set_icon_pixmap (f, pixmap_id) | |||
| 9923 | } | 9561 | } |
| 9924 | 9562 | ||
| 9925 | void | 9563 | void |
| 9926 | x_wm_set_icon_position (f, icon_x, icon_y) | 9564 | x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y) |
| 9927 | struct frame *f; | ||
| 9928 | int icon_x, icon_y; | ||
| 9929 | { | 9565 | { |
| 9930 | Window window = FRAME_OUTER_WINDOW (f); | 9566 | Window window = FRAME_OUTER_WINDOW (f); |
| 9931 | 9567 | ||
| @@ -9947,9 +9583,7 @@ x_wm_set_icon_position (f, icon_x, icon_y) | |||
| 9947 | font table. */ | 9583 | font table. */ |
| 9948 | 9584 | ||
| 9949 | static void | 9585 | static void |
| 9950 | x_check_font (f, font) | 9586 | x_check_font (struct frame *f, struct font *font) |
| 9951 | struct frame *f; | ||
| 9952 | struct font *font; | ||
| 9953 | { | 9587 | { |
| 9954 | Lisp_Object frame; | 9588 | Lisp_Object frame; |
| 9955 | 9589 | ||
| @@ -9998,8 +9632,7 @@ static int x_session_initialized; | |||
| 9998 | /* Test whether two display-name strings agree up to the dot that separates | 9632 | /* Test whether two display-name strings agree up to the dot that separates |
| 9999 | the screen number from the server number. */ | 9633 | the screen number from the server number. */ |
| 10000 | static int | 9634 | static int |
| 10001 | same_x_server (name1, name2) | 9635 | same_x_server (const char *name1, const char *name2) |
| 10002 | const char *name1, *name2; | ||
| 10003 | { | 9636 | { |
| 10004 | int seen_colon = 0; | 9637 | int seen_colon = 0; |
| 10005 | const unsigned char *system_name = SDATA (Vsystem_name); | 9638 | const unsigned char *system_name = SDATA (Vsystem_name); |
| @@ -10046,10 +9679,7 @@ same_x_server (name1, name2) | |||
| 10046 | get to the first bit. With MASK 0x7e0, *BITS is set to 6, and *OFFSET | 9679 | get to the first bit. With MASK 0x7e0, *BITS is set to 6, and *OFFSET |
| 10047 | to 5. */ | 9680 | to 5. */ |
| 10048 | static void | 9681 | static void |
| 10049 | get_bits_and_offset (mask, bits, offset) | 9682 | get_bits_and_offset (long unsigned int mask, int *bits, int *offset) |
| 10050 | unsigned long mask; | ||
| 10051 | int *bits; | ||
| 10052 | int *offset; | ||
| 10053 | { | 9683 | { |
| 10054 | int nr = 0; | 9684 | int nr = 0; |
| 10055 | int off = 0; | 9685 | int off = 0; |
| @@ -10074,8 +9704,7 @@ get_bits_and_offset (mask, bits, offset) | |||
| 10074 | But don't permanently open it, just test its availability. */ | 9704 | But don't permanently open it, just test its availability. */ |
| 10075 | 9705 | ||
| 10076 | int | 9706 | int |
| 10077 | x_display_ok (display) | 9707 | x_display_ok (const char *display) |
| 10078 | const char *display; | ||
| 10079 | { | 9708 | { |
| 10080 | int dpy_ok = 1; | 9709 | int dpy_ok = 1; |
| 10081 | Display *dpy; | 9710 | Display *dpy; |
| @@ -10090,26 +9719,19 @@ x_display_ok (display) | |||
| 10090 | 9719 | ||
| 10091 | #ifdef USE_GTK | 9720 | #ifdef USE_GTK |
| 10092 | static void | 9721 | static void |
| 10093 | my_log_handler (log_domain, log_level, message, user_data) | 9722 | my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) |
| 10094 | const gchar *log_domain; | ||
| 10095 | GLogLevelFlags log_level; | ||
| 10096 | const gchar *message; | ||
| 10097 | gpointer user_data; | ||
| 10098 | { | 9723 | { |
| 10099 | if (!strstr (message, "g_set_prgname")) | 9724 | if (!strstr (message, "g_set_prgname")) |
| 10100 | fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message); | 9725 | fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message); |
| 10101 | } | 9726 | } |
| 10102 | #endif | 9727 | #endif |
| 10103 | 9728 | ||
| 10104 | /* Open a connection to X display DISPLAY_NAME, and return | 9729 | /* Open a connection to X display DISPLAY_NAME, and return |
| 10105 | the structure that describes the open display. | 9730 | the structure that describes the open display. |
| 10106 | If we cannot contact the display, return null. */ | 9731 | If we cannot contact the display, return null. */ |
| 10107 | 9732 | ||
| 10108 | struct x_display_info * | 9733 | struct x_display_info * |
| 10109 | x_term_init (display_name, xrm_option, resource_name) | 9734 | x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) |
| 10110 | Lisp_Object display_name; | ||
| 10111 | char *xrm_option; | ||
| 10112 | char *resource_name; | ||
| 10113 | { | 9735 | { |
| 10114 | int connection; | 9736 | int connection; |
| 10115 | Display *dpy; | 9737 | Display *dpy; |
| @@ -10135,23 +9757,16 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10135 | char *argv[NUM_ARGV]; | 9757 | char *argv[NUM_ARGV]; |
| 10136 | char **argv2 = argv; | 9758 | char **argv2 = argv; |
| 10137 | guint id; | 9759 | guint id; |
| 10138 | #ifndef HAVE_GTK_MULTIDISPLAY | ||
| 10139 | if (!EQ (Vinitial_window_system, Qx)) | ||
| 10140 | error ("Sorry, you cannot connect to X servers with the GTK toolkit"); | ||
| 10141 | #endif | ||
| 10142 | 9760 | ||
| 10143 | if (x_initialized++ > 1) | 9761 | if (x_initialized++ > 1) |
| 10144 | { | 9762 | { |
| 10145 | #ifdef HAVE_GTK_MULTIDISPLAY | 9763 | xg_display_open (SDATA (display_name), &dpy); |
| 10146 | /* Opening another display. If xg_display_open returns less | ||
| 10147 | than zero, we are probably on GTK 2.0, which can only handle | ||
| 10148 | one display. GTK 2.2 or later can handle more than one. */ | ||
| 10149 | if (xg_display_open (SDATA (display_name), &dpy) < 0) | ||
| 10150 | #endif | ||
| 10151 | error ("Sorry, this version of GTK can only handle one display"); | ||
| 10152 | } | 9764 | } |
| 10153 | else | 9765 | else |
| 10154 | { | 9766 | { |
| 9767 | static char display_opt[] = "--display"; | ||
| 9768 | static char name_opt[] = "--name"; | ||
| 9769 | |||
| 10155 | for (argc = 0; argc < NUM_ARGV; ++argc) | 9770 | for (argc = 0; argc < NUM_ARGV; ++argc) |
| 10156 | argv[argc] = 0; | 9771 | argv[argc] = 0; |
| 10157 | 9772 | ||
| @@ -10160,11 +9775,11 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10160 | 9775 | ||
| 10161 | if (! NILP (display_name)) | 9776 | if (! NILP (display_name)) |
| 10162 | { | 9777 | { |
| 10163 | argv[argc++] = "--display"; | 9778 | argv[argc++] = display_opt; |
| 10164 | argv[argc++] = SDATA (display_name); | 9779 | argv[argc++] = SDATA (display_name); |
| 10165 | } | 9780 | } |
| 10166 | 9781 | ||
| 10167 | argv[argc++] = "--name"; | 9782 | argv[argc++] = name_opt; |
| 10168 | argv[argc++] = resource_name; | 9783 | argv[argc++] = resource_name; |
| 10169 | 9784 | ||
| 10170 | XSetLocaleModifiers (""); | 9785 | XSetLocaleModifiers (""); |
| @@ -10187,7 +9802,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10187 | 9802 | ||
| 10188 | /* Load our own gtkrc if it exists. */ | 9803 | /* Load our own gtkrc if it exists. */ |
| 10189 | { | 9804 | { |
| 10190 | char *file = "~/.emacs.d/gtkrc"; | 9805 | const char *file = "~/.emacs.d/gtkrc"; |
| 10191 | Lisp_Object s, abs_file; | 9806 | Lisp_Object s, abs_file; |
| 10192 | 9807 | ||
| 10193 | s = make_string (file, strlen (file)); | 9808 | s = make_string (file, strlen (file)); |
| @@ -10252,7 +9867,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10252 | /* We have definitely succeeded. Record the new connection. */ | 9867 | /* We have definitely succeeded. Record the new connection. */ |
| 10253 | 9868 | ||
| 10254 | dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); | 9869 | dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); |
| 10255 | bzero (dpyinfo, sizeof *dpyinfo); | 9870 | memset (dpyinfo, 0, sizeof *dpyinfo); |
| 10256 | 9871 | ||
| 10257 | terminal = x_create_terminal (dpyinfo); | 9872 | terminal = x_create_terminal (dpyinfo); |
| 10258 | 9873 | ||
| @@ -10530,7 +10145,11 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10530 | = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE", False); | 10145 | = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE", False); |
| 10531 | dpyinfo->Xatom_net_window_type_tooltip | 10146 | dpyinfo->Xatom_net_window_type_tooltip |
| 10532 | = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE_TOOLTIP", False); | 10147 | = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE_TOOLTIP", False); |
| 10533 | 10148 | dpyinfo->Xatom_net_wm_icon_name | |
| 10149 | = XInternAtom (dpyinfo->display, "_NET_WM_ICON_NAME", False); | ||
| 10150 | dpyinfo->Xatom_net_wm_name | ||
| 10151 | = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False); | ||
| 10152 | |||
| 10534 | dpyinfo->cut_buffers_initialized = 0; | 10153 | dpyinfo->cut_buffers_initialized = 0; |
| 10535 | 10154 | ||
| 10536 | dpyinfo->x_dnd_atoms_size = 8; | 10155 | dpyinfo->x_dnd_atoms_size = 8; |
| @@ -10546,8 +10165,6 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10546 | dpyinfo->connection = connection; | 10165 | dpyinfo->connection = connection; |
| 10547 | 10166 | ||
| 10548 | { | 10167 | { |
| 10549 | extern int gray_bitmap_width, gray_bitmap_height; | ||
| 10550 | extern char *gray_bitmap_bits; | ||
| 10551 | dpyinfo->gray | 10168 | dpyinfo->gray |
| 10552 | = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, | 10169 | = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, |
| 10553 | gray_bitmap_bits, | 10170 | gray_bitmap_bits, |
| @@ -10561,11 +10178,9 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10561 | 10178 | ||
| 10562 | xsettings_initialize (dpyinfo); | 10179 | xsettings_initialize (dpyinfo); |
| 10563 | 10180 | ||
| 10564 | #ifdef subprocesses | ||
| 10565 | /* This is only needed for distinguishing keyboard and process input. */ | 10181 | /* This is only needed for distinguishing keyboard and process input. */ |
| 10566 | if (connection != 0) | 10182 | if (connection != 0) |
| 10567 | add_keyboard_wait_descriptor (connection); | 10183 | add_keyboard_wait_descriptor (connection); |
| 10568 | #endif | ||
| 10569 | 10184 | ||
| 10570 | #ifdef F_SETOWN | 10185 | #ifdef F_SETOWN |
| 10571 | fcntl (connection, F_SETOWN, getpid ()); | 10186 | fcntl (connection, F_SETOWN, getpid ()); |
| @@ -10647,8 +10262,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10647 | and without sending any more commands to the X server. */ | 10262 | and without sending any more commands to the X server. */ |
| 10648 | 10263 | ||
| 10649 | void | 10264 | void |
| 10650 | x_delete_display (dpyinfo) | 10265 | x_delete_display (struct x_display_info *dpyinfo) |
| 10651 | struct x_display_info *dpyinfo; | ||
| 10652 | { | 10266 | { |
| 10653 | struct terminal *t; | 10267 | struct terminal *t; |
| 10654 | 10268 | ||
| @@ -10660,7 +10274,7 @@ x_delete_display (dpyinfo) | |||
| 10660 | #ifdef HAVE_X_SM | 10274 | #ifdef HAVE_X_SM |
| 10661 | /* Close X session management when we close its display. */ | 10275 | /* Close X session management when we close its display. */ |
| 10662 | if (t->id == 1 && x_session_have_connection ()) | 10276 | if (t->id == 1 && x_session_have_connection ()) |
| 10663 | x_session_close(); | 10277 | x_session_close (); |
| 10664 | #endif | 10278 | #endif |
| 10665 | delete_terminal (t); | 10279 | delete_terminal (t); |
| 10666 | break; | 10280 | break; |
| @@ -10717,8 +10331,7 @@ x_delete_display (dpyinfo) | |||
| 10717 | that slows us down. */ | 10331 | that slows us down. */ |
| 10718 | 10332 | ||
| 10719 | static void | 10333 | static void |
| 10720 | x_process_timeouts (timer) | 10334 | x_process_timeouts (struct atimer *timer) |
| 10721 | struct atimer *timer; | ||
| 10722 | { | 10335 | { |
| 10723 | BLOCK_INPUT; | 10336 | BLOCK_INPUT; |
| 10724 | x_timeout_atimer_activated_flag = 0; | 10337 | x_timeout_atimer_activated_flag = 0; |
| @@ -10741,7 +10354,7 @@ x_process_timeouts (timer) | |||
| 10741 | processed, these widgets don't behave normally. */ | 10354 | processed, these widgets don't behave normally. */ |
| 10742 | 10355 | ||
| 10743 | void | 10356 | void |
| 10744 | x_activate_timeout_atimer () | 10357 | x_activate_timeout_atimer (void) |
| 10745 | { | 10358 | { |
| 10746 | BLOCK_INPUT; | 10359 | BLOCK_INPUT; |
| 10747 | if (!x_timeout_atimer_activated_flag) | 10360 | if (!x_timeout_atimer_activated_flag) |
| @@ -10917,7 +10530,7 @@ x_create_terminal (struct x_display_info *dpyinfo) | |||
| 10917 | } | 10530 | } |
| 10918 | 10531 | ||
| 10919 | void | 10532 | void |
| 10920 | x_initialize () | 10533 | x_initialize (void) |
| 10921 | { | 10534 | { |
| 10922 | baud_rate = 19200; | 10535 | baud_rate = 19200; |
| 10923 | 10536 | ||
| @@ -10975,7 +10588,7 @@ x_initialize () | |||
| 10975 | 10588 | ||
| 10976 | 10589 | ||
| 10977 | void | 10590 | void |
| 10978 | syms_of_xterm () | 10591 | syms_of_xterm (void) |
| 10979 | { | 10592 | { |
| 10980 | x_error_message = NULL; | 10593 | x_error_message = NULL; |
| 10981 | 10594 | ||