aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c597
1 files changed, 156 insertions, 441 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 2279f71189f..da7763ca48c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -385,8 +385,7 @@ static SIGTYPE x_connection_closed (Display *, char *);
385/* Flush display of frame F, or of all frames if F is null. */ 385/* Flush display of frame F, or of all frames if F is null. */
386 386
387static void 387static void
388x_flush (f) 388x_flush (struct frame *f)
389 struct frame *f;
390{ 389{
391 /* Don't call XFlush when it is not safe to redisplay; the X 390 /* Don't call XFlush when it is not safe to redisplay; the X
392 connection may be broken. */ 391 connection may be broken. */
@@ -455,8 +454,7 @@ record_event (locus, type)
455/* Return the struct x_display_info corresponding to DPY. */ 454/* Return the struct x_display_info corresponding to DPY. */
456 455
457struct x_display_info * 456struct x_display_info *
458x_display_info_for_display (dpy) 457x_display_info_for_display (Display *dpy)
459 Display *dpy;
460{ 458{
461 struct x_display_info *dpyinfo; 459 struct x_display_info *dpyinfo;
462 460
@@ -471,8 +469,7 @@ x_display_info_for_display (dpy)
471#define OPACITY "_NET_WM_WINDOW_OPACITY" 469#define OPACITY "_NET_WM_WINDOW_OPACITY"
472 470
473void 471void
474x_set_frame_alpha (f) 472x_set_frame_alpha (struct frame *f)
475 struct frame *f;
476{ 473{
477 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 474 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
478 Display *dpy = FRAME_X_DISPLAY (f); 475 Display *dpy = FRAME_X_DISPLAY (f);
@@ -538,15 +535,13 @@ x_set_frame_alpha (f)
538} 535}
539 536
540int 537int
541x_display_pixel_height (dpyinfo) 538x_display_pixel_height (struct x_display_info *dpyinfo)
542 struct x_display_info *dpyinfo;
543{ 539{
544 return HeightOfScreen (dpyinfo->screen); 540 return HeightOfScreen (dpyinfo->screen);
545} 541}
546 542
547int 543int
548x_display_pixel_width (dpyinfo) 544x_display_pixel_width (struct x_display_info *dpyinfo)
549 struct x_display_info *dpyinfo;
550{ 545{
551 return WidthOfScreen (dpyinfo->screen); 546 return WidthOfScreen (dpyinfo->screen);
552} 547}
@@ -563,8 +558,7 @@ x_display_pixel_width (dpyinfo)
563 because all interesting stuff is done on a window basis. */ 558 because all interesting stuff is done on a window basis. */
564 559
565static void 560static void
566x_update_begin (f) 561x_update_begin (struct frame *f)
567 struct frame *f;
568{ 562{
569 /* Nothing to do. */ 563 /* Nothing to do. */
570} 564}
@@ -575,8 +569,7 @@ x_update_begin (f)
575 position of W. */ 569 position of W. */
576 570
577static void 571static void
578x_update_window_begin (w) 572x_update_window_begin (struct window *w)
579 struct window *w;
580{ 573{
581 struct frame *f = XFRAME (WINDOW_FRAME (w)); 574 struct frame *f = XFRAME (WINDOW_FRAME (w));
582 struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f); 575 struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f);
@@ -604,9 +597,7 @@ x_update_window_begin (w)
604/* Draw a vertical window border from (x,y0) to (x,y1) */ 597/* Draw a vertical window border from (x,y0) to (x,y1) */
605 598
606static void 599static void
607x_draw_vertical_window_border (w, x, y0, y1) 600x_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
608 struct window *w;
609 int x, y0, y1;
610{ 601{
611 struct frame *f = XFRAME (WINDOW_FRAME (w)); 602 struct frame *f = XFRAME (WINDOW_FRAME (w));
612 struct face *face; 603 struct face *face;
@@ -634,9 +625,7 @@ x_draw_vertical_window_border (w, x, y0, y1)
634 here. */ 625 here. */
635 626
636static void 627static void
637x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) 628x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p)
638 struct window *w;
639 int cursor_on_p, mouse_face_overwritten_p;
640{ 629{
641 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); 630 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
642 631
@@ -672,8 +661,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
672 update_end. */ 661 update_end. */
673 662
674static void 663static void
675x_update_end (f) 664x_update_end (struct frame *f)
676 struct frame *f;
677{ 665{
678 /* Mouse highlight may be displayed again. */ 666 /* Mouse highlight may be displayed again. */
679 FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0; 667 FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0;
@@ -691,8 +679,7 @@ x_update_end (f)
691 updated_window is not available here. */ 679 updated_window is not available here. */
692 680
693static void 681static void
694XTframe_up_to_date (f) 682XTframe_up_to_date (struct frame *f)
695 struct frame *f;
696{ 683{
697 if (FRAME_X_P (f)) 684 if (FRAME_X_P (f))
698 { 685 {
@@ -721,8 +708,7 @@ XTframe_up_to_date (f)
721 between bitmaps to be drawn between current row and DESIRED_ROW. */ 708 between bitmaps to be drawn between current row and DESIRED_ROW. */
722 709
723static void 710static void
724x_after_update_window_line (desired_row) 711x_after_update_window_line (struct glyph_row *desired_row)
725 struct glyph_row *desired_row;
726{ 712{
727 struct window *w = updated_window; 713 struct window *w = updated_window;
728 struct frame *f; 714 struct frame *f;
@@ -760,10 +746,7 @@ x_after_update_window_line (desired_row)
760} 746}
761 747
762static void 748static void
763x_draw_fringe_bitmap (w, row, p) 749x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fringe_bitmap_params *p)
764 struct window *w;
765 struct glyph_row *row;
766 struct draw_fringe_bitmap_params *p;
767{ 750{
768 struct frame *f = XFRAME (WINDOW_FRAME (w)); 751 struct frame *f = XFRAME (WINDOW_FRAME (w));
769 Display *display = FRAME_X_DISPLAY (f); 752 Display *display = FRAME_X_DISPLAY (f);
@@ -969,8 +952,7 @@ static void x_check_font (struct frame *, struct font *);
969 face. */ 952 face. */
970 953
971static void 954static void
972x_set_cursor_gc (s) 955x_set_cursor_gc (struct glyph_string *s)
973 struct glyph_string *s;
974{ 956{
975 if (s->font == FRAME_FONT (s->f) 957 if (s->font == FRAME_FONT (s->f)
976 && s->face->background == FRAME_BACKGROUND_PIXEL (s->f) 958 && s->face->background == FRAME_BACKGROUND_PIXEL (s->f)
@@ -1021,8 +1003,7 @@ x_set_cursor_gc (s)
1021/* Set up S->gc of glyph string S for drawing text in mouse face. */ 1003/* Set up S->gc of glyph string S for drawing text in mouse face. */
1022 1004
1023static void 1005static void
1024x_set_mouse_face_gc (s) 1006x_set_mouse_face_gc (struct glyph_string *s)
1025 struct glyph_string *s;
1026{ 1007{
1027 int face_id; 1008 int face_id;
1028 struct face *face; 1009 struct face *face;
@@ -1073,8 +1054,7 @@ x_set_mouse_face_gc (s)
1073 matrix was built, so there isn't much to do, here. */ 1054 matrix was built, so there isn't much to do, here. */
1074 1055
1075static INLINE void 1056static INLINE void
1076x_set_mode_line_face_gc (s) 1057x_set_mode_line_face_gc (struct glyph_string *s)
1077 struct glyph_string *s;
1078{ 1058{
1079 s->gc = s->face->gc; 1059 s->gc = s->face->gc;
1080} 1060}
@@ -1085,8 +1065,7 @@ x_set_mode_line_face_gc (s)
1085 pattern. */ 1065 pattern. */
1086 1066
1087static INLINE void 1067static INLINE void
1088x_set_glyph_string_gc (s) 1068x_set_glyph_string_gc (struct glyph_string *s)
1089 struct glyph_string *s;
1090{ 1069{
1091 PREPARE_FACE_FOR_DISPLAY (s->f, s->face); 1070 PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
1092 1071
@@ -1131,8 +1110,7 @@ x_set_glyph_string_gc (s)
1131 line or menu if we don't have X toolkit support. */ 1110 line or menu if we don't have X toolkit support. */
1132 1111
1133static INLINE void 1112static INLINE void
1134x_set_glyph_string_clipping (s) 1113x_set_glyph_string_clipping (struct glyph_string *s)
1135 struct glyph_string *s;
1136{ 1114{
1137 XRectangle *r = s->clip; 1115 XRectangle *r = s->clip;
1138 int n = get_glyph_string_clip_rects (s, r, 2); 1116 int n = get_glyph_string_clip_rects (s, r, 2);
@@ -1148,8 +1126,7 @@ x_set_glyph_string_clipping (s)
1148 the area of SRC. */ 1126 the area of SRC. */
1149 1127
1150static void 1128static void
1151x_set_glyph_string_clipping_exactly (src, dst) 1129x_set_glyph_string_clipping_exactly (struct glyph_string *src, struct glyph_string *dst)
1152 struct glyph_string *src, *dst;
1153{ 1130{
1154 XRectangle r; 1131 XRectangle r;
1155 1132
@@ -1167,8 +1144,7 @@ x_set_glyph_string_clipping_exactly (src, dst)
1167 Compute left and right overhang of glyph string S. */ 1144 Compute left and right overhang of glyph string S. */
1168 1145
1169static void 1146static void
1170x_compute_glyph_string_overhangs (s) 1147x_compute_glyph_string_overhangs (struct glyph_string *s)
1171 struct glyph_string *s;
1172{ 1148{
1173 if (s->cmp == NULL 1149 if (s->cmp == NULL
1174 && (s->first_glyph->type == CHAR_GLYPH 1150 && (s->first_glyph->type == CHAR_GLYPH
@@ -1207,9 +1183,7 @@ x_compute_glyph_string_overhangs (s)
1207/* Fill rectangle X, Y, W, H with background color of glyph string S. */ 1183/* Fill rectangle X, Y, W, H with background color of glyph string S. */
1208 1184
1209static INLINE void 1185static INLINE void
1210x_clear_glyph_string_rect (s, x, y, w, h) 1186x_clear_glyph_string_rect (struct glyph_string *s, int x, int y, int w, int h)
1211 struct glyph_string *s;
1212 int x, y, w, h;
1213{ 1187{
1214 XGCValues xgcv; 1188 XGCValues xgcv;
1215 XGetGCValues (s->display, s->gc, GCForeground | GCBackground, &xgcv); 1189 XGetGCValues (s->display, s->gc, GCForeground | GCBackground, &xgcv);
@@ -1226,9 +1200,7 @@ x_clear_glyph_string_rect (s, x, y, w, h)
1226 contains the first component of a composition. */ 1200 contains the first component of a composition. */
1227 1201
1228static void 1202static void
1229x_draw_glyph_string_background (s, force_p) 1203x_draw_glyph_string_background (struct glyph_string *s, int force_p)
1230 struct glyph_string *s;
1231 int force_p;
1232{ 1204{
1233 /* Nothing to do if background has already been drawn or if it 1205 /* Nothing to do if background has already been drawn or if it
1234 shouldn't be drawn in the first place. */ 1206 shouldn't be drawn in the first place. */
@@ -1264,8 +1236,7 @@ x_draw_glyph_string_background (s, force_p)
1264/* Draw the foreground of glyph string S. */ 1236/* Draw the foreground of glyph string S. */
1265 1237
1266static void 1238static void
1267x_draw_glyph_string_foreground (s) 1239x_draw_glyph_string_foreground (struct glyph_string *s)
1268 struct glyph_string *s;
1269{ 1240{
1270 int i, x; 1241 int i, x;
1271 1242
@@ -1313,8 +1284,7 @@ x_draw_glyph_string_foreground (s)
1313/* Draw the foreground of composite glyph string S. */ 1284/* Draw the foreground of composite glyph string S. */
1314 1285
1315static void 1286static void
1316x_draw_composite_glyph_string_foreground (s) 1287x_draw_composite_glyph_string_foreground (struct glyph_string *s)
1317 struct glyph_string *s;
1318{ 1288{
1319 int i, j, x; 1289 int i, j, x;
1320 struct font *font = s->font; 1290 struct font *font = s->font;
@@ -1639,9 +1609,7 @@ cvt_pixel_dtor (app, to, closure, args, nargs)
1639 say a 24-bit TrueColor map. */ 1609 say a 24-bit TrueColor map. */
1640 1610
1641static const XColor * 1611static const XColor *
1642x_color_cells (dpy, ncells) 1612x_color_cells (Display *dpy, int *ncells)
1643 Display *dpy;
1644 int *ncells;
1645{ 1613{
1646 struct x_display_info *dpyinfo = x_display_info_for_display (dpy); 1614 struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
1647 1615
@@ -1672,10 +1640,7 @@ x_color_cells (dpy, ncells)
1672 colors in COLORS. Use cached information, if available. */ 1640 colors in COLORS. Use cached information, if available. */
1673 1641
1674void 1642void
1675x_query_colors (f, colors, ncolors) 1643x_query_colors (struct frame *f, XColor *colors, int ncolors)
1676 struct frame *f;
1677 XColor *colors;
1678 int ncolors;
1679{ 1644{
1680 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1645 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
1681 1646
@@ -1699,9 +1664,7 @@ x_query_colors (f, colors, ncolors)
1699 COLOR. Use cached information, if available. */ 1664 COLOR. Use cached information, if available. */
1700 1665
1701void 1666void
1702x_query_color (f, color) 1667x_query_color (struct frame *f, XColor *color)
1703 struct frame *f;
1704 XColor *color;
1705{ 1668{
1706 x_query_colors (f, color, 1); 1669 x_query_colors (f, color, 1);
1707} 1670}
@@ -1713,10 +1676,7 @@ x_query_color (f, color)
1713 allocated. */ 1676 allocated. */
1714 1677
1715static int 1678static int
1716x_alloc_nearest_color_1 (dpy, cmap, color) 1679x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color)
1717 Display *dpy;
1718 Colormap cmap;
1719 XColor *color;
1720{ 1680{
1721 int rc; 1681 int rc;
1722 1682
@@ -1786,10 +1746,7 @@ x_alloc_nearest_color_1 (dpy, cmap, color)
1786 allocated. */ 1746 allocated. */
1787 1747
1788int 1748int
1789x_alloc_nearest_color (f, cmap, color) 1749x_alloc_nearest_color (struct frame *f, Colormap cmap, XColor *color)
1790 struct frame *f;
1791 Colormap cmap;
1792 XColor *color;
1793{ 1750{
1794 gamma_correct (f, color); 1751 gamma_correct (f, color);
1795 return x_alloc_nearest_color_1 (FRAME_X_DISPLAY (f), cmap, color); 1752 return x_alloc_nearest_color_1 (FRAME_X_DISPLAY (f), cmap, color);
@@ -1801,9 +1758,7 @@ x_alloc_nearest_color (f, cmap, color)
1801 get color reference counts right. */ 1758 get color reference counts right. */
1802 1759
1803unsigned long 1760unsigned long
1804x_copy_color (f, pixel) 1761x_copy_color (struct frame *f, long unsigned int pixel)
1805 struct frame *f;
1806 unsigned long pixel;
1807{ 1762{
1808 XColor color; 1763 XColor color;
1809 1764
@@ -1824,10 +1779,7 @@ x_copy_color (f, pixel)
1824 get color reference counts right. */ 1779 get color reference counts right. */
1825 1780
1826unsigned long 1781unsigned long
1827x_copy_dpy_color (dpy, cmap, pixel) 1782x_copy_dpy_color (Display *dpy, Colormap cmap, long unsigned int pixel)
1828 Display *dpy;
1829 Colormap cmap;
1830 unsigned long pixel;
1831{ 1783{
1832 XColor color; 1784 XColor color;
1833 1785
@@ -1865,13 +1817,7 @@ x_copy_dpy_color (dpy, cmap, pixel)
1865 Value is non-zero if successful. */ 1817 Value is non-zero if successful. */
1866 1818
1867static int 1819static int
1868x_alloc_lighter_color (f, display, cmap, pixel, factor, delta) 1820x_alloc_lighter_color (struct frame *f, Display *display, Colormap cmap, long unsigned int *pixel, double factor, int delta)
1869 struct frame *f;
1870 Display *display;
1871 Colormap cmap;
1872 unsigned long *pixel;
1873 double factor;
1874 int delta;
1875{ 1821{
1876 XColor color, new; 1822 XColor color, new;
1877 long bright; 1823 long bright;
@@ -1947,12 +1893,7 @@ x_alloc_lighter_color (f, display, cmap, pixel, factor, delta)
1947 be allocated, use DEFAULT_PIXEL, instead. */ 1893 be allocated, use DEFAULT_PIXEL, instead. */
1948 1894
1949static void 1895static void
1950x_setup_relief_color (f, relief, factor, delta, default_pixel) 1896x_setup_relief_color (struct frame *f, struct relief *relief, double factor, int delta, long unsigned int default_pixel)
1951 struct frame *f;
1952 struct relief *relief;
1953 double factor;
1954 int delta;
1955 unsigned long default_pixel;
1956{ 1897{
1957 XGCValues xgcv; 1898 XGCValues xgcv;
1958 struct x_output *di = f->output_data.x; 1899 struct x_output *di = f->output_data.x;
@@ -2000,8 +1941,7 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel)
2000/* Set up colors for the relief lines around glyph string S. */ 1941/* Set up colors for the relief lines around glyph string S. */
2001 1942
2002static void 1943static void
2003x_setup_relief_colors (s) 1944x_setup_relief_colors (struct glyph_string *s)
2004 struct glyph_string *s;
2005{ 1945{
2006 struct x_output *di = s->f->output_data.x; 1946 struct x_output *di = s->f->output_data.x;
2007 unsigned long color; 1947 unsigned long color;
@@ -2143,8 +2083,7 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
2143/* Draw a box around glyph string S. */ 2083/* Draw a box around glyph string S. */
2144 2084
2145static void 2085static void
2146x_draw_glyph_string_box (s) 2086x_draw_glyph_string_box (struct glyph_string *s)
2147 struct glyph_string *s;
2148{ 2087{
2149 int width, left_x, right_x, top_y, bottom_y, last_x, raised_p; 2088 int width, left_x, right_x, top_y, bottom_y, last_x, raised_p;
2150 int left_p, right_p; 2089 int left_p, right_p;
@@ -2195,8 +2134,7 @@ x_draw_glyph_string_box (s)
2195/* Draw foreground of image glyph string S. */ 2134/* Draw foreground of image glyph string S. */
2196 2135
2197static void 2136static void
2198x_draw_image_foreground (s) 2137x_draw_image_foreground (struct glyph_string *s)
2199 struct glyph_string *s;
2200{ 2138{
2201 int x = s->x; 2139 int x = s->x;
2202 int y = s->ybase - image_ascent (s->img, s->face, &s->slice); 2140 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -2286,8 +2224,7 @@ x_draw_image_foreground (s)
2286/* Draw a relief around the image glyph string S. */ 2224/* Draw a relief around the image glyph string S. */
2287 2225
2288static void 2226static void
2289x_draw_image_relief (s) 2227x_draw_image_relief (struct glyph_string *s)
2290 struct glyph_string *s;
2291{ 2228{
2292 int x0, y0, x1, y1, thick, raised_p, extra; 2229 int x0, y0, x1, y1, thick, raised_p, extra;
2293 XRectangle r; 2230 XRectangle r;
@@ -2342,9 +2279,7 @@ x_draw_image_relief (s)
2342/* Draw the foreground of image glyph string S to PIXMAP. */ 2279/* Draw the foreground of image glyph string S to PIXMAP. */
2343 2280
2344static void 2281static void
2345x_draw_image_foreground_1 (s, pixmap) 2282x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap)
2346 struct glyph_string *s;
2347 Pixmap pixmap;
2348{ 2283{
2349 int x = 0; 2284 int x = 0;
2350 int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice); 2285 int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
@@ -2420,9 +2355,7 @@ x_draw_image_foreground_1 (s, pixmap)
2420 give the rectangle to draw. */ 2355 give the rectangle to draw. */
2421 2356
2422static void 2357static void
2423x_draw_glyph_string_bg_rect (s, x, y, w, h) 2358x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h)
2424 struct glyph_string *s;
2425 int x, y, w, h;
2426{ 2359{
2427 if (s->stippled_p) 2360 if (s->stippled_p)
2428 { 2361 {
@@ -2451,8 +2384,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h)
2451 */ 2384 */
2452 2385
2453static void 2386static void
2454x_draw_image_glyph_string (s) 2387x_draw_image_glyph_string (struct glyph_string *s)
2455 struct glyph_string *s;
2456{ 2388{
2457 int box_line_hwidth = eabs (s->face->box_line_width); 2389 int box_line_hwidth = eabs (s->face->box_line_width);
2458 int box_line_vwidth = max (s->face->box_line_width, 0); 2390 int box_line_vwidth = max (s->face->box_line_width, 0);
@@ -2556,8 +2488,7 @@ x_draw_image_glyph_string (s)
2556/* Draw stretch glyph string S. */ 2488/* Draw stretch glyph string S. */
2557 2489
2558static void 2490static void
2559x_draw_stretch_glyph_string (s) 2491x_draw_stretch_glyph_string (struct glyph_string *s)
2560 struct glyph_string *s;
2561{ 2492{
2562 xassert (s->first_glyph->type == STRETCH_GLYPH); 2493 xassert (s->first_glyph->type == STRETCH_GLYPH);
2563 2494
@@ -2640,8 +2571,7 @@ x_draw_stretch_glyph_string (s)
2640/* Draw glyph string S. */ 2571/* Draw glyph string S. */
2641 2572
2642static void 2573static void
2643x_draw_glyph_string (s) 2574x_draw_glyph_string (struct glyph_string *s)
2644 struct glyph_string *s;
2645{ 2575{
2646 int relief_drawn_p = 0; 2576 int relief_drawn_p = 0;
2647 2577
@@ -2895,9 +2825,7 @@ x_draw_glyph_string (s)
2895/* Shift display to make room for inserted glyphs. */ 2825/* Shift display to make room for inserted glyphs. */
2896 2826
2897void 2827void
2898x_shift_glyphs_for_insert (f, x, y, width, height, shift_by) 2828x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height, int shift_by)
2899 struct frame *f;
2900 int x, y, width, height, shift_by;
2901{ 2829{
2902 XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_X_WINDOW (f), 2830 XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_X_WINDOW (f),
2903 f->output_data.x->normal_gc, 2831 f->output_data.x->normal_gc,
@@ -2909,9 +2837,7 @@ x_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
2909 for X frames. */ 2837 for X frames. */
2910 2838
2911static void 2839static void
2912x_delete_glyphs (f, n) 2840x_delete_glyphs (struct frame *f, register int n)
2913 struct frame *f;
2914 register int n;
2915{ 2841{
2916 abort (); 2842 abort ();
2917} 2843}
@@ -2921,12 +2847,7 @@ x_delete_glyphs (f, n)
2921 If they are <= 0, this is probably an error. */ 2847 If they are <= 0, this is probably an error. */
2922 2848
2923void 2849void
2924x_clear_area (dpy, window, x, y, width, height, exposures) 2850x_clear_area (Display *dpy, Window window, int x, int y, int width, int height, int exposures)
2925 Display *dpy;
2926 Window window;
2927 int x, y;
2928 int width, height;
2929 int exposures;
2930{ 2851{
2931 xassert (width > 0 && height > 0); 2852 xassert (width > 0 && height > 0);
2932 XClearArea (dpy, window, x, y, width, height, exposures); 2853 XClearArea (dpy, window, x, y, width, height, exposures);
@@ -2978,8 +2899,7 @@ x_clear_frame (struct frame *f)
2978 *RESULT. Return 1 if the difference is negative, otherwise 0. */ 2899 *RESULT. Return 1 if the difference is negative, otherwise 0. */
2979 2900
2980static int 2901static int
2981timeval_subtract (result, x, y) 2902timeval_subtract (struct timeval *result, struct timeval x, struct timeval y)
2982 struct timeval *result, x, y;
2983{ 2903{
2984 /* Perform the carry for the later subtraction by updating y. This 2904 /* Perform the carry for the later subtraction by updating y. This
2985 is safer because on some systems the tv_sec member is unsigned. */ 2905 is safer because on some systems the tv_sec member is unsigned. */
@@ -3008,8 +2928,7 @@ timeval_subtract (result, x, y)
3008} 2928}
3009 2929
3010void 2930void
3011XTflash (f) 2931XTflash (struct frame *f)
3012 struct frame *f;
3013{ 2932{
3014 BLOCK_INPUT; 2933 BLOCK_INPUT;
3015 2934
@@ -3164,9 +3083,7 @@ XTflash (f)
3164 3083
3165 3084
3166static void 3085static void
3167XTtoggle_invisible_pointer (f, invisible) 3086XTtoggle_invisible_pointer (FRAME_PTR f, int invisible)
3168 FRAME_PTR f;
3169 int invisible;
3170{ 3087{
3171 BLOCK_INPUT; 3088 BLOCK_INPUT;
3172 if (invisible) 3089 if (invisible)
@@ -3186,7 +3103,7 @@ XTtoggle_invisible_pointer (f, invisible)
3186/* Make audible bell. */ 3103/* Make audible bell. */
3187 3104
3188void 3105void
3189XTring_bell () 3106XTring_bell (void)
3190{ 3107{
3191 struct frame *f = SELECTED_FRAME (); 3108 struct frame *f = SELECTED_FRAME ();
3192 3109
@@ -3213,8 +3130,7 @@ XTring_bell ()
3213 that is bounded by calls to x_update_begin and x_update_end. */ 3130 that is bounded by calls to x_update_begin and x_update_end. */
3214 3131
3215static void 3132static void
3216XTset_terminal_window (n) 3133XTset_terminal_window (register int n)
3217 register int n;
3218{ 3134{
3219 /* This function intentionally left blank. */ 3135 /* This function intentionally left blank. */
3220} 3136}
@@ -3229,9 +3145,7 @@ XTset_terminal_window (n)
3229 lines or deleting -N lines at vertical position VPOS. */ 3145 lines or deleting -N lines at vertical position VPOS. */
3230 3146
3231static void 3147static void
3232x_ins_del_lines (f, vpos, n) 3148x_ins_del_lines (struct frame *f, int vpos, int n)
3233 struct frame *f;
3234 int vpos, n;
3235{ 3149{
3236 abort (); 3150 abort ();
3237} 3151}
@@ -3240,9 +3154,7 @@ x_ins_del_lines (f, vpos, n)
3240/* Scroll part of the display as described by RUN. */ 3154/* Scroll part of the display as described by RUN. */
3241 3155
3242static void 3156static void
3243x_scroll_run (w, run) 3157x_scroll_run (struct window *w, struct run *run)
3244 struct window *w;
3245 struct run *run;
3246{ 3158{
3247 struct frame *f = XFRAME (w->frame); 3159 struct frame *f = XFRAME (w->frame);
3248 int x, y, width, height, from_y, to_y, bottom_y; 3160 int x, y, width, height, from_y, to_y, bottom_y;
@@ -3299,8 +3211,7 @@ x_scroll_run (w, run)
3299 3211
3300 3212
3301static void 3213static void
3302frame_highlight (f) 3214frame_highlight (struct frame *f)
3303 struct frame *f;
3304{ 3215{
3305 /* We used to only do this if Vx_no_window_manager was non-nil, but 3216 /* We used to only do this if Vx_no_window_manager was non-nil, but
3306 the ICCCM (section 4.1.6) says that the window's border pixmap 3217 the ICCCM (section 4.1.6) says that the window's border pixmap
@@ -3315,8 +3226,7 @@ frame_highlight (f)
3315} 3226}
3316 3227
3317static void 3228static void
3318frame_unhighlight (f) 3229frame_unhighlight (struct frame *f)
3319 struct frame *f;
3320{ 3230{
3321 /* We used to only do this if Vx_no_window_manager was non-nil, but 3231 /* We used to only do this if Vx_no_window_manager was non-nil, but
3322 the ICCCM (section 4.1.6) says that the window's border pixmap 3232 the ICCCM (section 4.1.6) says that the window's border pixmap
@@ -3337,9 +3247,7 @@ frame_unhighlight (f)
3337 Lisp code can tell when the switch took place by examining the events. */ 3247 Lisp code can tell when the switch took place by examining the events. */
3338 3248
3339static void 3249static void
3340x_new_focus_frame (dpyinfo, frame) 3250x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame)
3341 struct x_display_info *dpyinfo;
3342 struct frame *frame;
3343{ 3251{
3344 struct frame *old_focus = dpyinfo->x_focus_frame; 3252 struct frame *old_focus = dpyinfo->x_focus_frame;
3345 3253
@@ -3366,12 +3274,7 @@ x_new_focus_frame (dpyinfo, frame)
3366 a FOCUS_IN_EVENT into *BUFP. */ 3274 a FOCUS_IN_EVENT into *BUFP. */
3367 3275
3368static void 3276static void
3369x_focus_changed (type, state, dpyinfo, frame, bufp) 3277x_focus_changed (int type, int state, struct x_display_info *dpyinfo, struct frame *frame, struct input_event *bufp)
3370 int type;
3371 int state;
3372 struct x_display_info *dpyinfo;
3373 struct frame *frame;
3374 struct input_event *bufp;
3375{ 3278{
3376 if (type == FocusIn) 3279 if (type == FocusIn)
3377 { 3280 {
@@ -3423,10 +3326,7 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
3423 Returns FOCUS_IN_EVENT event in *BUFP. */ 3326 Returns FOCUS_IN_EVENT event in *BUFP. */
3424 3327
3425static void 3328static void
3426x_detect_focus_change (dpyinfo, event, bufp) 3329x_detect_focus_change (struct x_display_info *dpyinfo, XEvent *event, struct input_event *bufp)
3427 struct x_display_info *dpyinfo;
3428 XEvent *event;
3429 struct input_event *bufp;
3430{ 3330{
3431 struct frame *frame; 3331 struct frame *frame;
3432 3332
@@ -3475,8 +3375,7 @@ x_detect_focus_change (dpyinfo, event, bufp)
3475/* Handle an event saying the mouse has moved out of an Emacs frame. */ 3375/* Handle an event saying the mouse has moved out of an Emacs frame. */
3476 3376
3477void 3377void
3478x_mouse_leave (dpyinfo) 3378x_mouse_leave (struct x_display_info *dpyinfo)
3479 struct x_display_info *dpyinfo;
3480{ 3379{
3481 x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame); 3380 x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame);
3482} 3381}
@@ -3490,15 +3389,13 @@ x_mouse_leave (dpyinfo)
3490 the appropriate X display info. */ 3389 the appropriate X display info. */
3491 3390
3492static void 3391static void
3493XTframe_rehighlight (frame) 3392XTframe_rehighlight (struct frame *frame)
3494 struct frame *frame;
3495{ 3393{
3496 x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame)); 3394 x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame));
3497} 3395}
3498 3396
3499static void 3397static void
3500x_frame_rehighlight (dpyinfo) 3398x_frame_rehighlight (struct x_display_info *dpyinfo)
3501 struct x_display_info *dpyinfo;
3502{ 3399{
3503 struct frame *old_highlight = dpyinfo->x_highlight_frame; 3400 struct frame *old_highlight = dpyinfo->x_highlight_frame;
3504 3401
@@ -3532,8 +3429,7 @@ x_frame_rehighlight (dpyinfo)
3532 3429
3533/* Initialize mode_switch_bit and modifier_meaning. */ 3430/* Initialize mode_switch_bit and modifier_meaning. */
3534static void 3431static void
3535x_find_modifier_meanings (dpyinfo) 3432x_find_modifier_meanings (struct x_display_info *dpyinfo)
3536 struct x_display_info *dpyinfo;
3537{ 3433{
3538 int min_code, max_code; 3434 int min_code, max_code;
3539 KeySym *syms; 3435 KeySym *syms;
@@ -3644,9 +3540,7 @@ x_find_modifier_meanings (dpyinfo)
3644 Emacs uses. */ 3540 Emacs uses. */
3645 3541
3646unsigned int 3542unsigned int
3647x_x_to_emacs_modifiers (dpyinfo, state) 3543x_x_to_emacs_modifiers (struct x_display_info *dpyinfo, unsigned int state)
3648 struct x_display_info *dpyinfo;
3649 unsigned int state;
3650{ 3544{
3651 EMACS_UINT mod_meta = meta_modifier; 3545 EMACS_UINT mod_meta = meta_modifier;
3652 EMACS_UINT mod_alt = alt_modifier; 3546 EMACS_UINT mod_alt = alt_modifier;
@@ -3673,9 +3567,7 @@ x_x_to_emacs_modifiers (dpyinfo, state)
3673} 3567}
3674 3568
3675static unsigned int 3569static unsigned int
3676x_emacs_to_x_modifiers (dpyinfo, state) 3570x_emacs_to_x_modifiers (struct x_display_info *dpyinfo, unsigned int state)
3677 struct x_display_info *dpyinfo;
3678 unsigned int state;
3679{ 3571{
3680 EMACS_UINT mod_meta = meta_modifier; 3572 EMACS_UINT mod_meta = meta_modifier;
3681 EMACS_UINT mod_alt = alt_modifier; 3573 EMACS_UINT mod_alt = alt_modifier;
@@ -3705,8 +3597,7 @@ x_emacs_to_x_modifiers (dpyinfo, state)
3705/* Convert a keysym to its name. */ 3597/* Convert a keysym to its name. */
3706 3598
3707char * 3599char *
3708x_get_keysym_name (keysym) 3600x_get_keysym_name (KeySym keysym)
3709 KeySym keysym;
3710{ 3601{
3711 char *value; 3602 char *value;
3712 3603
@@ -3727,10 +3618,7 @@ x_get_keysym_name (keysym)
3727 the mouse. */ 3618 the mouse. */
3728 3619
3729static Lisp_Object 3620static Lisp_Object
3730construct_mouse_click (result, event, f) 3621construct_mouse_click (struct input_event *result, XButtonEvent *event, struct frame *f)
3731 struct input_event *result;
3732 XButtonEvent *event;
3733 struct frame *f;
3734{ 3622{
3735 /* Make the event type NO_EVENT; we'll change that when we decide 3623 /* Make the event type NO_EVENT; we'll change that when we decide
3736 otherwise. */ 3624 otherwise. */
@@ -3763,9 +3651,7 @@ static XMotionEvent last_mouse_motion_event;
3763static Lisp_Object last_mouse_motion_frame; 3651static Lisp_Object last_mouse_motion_frame;
3764 3652
3765static int 3653static int
3766note_mouse_movement (frame, event) 3654note_mouse_movement (FRAME_PTR frame, XMotionEvent *event)
3767 FRAME_PTR frame;
3768 XMotionEvent *event;
3769{ 3655{
3770 last_mouse_movement_time = event->time; 3656 last_mouse_movement_time = event->time;
3771 last_mouse_motion_event = *event; 3657 last_mouse_motion_event = *event;
@@ -3809,7 +3695,7 @@ note_mouse_movement (frame, event)
3809 ************************************************************************/ 3695 ************************************************************************/
3810 3696
3811static void 3697static void
3812redo_mouse_highlight () 3698redo_mouse_highlight (void)
3813{ 3699{
3814 if (!NILP (last_mouse_motion_frame) 3700 if (!NILP (last_mouse_motion_frame)
3815 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame))) 3701 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame)))
@@ -3841,13 +3727,7 @@ redo_mouse_highlight ()
3841 movement. */ 3727 movement. */
3842 3728
3843static void 3729static void
3844XTmouse_position (fp, insist, bar_window, part, x, y, time) 3730XTmouse_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)
3845 FRAME_PTR *fp;
3846 int insist;
3847 Lisp_Object *bar_window;
3848 enum scroll_bar_part *part;
3849 Lisp_Object *x, *y;
3850 unsigned long *time;
3851{ 3731{
3852 FRAME_PTR f1; 3732 FRAME_PTR f1;
3853 3733
@@ -4049,9 +3929,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
4049 bits. */ 3929 bits. */
4050 3930
4051static struct scroll_bar * 3931static struct scroll_bar *
4052x_window_to_scroll_bar (display, window_id) 3932x_window_to_scroll_bar (Display *display, Window window_id)
4053 Display *display;
4054 Window window_id;
4055{ 3933{
4056 Lisp_Object tail; 3934 Lisp_Object tail;
4057 3935
@@ -4222,9 +4100,7 @@ static int scroll_bar_windows_size;
4222 amount to scroll of a whole of WHOLE. */ 4100 amount to scroll of a whole of WHOLE. */
4223 4101
4224static void 4102static void
4225x_send_scroll_bar_event (window, part, portion, whole) 4103x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
4226 Lisp_Object window;
4227 int part, portion, whole;
4228{ 4104{
4229 XEvent event; 4105 XEvent event;
4230 XClientMessageEvent *ev = (XClientMessageEvent *) &event; 4106 XClientMessageEvent *ev = (XClientMessageEvent *) &event;
@@ -4286,9 +4162,7 @@ x_send_scroll_bar_event (window, part, portion, whole)
4286 in *IEVENT. */ 4162 in *IEVENT. */
4287 4163
4288static void 4164static void
4289x_scroll_bar_to_input_event (event, ievent) 4165x_scroll_bar_to_input_event (XEvent *event, struct input_event *ievent)
4290 XEvent *event;
4291 struct input_event *ievent;
4292{ 4166{
4293 XClientMessageEvent *ev = (XClientMessageEvent *) event; 4167 XClientMessageEvent *ev = (XClientMessageEvent *) event;
4294 Lisp_Object window; 4168 Lisp_Object window;
@@ -4572,9 +4446,7 @@ xaw_scroll_callback (widget, client_data, call_data)
4572 4446
4573#ifdef USE_GTK 4447#ifdef USE_GTK
4574static void 4448static void
4575x_create_toolkit_scroll_bar (f, bar) 4449x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
4576 struct frame *f;
4577 struct scroll_bar *bar;
4578{ 4450{
4579 char *scroll_bar_name = SCROLL_BAR_NAME; 4451 char *scroll_bar_name = SCROLL_BAR_NAME;
4580 4452
@@ -4790,9 +4662,7 @@ x_create_toolkit_scroll_bar (f, bar)
4790 4662
4791#ifdef USE_GTK 4663#ifdef USE_GTK
4792static void 4664static void
4793x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) 4665x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole)
4794 struct scroll_bar *bar;
4795 int portion, position, whole;
4796{ 4666{
4797 xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); 4667 xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
4798} 4668}
@@ -4916,9 +4786,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
4916 scroll bar. */ 4786 scroll bar. */
4917 4787
4918static struct scroll_bar * 4788static struct scroll_bar *
4919x_scroll_bar_create (w, top, left, width, height) 4789x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
4920 struct window *w;
4921 int top, left, width, height;
4922{ 4790{
4923 struct frame *f = XFRAME (w->frame); 4791 struct frame *f = XFRAME (w->frame);
4924 struct scroll_bar *bar 4792 struct scroll_bar *bar
@@ -5133,8 +5001,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild)
5133 nil. */ 5001 nil. */
5134 5002
5135static void 5003static void
5136x_scroll_bar_remove (bar) 5004x_scroll_bar_remove (struct scroll_bar *bar)
5137 struct scroll_bar *bar;
5138{ 5005{
5139 struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 5006 struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
5140 BLOCK_INPUT; 5007 BLOCK_INPUT;
@@ -5162,9 +5029,7 @@ x_scroll_bar_remove (bar)
5162 create one. */ 5029 create one. */
5163 5030
5164static void 5031static void
5165XTset_vertical_scroll_bar (w, portion, whole, position) 5032XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position)
5166 struct window *w;
5167 int portion, whole, position;
5168{ 5033{
5169 struct frame *f = XFRAME (w->frame); 5034 struct frame *f = XFRAME (w->frame);
5170 struct scroll_bar *bar; 5035 struct scroll_bar *bar;
@@ -5381,8 +5246,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5381 `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ 5246 `*redeem_scroll_bar_hook' is applied to its window before the judgment. */
5382 5247
5383static void 5248static void
5384XTcondemn_scroll_bars (frame) 5249XTcondemn_scroll_bars (FRAME_PTR frame)
5385 FRAME_PTR frame;
5386{ 5250{
5387 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ 5251 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */
5388 while (! NILP (FRAME_SCROLL_BARS (frame))) 5252 while (! NILP (FRAME_SCROLL_BARS (frame)))
@@ -5403,8 +5267,7 @@ XTcondemn_scroll_bars (frame)
5403 Note that WINDOW isn't necessarily condemned at all. */ 5267 Note that WINDOW isn't necessarily condemned at all. */
5404 5268
5405static void 5269static void
5406XTredeem_scroll_bar (window) 5270XTredeem_scroll_bar (struct window *window)
5407 struct window *window;
5408{ 5271{
5409 struct scroll_bar *bar; 5272 struct scroll_bar *bar;
5410 struct frame *f; 5273 struct frame *f;
@@ -5449,8 +5312,7 @@ XTredeem_scroll_bar (window)
5449 last call to `*condemn_scroll_bars_hook'. */ 5312 last call to `*condemn_scroll_bars_hook'. */
5450 5313
5451static void 5314static void
5452XTjudge_scroll_bars (f) 5315XTjudge_scroll_bars (FRAME_PTR f)
5453 FRAME_PTR f;
5454{ 5316{
5455 Lisp_Object bar, next; 5317 Lisp_Object bar, next;
5456 5318
@@ -5527,10 +5389,7 @@ x_scroll_bar_expose (bar, event)
5527 5389
5528 5390
5529static void 5391static void
5530x_scroll_bar_handle_click (bar, event, emacs_event) 5392x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_event *emacs_event)
5531 struct scroll_bar *bar;
5532 XEvent *event;
5533 struct input_event *emacs_event;
5534{ 5393{
5535 if (! WINDOWP (bar->window)) 5394 if (! WINDOWP (bar->window))
5536 abort (); 5395 abort ();
@@ -5620,12 +5479,7 @@ x_scroll_bar_note_movement (bar, event)
5620 on the scroll bar. */ 5479 on the scroll bar. */
5621 5480
5622static void 5481static void
5623x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) 5482x_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)
5624 FRAME_PTR *fp;
5625 Lisp_Object *bar_window;
5626 enum scroll_bar_part *part;
5627 Lisp_Object *x, *y;
5628 unsigned long *time;
5629{ 5483{
5630 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); 5484 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
5631 Window w = bar->x_window; 5485 Window w = bar->x_window;
@@ -5697,8 +5551,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
5697 redraw them. */ 5551 redraw them. */
5698 5552
5699void 5553void
5700x_scroll_bar_clear (f) 5554x_scroll_bar_clear (FRAME_PTR f)
5701 FRAME_PTR f;
5702{ 5555{
5703#ifndef USE_TOOLKIT_SCROLL_BARS 5556#ifndef USE_TOOLKIT_SCROLL_BARS
5704 Lisp_Object bar; 5557 Lisp_Object bar;
@@ -5784,9 +5637,7 @@ enum
5784 5637
5785#ifdef HAVE_X_I18N 5638#ifdef HAVE_X_I18N
5786static int 5639static int
5787x_filter_event (dpyinfo, event) 5640x_filter_event (struct x_display_info *dpyinfo, XEvent *event)
5788 struct x_display_info *dpyinfo;
5789 XEvent *event;
5790{ 5641{
5791 /* XFilterEvent returns non-zero if the input method has 5642 /* XFilterEvent returns non-zero if the input method has
5792 consumed the event. We pass the frame's X window to 5643 consumed the event. We pass the frame's X window to
@@ -5809,10 +5660,7 @@ static struct input_event *current_hold_quit;
5809 It is invoked before the XEvent is translated to a GdkEvent, 5660 It is invoked before the XEvent is translated to a GdkEvent,
5810 so we have a chance to act on the event before GTK. */ 5661 so we have a chance to act on the event before GTK. */
5811static GdkFilterReturn 5662static GdkFilterReturn
5812event_handler_gdk (gxev, ev, data) 5663event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data)
5813 GdkXEvent *gxev;
5814 GdkEvent *ev;
5815 gpointer data;
5816{ 5664{
5817 XEvent *xev = (XEvent *) gxev; 5665 XEvent *xev = (XEvent *) gxev;
5818 5666
@@ -5865,11 +5713,7 @@ event_handler_gdk (gxev, ev, data)
5865 We return the number of characters stored into the buffer. */ 5713 We return the number of characters stored into the buffer. */
5866 5714
5867static int 5715static int
5868handle_one_xevent (dpyinfo, eventp, finish, hold_quit) 5716handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, struct input_event *hold_quit)
5869 struct x_display_info *dpyinfo;
5870 XEvent *eventp;
5871 int *finish;
5872 struct input_event *hold_quit;
5873{ 5717{
5874 union { 5718 union {
5875 struct input_event ie; 5719 struct input_event ie;
@@ -7096,9 +6940,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
7096 6940
7097 Returns the value handle_one_xevent sets in the finish argument. */ 6941 Returns the value handle_one_xevent sets in the finish argument. */
7098int 6942int
7099x_dispatch_event (event, display) 6943x_dispatch_event (XEvent *event, Display *display)
7100 XEvent *event;
7101 Display *display;
7102{ 6944{
7103 struct x_display_info *dpyinfo; 6945 struct x_display_info *dpyinfo;
7104 int finish = X_EVENT_NORMAL; 6946 int finish = X_EVENT_NORMAL;
@@ -7124,10 +6966,7 @@ x_dispatch_event (event, display)
7124 EXPECTED is nonzero if the caller knows input is available. */ 6966 EXPECTED is nonzero if the caller knows input is available. */
7125 6967
7126static int 6968static int
7127XTread_socket (terminal, expected, hold_quit) 6969XTread_socket (struct terminal *terminal, int expected, struct input_event *hold_quit)
7128 struct terminal *terminal;
7129 int expected;
7130 struct input_event *hold_quit;
7131{ 6970{
7132 int count = 0; 6971 int count = 0;
7133 XEvent event; 6972 XEvent event;
@@ -7278,11 +7117,7 @@ XTread_socket (terminal, expected, hold_quit)
7278 mode lines must be clipped to the whole window. */ 7117 mode lines must be clipped to the whole window. */
7279 7118
7280static void 7119static void
7281x_clip_to_row (w, row, area, gc) 7120x_clip_to_row (struct window *w, struct glyph_row *row, int area, GC gc)
7282 struct window *w;
7283 struct glyph_row *row;
7284 int area;
7285 GC gc;
7286{ 7121{
7287 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7122 struct frame *f = XFRAME (WINDOW_FRAME (w));
7288 XRectangle clip_rect; 7123 XRectangle clip_rect;
@@ -7303,9 +7138,7 @@ x_clip_to_row (w, row, area, gc)
7303/* Draw a hollow box cursor on window W in glyph row ROW. */ 7138/* Draw a hollow box cursor on window W in glyph row ROW. */
7304 7139
7305static void 7140static void
7306x_draw_hollow_cursor (w, row) 7141x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
7307 struct window *w;
7308 struct glyph_row *row;
7309{ 7142{
7310 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7143 struct frame *f = XFRAME (WINDOW_FRAME (w));
7311 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 7144 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -7350,11 +7183,7 @@ x_draw_hollow_cursor (w, row)
7350 --gerd. */ 7183 --gerd. */
7351 7184
7352static void 7185static void
7353x_draw_bar_cursor (w, row, width, kind) 7186x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind)
7354 struct window *w;
7355 struct glyph_row *row;
7356 int width;
7357 enum text_cursor_kinds kind;
7358{ 7187{
7359 struct frame *f = XFRAME (w->frame); 7188 struct frame *f = XFRAME (w->frame);
7360 struct glyph *cursor_glyph; 7189 struct glyph *cursor_glyph;
@@ -7445,9 +7274,7 @@ x_draw_bar_cursor (w, row, width, kind)
7445/* RIF: Define cursor CURSOR on frame F. */ 7274/* RIF: Define cursor CURSOR on frame F. */
7446 7275
7447static void 7276static void
7448x_define_frame_cursor (f, cursor) 7277x_define_frame_cursor (struct frame *f, Cursor cursor)
7449 struct frame *f;
7450 Cursor cursor;
7451{ 7278{
7452 if (!f->pointer_invisible 7279 if (!f->pointer_invisible
7453 && f->output_data.x->current_cursor != cursor) 7280 && f->output_data.x->current_cursor != cursor)
@@ -7459,9 +7286,7 @@ x_define_frame_cursor (f, cursor)
7459/* RIF: Clear area on frame F. */ 7286/* RIF: Clear area on frame F. */
7460 7287
7461static void 7288static void
7462x_clear_frame_area (f, x, y, width, height) 7289x_clear_frame_area (struct frame *f, int x, int y, int width, int height)
7463 struct frame *f;
7464 int x, y, width, height;
7465{ 7290{
7466 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 7291 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
7467 x, y, width, height, False); 7292 x, y, width, height, False);
@@ -7476,12 +7301,7 @@ x_clear_frame_area (f, x, y, width, height)
7476/* RIF: Draw cursor on window W. */ 7301/* RIF: Draw cursor on window W. */
7477 7302
7478static void 7303static void
7479x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p) 7304x_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)
7480 struct window *w;
7481 struct glyph_row *glyph_row;
7482 int x, y;
7483 int cursor_type, cursor_width;
7484 int on_p, active_p;
7485{ 7305{
7486 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7306 struct frame *f = XFRAME (WINDOW_FRAME (w));
7487 7307
@@ -7545,9 +7365,7 @@ x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, activ
7545/* Make the x-window of frame F use the gnu icon bitmap. */ 7365/* Make the x-window of frame F use the gnu icon bitmap. */
7546 7366
7547int 7367int
7548x_bitmap_icon (f, file) 7368x_bitmap_icon (struct frame *f, Lisp_Object file)
7549 struct frame *f;
7550 Lisp_Object file;
7551{ 7369{
7552 int bitmap_id; 7370 int bitmap_id;
7553 7371
@@ -7624,9 +7442,7 @@ x_bitmap_icon (f, file)
7624 Use ICON_NAME as the text. */ 7442 Use ICON_NAME as the text. */
7625 7443
7626int 7444int
7627x_text_icon (f, icon_name) 7445x_text_icon (struct frame *f, char *icon_name)
7628 struct frame *f;
7629 char *icon_name;
7630{ 7446{
7631 if (FRAME_X_WINDOW (f) == 0) 7447 if (FRAME_X_WINDOW (f) == 0)
7632 return 1; 7448 return 1;
@@ -7669,9 +7485,7 @@ static struct x_error_message_stack *x_error_message;
7669 x_catch_errors is in effect. */ 7485 x_catch_errors is in effect. */
7670 7486
7671static void 7487static void
7672x_error_catcher (display, error) 7488x_error_catcher (Display *display, XErrorEvent *error)
7673 Display *display;
7674 XErrorEvent *error;
7675{ 7489{
7676 XGetErrorText (display, error->error_code, 7490 XGetErrorText (display, error->error_code,
7677 x_error_message->string, 7491 x_error_message->string,
@@ -7691,11 +7505,10 @@ x_error_catcher (display, error)
7691 7505
7692 Calling x_uncatch_errors resumes the normal error handling. */ 7506 Calling x_uncatch_errors resumes the normal error handling. */
7693 7507
7694void x_check_errors (); 7508void x_check_errors (Display *dpy, char *format);
7695 7509
7696void 7510void
7697x_catch_errors (dpy) 7511x_catch_errors (Display *dpy)
7698 Display *dpy;
7699{ 7512{
7700 struct x_error_message_stack *data = xmalloc (sizeof (*data)); 7513 struct x_error_message_stack *data = xmalloc (sizeof (*data));
7701 7514
@@ -7712,7 +7525,7 @@ x_catch_errors (dpy)
7712 DPY should be the display that was passed to x_catch_errors. */ 7525 DPY should be the display that was passed to x_catch_errors. */
7713 7526
7714void 7527void
7715x_uncatch_errors () 7528x_uncatch_errors (void)
7716{ 7529{
7717 struct x_error_message_stack *tmp; 7530 struct x_error_message_stack *tmp;
7718 7531
@@ -7734,9 +7547,7 @@ x_uncatch_errors ()
7734 sprintf (a buffer, FORMAT, the x error message text) as the text. */ 7547 sprintf (a buffer, FORMAT, the x error message text) as the text. */
7735 7548
7736void 7549void
7737x_check_errors (dpy, format) 7550x_check_errors (Display *dpy, char *format)
7738 Display *dpy;
7739 char *format;
7740{ 7551{
7741 /* Make sure to catch any errors incurred so far. */ 7552 /* Make sure to catch any errors incurred so far. */
7742 XSync (dpy, False); 7553 XSync (dpy, False);
@@ -7754,8 +7565,7 @@ x_check_errors (dpy, format)
7754 since we did x_catch_errors on DPY. */ 7565 since we did x_catch_errors on DPY. */
7755 7566
7756int 7567int
7757x_had_errors_p (dpy) 7568x_had_errors_p (Display *dpy)
7758 Display *dpy;
7759{ 7569{
7760 /* Make sure to catch any errors incurred so far. */ 7570 /* Make sure to catch any errors incurred so far. */
7761 XSync (dpy, False); 7571 XSync (dpy, False);
@@ -7766,8 +7576,7 @@ x_had_errors_p (dpy)
7766/* Forget about any errors we have had, since we did x_catch_errors on DPY. */ 7576/* Forget about any errors we have had, since we did x_catch_errors on DPY. */
7767 7577
7768void 7578void
7769x_clear_errors (dpy) 7579x_clear_errors (Display *dpy)
7770 Display *dpy;
7771{ 7580{
7772 x_error_message->string[0] = 0; 7581 x_error_message->string[0] = 0;
7773} 7582}
@@ -7787,7 +7596,7 @@ x_fully_uncatch_errors ()
7787/* Nonzero if x_catch_errors has been done and not yet canceled. */ 7596/* Nonzero if x_catch_errors has been done and not yet canceled. */
7788 7597
7789int 7598int
7790x_catching_errors () 7599x_catching_errors (void)
7791{ 7600{
7792 return x_error_message != 0; 7601 return x_error_message != 0;
7793} 7602}
@@ -7808,8 +7617,8 @@ x_trace_wire ()
7808 which will do the appropriate cleanup for us. */ 7617 which will do the appropriate cleanup for us. */
7809 7618
7810static SIGTYPE 7619static SIGTYPE
7811x_connection_signal (signalnum) /* If we don't have an argument, */ 7620x_connection_signal (int signalnum) /* If we don't have an argument, */
7812 int signalnum; /* some compilers complain in signal calls. */ 7621 /* some compilers complain in signal calls. */
7813{ 7622{
7814#ifdef USG 7623#ifdef USG
7815 /* USG systems forget handlers when they are used; 7624 /* USG systems forget handlers when they are used;
@@ -7832,7 +7641,7 @@ static char *error_msg;
7832 instead of dumping core when XtCloseDisplay fails. */ 7641 instead of dumping core when XtCloseDisplay fails. */
7833 7642
7834static void 7643static void
7835x_fatal_error_signal () 7644x_fatal_error_signal (void)
7836{ 7645{
7837 fprintf (stderr, "%s\n", error_msg); 7646 fprintf (stderr, "%s\n", error_msg);
7838 exit (70); 7647 exit (70);
@@ -7842,9 +7651,7 @@ x_fatal_error_signal ()
7842 the text of an error message that lead to the connection loss. */ 7651 the text of an error message that lead to the connection loss. */
7843 7652
7844static SIGTYPE 7653static SIGTYPE
7845x_connection_closed (dpy, error_message) 7654x_connection_closed (Display *dpy, char *error_message)
7846 Display *dpy;
7847 char *error_message;
7848{ 7655{
7849 struct x_display_info *dpyinfo = x_display_info_for_display (dpy); 7656 struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
7850 Lisp_Object frame, tail; 7657 Lisp_Object frame, tail;
@@ -7986,9 +7793,7 @@ static void x_error_quitter (Display *, XErrorEvent *);
7986 It calls x_error_quitter or x_error_catcher. */ 7793 It calls x_error_quitter or x_error_catcher. */
7987 7794
7988static int 7795static int
7989x_error_handler (display, error) 7796x_error_handler (Display *display, XErrorEvent *error)
7990 Display *display;
7991 XErrorEvent *error;
7992{ 7797{
7993 if (x_error_message) 7798 if (x_error_message)
7994 x_error_catcher (display, error); 7799 x_error_catcher (display, error);
@@ -8019,9 +7824,7 @@ x_error_handler (display, error)
8019 after x_error_handler prevents inlining into the former. */ 7824 after x_error_handler prevents inlining into the former. */
8020 7825
8021static void NO_INLINE 7826static void NO_INLINE
8022x_error_quitter (display, error) 7827x_error_quitter (Display *display, XErrorEvent *error)
8023 Display *display;
8024 XErrorEvent *error;
8025{ 7828{
8026 char buf[256], buf1[356]; 7829 char buf[256], buf1[356];
8027 7830
@@ -8046,8 +7849,7 @@ x_error_quitter (display, error)
8046 If that was the only one, it prints an error message and kills Emacs. */ 7849 If that was the only one, it prints an error message and kills Emacs. */
8047 7850
8048static int 7851static int
8049x_io_error_quitter (display) 7852x_io_error_quitter (Display *display)
8050 Display *display;
8051{ 7853{
8052 char buf[256]; 7854 char buf[256];
8053 7855
@@ -8064,10 +7866,7 @@ x_io_error_quitter (display)
8064 FONT-OBJECT. */ 7866 FONT-OBJECT. */
8065 7867
8066Lisp_Object 7868Lisp_Object
8067x_new_font (f, font_object, fontset) 7869x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
8068 struct frame *f;
8069 Lisp_Object font_object;
8070 int fontset;
8071{ 7870{
8072 struct font *font = XFONT_OBJECT (font_object); 7871 struct font *font = XFONT_OBJECT (font_object);
8073 7872
@@ -8136,10 +7935,7 @@ x_new_font (f, font_object, fontset)
8136 pointer to the x_display_info structure corresponding to XIM. */ 7935 pointer to the x_display_info structure corresponding to XIM. */
8137 7936
8138static void 7937static void
8139xim_destroy_callback (xim, client_data, call_data) 7938xim_destroy_callback (XIM xim, XPointer client_data, XPointer call_data)
8140 XIM xim;
8141 XPointer client_data;
8142 XPointer call_data;
8143{ 7939{
8144 struct x_display_info *dpyinfo = (struct x_display_info *) client_data; 7940 struct x_display_info *dpyinfo = (struct x_display_info *) client_data;
8145 Lisp_Object frame, tail; 7941 Lisp_Object frame, tail;
@@ -8174,9 +7970,7 @@ extern char *XSetIMValues (XIM, ...);
8174 RESOURCE_NAME is the resource name Emacs uses. */ 7970 RESOURCE_NAME is the resource name Emacs uses. */
8175 7971
8176static void 7972static void
8177xim_open_dpy (dpyinfo, resource_name) 7973xim_open_dpy (struct x_display_info *dpyinfo, char *resource_name)
8178 struct x_display_info *dpyinfo;
8179 char *resource_name;
8180{ 7974{
8181 XIM xim; 7975 XIM xim;
8182 7976
@@ -8220,10 +8014,7 @@ xim_open_dpy (dpyinfo, resource_name)
8220 when the callback was registered. */ 8014 when the callback was registered. */
8221 8015
8222static void 8016static void
8223xim_instantiate_callback (display, client_data, call_data) 8017xim_instantiate_callback (Display *display, XPointer client_data, XPointer call_data)
8224 Display *display;
8225 XPointer client_data;
8226 XPointer call_data;
8227{ 8018{
8228 struct xim_inst_t *xim_inst = (struct xim_inst_t *) client_data; 8019 struct xim_inst_t *xim_inst = (struct xim_inst_t *) client_data;
8229 struct x_display_info *dpyinfo = xim_inst->dpyinfo; 8020 struct x_display_info *dpyinfo = xim_inst->dpyinfo;
@@ -8273,9 +8064,7 @@ xim_instantiate_callback (display, client_data, call_data)
8273 in the XIM instantiate callback function. */ 8064 in the XIM instantiate callback function. */
8274 8065
8275static void 8066static void
8276xim_initialize (dpyinfo, resource_name) 8067xim_initialize (struct x_display_info *dpyinfo, char *resource_name)
8277 struct x_display_info *dpyinfo;
8278 char *resource_name;
8279{ 8068{
8280 dpyinfo->xim = NULL; 8069 dpyinfo->xim = NULL;
8281#ifdef HAVE_XIM 8070#ifdef HAVE_XIM
@@ -8309,8 +8098,7 @@ xim_initialize (dpyinfo, resource_name)
8309/* Close the connection to the XIM server on display DPYINFO. */ 8098/* Close the connection to the XIM server on display DPYINFO. */
8310 8099
8311static void 8100static void
8312xim_close_dpy (dpyinfo) 8101xim_close_dpy (struct x_display_info *dpyinfo)
8313 struct x_display_info *dpyinfo;
8314{ 8102{
8315#ifdef HAVE_XIM 8103#ifdef HAVE_XIM
8316 if (use_xim) 8104 if (use_xim)
@@ -8339,8 +8127,7 @@ xim_close_dpy (dpyinfo)
8339 from its current recorded position values and gravity. */ 8127 from its current recorded position values and gravity. */
8340 8128
8341void 8129void
8342x_calc_absolute_position (f) 8130x_calc_absolute_position (struct frame *f)
8343 struct frame *f;
8344{ 8131{
8345 int flags = f->size_hint_flags; 8132 int flags = f->size_hint_flags;
8346 8133
@@ -8392,10 +8179,7 @@ x_calc_absolute_position (f)
8392 which means, do adjust for borders but don't change the gravity. */ 8179 which means, do adjust for borders but don't change the gravity. */
8393 8180
8394void 8181void
8395x_set_offset (f, xoff, yoff, change_gravity) 8182x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity)
8396 struct frame *f;
8397 register int xoff, yoff;
8398 int change_gravity;
8399{ 8183{
8400 int modified_top, modified_left; 8184 int modified_top, modified_left;
8401 8185
@@ -8464,9 +8248,7 @@ x_set_offset (f, xoff, yoff, change_gravity)
8464 http://freedesktop.org/wiki/Specifications/wm-spec. */ 8248 http://freedesktop.org/wiki/Specifications/wm-spec. */
8465 8249
8466static int 8250static int
8467wm_supports (f, atomname) 8251wm_supports (struct frame *f, const char *atomname)
8468 struct frame *f;
8469 const char *atomname;
8470{ 8252{
8471 Atom actual_type; 8253 Atom actual_type;
8472 unsigned long actual_size, bytes_remaining; 8254 unsigned long actual_size, bytes_remaining;
@@ -8555,11 +8337,7 @@ wm_supports (f, atomname)
8555} 8337}
8556 8338
8557static void 8339static void
8558set_wm_state (frame, add, what, what2) 8340set_wm_state (Lisp_Object frame, int add, const char *what, const char *what2)
8559 Lisp_Object frame;
8560 int add;
8561 const char *what;
8562 const char *what2;
8563{ 8341{
8564 const char *atom = "_NET_WM_STATE"; 8342 const char *atom = "_NET_WM_STATE";
8565 Fx_send_client_event (frame, make_number (0), frame, 8343 Fx_send_client_event (frame, make_number (0), frame,
@@ -8577,9 +8355,7 @@ set_wm_state (frame, add, what, what2)
8577} 8355}
8578 8356
8579void 8357void
8580x_set_sticky (f, new_value, old_value) 8358x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
8581 struct frame *f;
8582 Lisp_Object new_value, old_value;
8583{ 8359{
8584 Lisp_Object frame; 8360 Lisp_Object frame;
8585 8361
@@ -8591,8 +8367,7 @@ x_set_sticky (f, new_value, old_value)
8591/* Do fullscreen as specified in extended window manager hints */ 8367/* Do fullscreen as specified in extended window manager hints */
8592 8368
8593static int 8369static int
8594do_ewmh_fullscreen (f) 8370do_ewmh_fullscreen (struct frame *f)
8595 struct frame *f;
8596{ 8371{
8597 int have_net_atom = wm_supports (f, "_NET_WM_STATE"); 8372 int have_net_atom = wm_supports (f, "_NET_WM_STATE");
8598 8373
@@ -8640,8 +8415,7 @@ do_ewmh_fullscreen (f)
8640} 8415}
8641 8416
8642static void 8417static void
8643XTfullscreen_hook (f) 8418XTfullscreen_hook (FRAME_PTR f)
8644 FRAME_PTR f;
8645{ 8419{
8646 if (f->async_visible) 8420 if (f->async_visible)
8647 { 8421 {
@@ -8654,9 +8428,7 @@ XTfullscreen_hook (f)
8654 8428
8655 8429
8656static void 8430static void
8657x_handle_net_wm_state (f, event) 8431x_handle_net_wm_state (struct frame *f, XPropertyEvent *event)
8658 struct frame *f;
8659 XPropertyEvent *event;
8660{ 8432{
8661 Atom actual_type; 8433 Atom actual_type;
8662 unsigned long actual_size, bytes_remaining; 8434 unsigned long actual_size, bytes_remaining;
@@ -8736,8 +8508,7 @@ x_handle_net_wm_state (f, event)
8736/* Check if we need to resize the frame due to a fullscreen request. 8508/* Check if we need to resize the frame due to a fullscreen request.
8737 If so needed, resize the frame. */ 8509 If so needed, resize the frame. */
8738static void 8510static void
8739x_check_fullscreen (f) 8511x_check_fullscreen (struct frame *f)
8740 struct frame *f;
8741{ 8512{
8742 if (do_ewmh_fullscreen (f)) 8513 if (do_ewmh_fullscreen (f))
8743 return; 8514 return;
@@ -8783,10 +8554,7 @@ x_check_fullscreen (f)
8783 compensate by moving the window right and down by the proper amount. */ 8554 compensate by moving the window right and down by the proper amount. */
8784 8555
8785static void 8556static void
8786x_check_expected_move (f, expected_left, expected_top) 8557x_check_expected_move (struct frame *f, int expected_left, int expected_top)
8787 struct frame *f;
8788 int expected_left;
8789 int expected_top;
8790{ 8558{
8791 int current_left = 0, current_top = 0; 8559 int current_left = 0, current_top = 0;
8792 8560
@@ -8831,9 +8599,7 @@ x_check_expected_move (f, expected_left, expected_top)
8831 of an exact comparison. */ 8599 of an exact comparison. */
8832 8600
8833static void 8601static void
8834x_sync_with_move (f, left, top, fuzzy) 8602x_sync_with_move (struct frame *f, int left, int top, int fuzzy)
8835 struct frame *f;
8836 int left, top, fuzzy;
8837{ 8603{
8838 int count = 0; 8604 int count = 0;
8839 8605
@@ -8870,9 +8636,7 @@ x_sync_with_move (f, left, top, fuzzy)
8870 8636
8871/* Wait for an event on frame F matching EVENTTYPE. */ 8637/* Wait for an event on frame F matching EVENTTYPE. */
8872void 8638void
8873x_wait_for_event (f, eventtype) 8639x_wait_for_event (struct frame *f, int eventtype)
8874 struct frame *f;
8875 int eventtype;
8876{ 8640{
8877 int level = interrupt_input_blocked; 8641 int level = interrupt_input_blocked;
8878 8642
@@ -8917,10 +8681,7 @@ x_wait_for_event (f, eventtype)
8917 size changes. Otherwise we leave the window gravity unchanged. */ 8681 size changes. Otherwise we leave the window gravity unchanged. */
8918 8682
8919static void 8683static void
8920x_set_window_size_1 (f, change_gravity, cols, rows) 8684x_set_window_size_1 (struct frame *f, int change_gravity, int cols, int rows)
8921 struct frame *f;
8922 int change_gravity;
8923 int cols, rows;
8924{ 8685{
8925 int pixelwidth, pixelheight; 8686 int pixelwidth, pixelheight;
8926 8687
@@ -8985,10 +8746,7 @@ x_set_window_size_1 (f, change_gravity, cols, rows)
8985 Otherwise we leave the window gravity unchanged. */ 8746 Otherwise we leave the window gravity unchanged. */
8986 8747
8987void 8748void
8988x_set_window_size (f, change_gravity, cols, rows) 8749x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
8989 struct frame *f;
8990 int change_gravity;
8991 int cols, rows;
8992{ 8750{
8993 BLOCK_INPUT; 8751 BLOCK_INPUT;
8994 8752
@@ -9044,9 +8802,7 @@ x_set_window_size (f, change_gravity, cols, rows)
9044/* Mouse warping. */ 8802/* Mouse warping. */
9045 8803
9046void 8804void
9047x_set_mouse_position (f, x, y) 8805x_set_mouse_position (struct frame *f, int x, int y)
9048 struct frame *f;
9049 int x, y;
9050{ 8806{
9051 int pix_x, pix_y; 8807 int pix_x, pix_y;
9052 8808
@@ -9069,9 +8825,7 @@ x_set_mouse_position (f, x, y)
9069/* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */ 8825/* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */
9070 8826
9071void 8827void
9072x_set_mouse_pixel_position (f, pix_x, pix_y) 8828x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
9073 struct frame *f;
9074 int pix_x, pix_y;
9075{ 8829{
9076 BLOCK_INPUT; 8830 BLOCK_INPUT;
9077 8831
@@ -9083,8 +8837,7 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
9083/* focus shifting, raising and lowering. */ 8837/* focus shifting, raising and lowering. */
9084 8838
9085void 8839void
9086x_focus_on_frame (f) 8840x_focus_on_frame (struct frame *f)
9087 struct frame *f;
9088{ 8841{
9089#if 0 8842#if 0
9090 /* I don't think that the ICCCM allows programs to do things like this 8843 /* I don't think that the ICCCM allows programs to do things like this
@@ -9096,8 +8849,7 @@ x_focus_on_frame (f)
9096} 8849}
9097 8850
9098void 8851void
9099x_unfocus_frame (f) 8852x_unfocus_frame (struct frame *f)
9100 struct frame *f;
9101{ 8853{
9102#if 0 8854#if 0
9103 /* Look at the remarks in x_focus_on_frame. */ 8855 /* Look at the remarks in x_focus_on_frame. */
@@ -9110,8 +8862,7 @@ x_unfocus_frame (f)
9110/* Raise frame F. */ 8862/* Raise frame F. */
9111 8863
9112void 8864void
9113x_raise_frame (f) 8865x_raise_frame (struct frame *f)
9114 struct frame *f;
9115{ 8866{
9116 BLOCK_INPUT; 8867 BLOCK_INPUT;
9117 if (f->async_visible) 8868 if (f->async_visible)
@@ -9124,8 +8875,7 @@ x_raise_frame (f)
9124/* Lower frame F. */ 8875/* Lower frame F. */
9125 8876
9126void 8877void
9127x_lower_frame (f) 8878x_lower_frame (struct frame *f)
9128 struct frame *f;
9129{ 8879{
9130 if (f->async_visible) 8880 if (f->async_visible)
9131 { 8881 {
@@ -9139,8 +8889,7 @@ x_lower_frame (f)
9139/* Activate frame with Extended Window Manager Hints */ 8889/* Activate frame with Extended Window Manager Hints */
9140 8890
9141void 8891void
9142x_ewmh_activate_frame (f) 8892x_ewmh_activate_frame (FRAME_PTR f)
9143 FRAME_PTR f;
9144{ 8893{
9145 /* See Window Manager Specification/Extended Window Manager Hints at 8894 /* See Window Manager Specification/Extended Window Manager Hints at
9146 http://freedesktop.org/wiki/Specifications/wm-spec */ 8895 http://freedesktop.org/wiki/Specifications/wm-spec */
@@ -9160,9 +8909,7 @@ x_ewmh_activate_frame (f)
9160} 8909}
9161 8910
9162static void 8911static void
9163XTframe_raise_lower (f, raise_flag) 8912XTframe_raise_lower (FRAME_PTR f, int raise_flag)
9164 FRAME_PTR f;
9165 int raise_flag;
9166{ 8913{
9167 if (raise_flag) 8914 if (raise_flag)
9168 x_raise_frame (f); 8915 x_raise_frame (f);
@@ -9173,9 +8920,7 @@ XTframe_raise_lower (f, raise_flag)
9173/* XEmbed implementation. */ 8920/* XEmbed implementation. */
9174 8921
9175void 8922void
9176xembed_set_info (f, flags) 8923xembed_set_info (struct frame *f, enum xembed_info flags)
9177 struct frame *f;
9178 enum xembed_info flags;
9179{ 8924{
9180 Atom atom; 8925 Atom atom;
9181 unsigned long data[2]; 8926 unsigned long data[2];
@@ -9190,13 +8935,7 @@ xembed_set_info (f, flags)
9190} 8935}
9191 8936
9192void 8937void
9193xembed_send_message (f, time, message, detail, data1, data2) 8938xembed_send_message (struct frame *f, Time time, enum xembed_message message, long int detail, long int data1, long int data2)
9194 struct frame *f;
9195 Time time;
9196 enum xembed_message message;
9197 long detail;
9198 long data1;
9199 long data2;
9200{ 8939{
9201 XEvent event; 8940 XEvent event;
9202 8941
@@ -9225,8 +8964,7 @@ xembed_send_message (f, time, message, detail, data1, data2)
9225 finishes with it. */ 8964 finishes with it. */
9226 8965
9227void 8966void
9228x_make_frame_visible (f) 8967x_make_frame_visible (struct frame *f)
9229 struct frame *f;
9230{ 8968{
9231 Lisp_Object type; 8969 Lisp_Object type;
9232 int original_top, original_left; 8970 int original_top, original_left;
@@ -9389,8 +9127,7 @@ x_make_frame_visible (f)
9389/* Make the frame visible (mapped and not iconified). */ 9127/* Make the frame visible (mapped and not iconified). */
9390 9128
9391void 9129void
9392x_make_frame_invisible (f) 9130x_make_frame_invisible (struct frame *f)
9393 struct frame *f;
9394{ 9131{
9395 Window window; 9132 Window window;
9396 9133
@@ -9447,8 +9184,7 @@ x_make_frame_invisible (f)
9447/* Change window state from mapped to iconified. */ 9184/* Change window state from mapped to iconified. */
9448 9185
9449void 9186void
9450x_iconify_frame (f) 9187x_iconify_frame (struct frame *f)
9451 struct frame *f;
9452{ 9188{
9453 int result; 9189 int result;
9454 Lisp_Object type; 9190 Lisp_Object type;
@@ -9574,8 +9310,7 @@ x_iconify_frame (f)
9574/* Free X resources of frame F. */ 9310/* Free X resources of frame F. */
9575 9311
9576void 9312void
9577x_free_frame_resources (f) 9313x_free_frame_resources (struct frame *f)
9578 struct frame *f;
9579{ 9314{
9580 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9315 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
9581 Lisp_Object bar; 9316 Lisp_Object bar;
@@ -9698,8 +9433,7 @@ x_free_frame_resources (f)
9698/* Destroy the X window of frame F. */ 9433/* Destroy the X window of frame F. */
9699 9434
9700void 9435void
9701x_destroy_window (f) 9436x_destroy_window (struct frame *f)
9702 struct frame *f;
9703{ 9437{
9704 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9438 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
9705 9439
@@ -9826,9 +9560,7 @@ x_wm_set_size_hint (f, flags, user_position)
9826/* Used for IconicState or NormalState */ 9560/* Used for IconicState or NormalState */
9827 9561
9828void 9562void
9829x_wm_set_window_state (f, state) 9563x_wm_set_window_state (struct frame *f, int state)
9830 struct frame *f;
9831 int state;
9832{ 9564{
9833#ifdef USE_X_TOOLKIT 9565#ifdef USE_X_TOOLKIT
9834 Arg al[1]; 9566 Arg al[1];
@@ -9846,9 +9578,7 @@ x_wm_set_window_state (f, state)
9846} 9578}
9847 9579
9848void 9580void
9849x_wm_set_icon_pixmap (f, pixmap_id) 9581x_wm_set_icon_pixmap (struct frame *f, int pixmap_id)
9850 struct frame *f;
9851 int pixmap_id;
9852{ 9582{
9853 Pixmap icon_pixmap, icon_mask; 9583 Pixmap icon_pixmap, icon_mask;
9854 9584
@@ -9896,9 +9626,7 @@ x_wm_set_icon_pixmap (f, pixmap_id)
9896} 9626}
9897 9627
9898void 9628void
9899x_wm_set_icon_position (f, icon_x, icon_y) 9629x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y)
9900 struct frame *f;
9901 int icon_x, icon_y;
9902{ 9630{
9903 Window window = FRAME_OUTER_WINDOW (f); 9631 Window window = FRAME_OUTER_WINDOW (f);
9904 9632
@@ -9971,8 +9699,7 @@ static int x_session_initialized;
9971/* Test whether two display-name strings agree up to the dot that separates 9699/* Test whether two display-name strings agree up to the dot that separates
9972 the screen number from the server number. */ 9700 the screen number from the server number. */
9973static int 9701static int
9974same_x_server (name1, name2) 9702same_x_server (const char *name1, const char *name2)
9975 const char *name1, *name2;
9976{ 9703{
9977 int seen_colon = 0; 9704 int seen_colon = 0;
9978 const unsigned char *system_name = SDATA (Vsystem_name); 9705 const unsigned char *system_name = SDATA (Vsystem_name);
@@ -10019,10 +9746,7 @@ same_x_server (name1, name2)
10019 get to the first bit. With MASK 0x7e0, *BITS is set to 6, and *OFFSET 9746 get to the first bit. With MASK 0x7e0, *BITS is set to 6, and *OFFSET
10020 to 5. */ 9747 to 5. */
10021static void 9748static void
10022get_bits_and_offset (mask, bits, offset) 9749get_bits_and_offset (long unsigned int mask, int *bits, int *offset)
10023 unsigned long mask;
10024 int *bits;
10025 int *offset;
10026{ 9750{
10027 int nr = 0; 9751 int nr = 0;
10028 int off = 0; 9752 int off = 0;
@@ -10047,8 +9771,7 @@ get_bits_and_offset (mask, bits, offset)
10047 But don't permanently open it, just test its availability. */ 9771 But don't permanently open it, just test its availability. */
10048 9772
10049int 9773int
10050x_display_ok (display) 9774x_display_ok (const char *display)
10051 const char *display;
10052{ 9775{
10053 int dpy_ok = 1; 9776 int dpy_ok = 1;
10054 Display *dpy; 9777 Display *dpy;
@@ -10063,11 +9786,7 @@ x_display_ok (display)
10063 9786
10064#ifdef USE_GTK 9787#ifdef USE_GTK
10065static void 9788static void
10066my_log_handler (log_domain, log_level, message, user_data) 9789my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
10067 const gchar *log_domain;
10068 GLogLevelFlags log_level;
10069 const gchar *message;
10070 gpointer user_data;
10071{ 9790{
10072 if (!strstr (message, "g_set_prgname")) 9791 if (!strstr (message, "g_set_prgname"))
10073 fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message); 9792 fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message);
@@ -10079,10 +9798,7 @@ my_log_handler (log_domain, log_level, message, user_data)
10079 If we cannot contact the display, return null. */ 9798 If we cannot contact the display, return null. */
10080 9799
10081struct x_display_info * 9800struct x_display_info *
10082x_term_init (display_name, xrm_option, resource_name) 9801x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10083 Lisp_Object display_name;
10084 char *xrm_option;
10085 char *resource_name;
10086{ 9802{
10087 int connection; 9803 int connection;
10088 Display *dpy; 9804 Display *dpy;
@@ -10610,8 +10326,7 @@ x_term_init (display_name, xrm_option, resource_name)
10610 and without sending any more commands to the X server. */ 10326 and without sending any more commands to the X server. */
10611 10327
10612void 10328void
10613x_delete_display (dpyinfo) 10329x_delete_display (struct x_display_info *dpyinfo)
10614 struct x_display_info *dpyinfo;
10615{ 10330{
10616 struct terminal *t; 10331 struct terminal *t;
10617 10332
@@ -10880,7 +10595,7 @@ x_create_terminal (struct x_display_info *dpyinfo)
10880} 10595}
10881 10596
10882void 10597void
10883x_initialize () 10598x_initialize (void)
10884{ 10599{
10885 baud_rate = 19200; 10600 baud_rate = 19200;
10886 10601
@@ -10938,7 +10653,7 @@ x_initialize ()
10938 10653
10939 10654
10940void 10655void
10941syms_of_xterm () 10656syms_of_xterm (void)
10942{ 10657{
10943 x_error_message = NULL; 10658 x_error_message = NULL;
10944 10659