aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorJuanma Barranquero2010-07-06 16:22:29 +0200
committerJuanma Barranquero2010-07-06 16:22:29 +0200
commitb56ceb92bf4d470af2e9172d1fcd4d85232c40a6 (patch)
tree50ab60b4715be45ed671c386c5b9336b45443539 /src/w32term.c
parent7af07b967171736a35e0af8b6ecf6feb072184dc (diff)
downloademacs-b56ceb92bf4d470af2e9172d1fcd4d85232c40a6.tar.gz
emacs-b56ceb92bf4d470af2e9172d1fcd4d85232c40a6.zip
src/w32*.c: Convert function definitions to standard C.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c484
1 files changed, 153 insertions, 331 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 1acb77e7b16..5dfe6a363d3 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -96,7 +96,7 @@ int x_underline_at_descent_line;
96 96
97extern unsigned int msh_mousewheel; 97extern unsigned int msh_mousewheel;
98 98
99extern void free_frame_menubar (); 99extern void free_frame_menubar (struct frame *);
100 100
101extern int w32_codepage_for_font (char *fontname); 101extern int w32_codepage_for_font (char *fontname);
102extern Cursor w32_load_cursor (LPCTSTR name); 102extern Cursor w32_load_cursor (LPCTSTR name);
@@ -294,9 +294,7 @@ struct record event_record[100];
294 294
295int event_record_index; 295int event_record_index;
296 296
297record_event (locus, type) 297record_event (char *locus, int type)
298 char *locus;
299 int type;
300{ 298{
301 if (event_record_index == sizeof (event_record) / sizeof (struct record)) 299 if (event_record_index == sizeof (event_record) / sizeof (struct record))
302 event_record_index = 0; 300 event_record_index = 0;
@@ -310,7 +308,7 @@ record_event (locus, type)
310 308
311 309
312void 310void
313XChangeGC (void * ignore, XGCValues* gc, unsigned long mask, 311XChangeGC (void *ignore, XGCValues *gc, unsigned long mask,
314 XGCValues *xgcv) 312 XGCValues *xgcv)
315{ 313{
316 if (mask & GCForeground) 314 if (mask & GCForeground)
@@ -321,8 +319,8 @@ XChangeGC (void * ignore, XGCValues* gc, unsigned long mask,
321 gc->font = xgcv->font; 319 gc->font = xgcv->font;
322} 320}
323 321
324XGCValues *XCreateGC (void * ignore, Window window, unsigned long mask, 322XGCValues *
325 XGCValues *xgcv) 323XCreateGC (void *ignore, Window window, unsigned long mask, XGCValues *xgcv)
326{ 324{
327 XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues)); 325 XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues));
328 bzero (gc, sizeof (XGCValues)); 326 bzero (gc, sizeof (XGCValues));
@@ -333,8 +331,8 @@ XGCValues *XCreateGC (void * ignore, Window window, unsigned long mask,
333} 331}
334 332
335void 333void
336XGetGCValues (void* ignore, XGCValues *gc, 334XGetGCValues (void *ignore, XGCValues *gc,
337 unsigned long mask, XGCValues *xgcv) 335 unsigned long mask, XGCValues *xgcv)
338{ 336{
339 XChangeGC (ignore, xgcv, mask, gc); 337 XChangeGC (ignore, xgcv, mask, gc);
340} 338}
@@ -376,11 +374,7 @@ w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y,
376 374
377/* Draw a filled rectangle at the specified position. */ 375/* Draw a filled rectangle at the specified position. */
378void 376void
379w32_fill_rect (f, hdc, pix, lprect) 377w32_fill_rect (FRAME_PTR f, HDC hdc, COLORREF pix, RECT *lprect)
380 FRAME_PTR f;
381 HDC hdc;
382 COLORREF pix;
383 RECT * lprect;
384{ 378{
385 HBRUSH hb; 379 HBRUSH hb;
386 380
@@ -390,8 +384,7 @@ w32_fill_rect (f, hdc, pix, lprect)
390} 384}
391 385
392void 386void
393w32_clear_window (f) 387w32_clear_window (FRAME_PTR f)
394 FRAME_PTR f;
395{ 388{
396 RECT rect; 389 RECT rect;
397 HDC hdc = get_frame_dc (f); 390 HDC hdc = get_frame_dc (f);
@@ -411,8 +404,7 @@ w32_clear_window (f)
411#define OPAQUE_FRAME 255 404#define OPAQUE_FRAME 255
412 405
413void 406void
414x_set_frame_alpha (f) 407x_set_frame_alpha (struct frame *f)
415 struct frame *f;
416{ 408{
417 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 409 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
418 double alpha = 1.0; 410 double alpha = 1.0;
@@ -458,8 +450,7 @@ x_set_frame_alpha (f)
458} 450}
459 451
460int 452int
461x_display_pixel_height (dpyinfo) 453x_display_pixel_height (struct w32_display_info *dpyinfo)
462 struct w32_display_info *dpyinfo;
463{ 454{
464 HDC dc = GetDC (NULL); 455 HDC dc = GetDC (NULL);
465 int pixels = GetDeviceCaps (dc, VERTRES); 456 int pixels = GetDeviceCaps (dc, VERTRES);
@@ -468,8 +459,7 @@ x_display_pixel_height (dpyinfo)
468} 459}
469 460
470int 461int
471x_display_pixel_width (dpyinfo) 462x_display_pixel_width (struct w32_display_info *dpyinfo)
472 struct w32_display_info *dpyinfo;
473{ 463{
474 HDC dc = GetDC (NULL); 464 HDC dc = GetDC (NULL);
475 int pixels = GetDeviceCaps (dc, HORZRES); 465 int pixels = GetDeviceCaps (dc, HORZRES);
@@ -488,8 +478,7 @@ x_display_pixel_width (dpyinfo)
488 each window being updated. */ 478 each window being updated. */
489 479
490static void 480static void
491x_update_begin (f) 481x_update_begin (struct frame *f)
492 struct frame *f;
493{ 482{
494 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); 483 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
495 484
@@ -511,8 +500,7 @@ x_update_begin (f)
511 position of W. */ 500 position of W. */
512 501
513static void 502static void
514x_update_window_begin (w) 503x_update_window_begin (struct window *w)
515 struct window *w;
516{ 504{
517 struct frame *f = XFRAME (WINDOW_FRAME (w)); 505 struct frame *f = XFRAME (WINDOW_FRAME (w));
518 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); 506 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
@@ -571,9 +559,7 @@ x_update_window_begin (w)
571/* Draw a vertical window border from (x,y0) to (x,y1) */ 559/* Draw a vertical window border from (x,y0) to (x,y1) */
572 560
573static void 561static void
574w32_draw_vertical_window_border (w, x, y0, y1) 562w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
575 struct window *w;
576 int x, y0, y1;
577{ 563{
578 struct frame *f = XFRAME (WINDOW_FRAME (w)); 564 struct frame *f = XFRAME (WINDOW_FRAME (w));
579 RECT r; 565 RECT r;
@@ -610,9 +596,8 @@ w32_draw_vertical_window_border (w, x, y0, y1)
610 here. */ 596 here. */
611 597
612static void 598static void
613x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) 599x_update_window_end (struct window *w, int cursor_on_p,
614 struct window *w; 600 int mouse_face_overwritten_p)
615 int cursor_on_p, mouse_face_overwritten_p;
616{ 601{
617 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame)); 602 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame));
618 603
@@ -656,8 +641,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
656 update_end. */ 641 update_end. */
657 642
658static void 643static void
659x_update_end (f) 644x_update_end (struct frame *f)
660 struct frame *f;
661{ 645{
662 if (! FRAME_W32_P (f)) 646 if (! FRAME_W32_P (f))
663 return; 647 return;
@@ -672,8 +656,7 @@ x_update_end (f)
672 updated_window is not available here. */ 656 updated_window is not available here. */
673 657
674static void 658static void
675w32_frame_up_to_date (f) 659w32_frame_up_to_date (struct frame *f)
676 struct frame *f;
677{ 660{
678 if (FRAME_W32_P (f)) 661 if (FRAME_W32_P (f))
679 { 662 {
@@ -702,8 +685,7 @@ w32_frame_up_to_date (f)
702 between bitmaps to be drawn between current row and DESIRED_ROW. */ 685 between bitmaps to be drawn between current row and DESIRED_ROW. */
703 686
704static void 687static void
705x_after_update_window_line (desired_row) 688x_after_update_window_line (struct glyph_row *desired_row)
706 struct glyph_row *desired_row;
707{ 689{
708 struct window *w = updated_window; 690 struct window *w = updated_window;
709 struct frame *f; 691 struct frame *f;
@@ -749,10 +731,8 @@ x_after_update_window_line (desired_row)
749 drawn. */ 731 drawn. */
750 732
751static void 733static void
752w32_draw_fringe_bitmap (w, row, p) 734w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
753 struct window *w; 735 struct draw_fringe_bitmap_params *p)
754 struct glyph_row *row;
755 struct draw_fringe_bitmap_params *p;
756{ 736{
757 struct frame *f = XFRAME (WINDOW_FRAME (w)); 737 struct frame *f = XFRAME (WINDOW_FRAME (w));
758 HDC hdc; 738 HDC hdc;
@@ -890,10 +870,7 @@ w32_draw_fringe_bitmap (w, row, p)
890} 870}
891 871
892static void 872static void
893w32_define_fringe_bitmap (which, bits, h, wd) 873w32_define_fringe_bitmap (int which, unsigned short *bits, int h, int wd)
894 int which;
895 unsigned short *bits;
896 int h, wd;
897{ 874{
898 if (which >= max_fringe_bmp) 875 if (which >= max_fringe_bmp)
899 { 876 {
@@ -908,8 +885,7 @@ w32_define_fringe_bitmap (which, bits, h, wd)
908} 885}
909 886
910static void 887static void
911w32_destroy_fringe_bitmap (which) 888w32_destroy_fringe_bitmap (int which)
912 int which;
913{ 889{
914 if (which >= max_fringe_bmp) 890 if (which >= max_fringe_bmp)
915 return; 891 return;
@@ -979,8 +955,7 @@ static void w32_draw_box_rect (struct glyph_string *, int, int, int, int,
979 face. */ 955 face. */
980 956
981static void 957static void
982x_set_cursor_gc (s) 958x_set_cursor_gc (struct glyph_string *s)
983 struct glyph_string *s;
984{ 959{
985 if (s->font == FRAME_FONT (s->f) 960 if (s->font == FRAME_FONT (s->f)
986 && s->face->background == FRAME_BACKGROUND_PIXEL (s->f) 961 && s->face->background == FRAME_BACKGROUND_PIXEL (s->f)
@@ -1031,8 +1006,7 @@ x_set_cursor_gc (s)
1031/* Set up S->gc of glyph string S for drawing text in mouse face. */ 1006/* Set up S->gc of glyph string S for drawing text in mouse face. */
1032 1007
1033static void 1008static void
1034x_set_mouse_face_gc (s) 1009x_set_mouse_face_gc (struct glyph_string *s)
1035 struct glyph_string *s;
1036{ 1010{
1037 int face_id; 1011 int face_id;
1038 struct face *face; 1012 struct face *face;
@@ -1085,8 +1059,7 @@ x_set_mouse_face_gc (s)
1085 matrix was built, so there isn't much to do, here. */ 1059 matrix was built, so there isn't much to do, here. */
1086 1060
1087static INLINE void 1061static INLINE void
1088x_set_mode_line_face_gc (s) 1062x_set_mode_line_face_gc (struct glyph_string *s)
1089 struct glyph_string *s;
1090{ 1063{
1091 s->gc = s->face->gc; 1064 s->gc = s->face->gc;
1092} 1065}
@@ -1097,8 +1070,7 @@ x_set_mode_line_face_gc (s)
1097 pattern. */ 1070 pattern. */
1098 1071
1099static INLINE void 1072static INLINE void
1100x_set_glyph_string_gc (s) 1073x_set_glyph_string_gc (struct glyph_string *s)
1101 struct glyph_string *s;
1102{ 1074{
1103 PREPARE_FACE_FOR_DISPLAY (s->f, s->face); 1075 PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
1104 1076
@@ -1143,8 +1115,7 @@ x_set_glyph_string_gc (s)
1143 line or menu if we don't have X toolkit support. */ 1115 line or menu if we don't have X toolkit support. */
1144 1116
1145static INLINE void 1117static INLINE void
1146x_set_glyph_string_clipping (s) 1118x_set_glyph_string_clipping (struct glyph_string *s)
1147 struct glyph_string *s;
1148{ 1119{
1149 RECT *r = s->clip; 1120 RECT *r = s->clip;
1150 int n = get_glyph_string_clip_rects (s, r, 2); 1121 int n = get_glyph_string_clip_rects (s, r, 2);
@@ -1172,8 +1143,8 @@ x_set_glyph_string_clipping (s)
1172 the area of SRC. */ 1143 the area of SRC. */
1173 1144
1174static void 1145static void
1175x_set_glyph_string_clipping_exactly (src, dst) 1146x_set_glyph_string_clipping_exactly (struct glyph_string *src,
1176 struct glyph_string *src, *dst; 1147 struct glyph_string *dst)
1177{ 1148{
1178 RECT r; 1149 RECT r;
1179 1150
@@ -1190,8 +1161,7 @@ x_set_glyph_string_clipping_exactly (src, dst)
1190 Compute left and right overhang of glyph string S. */ 1161 Compute left and right overhang of glyph string S. */
1191 1162
1192static void 1163static void
1193w32_compute_glyph_string_overhangs (s) 1164w32_compute_glyph_string_overhangs (struct glyph_string *s)
1194 struct glyph_string *s;
1195{ 1165{
1196 if (s->cmp == NULL 1166 if (s->cmp == NULL
1197 && s->first_glyph->type == CHAR_GLYPH 1167 && s->first_glyph->type == CHAR_GLYPH
@@ -1219,9 +1189,8 @@ w32_compute_glyph_string_overhangs (s)
1219/* Fill rectangle X, Y, W, H with background color of glyph string S. */ 1189/* Fill rectangle X, Y, W, H with background color of glyph string S. */
1220 1190
1221static INLINE void 1191static INLINE void
1222x_clear_glyph_string_rect (s, x, y, w, h) 1192x_clear_glyph_string_rect (struct glyph_string *s,
1223 struct glyph_string *s; 1193 int x, int y, int w, int h)
1224 int x, y, w, h;
1225{ 1194{
1226 int real_x = x; 1195 int real_x = x;
1227 int real_y = y; 1196 int real_y = y;
@@ -1251,9 +1220,7 @@ x_clear_glyph_string_rect (s, x, y, w, h)
1251 contains the first component of a composition. */ 1220 contains the first component of a composition. */
1252 1221
1253static void 1222static void
1254x_draw_glyph_string_background (s, force_p) 1223x_draw_glyph_string_background (struct glyph_string *s, int force_p)
1255 struct glyph_string *s;
1256 int force_p;
1257{ 1224{
1258 /* Nothing to do if background has already been drawn or if it 1225 /* Nothing to do if background has already been drawn or if it
1259 shouldn't be drawn in the first place. */ 1226 shouldn't be drawn in the first place. */
@@ -1292,8 +1259,7 @@ x_draw_glyph_string_background (s, force_p)
1292/* Draw the foreground of glyph string S. */ 1259/* Draw the foreground of glyph string S. */
1293 1260
1294static void 1261static void
1295x_draw_glyph_string_foreground (s) 1262x_draw_glyph_string_foreground (struct glyph_string *s)
1296 struct glyph_string *s;
1297{ 1263{
1298 int i, x; 1264 int i, x;
1299 1265
@@ -1350,8 +1316,7 @@ x_draw_glyph_string_foreground (s)
1350/* Draw the foreground of composite glyph string S. */ 1316/* Draw the foreground of composite glyph string S. */
1351 1317
1352static void 1318static void
1353x_draw_composite_glyph_string_foreground (s) 1319x_draw_composite_glyph_string_foreground (struct glyph_string *s)
1354 struct glyph_string *s;
1355{ 1320{
1356 int i, j, x; 1321 int i, j, x;
1357 struct font *font = s->font; 1322 struct font *font = s->font;
@@ -1464,11 +1429,8 @@ x_draw_composite_glyph_string_foreground (s)
1464 Value is non-zero if successful. */ 1429 Value is non-zero if successful. */
1465 1430
1466static int 1431static int
1467w32_alloc_lighter_color (f, color, factor, delta) 1432w32_alloc_lighter_color (struct frame *f, COLORREF *color,
1468 struct frame *f; 1433 double factor, int delta)
1469 COLORREF *color;
1470 double factor;
1471 int delta;
1472{ 1434{
1473 COLORREF new; 1435 COLORREF new;
1474 long bright; 1436 long bright;
@@ -1527,10 +1489,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
1527 colors in COLORS. On W32, we no longer try to map colors to 1489 colors in COLORS. On W32, we no longer try to map colors to
1528 a palette. */ 1490 a palette. */
1529void 1491void
1530x_query_colors (f, colors, ncolors) 1492x_query_colors (struct frame *f, XColor *colors, int ncolors)
1531 struct frame *f;
1532 XColor *colors;
1533 int ncolors;
1534{ 1493{
1535 int i; 1494 int i;
1536 1495
@@ -1545,9 +1504,7 @@ x_query_colors (f, colors, ncolors)
1545} 1504}
1546 1505
1547void 1506void
1548x_query_color (f, color) 1507x_query_color (struct frame *f, XColor *color)
1549 struct frame *f;
1550 XColor *color;
1551{ 1508{
1552 x_query_colors (f, color, 1); 1509 x_query_colors (f, color, 1);
1553} 1510}
@@ -1561,12 +1518,8 @@ x_query_color (f, color)
1561 be allocated, use DEFAULT_PIXEL, instead. */ 1518 be allocated, use DEFAULT_PIXEL, instead. */
1562 1519
1563static void 1520static void
1564w32_setup_relief_color (f, relief, factor, delta, default_pixel) 1521w32_setup_relief_color (struct frame *f, struct relief *relief, double factor,
1565 struct frame *f; 1522 int delta, COLORREF default_pixel)
1566 struct relief *relief;
1567 double factor;
1568 int delta;
1569 COLORREF default_pixel;
1570{ 1523{
1571 XGCValues xgcv; 1524 XGCValues xgcv;
1572 struct w32_output *di = f->output_data.w32; 1525 struct w32_output *di = f->output_data.w32;
@@ -1602,8 +1555,7 @@ w32_setup_relief_color (f, relief, factor, delta, default_pixel)
1602/* Set up colors for the relief lines around glyph string S. */ 1555/* Set up colors for the relief lines around glyph string S. */
1603 1556
1604static void 1557static void
1605x_setup_relief_colors (s) 1558x_setup_relief_colors (struct glyph_string *s)
1606 struct glyph_string *s;
1607{ 1559{
1608 struct w32_output *di = s->f->output_data.w32; 1560 struct w32_output *di = s->f->output_data.w32;
1609 COLORREF color; 1561 COLORREF color;
@@ -1638,12 +1590,10 @@ x_setup_relief_colors (s)
1638 when drawing. */ 1590 when drawing. */
1639 1591
1640static void 1592static void
1641w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, 1593w32_draw_relief_rect (struct frame *f,
1642 raised_p, top_p, bot_p, left_p, right_p, clip_rect) 1594 int left_x, int top_y, int right_x, int bottom_y, int width,
1643 struct frame *f; 1595 int raised_p, int top_p, int bot_p, int left_p, int right_p,
1644 int left_x, top_y, right_x, bottom_y, width; 1596 RECT *clip_rect)
1645 int top_p, bot_p, left_p, right_p, raised_p;
1646 RECT *clip_rect;
1647{ 1597{
1648 int i; 1598 int i;
1649 XGCValues gc; 1599 XGCValues gc;
@@ -1703,11 +1653,9 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
1703 rectangle to use when drawing. */ 1653 rectangle to use when drawing. */
1704 1654
1705static void 1655static void
1706w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, 1656w32_draw_box_rect (struct glyph_string *s,
1707 left_p, right_p, clip_rect) 1657 int left_x, int top_y, int right_x, int bottom_y, int width,
1708 struct glyph_string *s; 1658 int left_p, int right_p, RECT *clip_rect)
1709 int left_x, top_y, right_x, bottom_y, width, left_p, right_p;
1710 RECT *clip_rect;
1711{ 1659{
1712 w32_set_clip_rectangle (s->hdc, clip_rect); 1660 w32_set_clip_rectangle (s->hdc, clip_rect);
1713 1661
@@ -1740,8 +1688,7 @@ w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
1740/* Draw a box around glyph string S. */ 1688/* Draw a box around glyph string S. */
1741 1689
1742static void 1690static void
1743x_draw_glyph_string_box (s) 1691x_draw_glyph_string_box (struct glyph_string *s)
1744 struct glyph_string *s;
1745{ 1692{
1746 int width, left_x, right_x, top_y, bottom_y, last_x, raised_p; 1693 int width, left_x, right_x, top_y, bottom_y, last_x, raised_p;
1747 int left_p, right_p; 1694 int left_p, right_p;
@@ -1792,8 +1739,7 @@ x_draw_glyph_string_box (s)
1792/* Draw foreground of image glyph string S. */ 1739/* Draw foreground of image glyph string S. */
1793 1740
1794static void 1741static void
1795x_draw_image_foreground (s) 1742x_draw_image_foreground (struct glyph_string *s)
1796 struct glyph_string *s;
1797{ 1743{
1798 int x = s->x; 1744 int x = s->x;
1799 int y = s->ybase - image_ascent (s->img, s->face, &s->slice); 1745 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -1883,8 +1829,7 @@ x_draw_image_foreground (s)
1883/* Draw a relief around the image glyph string S. */ 1829/* Draw a relief around the image glyph string S. */
1884 1830
1885static void 1831static void
1886x_draw_image_relief (s) 1832x_draw_image_relief (struct glyph_string *s)
1887 struct glyph_string *s;
1888{ 1833{
1889 int x0, y0, x1, y1, thick, raised_p; 1834 int x0, y0, x1, y1, thick, raised_p;
1890 RECT r; 1835 RECT r;
@@ -1936,9 +1881,7 @@ x_draw_image_relief (s)
1936/* Draw the foreground of image glyph string S to PIXMAP. */ 1881/* Draw the foreground of image glyph string S to PIXMAP. */
1937 1882
1938static void 1883static void
1939w32_draw_image_foreground_1 (s, pixmap) 1884w32_draw_image_foreground_1 (struct glyph_string *s, HBITMAP pixmap)
1940 struct glyph_string *s;
1941 HBITMAP pixmap;
1942{ 1885{
1943 HDC hdc = CreateCompatibleDC (s->hdc); 1886 HDC hdc = CreateCompatibleDC (s->hdc);
1944 HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap); 1887 HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap);
@@ -2025,9 +1968,7 @@ w32_draw_image_foreground_1 (s, pixmap)
2025 give the rectangle to draw. */ 1968 give the rectangle to draw. */
2026 1969
2027static void 1970static void
2028x_draw_glyph_string_bg_rect (s, x, y, w, h) 1971x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h)
2029 struct glyph_string *s;
2030 int x, y, w, h;
2031{ 1972{
2032#if 0 /* TODO: stipple */ 1973#if 0 /* TODO: stipple */
2033 if (s->stippled_p) 1974 if (s->stippled_p)
@@ -2058,8 +1999,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h)
2058 */ 1999 */
2059 2000
2060static void 2001static void
2061x_draw_image_glyph_string (s) 2002x_draw_image_glyph_string (struct glyph_string *s)
2062 struct glyph_string *s;
2063{ 2003{
2064 int x, y; 2004 int x, y;
2065 int box_line_hwidth = eabs (s->face->box_line_width); 2005 int box_line_hwidth = eabs (s->face->box_line_width);
@@ -2172,8 +2112,7 @@ x_draw_image_glyph_string (s)
2172/* Draw stretch glyph string S. */ 2112/* Draw stretch glyph string S. */
2173 2113
2174static void 2114static void
2175x_draw_stretch_glyph_string (s) 2115x_draw_stretch_glyph_string (struct glyph_string *s)
2176 struct glyph_string *s;
2177{ 2116{
2178 xassert (s->first_glyph->type == STRETCH_GLYPH); 2117 xassert (s->first_glyph->type == STRETCH_GLYPH);
2179 2118
@@ -2255,8 +2194,7 @@ x_draw_stretch_glyph_string (s)
2255/* Draw glyph string S. */ 2194/* Draw glyph string S. */
2256 2195
2257static void 2196static void
2258x_draw_glyph_string (s) 2197x_draw_glyph_string (struct glyph_string *s)
2259 struct glyph_string *s;
2260{ 2198{
2261 int relief_drawn_p = 0; 2199 int relief_drawn_p = 0;
2262 2200
@@ -2502,9 +2440,8 @@ x_draw_glyph_string (s)
2502/* Shift display to make room for inserted glyphs. */ 2440/* Shift display to make room for inserted glyphs. */
2503 2441
2504void 2442void
2505w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by) 2443w32_shift_glyphs_for_insert (struct frame *f, int x, int y,
2506 struct frame *f; 2444 int width, int height, int shift_by)
2507 int x, y, width, height, shift_by;
2508{ 2445{
2509 HDC hdc; 2446 HDC hdc;
2510 2447
@@ -2520,9 +2457,7 @@ w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
2520 for X frames. */ 2457 for X frames. */
2521 2458
2522static void 2459static void
2523x_delete_glyphs (f, n) 2460x_delete_glyphs (struct frame *f, register int n)
2524 struct frame *f;
2525 register int n;
2526{ 2461{
2527 if (! FRAME_W32_P (f)) 2462 if (! FRAME_W32_P (f))
2528 return; 2463 return;
@@ -2592,8 +2527,7 @@ w32_ring_bell (struct frame *f)
2592 that is bounded by calls to x_update_begin and x_update_end. */ 2527 that is bounded by calls to x_update_begin and x_update_end. */
2593 2528
2594static void 2529static void
2595w32_set_terminal_window (n) 2530w32_set_terminal_window (struct frame *f, int n)
2596 register int n;
2597{ 2531{
2598 /* This function intentionally left blank. */ 2532 /* This function intentionally left blank. */
2599} 2533}
@@ -2607,9 +2541,7 @@ w32_set_terminal_window (n)
2607 lines or deleting -N lines at vertical position VPOS. */ 2541 lines or deleting -N lines at vertical position VPOS. */
2608 2542
2609static void 2543static void
2610x_ins_del_lines (f, vpos, n) 2544x_ins_del_lines (struct frame *f, int vpos, int n)
2611 struct frame *f;
2612 int vpos, n;
2613{ 2545{
2614 if (! FRAME_W32_P (f)) 2546 if (! FRAME_W32_P (f))
2615 return; 2547 return;
@@ -2621,9 +2553,7 @@ x_ins_del_lines (f, vpos, n)
2621/* Scroll part of the display as described by RUN. */ 2553/* Scroll part of the display as described by RUN. */
2622 2554
2623static void 2555static void
2624x_scroll_run (w, run) 2556x_scroll_run (struct window *w, struct run *run)
2625 struct window *w;
2626 struct run *run;
2627{ 2557{
2628 struct frame *f = XFRAME (w->frame); 2558 struct frame *f = XFRAME (w->frame);
2629 int x, y, width, height, from_y, to_y, bottom_y; 2559 int x, y, width, height, from_y, to_y, bottom_y;
@@ -2705,16 +2635,14 @@ x_scroll_run (w, run)
2705 ***********************************************************************/ 2635 ***********************************************************************/
2706 2636
2707static void 2637static void
2708frame_highlight (f) 2638frame_highlight (struct frame *f)
2709 struct frame *f;
2710{ 2639{
2711 x_update_cursor (f, 1); 2640 x_update_cursor (f, 1);
2712 x_set_frame_alpha (f); 2641 x_set_frame_alpha (f);
2713} 2642}
2714 2643
2715static void 2644static void
2716frame_unhighlight (f) 2645frame_unhighlight (struct frame *f)
2717 struct frame *f;
2718{ 2646{
2719 x_update_cursor (f, 1); 2647 x_update_cursor (f, 1);
2720 x_set_frame_alpha (f); 2648 x_set_frame_alpha (f);
@@ -2727,9 +2655,7 @@ frame_unhighlight (f)
2727 Lisp code can tell when the switch took place by examining the events. */ 2655 Lisp code can tell when the switch took place by examining the events. */
2728 2656
2729static void 2657static void
2730x_new_focus_frame (dpyinfo, frame) 2658x_new_focus_frame (struct w32_display_info *dpyinfo, struct frame *frame)
2731 struct w32_display_info *dpyinfo;
2732 struct frame *frame;
2733{ 2659{
2734 struct frame *old_focus = dpyinfo->w32_focus_frame; 2660 struct frame *old_focus = dpyinfo->w32_focus_frame;
2735 2661
@@ -2757,12 +2683,8 @@ x_new_focus_frame (dpyinfo, frame)
2757 a FOCUS_IN_EVENT into *BUFP. */ 2683 a FOCUS_IN_EVENT into *BUFP. */
2758 2684
2759static void 2685static void
2760x_focus_changed (type, state, dpyinfo, frame, bufp) 2686x_focus_changed (int type, int state, struct w32_display_info *dpyinfo,
2761 int type; 2687 struct frame *frame, struct input_event *bufp)
2762 int state;
2763 struct w32_display_info *dpyinfo;
2764 struct frame *frame;
2765 struct input_event *bufp;
2766{ 2688{
2767 if (type == WM_SETFOCUS) 2689 if (type == WM_SETFOCUS)
2768 { 2690 {
@@ -2807,10 +2729,8 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
2807 Returns FOCUS_IN_EVENT event in *BUFP. */ 2729 Returns FOCUS_IN_EVENT event in *BUFP. */
2808 2730
2809static void 2731static void
2810w32_detect_focus_change (dpyinfo, event, bufp) 2732w32_detect_focus_change (struct w32_display_info *dpyinfo, W32Msg *event,
2811 struct w32_display_info *dpyinfo; 2733 struct input_event *bufp)
2812 W32Msg *event;
2813 struct input_event *bufp;
2814{ 2734{
2815 struct frame *frame; 2735 struct frame *frame;
2816 2736
@@ -2829,8 +2749,7 @@ w32_detect_focus_change (dpyinfo, event, bufp)
2829/* Handle an event saying the mouse has moved out of an Emacs frame. */ 2749/* Handle an event saying the mouse has moved out of an Emacs frame. */
2830 2750
2831void 2751void
2832x_mouse_leave (dpyinfo) 2752x_mouse_leave (struct w32_display_info *dpyinfo)
2833 struct w32_display_info *dpyinfo;
2834{ 2753{
2835 x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame); 2754 x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame);
2836} 2755}
@@ -2844,8 +2763,7 @@ x_mouse_leave (dpyinfo)
2844 the appropriate X display info. */ 2763 the appropriate X display info. */
2845 2764
2846static void 2765static void
2847w32_frame_rehighlight (frame) 2766w32_frame_rehighlight (struct frame *frame)
2848 struct frame *frame;
2849{ 2767{
2850 if (! FRAME_W32_P (frame)) 2768 if (! FRAME_W32_P (frame))
2851 return; 2769 return;
@@ -2853,8 +2771,7 @@ w32_frame_rehighlight (frame)
2853} 2771}
2854 2772
2855static void 2773static void
2856x_frame_rehighlight (dpyinfo) 2774x_frame_rehighlight (struct w32_display_info *dpyinfo)
2857 struct w32_display_info *dpyinfo;
2858{ 2775{
2859 struct frame *old_highlight = dpyinfo->x_highlight_frame; 2776 struct frame *old_highlight = dpyinfo->x_highlight_frame;
2860 2777
@@ -2887,8 +2804,7 @@ x_frame_rehighlight (dpyinfo)
2887/* Convert a keysym to its name. */ 2804/* Convert a keysym to its name. */
2888 2805
2889char * 2806char *
2890x_get_keysym_name (keysym) 2807x_get_keysym_name (int keysym)
2891 int keysym;
2892{ 2808{
2893 /* Make static so we can always return it */ 2809 /* Make static so we can always return it */
2894 static char value[100]; 2810 static char value[100];
@@ -2900,7 +2816,8 @@ x_get_keysym_name (keysym)
2900 return value; 2816 return value;
2901} 2817}
2902 2818
2903static int codepage_for_locale(LCID locale) 2819static int
2820codepage_for_locale (LCID locale)
2904{ 2821{
2905 char cp[20]; 2822 char cp[20];
2906 2823
@@ -2917,11 +2834,7 @@ static int codepage_for_locale(LCID locale)
2917 the state in PUP. XBUTTON provides extra information for extended mouse 2834 the state in PUP. XBUTTON provides extra information for extended mouse
2918 button messages. Returns FALSE if unable to parse the message. */ 2835 button messages. Returns FALSE if unable to parse the message. */
2919BOOL 2836BOOL
2920parse_button (message, xbutton, pbutton, pup) 2837parse_button (int message, int xbutton, int * pbutton, int * pup)
2921 int message;
2922 int xbutton;
2923 int * pbutton;
2924 int * pup;
2925{ 2838{
2926 int button = 0; 2839 int button = 0;
2927 int up = 0; 2840 int up = 0;
@@ -2989,10 +2902,7 @@ parse_button (message, xbutton, pbutton, pup)
2989 the mouse. */ 2902 the mouse. */
2990 2903
2991static Lisp_Object 2904static Lisp_Object
2992construct_mouse_click (result, msg, f) 2905construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f)
2993 struct input_event *result;
2994 W32Msg *msg;
2995 struct frame *f;
2996{ 2906{
2997 int button; 2907 int button;
2998 int up; 2908 int up;
@@ -3018,10 +2928,7 @@ construct_mouse_click (result, msg, f)
3018} 2928}
3019 2929
3020static Lisp_Object 2930static Lisp_Object
3021construct_mouse_wheel (result, msg, f) 2931construct_mouse_wheel (struct input_event *result, W32Msg *msg, struct frame *f)
3022 struct input_event *result;
3023 W32Msg *msg;
3024 struct frame *f;
3025{ 2932{
3026 POINT p; 2933 POINT p;
3027 int delta; 2934 int delta;
@@ -3054,10 +2961,7 @@ construct_mouse_wheel (result, msg, f)
3054} 2961}
3055 2962
3056static Lisp_Object 2963static Lisp_Object
3057construct_drag_n_drop (result, msg, f) 2964construct_drag_n_drop (struct input_event *result, W32Msg *msg, struct frame *f)
3058 struct input_event *result;
3059 W32Msg *msg;
3060 struct frame *f;
3061{ 2965{
3062 Lisp_Object files; 2966 Lisp_Object files;
3063 Lisp_Object frame; 2967 Lisp_Object frame;
@@ -3118,9 +3022,7 @@ static MSG last_mouse_motion_event;
3118static Lisp_Object last_mouse_motion_frame; 3022static Lisp_Object last_mouse_motion_frame;
3119 3023
3120static int 3024static int
3121note_mouse_movement (frame, msg) 3025note_mouse_movement (FRAME_PTR frame, MSG *msg)
3122 FRAME_PTR frame;
3123 MSG *msg;
3124{ 3026{
3125 int mouse_x = LOWORD (msg->lParam); 3027 int mouse_x = LOWORD (msg->lParam);
3126 int mouse_y = HIWORD (msg->lParam); 3028 int mouse_y = HIWORD (msg->lParam);
@@ -3168,12 +3070,15 @@ note_mouse_movement (frame, msg)
3168 Mouse Face 3070 Mouse Face
3169 ************************************************************************/ 3071 ************************************************************************/
3170 3072
3171static struct scroll_bar *x_window_to_scroll_bar (); 3073static struct scroll_bar *x_window_to_scroll_bar (Window);
3172static void x_scroll_bar_report_motion (); 3074static void x_scroll_bar_report_motion (FRAME_PTR *, Lisp_Object *,
3075 enum scroll_bar_part *,
3076 Lisp_Object *, Lisp_Object *,
3077 unsigned long *);
3173static void x_check_fullscreen (struct frame *); 3078static void x_check_fullscreen (struct frame *);
3174 3079
3175static void 3080static void
3176redo_mouse_highlight () 3081redo_mouse_highlight (void)
3177{ 3082{
3178 if (!NILP (last_mouse_motion_frame) 3083 if (!NILP (last_mouse_motion_frame)
3179 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame))) 3084 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame)))
@@ -3183,9 +3088,7 @@ redo_mouse_highlight ()
3183} 3088}
3184 3089
3185static void 3090static void
3186w32_define_cursor (window, cursor) 3091w32_define_cursor (Window window, Cursor cursor)
3187 Window window;
3188 Cursor cursor;
3189{ 3092{
3190 PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0); 3093 PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
3191} 3094}
@@ -3210,13 +3113,9 @@ w32_define_cursor (window, cursor)
3210 movement. */ 3113 movement. */
3211 3114
3212static void 3115static void
3213w32_mouse_position (fp, insist, bar_window, part, x, y, time) 3116w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
3214 FRAME_PTR *fp; 3117 enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y,
3215 int insist; 3118 unsigned long *time)
3216 Lisp_Object *bar_window;
3217 enum scroll_bar_part *part;
3218 Lisp_Object *x, *y;
3219 unsigned long *time;
3220{ 3119{
3221 FRAME_PTR f1; 3120 FRAME_PTR f1;
3222 3121
@@ -3307,9 +3206,7 @@ w32_mouse_position (fp, insist, bar_window, part, x, y, time)
3307 or ButtonRelase. */ 3206 or ButtonRelase. */
3308 3207
3309static void 3208static void
3310w32_handle_tool_bar_click (f, button_event) 3209w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event)
3311 struct frame *f;
3312 struct input_event *button_event;
3313{ 3210{
3314 int x = XFASTINT (button_event->x); 3211 int x = XFASTINT (button_event->x);
3315 int y = XFASTINT (button_event->y); 3212 int y = XFASTINT (button_event->y);
@@ -3334,8 +3231,7 @@ w32_handle_tool_bar_click (f, button_event)
3334 bits. */ 3231 bits. */
3335 3232
3336static struct scroll_bar * 3233static struct scroll_bar *
3337x_window_to_scroll_bar (window_id) 3234x_window_to_scroll_bar (Window window_id)
3338 Window window_id;
3339{ 3235{
3340 Lisp_Object tail; 3236 Lisp_Object tail;
3341 3237
@@ -3371,9 +3267,8 @@ x_window_to_scroll_bar (window_id)
3371 displaying PORTION out of a whole WHOLE, and our position POSITION. */ 3267 displaying PORTION out of a whole WHOLE, and our position POSITION. */
3372 3268
3373static void 3269static void
3374w32_set_scroll_bar_thumb (bar, portion, position, whole) 3270w32_set_scroll_bar_thumb (struct scroll_bar *bar,
3375 struct scroll_bar *bar; 3271 int portion, int position, int whole)
3376 int portion, position, whole;
3377{ 3272{
3378 Window w = SCROLL_BAR_W32_WINDOW (bar); 3273 Window w = SCROLL_BAR_W32_WINDOW (bar);
3379 /* We use the whole scroll-bar height in the calculations below, to 3274 /* We use the whole scroll-bar height in the calculations below, to
@@ -3448,9 +3343,7 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole)
3448 ************************************************************************/ 3343 ************************************************************************/
3449 3344
3450static HWND 3345static HWND
3451my_create_scrollbar (f, bar) 3346my_create_scrollbar (struct frame * f, struct scroll_bar * bar)
3452 struct frame * f;
3453 struct scroll_bar * bar;
3454{ 3347{
3455 return (HWND) SendMessage (FRAME_W32_WINDOW (f), 3348 return (HWND) SendMessage (FRAME_W32_WINDOW (f),
3456 WM_EMACS_CREATESCROLLBAR, (WPARAM) f, 3349 WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
@@ -3489,26 +3382,21 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter,
3489} 3382}
3490 3383
3491static void 3384static void
3492my_set_focus (f, hwnd) 3385my_set_focus (struct frame * f, HWND hwnd)
3493 struct frame * f;
3494 HWND hwnd;
3495{ 3386{
3496 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS, 3387 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS,
3497 (WPARAM) hwnd, 0); 3388 (WPARAM) hwnd, 0);
3498} 3389}
3499 3390
3500static void 3391static void
3501my_set_foreground_window (hwnd) 3392my_set_foreground_window (HWND hwnd)
3502 HWND hwnd;
3503{ 3393{
3504 SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0); 3394 SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0);
3505} 3395}
3506 3396
3507 3397
3508static void 3398static void
3509my_destroy_window (f, hwnd) 3399my_destroy_window (struct frame * f, HWND hwnd)
3510 struct frame * f;
3511 HWND hwnd;
3512{ 3400{
3513 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW, 3401 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW,
3514 (WPARAM) hwnd, 0); 3402 (WPARAM) hwnd, 0);
@@ -3520,9 +3408,7 @@ my_destroy_window (f, hwnd)
3520 scroll bar. */ 3408 scroll bar. */
3521 3409
3522static struct scroll_bar * 3410static struct scroll_bar *
3523x_scroll_bar_create (w, top, left, width, height) 3411x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
3524 struct window *w;
3525 int top, left, width, height;
3526{ 3412{
3527 struct frame *f = XFRAME (WINDOW_FRAME (w)); 3413 struct frame *f = XFRAME (WINDOW_FRAME (w));
3528 HWND hwnd; 3414 HWND hwnd;
@@ -3575,8 +3461,7 @@ x_scroll_bar_create (w, top, left, width, height)
3575 nil. */ 3461 nil. */
3576 3462
3577static void 3463static void
3578x_scroll_bar_remove (bar) 3464x_scroll_bar_remove (struct scroll_bar *bar)
3579 struct scroll_bar *bar;
3580{ 3465{
3581 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 3466 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
3582 3467
@@ -3596,9 +3481,8 @@ x_scroll_bar_remove (bar)
3596 characters, starting at POSITION. If WINDOW has no scroll bar, 3481 characters, starting at POSITION. If WINDOW has no scroll bar,
3597 create one. */ 3482 create one. */
3598static void 3483static void
3599w32_set_vertical_scroll_bar (w, portion, whole, position) 3484w32_set_vertical_scroll_bar (struct window *w,
3600 struct window *w; 3485 int portion, int whole, int position)
3601 int portion, whole, position;
3602{ 3486{
3603 struct frame *f = XFRAME (w->frame); 3487 struct frame *f = XFRAME (w->frame);
3604 struct scroll_bar *bar; 3488 struct scroll_bar *bar;
@@ -3741,8 +3625,7 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
3741 `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ 3625 `*redeem_scroll_bar_hook' is applied to its window before the judgment. */
3742 3626
3743static void 3627static void
3744w32_condemn_scroll_bars (frame) 3628w32_condemn_scroll_bars (FRAME_PTR frame)
3745 FRAME_PTR frame;
3746{ 3629{
3747 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ 3630 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */
3748 while (! NILP (FRAME_SCROLL_BARS (frame))) 3631 while (! NILP (FRAME_SCROLL_BARS (frame)))
@@ -3763,8 +3646,7 @@ w32_condemn_scroll_bars (frame)
3763 Note that WINDOW isn't necessarily condemned at all. */ 3646 Note that WINDOW isn't necessarily condemned at all. */
3764 3647
3765static void 3648static void
3766w32_redeem_scroll_bar (window) 3649w32_redeem_scroll_bar (struct window *window)
3767 struct window *window;
3768{ 3650{
3769 struct scroll_bar *bar; 3651 struct scroll_bar *bar;
3770 struct frame *f; 3652 struct frame *f;
@@ -3809,8 +3691,7 @@ w32_redeem_scroll_bar (window)
3809 last call to `*condemn_scroll_bars_hook'. */ 3691 last call to `*condemn_scroll_bars_hook'. */
3810 3692
3811static void 3693static void
3812w32_judge_scroll_bars (f) 3694w32_judge_scroll_bars (FRAME_PTR f)
3813 FRAME_PTR f;
3814{ 3695{
3815 Lisp_Object bar, next; 3696 Lisp_Object bar, next;
3816 3697
@@ -3841,10 +3722,8 @@ w32_judge_scroll_bars (f)
3841 mark bits. */ 3722 mark bits. */
3842 3723
3843static int 3724static int
3844w32_scroll_bar_handle_click (bar, msg, emacs_event) 3725w32_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg,
3845 struct scroll_bar *bar; 3726 struct input_event *emacs_event)
3846 W32Msg *msg;
3847 struct input_event *emacs_event;
3848{ 3727{
3849 if (! WINDOWP (bar->window)) 3728 if (! WINDOWP (bar->window))
3850 abort (); 3729 abort ();
@@ -3950,12 +3829,10 @@ w32_scroll_bar_handle_click (bar, msg, emacs_event)
3950 on the scroll bar. */ 3829 on the scroll bar. */
3951 3830
3952static void 3831static void
3953x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) 3832x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window,
3954 FRAME_PTR *fp; 3833 enum scroll_bar_part *part,
3955 Lisp_Object *bar_window; 3834 Lisp_Object *x, Lisp_Object *y,
3956 enum scroll_bar_part *part; 3835 unsigned long *time)
3957 Lisp_Object *x, *y;
3958 unsigned long *time;
3959{ 3836{
3960 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); 3837 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
3961 Window w = SCROLL_BAR_W32_WINDOW (bar); 3838 Window w = SCROLL_BAR_W32_WINDOW (bar);
@@ -4011,8 +3888,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
4011 redraw them. */ 3888 redraw them. */
4012 3889
4013void 3890void
4014x_scroll_bar_clear (f) 3891x_scroll_bar_clear (FRAME_PTR f)
4015 FRAME_PTR f;
4016{ 3892{
4017 Lisp_Object bar; 3893 Lisp_Object bar;
4018 3894
@@ -4071,10 +3947,8 @@ static char dbcs_lead = 0;
4071*/ 3947*/
4072 3948
4073int 3949int
4074w32_read_socket (sd, expected, hold_quit) 3950w32_read_socket (struct terminal *terminal, int expected,
4075 register int sd; 3951 struct input_event *hold_quit)
4076 int expected;
4077 struct input_event *hold_quit;
4078{ 3952{
4079 int count = 0; 3953 int count = 0;
4080 int check_visibility = 0; 3954 int check_visibility = 0;
@@ -4903,11 +4777,7 @@ w32_read_socket (sd, expected, hold_quit)
4903 mode lines must be clipped to the whole window. */ 4777 mode lines must be clipped to the whole window. */
4904 4778
4905static void 4779static void
4906w32_clip_to_row (w, row, area, hdc) 4780w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc)
4907 struct window *w;
4908 struct glyph_row *row;
4909 int area;
4910 HDC hdc;
4911{ 4781{
4912 struct frame *f = XFRAME (WINDOW_FRAME (w)); 4782 struct frame *f = XFRAME (WINDOW_FRAME (w));
4913 RECT clip_rect; 4783 RECT clip_rect;
@@ -4928,9 +4798,7 @@ w32_clip_to_row (w, row, area, hdc)
4928/* Draw a hollow box cursor on window W in glyph row ROW. */ 4798/* Draw a hollow box cursor on window W in glyph row ROW. */
4929 4799
4930static void 4800static void
4931x_draw_hollow_cursor (w, row) 4801x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
4932 struct window *w;
4933 struct glyph_row *row;
4934{ 4802{
4935 struct frame *f = XFRAME (WINDOW_FRAME (w)); 4803 struct frame *f = XFRAME (WINDOW_FRAME (w));
4936 HDC hdc; 4804 HDC hdc;
@@ -4970,11 +4838,8 @@ x_draw_hollow_cursor (w, row)
4970 --gerd. */ 4838 --gerd. */
4971 4839
4972static void 4840static void
4973x_draw_bar_cursor (w, row, width, kind) 4841x_draw_bar_cursor (struct window *w, struct glyph_row *row,
4974 struct window *w; 4842 int width, enum text_cursor_kinds kind)
4975 struct glyph_row *row;
4976 int width;
4977 enum text_cursor_kinds kind;
4978{ 4843{
4979 struct frame *f = XFRAME (w->frame); 4844 struct frame *f = XFRAME (w->frame);
4980 struct glyph *cursor_glyph; 4845 struct glyph *cursor_glyph;
@@ -5053,9 +4918,7 @@ x_draw_bar_cursor (w, row, width, kind)
5053/* RIF: Define cursor CURSOR on frame F. */ 4918/* RIF: Define cursor CURSOR on frame F. */
5054 4919
5055static void 4920static void
5056w32_define_frame_cursor (f, cursor) 4921w32_define_frame_cursor (struct frame *f, Cursor cursor)
5057 struct frame *f;
5058 Cursor cursor;
5059{ 4922{
5060 w32_define_cursor (FRAME_W32_WINDOW (f), cursor); 4923 w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
5061} 4924}
@@ -5064,9 +4927,7 @@ w32_define_frame_cursor (f, cursor)
5064/* RIF: Clear area on frame F. */ 4927/* RIF: Clear area on frame F. */
5065 4928
5066static void 4929static void
5067w32_clear_frame_area (f, x, y, width, height) 4930w32_clear_frame_area (struct frame *f, int x, int y, int width, int height)
5068 struct frame *f;
5069 int x, y, width, height;
5070{ 4931{
5071 HDC hdc; 4932 HDC hdc;
5072 4933
@@ -5078,12 +4939,9 @@ w32_clear_frame_area (f, x, y, width, height)
5078/* RIF: Draw or clear cursor on window W. */ 4939/* RIF: Draw or clear cursor on window W. */
5079 4940
5080static void 4941static void
5081w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p) 4942w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
5082 struct window *w; 4943 int x, int y, int cursor_type, int cursor_width,
5083 struct glyph_row *glyph_row; 4944 int on_p, int active_p)
5084 int x, y;
5085 int cursor_type, cursor_width;
5086 int on_p, active_p;
5087{ 4945{
5088 if (on_p) 4946 if (on_p)
5089 { 4947 {
@@ -5178,9 +5036,7 @@ w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, act
5178/* Icons. */ 5036/* Icons. */
5179 5037
5180int 5038int
5181x_bitmap_icon (f, icon) 5039x_bitmap_icon (struct frame *f, Lisp_Object icon)
5182 struct frame *f;
5183 Lisp_Object icon;
5184{ 5040{
5185 HANDLE main_icon; 5041 HANDLE main_icon;
5186 HANDLE small_icon = NULL; 5042 HANDLE small_icon = NULL;
@@ -5269,10 +5125,7 @@ x_io_error_quitter (display)
5269/* Changing the font of the frame. */ 5125/* Changing the font of the frame. */
5270 5126
5271Lisp_Object 5127Lisp_Object
5272x_new_font (f, font_object, fontset) 5128x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
5273 struct frame *f;
5274 Lisp_Object font_object;
5275 int fontset;
5276{ 5129{
5277 struct font *font = XFONT_OBJECT (font_object); 5130 struct font *font = XFONT_OBJECT (font_object);
5278 5131
@@ -5340,8 +5193,7 @@ xim_close_dpy (dpyinfo)
5340 from its current recorded position values and gravity. */ 5193 from its current recorded position values and gravity. */
5341 5194
5342void 5195void
5343x_calc_absolute_position (f) 5196x_calc_absolute_position (struct frame *f)
5344 struct frame *f;
5345{ 5197{
5346 int flags = f->size_hint_flags; 5198 int flags = f->size_hint_flags;
5347 5199
@@ -5401,10 +5253,8 @@ x_calc_absolute_position (f)
5401 which means, do adjust for borders but don't change the gravity. */ 5253 which means, do adjust for borders but don't change the gravity. */
5402 5254
5403void 5255void
5404x_set_offset (f, xoff, yoff, change_gravity) 5256x_set_offset (struct frame *f, register int xoff, register int yoff,
5405 struct frame *f; 5257 int change_gravity)
5406 register int xoff, yoff;
5407 int change_gravity;
5408{ 5258{
5409 int modified_top, modified_left; 5259 int modified_top, modified_left;
5410 5260
@@ -5439,8 +5289,7 @@ x_set_offset (f, xoff, yoff, change_gravity)
5439/* Check if we need to resize the frame due to a fullscreen request. 5289/* Check if we need to resize the frame due to a fullscreen request.
5440 If so needed, resize the frame. */ 5290 If so needed, resize the frame. */
5441static void 5291static void
5442x_check_fullscreen (f) 5292x_check_fullscreen (struct frame *f)
5443 struct frame *f;
5444{ 5293{
5445 if (f->want_fullscreen & FULLSCREEN_BOTH) 5294 if (f->want_fullscreen & FULLSCREEN_BOTH)
5446 { 5295 {
@@ -5470,10 +5319,7 @@ x_check_fullscreen (f)
5470 Otherwise we leave the window gravity unchanged. */ 5319 Otherwise we leave the window gravity unchanged. */
5471 5320
5472void 5321void
5473x_set_window_size (f, change_gravity, cols, rows) 5322x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
5474 struct frame *f;
5475 int change_gravity;
5476 int cols, rows;
5477{ 5323{
5478 int pixelwidth, pixelheight; 5324 int pixelwidth, pixelheight;
5479 5325
@@ -5565,9 +5411,7 @@ x_set_window_size (f, change_gravity, cols, rows)
5565void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); 5411void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
5566 5412
5567void 5413void
5568x_set_mouse_position (f, x, y) 5414x_set_mouse_position (struct frame *f, int x, int y)
5569 struct frame *f;
5570 int x, y;
5571{ 5415{
5572 int pix_x, pix_y; 5416 int pix_x, pix_y;
5573 5417
@@ -5584,9 +5428,7 @@ x_set_mouse_position (f, x, y)
5584} 5428}
5585 5429
5586void 5430void
5587x_set_mouse_pixel_position (f, pix_x, pix_y) 5431x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
5588 struct frame *f;
5589 int pix_x, pix_y;
5590{ 5432{
5591 RECT rect; 5433 RECT rect;
5592 POINT pt; 5434 POINT pt;
@@ -5607,8 +5449,7 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
5607/* focus shifting, raising and lowering. */ 5449/* focus shifting, raising and lowering. */
5608 5450
5609void 5451void
5610x_focus_on_frame (f) 5452x_focus_on_frame (struct frame *f)
5611 struct frame *f;
5612{ 5453{
5613 struct w32_display_info *dpyinfo = &one_w32_display_info; 5454 struct w32_display_info *dpyinfo = &one_w32_display_info;
5614 5455
@@ -5625,15 +5466,13 @@ x_focus_on_frame (f)
5625} 5466}
5626 5467
5627void 5468void
5628x_unfocus_frame (f) 5469x_unfocus_frame (struct frame *f)
5629 struct frame *f;
5630{ 5470{
5631} 5471}
5632 5472
5633/* Raise frame F. */ 5473/* Raise frame F. */
5634void 5474void
5635x_raise_frame (f) 5475x_raise_frame (struct frame *f)
5636 struct frame *f;
5637{ 5476{
5638 BLOCK_INPUT; 5477 BLOCK_INPUT;
5639 5478
@@ -5692,8 +5531,7 @@ x_raise_frame (f)
5692 5531
5693/* Lower frame F. */ 5532/* Lower frame F. */
5694void 5533void
5695x_lower_frame (f) 5534x_lower_frame (struct frame *f)
5696 struct frame *f;
5697{ 5535{
5698 BLOCK_INPUT; 5536 BLOCK_INPUT;
5699 my_set_window_pos (FRAME_W32_WINDOW (f), 5537 my_set_window_pos (FRAME_W32_WINDOW (f),
@@ -5704,9 +5542,7 @@ x_lower_frame (f)
5704} 5542}
5705 5543
5706static void 5544static void
5707w32_frame_raise_lower (f, raise_flag) 5545w32_frame_raise_lower (FRAME_PTR f, int raise_flag)
5708 FRAME_PTR f;
5709 int raise_flag;
5710{ 5546{
5711 if (! FRAME_W32_P (f)) 5547 if (! FRAME_W32_P (f))
5712 return; 5548 return;
@@ -5727,8 +5563,7 @@ w32_frame_raise_lower (f, raise_flag)
5727 finishes with it. */ 5563 finishes with it. */
5728 5564
5729void 5565void
5730x_make_frame_visible (f) 5566x_make_frame_visible (struct frame *f)
5731 struct frame *f;
5732{ 5567{
5733 Lisp_Object type; 5568 Lisp_Object type;
5734 5569
@@ -5820,8 +5655,8 @@ x_make_frame_visible (f)
5820 5655
5821/* Make the frame visible (mapped and not iconified). */ 5656/* Make the frame visible (mapped and not iconified). */
5822 5657
5823x_make_frame_invisible (f) 5658void
5824 struct frame *f; 5659x_make_frame_invisible (struct frame *f)
5825{ 5660{
5826 /* Don't keep the highlight on an invisible frame. */ 5661 /* Don't keep the highlight on an invisible frame. */
5827 if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f) 5662 if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f)
@@ -5847,8 +5682,7 @@ x_make_frame_invisible (f)
5847/* Change window state from mapped to iconified. */ 5682/* Change window state from mapped to iconified. */
5848 5683
5849void 5684void
5850x_iconify_frame (f) 5685x_iconify_frame (struct frame *f)
5851 struct frame *f;
5852{ 5686{
5853 Lisp_Object type; 5687 Lisp_Object type;
5854 5688
@@ -5934,8 +5768,7 @@ x_free_frame_resources (f)
5934 5768
5935/* Destroy the window of frame F. */ 5769/* Destroy the window of frame F. */
5936void 5770void
5937x_destroy_window (f) 5771x_destroy_window (struct frame *f)
5938 struct frame *f;
5939{ 5772{
5940 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 5773 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
5941 5774
@@ -5952,10 +5785,7 @@ x_destroy_window (f)
5952 If USER_POSITION is nonzero, we set the USPosition 5785 If USER_POSITION is nonzero, we set the USPosition
5953 flag (this is useful when FLAGS is 0). */ 5786 flag (this is useful when FLAGS is 0). */
5954void 5787void
5955x_wm_set_size_hint (f, flags, user_position) 5788x_wm_set_size_hint (struct frame *f, long flags, int user_position)
5956 struct frame *f;
5957 long flags;
5958 int user_position;
5959{ 5789{
5960 Window window = FRAME_W32_WINDOW (f); 5790 Window window = FRAME_W32_WINDOW (f);
5961 5791
@@ -5971,9 +5801,7 @@ x_wm_set_size_hint (f, flags, user_position)
5971 5801
5972/* Window manager things */ 5802/* Window manager things */
5973void 5803void
5974x_wm_set_icon_position (f, icon_x, icon_y) 5804x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y)
5975 struct frame *f;
5976 int icon_x, icon_y;
5977{ 5805{
5978#if 0 5806#if 0
5979 Window window = FRAME_W32_WINDOW (f); 5807 Window window = FRAME_W32_WINDOW (f);
@@ -5994,8 +5822,7 @@ x_wm_set_icon_position (f, icon_x, icon_y)
5994static int w32_initialized = 0; 5822static int w32_initialized = 0;
5995 5823
5996void 5824void
5997w32_initialize_display_info (display_name) 5825w32_initialize_display_info (Lisp_Object display_name)
5998 Lisp_Object display_name;
5999{ 5826{
6000 struct w32_display_info *dpyinfo = &one_w32_display_info; 5827 struct w32_display_info *dpyinfo = &one_w32_display_info;
6001 5828
@@ -6048,8 +5875,7 @@ w32_initialize_display_info (display_name)
6048 but any whitespace following value is not removed. */ 5875 but any whitespace following value is not removed. */
6049 5876
6050static char * 5877static char *
6051w32_make_rdb (xrm_option) 5878w32_make_rdb (char *xrm_option)
6052 char *xrm_option;
6053{ 5879{
6054 char *buffer = xmalloc (strlen (xrm_option) + 2); 5880 char *buffer = xmalloc (strlen (xrm_option) + 2);
6055 char *current = buffer; 5881 char *current = buffer;
@@ -6208,10 +6034,7 @@ x_delete_terminal (struct terminal *terminal)
6208} 6034}
6209 6035
6210struct w32_display_info * 6036struct w32_display_info *
6211w32_term_init (display_name, xrm_option, resource_name) 6037w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
6212 Lisp_Object display_name;
6213 char *xrm_option;
6214 char *resource_name;
6215{ 6038{
6216 struct w32_display_info *dpyinfo; 6039 struct w32_display_info *dpyinfo;
6217 struct terminal *terminal; 6040 struct terminal *terminal;
@@ -6286,8 +6109,7 @@ w32_term_init (display_name, xrm_option, resource_name)
6286 6109
6287/* Get rid of display DPYINFO, assuming all frames are already gone. */ 6110/* Get rid of display DPYINFO, assuming all frames are already gone. */
6288void 6111void
6289x_delete_display (dpyinfo) 6112x_delete_display (struct w32_display_info *dpyinfo)
6290 struct w32_display_info *dpyinfo;
6291{ 6113{
6292 /* Discard this display from w32_display_name_list and w32_display_list. 6114 /* Discard this display from w32_display_name_list and w32_display_list.
6293 We can't use Fdelq because that can quit. */ 6115 We can't use Fdelq because that can quit. */
@@ -6335,7 +6157,7 @@ x_delete_display (dpyinfo)
6335DWORD WINAPI w32_msg_worker (void * arg); 6157DWORD WINAPI w32_msg_worker (void * arg);
6336 6158
6337static void 6159static void
6338w32_initialize () 6160w32_initialize (void)
6339{ 6161{
6340 HANDLE shell; 6162 HANDLE shell;
6341 HRESULT (WINAPI * set_user_model) (wchar_t * id); 6163 HRESULT (WINAPI * set_user_model) (wchar_t * id);
@@ -6438,7 +6260,7 @@ w32_initialize ()
6438} 6260}
6439 6261
6440void 6262void
6441syms_of_w32term () 6263syms_of_w32term (void)
6442{ 6264{
6443 staticpro (&w32_display_name_list); 6265 staticpro (&w32_display_name_list);
6444 w32_display_name_list = Qnil; 6266 w32_display_name_list = Qnil;