aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2002-11-08 08:42:03 +0000
committerJuanma Barranquero2002-11-08 08:42:03 +0000
commitd67d16270c5b2f9f5f202be4d9747aefcd99ba43 (patch)
treea60df5e0a0104607e1560bc40596dcbd21072f8b
parent6c1b363d03ff89f46025475c315a18d41fbe4740 (diff)
downloademacs-d67d16270c5b2f9f5f202be4d9747aefcd99ba43.tar.gz
emacs-d67d16270c5b2f9f5f202be4d9747aefcd99ba43.zip
(w32_draw_fringe_bitmap): Remove unused local variable window.
-rw-r--r--src/w32term.c537
1 files changed, 268 insertions, 269 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 55ce9d62391..313f9348ce1 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -155,7 +155,7 @@ Lisp_Object Vx_toolkit_scroll_bars;
155 155
156/* If a string, w32_read_socket generates an event to display that string. 156/* If a string, w32_read_socket generates an event to display that string.
157 (The display is done in read_char.) */ 157 (The display is done in read_char.) */
158 158
159static Lisp_Object help_echo; 159static Lisp_Object help_echo;
160static Lisp_Object help_echo_window; 160static Lisp_Object help_echo_window;
161static Lisp_Object help_echo_object; 161static Lisp_Object help_echo_object;
@@ -415,7 +415,7 @@ static void x_erase_phys_cursor P_ ((struct window *));
415void x_display_cursor P_ ((struct window *w, int, int, int, int, int)); 415void x_display_cursor P_ ((struct window *w, int, int, int, int, int));
416void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int)); 416void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int));
417static void w32_draw_fringe_bitmap P_ ((struct window *, HDC hdc, 417static void w32_draw_fringe_bitmap P_ ((struct window *, HDC hdc,
418 struct glyph_row *, 418 struct glyph_row *,
419 enum fringe_bitmap_type, int left_p)); 419 enum fringe_bitmap_type, int left_p));
420static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, 420static void w32_clip_to_row P_ ((struct window *, struct glyph_row *,
421 HDC, int)); 421 HDC, int));
@@ -438,7 +438,7 @@ static Lisp_Object Qvendor_specific_keysyms;
438/* This is a function useful for recording debugging information about 438/* This is a function useful for recording debugging information about
439 the sequence of occurrences in this file. */ 439 the sequence of occurrences in this file. */
440 440
441struct record 441struct record
442{ 442{
443 char *locus; 443 char *locus;
444 int type; 444 int type;
@@ -527,7 +527,7 @@ w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y,
527} 527}
528 528
529/* Draw a filled rectangle at the specified position. */ 529/* Draw a filled rectangle at the specified position. */
530void 530void
531w32_fill_rect (f, hdc, pix, lprect) 531w32_fill_rect (f, hdc, pix, lprect)
532 FRAME_PTR f; 532 FRAME_PTR f;
533 HDC hdc; 533 HDC hdc;
@@ -541,7 +541,7 @@ w32_fill_rect (f, hdc, pix, lprect)
541 DeleteObject (hb); 541 DeleteObject (hb);
542} 542}
543 543
544void 544void
545w32_clear_window (f) 545w32_clear_window (f)
546 FRAME_PTR f; 546 FRAME_PTR f;
547{ 547{
@@ -564,7 +564,7 @@ w32_clear_window (f)
564/*********************************************************************** 564/***********************************************************************
565 Starting and ending an update 565 Starting and ending an update
566 ***********************************************************************/ 566 ***********************************************************************/
567 567
568/* Start an update of frame F. This function is installed as a hook 568/* Start an update of frame F. This function is installed as a hook
569 for update_begin, i.e. it is called when update_begin is called. 569 for update_begin, i.e. it is called when update_begin is called.
570 This function is called prior to calls to x_update_window_begin for 570 This function is called prior to calls to x_update_window_begin for
@@ -625,7 +625,7 @@ x_update_window_begin (w)
625 flag set. So, rows containing mouse-face glyphs are never 625 flag set. So, rows containing mouse-face glyphs are never
626 scrolled, and we don't have to switch the mouse highlight off 626 scrolled, and we don't have to switch the mouse highlight off
627 here to prevent it from being scrolled. */ 627 here to prevent it from being scrolled. */
628 628
629 /* Can we tell that this update does not affect the window 629 /* Can we tell that this update does not affect the window
630 where the mouse highlight is? If so, no need to turn off. 630 where the mouse highlight is? If so, no need to turn off.
631 Likewise, don't do anything if the frame is garbaged; 631 Likewise, don't do anything if the frame is garbaged;
@@ -658,7 +658,7 @@ x_draw_vertical_border (w)
658 struct window *w; 658 struct window *w;
659{ 659{
660 struct frame *f = XFRAME (WINDOW_FRAME (w)); 660 struct frame *f = XFRAME (WINDOW_FRAME (w));
661 661
662 /* Redraw borders between horizontally adjacent windows. Don't 662 /* Redraw borders between horizontally adjacent windows. Don't
663 do it for frames with vertical scroll bars because either the 663 do it for frames with vertical scroll bars because either the
664 right scroll bar of a window, or the left scroll bar of its 664 right scroll bar of a window, or the left scroll bar of its
@@ -681,7 +681,7 @@ x_draw_vertical_border (w)
681 } 681 }
682} 682}
683 683
684 684
685/* End update of window W (which is equal to updated_window). 685/* End update of window W (which is equal to updated_window).
686 686
687 Draw vertical borders between horizontally adjacent windows, and 687 Draw vertical borders between horizontally adjacent windows, and
@@ -711,7 +711,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
711 x_display_and_set_cursor (w, 1, output_cursor.hpos, 711 x_display_and_set_cursor (w, 1, output_cursor.hpos,
712 output_cursor.vpos, 712 output_cursor.vpos,
713 output_cursor.x, output_cursor.y); 713 output_cursor.x, output_cursor.y);
714 714
715 x_draw_vertical_border (w); 715 x_draw_vertical_border (w);
716 UNBLOCK_INPUT; 716 UNBLOCK_INPUT;
717 } 717 }
@@ -792,7 +792,7 @@ x_after_update_window_line (desired_row)
792 int width, height; 792 int width, height;
793 793
794 xassert (w); 794 xassert (w);
795 795
796 if (!desired_row->mode_line_p && !w->pseudo_window_p) 796 if (!desired_row->mode_line_p && !w->pseudo_window_p)
797 { 797 {
798 BLOCK_INPUT; 798 BLOCK_INPUT;
@@ -847,7 +847,6 @@ w32_draw_fringe_bitmap (w, hdc, row, which, left_p)
847 int left_p; 847 int left_p;
848{ 848{
849 struct frame *f = XFRAME (WINDOW_FRAME (w)); 849 struct frame *f = XFRAME (WINDOW_FRAME (w));
850 Window window = FRAME_W32_WINDOW (f);
851 HDC compat_hdc; 850 HDC compat_hdc;
852 int x, y, wd, h, dy; 851 int x, y, wd, h, dy;
853 int b1, b2; 852 int b1, b2;
@@ -873,13 +872,13 @@ w32_draw_fringe_bitmap (w, hdc, row, which, left_p)
873 h = left_height; 872 h = left_height;
874 pixmap = left_bmp; 873 pixmap = left_bmp;
875 break; 874 break;
876 875
877 case OVERLAY_ARROW_BITMAP: 876 case OVERLAY_ARROW_BITMAP:
878 wd = ov_width; 877 wd = ov_width;
879 h = ov_height; 878 h = ov_height;
880 pixmap = ov_bmp; 879 pixmap = ov_bmp;
881 break; 880 break;
882 881
883 case RIGHT_TRUNCATION_BITMAP: 882 case RIGHT_TRUNCATION_BITMAP:
884 wd = right_width; 883 wd = right_width;
885 h = right_height; 884 h = right_height;
@@ -891,7 +890,7 @@ w32_draw_fringe_bitmap (w, hdc, row, which, left_p)
891 h = continued_height; 890 h = continued_height;
892 pixmap = continued_bmp; 891 pixmap = continued_bmp;
893 break; 892 break;
894 893
895 case CONTINUATION_LINE_BITMAP: 894 case CONTINUATION_LINE_BITMAP:
896 wd = continuation_width; 895 wd = continuation_width;
897 h = continuation_height; 896 h = continuation_height;
@@ -959,7 +958,7 @@ w32_draw_fringe_bitmap (w, hdc, row, which, left_p)
959 if (b1 >= 0) 958 if (b1 >= 0)
960 { 959 {
961 int header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); 960 int header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
962 961
963 w32_fill_area (f, hdc, face->background, 962 w32_fill_area (f, hdc, face->background,
964 b1, 963 b1,
965 WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, 964 WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
@@ -1087,7 +1086,7 @@ set_output_cursor (cursor)
1087 1086
1088 HPOS and VPOS are column/row positions in a window glyph matrix. X 1087 HPOS and VPOS are column/row positions in a window glyph matrix. X
1089 and Y are window text area relative pixel positions. 1088 and Y are window text area relative pixel positions.
1090 1089
1091 If this is done during an update, updated_window will contain the 1090 If this is done during an update, updated_window will contain the
1092 window that is being updated and the position is the future output 1091 window that is being updated and the position is the future output
1093 cursor position for that window. If updated_window is null, use 1092 cursor position for that window. If updated_window is null, use
@@ -1385,7 +1384,7 @@ int w32_font_is_double_byte (XFontStruct *font)
1385} 1384}
1386 1385
1387 1386
1388static BOOL 1387static BOOL
1389w32_use_unicode_for_codepage (codepage) 1388w32_use_unicode_for_codepage (codepage)
1390 int codepage; 1389 int codepage;
1391{ 1390{
@@ -1449,11 +1448,11 @@ w32_encode_char (c, char2b, font_info, two_byte_p)
1449 /* Fixed encoding scheme. See fontset.h for the meaning of the 1448 /* Fixed encoding scheme. See fontset.h for the meaning of the
1450 encoding numbers. */ 1449 encoding numbers. */
1451 int enc = font_info->encoding[charset]; 1450 int enc = font_info->encoding[charset];
1452 1451
1453 if ((enc == 1 || enc == 2) 1452 if ((enc == 1 || enc == 2)
1454 && CHARSET_DIMENSION (charset) == 2) 1453 && CHARSET_DIMENSION (charset) == 2)
1455 *char2b = BUILD_WCHAR_T (BYTE1 (*char2b) | 0x80, BYTE2 (*char2b)); 1454 *char2b = BUILD_WCHAR_T (BYTE1 (*char2b) | 0x80, BYTE2 (*char2b));
1456 1455
1457 if (enc == 1 || enc == 3 1456 if (enc == 1 || enc == 3
1458 || (enc == 4 && CHARSET_DIMENSION (charset) == 1)) 1457 || (enc == 4 && CHARSET_DIMENSION (charset) == 1))
1459 *char2b = BUILD_WCHAR_T (BYTE1 (*char2b), BYTE2 (*char2b) | 0x80); 1458 *char2b = BUILD_WCHAR_T (BYTE1 (*char2b), BYTE2 (*char2b) | 0x80);
@@ -1531,7 +1530,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p)
1531 else 1530 else
1532 { 1531 {
1533 int c1, c2, charset; 1532 int c1, c2, charset;
1534 1533
1535 /* Split characters into bytes. If c2 is -1 afterwards, C is 1534 /* Split characters into bytes. If c2 is -1 afterwards, C is
1536 really a one-byte character so that byte1 is zero. */ 1535 really a one-byte character so that byte1 is zero. */
1537 SPLIT_CHAR (c, charset, c1, c2); 1536 SPLIT_CHAR (c, charset, c1, c2);
@@ -1539,7 +1538,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p)
1539 *char2b = BUILD_WCHAR_T (c1, c2); 1538 *char2b = BUILD_WCHAR_T (c1, c2);
1540 else 1539 else
1541 *char2b = BUILD_WCHAR_T (0, c1); 1540 *char2b = BUILD_WCHAR_T (0, c1);
1542 1541
1543 /* Maybe encode the character in *CHAR2B. */ 1542 /* Maybe encode the character in *CHAR2B. */
1544 if (face->font != NULL) 1543 if (face->font != NULL)
1545 { 1544 {
@@ -1553,7 +1552,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p)
1553 /* Make sure X resources of the face are allocated. */ 1552 /* Make sure X resources of the face are allocated. */
1554 xassert (face != NULL); 1553 xassert (face != NULL);
1555 PREPARE_FACE_FOR_DISPLAY (f, face); 1554 PREPARE_FACE_FOR_DISPLAY (f, face);
1556 1555
1557 return face; 1556 return face;
1558} 1557}
1559 1558
@@ -1595,7 +1594,7 @@ x_get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
1595 else 1594 else
1596 { 1595 {
1597 int c1, c2, charset; 1596 int c1, c2, charset;
1598 1597
1599 /* Split characters into bytes. If c2 is -1 afterwards, C is 1598 /* Split characters into bytes. If c2 is -1 afterwards, C is
1600 really a one-byte character so that byte1 is zero. */ 1599 really a one-byte character so that byte1 is zero. */
1601 SPLIT_CHAR (glyph->u.ch, charset, c1, c2); 1600 SPLIT_CHAR (glyph->u.ch, charset, c1, c2);
@@ -1624,7 +1623,7 @@ x_get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
1624} 1623}
1625 1624
1626 1625
1627/* Store one glyph for IT->char_to_display in IT->glyph_row. 1626/* Store one glyph for IT->char_to_display in IT->glyph_row.
1628 Called from x_produce_glyphs when IT->glyph_row is non-null. */ 1627 Called from x_produce_glyphs when IT->glyph_row is non-null. */
1629 1628
1630static INLINE void 1629static INLINE void
@@ -1633,10 +1632,10 @@ x_append_glyph (it)
1633{ 1632{
1634 struct glyph *glyph; 1633 struct glyph *glyph;
1635 enum glyph_row_area area = it->area; 1634 enum glyph_row_area area = it->area;
1636 1635
1637 xassert (it->glyph_row); 1636 xassert (it->glyph_row);
1638 xassert (it->char_to_display != '\n' && it->char_to_display != '\t'); 1637 xassert (it->char_to_display != '\n' && it->char_to_display != '\t');
1639 1638
1640 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; 1639 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
1641 if (glyph < it->glyph_row->glyphs[area + 1]) 1640 if (glyph < it->glyph_row->glyphs[area + 1])
1642 { 1641 {
@@ -1659,7 +1658,7 @@ x_append_glyph (it)
1659 } 1658 }
1660} 1659}
1661 1660
1662/* Store one glyph for the composition IT->cmp_id in IT->glyph_row. 1661/* Store one glyph for the composition IT->cmp_id in IT->glyph_row.
1663 Called from x_produce_glyphs when IT->glyph_row is non-null. */ 1662 Called from x_produce_glyphs when IT->glyph_row is non-null. */
1664 1663
1665static INLINE void 1664static INLINE void
@@ -1668,9 +1667,9 @@ x_append_composite_glyph (it)
1668{ 1667{
1669 struct glyph *glyph; 1668 struct glyph *glyph;
1670 enum glyph_row_area area = it->area; 1669 enum glyph_row_area area = it->area;
1671 1670
1672 xassert (it->glyph_row); 1671 xassert (it->glyph_row);
1673 1672
1674 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; 1673 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
1675 if (glyph < it->glyph_row->glyphs[area + 1]) 1674 if (glyph < it->glyph_row->glyphs[area + 1])
1676 { 1675 {
@@ -1741,7 +1740,7 @@ x_produce_image_glyph (it)
1741 it->pixel_width = img->width + 2 * img->hmargin; 1740 it->pixel_width = img->width + 2 * img->hmargin;
1742 1741
1743 it->nglyphs = 1; 1742 it->nglyphs = 1;
1744 1743
1745 if (face->box != FACE_NO_BOX) 1744 if (face->box != FACE_NO_BOX)
1746 { 1745 {
1747 if (face->box_line_width > 0) 1746 if (face->box_line_width > 0)
@@ -1749,7 +1748,7 @@ x_produce_image_glyph (it)
1749 it->ascent += face->box_line_width; 1748 it->ascent += face->box_line_width;
1750 it->descent += face->box_line_width; 1749 it->descent += face->box_line_width;
1751 } 1750 }
1752 1751
1753 if (it->start_of_box_run_p) 1752 if (it->start_of_box_run_p)
1754 it->pixel_width += abs (face->box_line_width); 1753 it->pixel_width += abs (face->box_line_width);
1755 if (it->end_of_box_run_p) 1754 if (it->end_of_box_run_p)
@@ -1757,12 +1756,12 @@ x_produce_image_glyph (it)
1757 } 1756 }
1758 1757
1759 take_vertical_position_into_account (it); 1758 take_vertical_position_into_account (it);
1760 1759
1761 if (it->glyph_row) 1760 if (it->glyph_row)
1762 { 1761 {
1763 struct glyph *glyph; 1762 struct glyph *glyph;
1764 enum glyph_row_area area = it->area; 1763 enum glyph_row_area area = it->area;
1765 1764
1766 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; 1765 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
1767 if (glyph < it->glyph_row->glyphs[area + 1]) 1766 if (glyph < it->glyph_row->glyphs[area + 1])
1768 { 1767 {
@@ -1787,10 +1786,10 @@ x_produce_image_glyph (it)
1787 1786
1788 1787
1789/* Append a stretch glyph to IT->glyph_row. OBJECT is the source 1788/* Append a stretch glyph to IT->glyph_row. OBJECT is the source
1790 of the glyph, WIDTH and HEIGHT are the width and height of the 1789 of the glyph, WIDTH and HEIGHT are the width and height of the
1791 stretch. ASCENT is the percentage/100 of HEIGHT to use for the 1790 stretch. ASCENT is the percentage/100 of HEIGHT to use for the
1792 ascent of the glyph (0 <= ASCENT <= 1). */ 1791 ascent of the glyph (0 <= ASCENT <= 1). */
1793 1792
1794static void 1793static void
1795x_append_stretch_glyph (it, object, width, height, ascent) 1794x_append_stretch_glyph (it, object, width, height, ascent)
1796 struct it *it; 1795 struct it *it;
@@ -1802,7 +1801,7 @@ x_append_stretch_glyph (it, object, width, height, ascent)
1802 enum glyph_row_area area = it->area; 1801 enum glyph_row_area area = it->area;
1803 1802
1804 xassert (ascent >= 0 && ascent <= 1); 1803 xassert (ascent >= 0 && ascent <= 1);
1805 1804
1806 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; 1805 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
1807 if (glyph < it->glyph_row->glyphs[area + 1]) 1806 if (glyph < it->glyph_row->glyphs[area + 1])
1808 { 1807 {
@@ -1832,7 +1831,7 @@ x_append_stretch_glyph (it, object, width, height, ascent)
1832 being recognized: 1831 being recognized:
1833 1832
1834 1. `:width WIDTH' specifies that the space should be WIDTH * 1833 1. `:width WIDTH' specifies that the space should be WIDTH *
1835 canonical char width wide. WIDTH may be an integer or floating 1834 canonical char width wide. WIDTH may be an integer or floating
1836 point number. 1835 point number.
1837 1836
1838 2. `:relative-width FACTOR' specifies that the width of the stretch 1837 2. `:relative-width FACTOR' specifies that the width of the stretch
@@ -1842,7 +1841,7 @@ x_append_stretch_glyph (it, object, width, height, ascent)
1842 3. `:align-to HPOS' specifies that the space should be wide enough 1841 3. `:align-to HPOS' specifies that the space should be wide enough
1843 to reach HPOS, a value in canonical character units. 1842 to reach HPOS, a value in canonical character units.
1844 1843
1845 Exactly one of the above pairs must be present. 1844 Exactly one of the above pairs must be present.
1846 1845
1847 4. `:height HEIGHT' specifies that the height of the stretch produced 1846 4. `:height HEIGHT' specifies that the height of the stretch produced
1848 should be HEIGHT, measured in canonical character units. 1847 should be HEIGHT, measured in canonical character units.
@@ -1880,7 +1879,7 @@ x_produce_stretch_glyph (it)
1880 XFontStruct *font = face->font ? face->font : FRAME_FONT (it->f); 1879 XFontStruct *font = face->font ? face->font : FRAME_FONT (it->f);
1881 1880
1882 PREPARE_FACE_FOR_DISPLAY (it->f, face); 1881 PREPARE_FACE_FOR_DISPLAY (it->f, face);
1883 1882
1884 /* List should start with `space'. */ 1883 /* List should start with `space'. */
1885 xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace)); 1884 xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
1886 plist = XCDR (it->object); 1885 plist = XCDR (it->object);
@@ -1898,7 +1897,7 @@ x_produce_stretch_glyph (it)
1898 property. */ 1897 property. */
1899 struct it it2; 1898 struct it it2;
1900 unsigned char *p = BYTE_POS_ADDR (IT_BYTEPOS (*it)); 1899 unsigned char *p = BYTE_POS_ADDR (IT_BYTEPOS (*it));
1901 1900
1902 it2 = *it; 1901 it2 = *it;
1903 if (it->multibyte_p) 1902 if (it->multibyte_p)
1904 { 1903 {
@@ -1920,7 +1919,7 @@ x_produce_stretch_glyph (it)
1920 else 1919 else
1921 /* Nothing specified -> width defaults to canonical char width. */ 1920 /* Nothing specified -> width defaults to canonical char width. */
1922 width = CANON_X_UNIT (it->f); 1921 width = CANON_X_UNIT (it->f);
1923 1922
1924 /* Compute height. */ 1923 /* Compute height. */
1925 if (prop = Fplist_get (plist, QCheight), 1924 if (prop = Fplist_get (plist, QCheight),
1926 NUMVAL (prop) > 0) 1925 NUMVAL (prop) > 0)
@@ -1931,7 +1930,7 @@ x_produce_stretch_glyph (it)
1931 else 1930 else
1932 height = FONT_HEIGHT (font); 1931 height = FONT_HEIGHT (font);
1933 1932
1934 /* Compute percentage of height used for ascent. If 1933 /* Compute percentage of height used for ascent. If
1935 `:ascent ASCENT' is present and valid, use that. Otherwise, 1934 `:ascent ASCENT' is present and valid, use that. Otherwise,
1936 derive the ascent from the font in use. */ 1935 derive the ascent from the font in use. */
1937 if (prop = Fplist_get (plist, QCascent), 1936 if (prop = Fplist_get (plist, QCascent),
@@ -1965,13 +1964,13 @@ x_produce_stretch_glyph (it)
1965 it->ascent += face->box_line_width; 1964 it->ascent += face->box_line_width;
1966 it->descent += face->box_line_width; 1965 it->descent += face->box_line_width;
1967 } 1966 }
1968 1967
1969 if (it->start_of_box_run_p) 1968 if (it->start_of_box_run_p)
1970 it->pixel_width += abs (face->box_line_width); 1969 it->pixel_width += abs (face->box_line_width);
1971 if (it->end_of_box_run_p) 1970 if (it->end_of_box_run_p)
1972 it->pixel_width += abs (face->box_line_width); 1971 it->pixel_width += abs (face->box_line_width);
1973 } 1972 }
1974 1973
1975 take_vertical_position_into_account (it); 1974 take_vertical_position_into_account (it);
1976} 1975}
1977 1976
@@ -2063,7 +2062,7 @@ x_produce_glyphs (it)
2063 face = FACE_FROM_ID (it->f, it->face_id); 2062 face = FACE_FROM_ID (it->f, it->face_id);
2064 } 2063 }
2065 } 2064 }
2066 2065
2067 /* Get font to use. Encode IT->char_to_display. */ 2066 /* Get font to use. Encode IT->char_to_display. */
2068 x_get_char_face_and_encoding (it->f, it->char_to_display, 2067 x_get_char_face_and_encoding (it->f, it->char_to_display,
2069 it->face_id, &char2b, 2068 it->face_id, &char2b,
@@ -2112,7 +2111,7 @@ x_produce_glyphs (it)
2112 it->phys_descent = FONT_DESCENT (font) - boff; 2111 it->phys_descent = FONT_DESCENT (font) - boff;
2113 it->pixel_width = FONT_WIDTH (font); 2112 it->pixel_width = FONT_WIDTH (font);
2114 } 2113 }
2115 2114
2116 /* If this is a space inside a region of text with 2115 /* If this is a space inside a region of text with
2117 `space-width' property, change its width. */ 2116 `space-width' property, change its width. */
2118 stretched_p = it->char_to_display == ' ' && !NILP (it->space_width); 2117 stretched_p = it->char_to_display == ' ' && !NILP (it->space_width);
@@ -2125,7 +2124,7 @@ x_produce_glyphs (it)
2125 if (face->box != FACE_NO_BOX) 2124 if (face->box != FACE_NO_BOX)
2126 { 2125 {
2127 int thick = face->box_line_width; 2126 int thick = face->box_line_width;
2128 2127
2129 if (thick > 0) 2128 if (thick > 0)
2130 { 2129 {
2131 it->ascent += thick; 2130 it->ascent += thick;
@@ -2133,7 +2132,7 @@ x_produce_glyphs (it)
2133 } 2132 }
2134 else 2133 else
2135 thick = -thick; 2134 thick = -thick;
2136 2135
2137 if (it->start_of_box_run_p) 2136 if (it->start_of_box_run_p)
2138 it->pixel_width += thick; 2137 it->pixel_width += thick;
2139 if (it->end_of_box_run_p) 2138 if (it->end_of_box_run_p)
@@ -2146,7 +2145,7 @@ x_produce_glyphs (it)
2146 it->ascent += 2; 2145 it->ascent += 2;
2147 2146
2148 take_vertical_position_into_account (it); 2147 take_vertical_position_into_account (it);
2149 2148
2150 /* If we have to actually produce glyphs, do it. */ 2149 /* If we have to actually produce glyphs, do it. */
2151 if (it->glyph_row) 2150 if (it->glyph_row)
2152 { 2151 {
@@ -2156,7 +2155,7 @@ x_produce_glyphs (it)
2156 into a stretch glyph. */ 2155 into a stretch glyph. */
2157 double ascent = (double) FONT_BASE (font) 2156 double ascent = (double) FONT_BASE (font)
2158 / FONT_HEIGHT (font); 2157 / FONT_HEIGHT (font);
2159 x_append_stretch_glyph (it, it->object, it->pixel_width, 2158 x_append_stretch_glyph (it, it->object, it->pixel_width,
2160 it->ascent + it->descent, ascent); 2159 it->ascent + it->descent, ascent);
2161 } 2160 }
2162 else 2161 else
@@ -2176,7 +2175,7 @@ x_produce_glyphs (it)
2176 it->nglyphs = 0; 2175 it->nglyphs = 0;
2177 it->ascent = it->phys_ascent = FONT_BASE (font) + boff; 2176 it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
2178 it->descent = it->phys_descent = FONT_DESCENT (font) - boff; 2177 it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
2179 2178
2180 if (face->box != FACE_NO_BOX 2179 if (face->box != FACE_NO_BOX
2181 && face->box_line_width > 0) 2180 && face->box_line_width > 0)
2182 { 2181 {
@@ -2189,7 +2188,7 @@ x_produce_glyphs (it)
2189 int tab_width = it->tab_width * CANON_X_UNIT (it->f); 2188 int tab_width = it->tab_width * CANON_X_UNIT (it->f);
2190 int x = it->current_x + it->continuation_lines_width; 2189 int x = it->current_x + it->continuation_lines_width;
2191 int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width; 2190 int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width;
2192 2191
2193 /* If the distance from the current position to the next tab 2192 /* If the distance from the current position to the next tab
2194 stop is less than a canonical character width, use the 2193 stop is less than a canonical character width, use the
2195 tab stop after that. */ 2194 tab stop after that. */
@@ -2200,15 +2199,15 @@ x_produce_glyphs (it)
2200 it->nglyphs = 1; 2199 it->nglyphs = 1;
2201 it->ascent = it->phys_ascent = FONT_BASE (font) + boff; 2200 it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
2202 it->descent = it->phys_descent = FONT_DESCENT (font) - boff; 2201 it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
2203 2202
2204 if (it->glyph_row) 2203 if (it->glyph_row)
2205 { 2204 {
2206 double ascent = (double) it->ascent / (it->ascent + it->descent); 2205 double ascent = (double) it->ascent / (it->ascent + it->descent);
2207 x_append_stretch_glyph (it, it->object, it->pixel_width, 2206 x_append_stretch_glyph (it, it->object, it->pixel_width,
2208 it->ascent + it->descent, ascent); 2207 it->ascent + it->descent, ascent);
2209 } 2208 }
2210 } 2209 }
2211 else 2210 else
2212 { 2211 {
2213 /* A multi-byte character. 2212 /* A multi-byte character.
2214 If we found a font, this font should give us the right 2213 If we found a font, this font should give us the right
@@ -2261,20 +2260,20 @@ x_produce_glyphs (it)
2261 } 2260 }
2262 else 2261 else
2263 thick = - thick; 2262 thick = - thick;
2264 2263
2265 if (it->start_of_box_run_p) 2264 if (it->start_of_box_run_p)
2266 it->pixel_width += thick; 2265 it->pixel_width += thick;
2267 if (it->end_of_box_run_p) 2266 if (it->end_of_box_run_p)
2268 it->pixel_width += thick; 2267 it->pixel_width += thick;
2269 } 2268 }
2270 2269
2271 /* If face has an overline, add the height of the overline 2270 /* If face has an overline, add the height of the overline
2272 (1 pixel) and a 1 pixel margin to the character height. */ 2271 (1 pixel) and a 1 pixel margin to the character height. */
2273 if (face->overline_p) 2272 if (face->overline_p)
2274 it->ascent += 2; 2273 it->ascent += 2;
2275 2274
2276 take_vertical_position_into_account (it); 2275 take_vertical_position_into_account (it);
2277 2276
2278 if (it->glyph_row) 2277 if (it->glyph_row)
2279 x_append_glyph (it); 2278 x_append_glyph (it);
2280 } 2279 }
@@ -2376,12 +2375,12 @@ x_produce_glyphs (it)
2376 ascent = FONT_BASE (font); 2375 ascent = FONT_BASE (font);
2377 descent = FONT_DESCENT (font); 2376 descent = FONT_DESCENT (font);
2378 } 2377 }
2379 2378
2380 rightmost = width; 2379 rightmost = width;
2381 lowest = - descent + boff; 2380 lowest = - descent + boff;
2382 highest = ascent + boff; 2381 highest = ascent + boff;
2383 leftmost = 0; 2382 leftmost = 0;
2384 2383
2385 if (font_info 2384 if (font_info
2386 && font_info->default_ascent 2385 && font_info->default_ascent
2387 && CHAR_TABLE_P (Vuse_default_ascent) 2386 && CHAR_TABLE_P (Vuse_default_ascent)
@@ -2549,20 +2548,20 @@ x_produce_glyphs (it)
2549 } 2548 }
2550 else 2549 else
2551 thick = - thick; 2550 thick = - thick;
2552 2551
2553 if (it->start_of_box_run_p) 2552 if (it->start_of_box_run_p)
2554 it->pixel_width += thick; 2553 it->pixel_width += thick;
2555 if (it->end_of_box_run_p) 2554 if (it->end_of_box_run_p)
2556 it->pixel_width += thick; 2555 it->pixel_width += thick;
2557 } 2556 }
2558 2557
2559 /* If face has an overline, add the height of the overline 2558 /* If face has an overline, add the height of the overline
2560 (1 pixel) and a 1 pixel margin to the character height. */ 2559 (1 pixel) and a 1 pixel margin to the character height. */
2561 if (face->overline_p) 2560 if (face->overline_p)
2562 it->ascent += 2; 2561 it->ascent += 2;
2563 2562
2564 take_vertical_position_into_account (it); 2563 take_vertical_position_into_account (it);
2565 2564
2566 if (it->glyph_row) 2565 if (it->glyph_row)
2567 x_append_composite_glyph (it); 2566 x_append_composite_glyph (it);
2568 } 2567 }
@@ -2609,7 +2608,7 @@ x_estimate_mode_line_height (f, face_id)
2609 height += 2 * face->box_line_width; 2608 height += 2 * face->box_line_width;
2610 } 2609 }
2611 } 2610 }
2612 2611
2613 return height; 2612 return height;
2614} 2613}
2615 2614
@@ -2801,7 +2800,7 @@ static int x_fill_glyph_string P_ ((struct glyph_string *, int, int, int,
2801static void w32_init_glyph_string P_ ((struct glyph_string *, HDC hdc, 2800static void w32_init_glyph_string P_ ((struct glyph_string *, HDC hdc,
2802 wchar_t *, struct window *, 2801 wchar_t *, struct window *,
2803 struct glyph_row *, 2802 struct glyph_row *,
2804 enum glyph_row_area, int, 2803 enum glyph_row_area, int,
2805 enum draw_glyphs_face)); 2804 enum draw_glyphs_face));
2806static int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *, 2805static int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *,
2807 enum glyph_row_area, int, int, 2806 enum glyph_row_area, int, int,
@@ -2847,7 +2846,7 @@ static int x_fill_stretch_glyph_string P_ ((struct glyph_string *,
2847static void x_check_font P_ ((struct frame *, XFontStruct *)); 2846static void x_check_font P_ ((struct frame *, XFontStruct *));
2848#endif 2847#endif
2849 2848
2850 2849
2851/* Append the list of glyph strings with head H and tail T to the list 2850/* Append the list of glyph strings with head H and tail T to the list
2852 with head *HEAD and tail *TAIL. Set *HEAD and *TAIL to the result. */ 2851 with head *HEAD and tail *TAIL. Set *HEAD and *TAIL to the result. */
2853 2852
@@ -2956,11 +2955,11 @@ x_set_cursor_gc (s)
2956 2955
2957 2956
2958/* Set up S->gc of glyph string S for drawing text in mouse face. */ 2957/* Set up S->gc of glyph string S for drawing text in mouse face. */
2959 2958
2960static void 2959static void
2961x_set_mouse_face_gc (s) 2960x_set_mouse_face_gc (s)
2962 struct glyph_string *s; 2961 struct glyph_string *s;
2963{ 2962{
2964 int face_id; 2963 int face_id;
2965 struct face *face; 2964 struct face *face;
2966 2965
@@ -2969,7 +2968,7 @@ x_set_mouse_face_gc (s)
2969 face = FACE_FROM_ID (s->f, face_id); 2968 face = FACE_FROM_ID (s->f, face_id);
2970 if (face == NULL) 2969 if (face == NULL)
2971 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); 2970 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
2972 2971
2973 if (s->first_glyph->type == CHAR_GLYPH) 2972 if (s->first_glyph->type == CHAR_GLYPH)
2974 face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch); 2973 face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch);
2975 else 2974 else
@@ -2986,20 +2985,20 @@ x_set_mouse_face_gc (s)
2986 but font FONT. */ 2985 but font FONT. */
2987 XGCValues xgcv; 2986 XGCValues xgcv;
2988 unsigned long mask; 2987 unsigned long mask;
2989 2988
2990 xgcv.background = s->face->background; 2989 xgcv.background = s->face->background;
2991 xgcv.foreground = s->face->foreground; 2990 xgcv.foreground = s->face->foreground;
2992 IF_DEBUG (x_check_font (s->f, s->font)); 2991 IF_DEBUG (x_check_font (s->f, s->font));
2993 xgcv.font = s->font; 2992 xgcv.font = s->font;
2994 mask = GCForeground | GCBackground | GCFont; 2993 mask = GCForeground | GCBackground | GCFont;
2995 2994
2996 if (FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc) 2995 if (FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc)
2997 XChangeGC (NULL, FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc, 2996 XChangeGC (NULL, FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc,
2998 mask, &xgcv); 2997 mask, &xgcv);
2999 else 2998 else
3000 FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc 2999 FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc
3001 = XCreateGC (NULL, s->window, mask, &xgcv); 3000 = XCreateGC (NULL, s->window, mask, &xgcv);
3002 3001
3003 s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc; 3002 s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc;
3004 } 3003 }
3005 3004
@@ -3014,7 +3013,7 @@ x_set_mouse_face_gc (s)
3014static INLINE void 3013static INLINE void
3015x_set_mode_line_face_gc (s) 3014x_set_mode_line_face_gc (s)
3016 struct glyph_string *s; 3015 struct glyph_string *s;
3017{ 3016{
3018 s->gc = s->face->gc; 3017 s->gc = s->face->gc;
3019} 3018}
3020 3019
@@ -3028,7 +3027,7 @@ x_set_glyph_string_gc (s)
3028 struct glyph_string *s; 3027 struct glyph_string *s;
3029{ 3028{
3030 PREPARE_FACE_FOR_DISPLAY (s->f, s->face); 3029 PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
3031 3030
3032 if (s->hl == DRAW_NORMAL_TEXT) 3031 if (s->hl == DRAW_NORMAL_TEXT)
3033 { 3032 {
3034 s->gc = s->face->gc; 3033 s->gc = s->face->gc;
@@ -3079,7 +3078,7 @@ w32_get_glyph_string_clip_rect (s, r)
3079 { 3078 {
3080 /* Draw full-width. X coordinates are relative to S->w->left. */ 3079 /* Draw full-width. X coordinates are relative to S->w->left. */
3081 int canon_x = CANON_X_UNIT (s->f); 3080 int canon_x = CANON_X_UNIT (s->f);
3082 3081
3083 r->left = WINDOW_LEFT_MARGIN (s->w) * canon_x; 3082 r->left = WINDOW_LEFT_MARGIN (s->w) * canon_x;
3084 r_width = XFASTINT (s->w->width) * canon_x; 3083 r_width = XFASTINT (s->w->width) * canon_x;
3085 3084
@@ -3089,7 +3088,7 @@ w32_get_glyph_string_clip_rect (s, r)
3089 if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (s->f)) 3088 if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (s->f))
3090 r->left -= width; 3089 r->left -= width;
3091 } 3090 }
3092 3091
3093 r->left += FRAME_INTERNAL_BORDER_WIDTH (s->f); 3092 r->left += FRAME_INTERNAL_BORDER_WIDTH (s->f);
3094 3093
3095 /* Unless displaying a mode or menu bar line, which are always 3094 /* Unless displaying a mode or menu bar line, which are always
@@ -3168,7 +3167,7 @@ x_compute_glyph_string_overhangs (s)
3168/* Compute overhangs and x-positions for glyph string S and its 3167/* Compute overhangs and x-positions for glyph string S and its
3169 predecessors, or successors. X is the starting x-position for S. 3168 predecessors, or successors. X is the starting x-position for S.
3170 BACKWARD_P non-zero means process predecessors. */ 3169 BACKWARD_P non-zero means process predecessors. */
3171 3170
3172static void 3171static void
3173x_compute_overhangs_and_x (s, x, backward_p) 3172x_compute_overhangs_and_x (s, x, backward_p)
3174 struct glyph_string *s; 3173 struct glyph_string *s;
@@ -3210,7 +3209,7 @@ w32_get_glyph_overhangs (hdc, glyph, f, left, right)
3210 int *left, *right; 3209 int *left, *right;
3211{ 3210{
3212 *left = *right = 0; 3211 *left = *right = 0;
3213 3212
3214 if (glyph->type == CHAR_GLYPH) 3213 if (glyph->type == CHAR_GLYPH)
3215 { 3214 {
3216 XFontStruct *font; 3215 XFontStruct *font;
@@ -3256,7 +3255,7 @@ x_left_overwritten (s)
3256 struct glyph_string *s; 3255 struct glyph_string *s;
3257{ 3256{
3258 int k; 3257 int k;
3259 3258
3260 if (s->left_overhang) 3259 if (s->left_overhang)
3261 { 3260 {
3262 int x = 0, i; 3261 int x = 0, i;
@@ -3318,7 +3317,7 @@ x_right_overwritten (s)
3318 struct glyph *glyphs = s->row->glyphs[s->area]; 3317 struct glyph *glyphs = s->row->glyphs[s->area];
3319 int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars); 3318 int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);
3320 int end = s->row->used[s->area]; 3319 int end = s->row->used[s->area];
3321 3320
3322 for (i = first; i < end && s->right_overhang > x; ++i) 3321 for (i = first; i < end && s->right_overhang > x; ++i)
3323 x += glyphs[i].pixel_width; 3322 x += glyphs[i].pixel_width;
3324 3323
@@ -3597,7 +3596,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
3597 double dimness = 1 - (double)bright / HIGHLIGHT_COLOR_DARK_BOOST_LIMIT; 3596 double dimness = 1 - (double)bright / HIGHLIGHT_COLOR_DARK_BOOST_LIMIT;
3598 /* The additive adjustment. */ 3597 /* The additive adjustment. */
3599 int min_delta = delta * dimness * factor / 2; 3598 int min_delta = delta * dimness * factor / 2;
3600 3599
3601 if (factor < 1) 3600 if (factor < 1)
3602 new = PALETTERGB (max (0, min (0xff, min_delta - GetRValue (*color))), 3601 new = PALETTERGB (max (0, min (0xff, min_delta - GetRValue (*color))),
3603 max (0, min (0xff, min_delta - GetGValue (*color))), 3602 max (0, min (0xff, min_delta - GetGValue (*color))),
@@ -3607,7 +3606,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
3607 max (0, min (0xff, min_delta + GetGValue (*color))), 3606 max (0, min (0xff, min_delta + GetGValue (*color))),
3608 max (0, min (0xff, min_delta + GetBValue (*color)))); 3607 max (0, min (0xff, min_delta + GetBValue (*color))));
3609 } 3608 }
3610 3609
3611 if (new == *color) 3610 if (new == *color)
3612 new = PALETTERGB (max (0, min (0xff, delta + GetRValue (*color))), 3611 new = PALETTERGB (max (0, min (0xff, delta + GetRValue (*color))),
3613 max (0, min (0xff, delta + GetGValue (*color))), 3612 max (0, min (0xff, delta + GetGValue (*color))),
@@ -3631,7 +3630,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
3631 DELTA lighter or darker than the relief's background which is found 3630 DELTA lighter or darker than the relief's background which is found
3632 in S->f->output_data.x->relief_background. If such a color cannot 3631 in S->f->output_data.x->relief_background. If such a color cannot
3633 be allocated, use DEFAULT_PIXEL, instead. */ 3632 be allocated, use DEFAULT_PIXEL, instead. */
3634 3633
3635static void 3634static void
3636w32_setup_relief_color (f, relief, factor, delta, default_pixel) 3635w32_setup_relief_color (f, relief, factor, delta, default_pixel)
3637 struct frame *f; 3636 struct frame *f;
@@ -3657,7 +3656,7 @@ w32_setup_relief_color (f, relief, factor, delta, default_pixel)
3657 relief->allocated_p = 1; 3656 relief->allocated_p = 1;
3658 xgcv.foreground = relief->pixel = pixel; 3657 xgcv.foreground = relief->pixel = pixel;
3659 } 3658 }
3660 3659
3661 if (relief->gc == 0) 3660 if (relief->gc == 0)
3662 { 3661 {
3663#if 0 /* TODO: stipple */ 3662#if 0 /* TODO: stipple */
@@ -3744,10 +3743,10 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3744 gc.foreground = f->output_data.w32->black_relief.gc->foreground; 3743 gc.foreground = f->output_data.w32->black_relief.gc->foreground;
3745 else 3744 else
3746 gc.foreground = f->output_data.w32->white_relief.gc->foreground; 3745 gc.foreground = f->output_data.w32->white_relief.gc->foreground;
3747 3746
3748 /* Bottom. */ 3747 /* Bottom. */
3749 for (i = 0; i < width; ++i) 3748 for (i = 0; i < width; ++i)
3750 w32_fill_area (f, hdc, gc.foreground, 3749 w32_fill_area (f, hdc, gc.foreground,
3751 left_x + i * left_p, bottom_y - i, 3750 left_x + i * left_p, bottom_y - i,
3752 right_x - left_x - i * (left_p + right_p) + 1, 1); 3751 right_x - left_x - i * (left_p + right_p) + 1, 1);
3753 3752
@@ -3759,7 +3758,7 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3759 bottom_y - top_y - 2 * i - 1); 3758 bottom_y - top_y - 2 * i - 1);
3760 3759
3761 w32_set_clip_rectangle (hdc, NULL); 3760 w32_set_clip_rectangle (hdc, NULL);
3762 3761
3763 release_frame_dc (f, hdc); 3762 release_frame_dc (f, hdc);
3764} 3763}
3765 3764
@@ -3779,7 +3778,7 @@ w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
3779 RECT *clip_rect; 3778 RECT *clip_rect;
3780{ 3779{
3781 w32_set_clip_rectangle (s->hdc, clip_rect); 3780 w32_set_clip_rectangle (s->hdc, clip_rect);
3782 3781
3783 /* Top. */ 3782 /* Top. */
3784 w32_fill_area (s->f, s->hdc, s->face->box_color, 3783 w32_fill_area (s->f, s->hdc, s->face->box_color,
3785 left_x, top_y, right_x - left_x + 1, width); 3784 left_x, top_y, right_x - left_x + 1, width);
@@ -3790,11 +3789,11 @@ w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
3790 w32_fill_area (s->f, s->hdc, s->face->box_color, 3789 w32_fill_area (s->f, s->hdc, s->face->box_color,
3791 left_x, top_y, width, bottom_y - top_y + 1); 3790 left_x, top_y, width, bottom_y - top_y + 1);
3792 } 3791 }
3793 3792
3794 /* Bottom. */ 3793 /* Bottom. */
3795 w32_fill_area (s->f, s->hdc, s->face->box_color, 3794 w32_fill_area (s->f, s->hdc, s->face->box_color,
3796 left_x, bottom_y - width + 1, right_x - left_x + 1, width); 3795 left_x, bottom_y - width + 1, right_x - left_x + 1, width);
3797 3796
3798 /* Right. */ 3797 /* Right. */
3799 if (right_p) 3798 if (right_p)
3800 { 3799 {
@@ -3825,7 +3824,7 @@ x_draw_glyph_string_box (s)
3825 if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f)) 3824 if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f))
3826 last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f); 3825 last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f);
3827 } 3826 }
3828 3827
3829 /* The glyph that may have a right box line. */ 3828 /* The glyph that may have a right box line. */
3830 last_glyph = (s->cmp || s->img 3829 last_glyph = (s->cmp || s->img
3831 ? s->first_glyph 3830 ? s->first_glyph
@@ -3848,7 +3847,7 @@ x_draw_glyph_string_box (s)
3848 || (s->hl == DRAW_MOUSE_FACE 3847 || (s->hl == DRAW_MOUSE_FACE
3849 && (s->next == NULL 3848 && (s->next == NULL
3850 || s->next->hl != s->hl))); 3849 || s->next->hl != s->hl)));
3851 3850
3852 w32_get_glyph_string_clip_rect (s, &clip_rect); 3851 w32_get_glyph_string_clip_rect (s, &clip_rect);
3853 3852
3854 if (s->face->box == FACE_SIMPLE_BOX) 3853 if (s->face->box == FACE_SIMPLE_BOX)
@@ -3907,7 +3906,7 @@ x_draw_image_foreground (s)
3907 xgcv.clip_y_origin = y; 3906 xgcv.clip_y_origin = y;
3908 xgcv.function = GXcopy; 3907 xgcv.function = GXcopy;
3909 XChangeGC (s->display, s->gc, mask, &xgcv); 3908 XChangeGC (s->display, s->gc, mask, &xgcv);
3910 3909
3911 w32_get_glyph_string_clip_rect (s, &clip_rect); 3910 w32_get_glyph_string_clip_rect (s, &clip_rect);
3912 image_rect.x = x; 3911 image_rect.x = x;
3913 image_rect.y = y; 3912 image_rect.y = y;
@@ -3977,7 +3976,7 @@ x_draw_image_relief (s)
3977 RECT r; 3976 RECT r;
3978 int x; 3977 int x;
3979 int y = s->ybase - image_ascent (s->img, s->face); 3978 int y = s->ybase - image_ascent (s->img, s->face);
3980 3979
3981 /* If first glyph of S has a left box line, start drawing it to the 3980 /* If first glyph of S has a left box line, start drawing it to the
3982 right of that line. */ 3981 right of that line. */
3983 if (s->face->box != FACE_NO_BOX 3982 if (s->face->box != FACE_NO_BOX
@@ -3985,12 +3984,12 @@ x_draw_image_relief (s)
3985 x = s->x + abs (s->face->box_line_width); 3984 x = s->x + abs (s->face->box_line_width);
3986 else 3985 else
3987 x = s->x; 3986 x = s->x;
3988 3987
3989 /* If there is a margin around the image, adjust x- and y-position 3988 /* If there is a margin around the image, adjust x- and y-position
3990 by that margin. */ 3989 by that margin. */
3991 x += s->img->hmargin; 3990 x += s->img->hmargin;
3992 y += s->img->vmargin; 3991 y += s->img->vmargin;
3993 3992
3994 if (s->hl == DRAW_IMAGE_SUNKEN 3993 if (s->hl == DRAW_IMAGE_SUNKEN
3995 || s->hl == DRAW_IMAGE_RAISED) 3994 || s->hl == DRAW_IMAGE_RAISED)
3996 { 3995 {
@@ -4002,12 +4001,12 @@ x_draw_image_relief (s)
4002 thick = abs (s->img->relief); 4001 thick = abs (s->img->relief);
4003 raised_p = s->img->relief > 0; 4002 raised_p = s->img->relief > 0;
4004 } 4003 }
4005 4004
4006 x0 = x - thick; 4005 x0 = x - thick;
4007 y0 = y - thick; 4006 y0 = y - thick;
4008 x1 = x + s->img->width + thick - 1; 4007 x1 = x + s->img->width + thick - 1;
4009 y1 = y + s->img->height + thick - 1; 4008 y1 = y + s->img->height + thick - 1;
4010 4009
4011 x_setup_relief_colors (s); 4010 x_setup_relief_colors (s);
4012 w32_get_glyph_string_clip_rect (s, &r); 4011 w32_get_glyph_string_clip_rect (s, &r);
4013 w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); 4012 w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r);
@@ -4133,7 +4132,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h)
4133} 4132}
4134 4133
4135 4134
4136/* Draw image glyph string S. 4135/* Draw image glyph string S.
4137 4136
4138 s->y 4137 s->y
4139 s->x +------------------------- 4138 s->x +-------------------------
@@ -4176,7 +4175,7 @@ x_draw_image_glyph_string (s)
4176 x = s->x + box_line_hwidth; 4175 x = s->x + box_line_hwidth;
4177 else 4176 else
4178 x = s->x; 4177 x = s->x;
4179 4178
4180 y = s->y + box_line_vwidth; 4179 y = s->y + box_line_vwidth;
4181#if 0 /* TODO: image mask */ 4180#if 0 /* TODO: image mask */
4182 if (s->img->mask) 4181 if (s->img->mask)
@@ -4191,7 +4190,7 @@ x_draw_image_glyph_string (s)
4191 pixmap = XCreatePixmap (s->display, s->window, 4190 pixmap = XCreatePixmap (s->display, s->window,
4192 s->background_width, 4191 s->background_width,
4193 s->height, depth); 4192 s->height, depth);
4194 4193
4195 /* Don't clip in the following because we're working on the 4194 /* Don't clip in the following because we're working on the
4196 pixmap. */ 4195 pixmap. */
4197 XSetClipMask (s->display, s->gc, None); 4196 XSetClipMask (s->display, s->gc, None);
@@ -4219,7 +4218,7 @@ x_draw_image_glyph_string (s)
4219 else 4218 else
4220#endif 4219#endif
4221 x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); 4220 x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
4222 4221
4223 s->background_filled_p = 1; 4222 s->background_filled_p = 1;
4224 } 4223 }
4225 4224
@@ -4300,7 +4299,7 @@ x_draw_stretch_glyph_string (s)
4300 } 4299 }
4301 else 4300 else
4302 gc = s->face->gc; 4301 gc = s->face->gc;
4303 4302
4304 w32_get_glyph_string_clip_rect (s, &r); 4303 w32_get_glyph_string_clip_rect (s, &r);
4305 w32_set_clip_rectangle (hdc, &r); 4304 w32_set_clip_rectangle (hdc, &r);
4306 4305
@@ -4322,7 +4321,7 @@ x_draw_stretch_glyph_string (s)
4322 else if (!s->background_filled_p) 4321 else if (!s->background_filled_p)
4323 x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width, 4322 x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width,
4324 s->height); 4323 s->height);
4325 4324
4326 s->background_filled_p = 1; 4325 s->background_filled_p = 1;
4327} 4326}
4328 4327
@@ -4470,7 +4469,7 @@ static int x_fill_composite_glyph_string P_ ((struct glyph_string *,
4470 4469
4471 4470
4472/* Fill glyph string S with composition components specified by S->cmp. 4471/* Fill glyph string S with composition components specified by S->cmp.
4473 4472
4474 FACES is an array of faces for all components of this composition. 4473 FACES is an array of faces for all components of this composition.
4475 S->gidx is the index of the first component for S. 4474 S->gidx is the index of the first component for S.
4476 OVERLAPS_P non-zero means S should draw the foreground only, and 4475 OVERLAPS_P non-zero means S should draw the foreground only, and
@@ -4518,7 +4517,7 @@ x_fill_composite_glyph_string (s, faces, overlaps_p)
4518 4517
4519 /* Adjust base line for subscript/superscript text. */ 4518 /* Adjust base line for subscript/superscript text. */
4520 s->ybase += s->first_glyph->voffset; 4519 s->ybase += s->first_glyph->voffset;
4521 4520
4522 xassert (s->face && s->face->gc); 4521 xassert (s->face && s->face->gc);
4523 4522
4524 /* This glyph string must always be drawn with 16-bit functions. */ 4523 /* This glyph string must always be drawn with 16-bit functions. */
@@ -4529,7 +4528,7 @@ x_fill_composite_glyph_string (s, faces, overlaps_p)
4529 4528
4530 4529
4531/* Fill glyph string S from a sequence of character glyphs. 4530/* Fill glyph string S from a sequence of character glyphs.
4532 4531
4533 FACE_ID is the face id of the string. START is the index of the 4532 FACE_ID is the face id of the string. START is the index of the
4534 first glyph to consider, END is the index of the last + 1. 4533 first glyph to consider, END is the index of the last + 1.
4535 OVERLAPS_P non-zero means S should draw the foreground only, and 4534 OVERLAPS_P non-zero means S should draw the foreground only, and
@@ -4579,7 +4578,7 @@ x_fill_glyph_string (s, face_id, start, end, overlaps_p)
4579 4578
4580 s->font = s->face->font; 4579 s->font = s->face->font;
4581 s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); 4580 s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
4582 4581
4583 /* If the specified font could not be loaded, use the frame's font, 4582 /* If the specified font could not be loaded, use the frame's font,
4584 but record the fact that we couldn't load it in 4583 but record the fact that we couldn't load it in
4585 S->font_not_found_p so that we can draw rectangles for the 4584 S->font_not_found_p so that we can draw rectangles for the
@@ -4592,7 +4591,7 @@ x_fill_glyph_string (s, face_id, start, end, overlaps_p)
4592 4591
4593 /* Adjust base line for subscript/superscript text. */ 4592 /* Adjust base line for subscript/superscript text. */
4594 s->ybase += voffset; 4593 s->ybase += voffset;
4595 4594
4596 xassert (s->face && s->face->gc); 4595 xassert (s->face && s->face->gc);
4597 return glyph - s->row->glyphs[s->area]; 4596 return glyph - s->row->glyphs[s->area];
4598} 4597}
@@ -4610,7 +4609,7 @@ x_fill_image_glyph_string (s)
4610 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); 4609 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
4611 s->font = s->face->font; 4610 s->font = s->face->font;
4612 s->width = s->first_glyph->pixel_width; 4611 s->width = s->first_glyph->pixel_width;
4613 4612
4614 /* Adjust base line for subscript/superscript text. */ 4613 /* Adjust base line for subscript/superscript text. */
4615 s->ybase += s->first_glyph->voffset; 4614 s->ybase += s->first_glyph->voffset;
4616} 4615}
@@ -4633,9 +4632,9 @@ x_fill_stretch_glyph_string (s, row, area, start, end)
4633{ 4632{
4634 struct glyph *glyph, *last; 4633 struct glyph *glyph, *last;
4635 int voffset, face_id; 4634 int voffset, face_id;
4636 4635
4637 xassert (s->first_glyph->type == STRETCH_GLYPH); 4636 xassert (s->first_glyph->type == STRETCH_GLYPH);
4638 4637
4639 glyph = s->row->glyphs[s->area] + start; 4638 glyph = s->row->glyphs[s->area] + start;
4640 last = s->row->glyphs[s->area] + end; 4639 last = s->row->glyphs[s->area] + end;
4641 face_id = glyph->face_id; 4640 face_id = glyph->face_id;
@@ -4652,7 +4651,7 @@ x_fill_stretch_glyph_string (s, row, area, start, end)
4652 && glyph->face_id == face_id); 4651 && glyph->face_id == face_id);
4653 ++glyph) 4652 ++glyph)
4654 s->width += glyph->pixel_width; 4653 s->width += glyph->pixel_width;
4655 4654
4656 /* Adjust base line for subscript/superscript text. */ 4655 /* Adjust base line for subscript/superscript text. */
4657 s->ybase += voffset; 4656 s->ybase += voffset;
4658 4657
@@ -4668,7 +4667,7 @@ x_fill_stretch_glyph_string (s, row, area, start, end)
4668 and area within the row from which S is constructed. START is the 4667 and area within the row from which S is constructed. START is the
4669 index of the first glyph structure covered by S. HL is a 4668 index of the first glyph structure covered by S. HL is a
4670 face-override for drawing S. */ 4669 face-override for drawing S. */
4671 4670
4672static void 4671static void
4673w32_init_glyph_string (s, hdc, char2b, w, row, area, start, hl) 4672w32_init_glyph_string (s, hdc, char2b, w, row, area, start, hl)
4674 struct glyph_string *s; 4673 struct glyph_string *s;
@@ -4696,7 +4695,7 @@ w32_init_glyph_string (s, hdc, char2b, w, row, area, start, hl)
4696 /* Display the internal border below the tool-bar window. */ 4695 /* Display the internal border below the tool-bar window. */
4697 if (s->w == XWINDOW (s->f->tool_bar_window)) 4696 if (s->w == XWINDOW (s->f->tool_bar_window))
4698 s->y -= s->f->output_data.w32->internal_border_width; 4697 s->y -= s->f->output_data.w32->internal_border_width;
4699 4698
4700 s->ybase = s->y + row->ascent; 4699 s->ybase = s->y + row->ascent;
4701} 4700}
4702 4701
@@ -4714,7 +4713,7 @@ x_set_glyph_string_background_width (s, start, last_x)
4714 /* If the face of this glyph string has to be drawn to the end of 4713 /* If the face of this glyph string has to be drawn to the end of
4715 the drawing area, set S->extends_to_end_of_line_p. */ 4714 the drawing area, set S->extends_to_end_of_line_p. */
4716 struct face *default_face = FACE_FROM_ID (s->f, DEFAULT_FACE_ID); 4715 struct face *default_face = FACE_FROM_ID (s->f, DEFAULT_FACE_ID);
4717 4716
4718 if (start == s->row->used[s->area] 4717 if (start == s->row->used[s->area]
4719 && s->area == TEXT_AREA 4718 && s->area == TEXT_AREA
4720 && ((s->hl == DRAW_NORMAL_TEXT 4719 && ((s->hl == DRAW_NORMAL_TEXT
@@ -4726,7 +4725,7 @@ x_set_glyph_string_background_width (s, start, last_x)
4726 || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN) 4725 || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN)
4727 && s->row->fill_line_p))) 4726 && s->row->fill_line_p)))
4728 s->extends_to_end_of_line_p = 1; 4727 s->extends_to_end_of_line_p = 1;
4729 4728
4730 /* If S extends its face to the end of the line, set its 4729 /* If S extends its face to the end of the line, set its
4731 background_width to the distance to the right edge of the drawing 4730 background_width to the distance to the right edge of the drawing
4732 area. */ 4731 area. */
@@ -4805,7 +4804,7 @@ x_set_glyph_string_background_width (s, start, last_x)
4805 OVERLAPS_P); \ 4804 OVERLAPS_P); \
4806 } \ 4805 } \
4807 while (0) 4806 while (0)
4808 4807
4809 4808
4810/* Add a glyph string for a composite sequence to the list of strings 4809/* Add a glyph string for a composite sequence to the list of strings
4811 between HEAD and TAIL. START is the index of the first glyph in 4810 between HEAD and TAIL. START is the index of the first glyph in
@@ -4930,7 +4929,7 @@ x_set_glyph_string_background_width (s, start, last_x)
4930 and clip to the physical height of ROW. 4929 and clip to the physical height of ROW.
4931 4930
4932 Value is the x-position reached, relative to AREA of W. */ 4931 Value is the x-position reached, relative to AREA of W. */
4933 4932
4934static int 4933static int
4935x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p) 4934x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
4936 struct window *w; 4935 struct window *w;
@@ -5012,7 +5011,7 @@ x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
5012 /* Prepend glyph strings for glyphs in front of the first glyph 5011 /* Prepend glyph strings for glyphs in front of the first glyph
5013 string that are overwritten because of the first glyph 5012 string that are overwritten because of the first glyph
5014 string's left overhang. The background of all strings 5013 string's left overhang. The background of all strings
5015 prepended must be drawn because the first glyph string 5014 prepended must be drawn because the first glyph string
5016 draws over it. */ 5015 draws over it. */
5017 i = x_left_overwritten (head); 5016 i = x_left_overwritten (head);
5018 if (i >= 0) 5017 if (i >= 0)
@@ -5090,10 +5089,10 @@ x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
5090 { 5089 {
5091 int x0 = head ? head->x : x; 5090 int x0 = head ? head->x : x;
5092 int x1 = tail ? tail->x + tail->background_width : x; 5091 int x1 = tail ? tail->x + tail->background_width : x;
5093 5092
5094 x0 = FRAME_TO_WINDOW_PIXEL_X (w, x0); 5093 x0 = FRAME_TO_WINDOW_PIXEL_X (w, x0);
5095 x1 = FRAME_TO_WINDOW_PIXEL_X (w, x1); 5094 x1 = FRAME_TO_WINDOW_PIXEL_X (w, x1);
5096 5095
5097 if (!row->full_width_p && XFASTINT (w->left_margin_width) != 0) 5096 if (!row->full_width_p && XFASTINT (w->left_margin_width) != 0)
5098 { 5097 {
5099 int left_area_width = window_box_width (w, LEFT_MARGIN_AREA); 5098 int left_area_width = window_box_width (w, LEFT_MARGIN_AREA);
@@ -5131,9 +5130,9 @@ x_fix_overlapping_area (w, row, area)
5131 enum glyph_row_area area; 5130 enum glyph_row_area area;
5132{ 5131{
5133 int i, x; 5132 int i, x;
5134 5133
5135 BLOCK_INPUT; 5134 BLOCK_INPUT;
5136 5135
5137 if (area == LEFT_MARGIN_AREA) 5136 if (area == LEFT_MARGIN_AREA)
5138 x = 0; 5137 x = 0;
5139 else if (area == TEXT_AREA) 5138 else if (area == TEXT_AREA)
@@ -5165,7 +5164,7 @@ x_fix_overlapping_area (w, row, area)
5165 ++i; 5164 ++i;
5166 } 5165 }
5167 } 5166 }
5168 5167
5169 UNBLOCK_INPUT; 5168 UNBLOCK_INPUT;
5170} 5169}
5171 5170
@@ -5185,7 +5184,7 @@ x_write_glyphs (start, len)
5185 5184
5186 xassert (updated_window && updated_row); 5185 xassert (updated_window && updated_row);
5187 BLOCK_INPUT; 5186 BLOCK_INPUT;
5188 5187
5189 /* Write glyphs. */ 5188 /* Write glyphs. */
5190 5189
5191 hpos = start - updated_row->glyphs[updated_area]; 5190 hpos = start - updated_row->glyphs[updated_area];
@@ -5195,7 +5194,7 @@ x_write_glyphs (start, len)
5195 DRAW_NORMAL_TEXT, 0); 5194 DRAW_NORMAL_TEXT, 0);
5196 5195
5197 UNBLOCK_INPUT; 5196 UNBLOCK_INPUT;
5198 5197
5199 /* Advance the output cursor. */ 5198 /* Advance the output cursor. */
5200 output_cursor.hpos += len; 5199 output_cursor.hpos += len;
5201 output_cursor.x = x; 5200 output_cursor.x = x;
@@ -5294,10 +5293,10 @@ x_clear_end_of_line (to_x)
5294 struct window *w = updated_window; 5293 struct window *w = updated_window;
5295 int max_x, min_y, max_y; 5294 int max_x, min_y, max_y;
5296 int from_x, from_y, to_y; 5295 int from_x, from_y, to_y;
5297 5296
5298 xassert (updated_window && updated_row); 5297 xassert (updated_window && updated_row);
5299 f = XFRAME (w->frame); 5298 f = XFRAME (w->frame);
5300 5299
5301 if (updated_row->full_width_p) 5300 if (updated_row->full_width_p)
5302 { 5301 {
5303 max_x = XFASTINT (w->width) * CANON_X_UNIT (f); 5302 max_x = XFASTINT (w->width) * CANON_X_UNIT (f);
@@ -5319,7 +5318,7 @@ x_clear_end_of_line (to_x)
5319 to_x = min (to_x, max_x); 5318 to_x = min (to_x, max_x);
5320 5319
5321 to_y = min (max_y, output_cursor.y + updated_row->height); 5320 to_y = min (max_y, output_cursor.y + updated_row->height);
5322 5321
5323 /* Notice if the cursor will be cleared by this operation. */ 5322 /* Notice if the cursor will be cleared by this operation. */
5324 if (!updated_row->full_width_p) 5323 if (!updated_row->full_width_p)
5325 notice_overwritten_cursor (w, updated_area, 5324 notice_overwritten_cursor (w, updated_area,
@@ -5340,11 +5339,11 @@ x_clear_end_of_line (to_x)
5340 from_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, from_x); 5339 from_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, from_x);
5341 to_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, to_x); 5340 to_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, to_x);
5342 } 5341 }
5343 5342
5344 min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); 5343 min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
5345 from_y = WINDOW_TO_FRAME_PIXEL_Y (w, max (min_y, output_cursor.y)); 5344 from_y = WINDOW_TO_FRAME_PIXEL_Y (w, max (min_y, output_cursor.y));
5346 to_y = WINDOW_TO_FRAME_PIXEL_Y (w, to_y); 5345 to_y = WINDOW_TO_FRAME_PIXEL_Y (w, to_y);
5347 5346
5348 /* Prevent inadvertently clearing to end of the X window. */ 5347 /* Prevent inadvertently clearing to end of the X window. */
5349 if (to_x > from_x && to_y > from_y) 5348 if (to_x > from_x && to_y > from_y)
5350 { 5349 {
@@ -5411,7 +5410,7 @@ w32_ring_bell (void)
5411 int i; 5410 int i;
5412 HWND hwnd = FRAME_W32_WINDOW (SELECTED_FRAME ()); 5411 HWND hwnd = FRAME_W32_WINDOW (SELECTED_FRAME ());
5413 5412
5414 for (i = 0; i < 5; i++) 5413 for (i = 0; i < 5; i++)
5415 { 5414 {
5416 FlashWindow (hwnd, TRUE); 5415 FlashWindow (hwnd, TRUE);
5417 Sleep (10); 5416 Sleep (10);
@@ -5509,7 +5508,7 @@ x_scroll_run (w, run)
5509 } 5508 }
5510 5509
5511 BLOCK_INPUT; 5510 BLOCK_INPUT;
5512 5511
5513 /* Cursor off. Will be switched on again in x_update_window_end. */ 5512 /* Cursor off. Will be switched on again in x_update_window_end. */
5514 updated_window = w; 5513 updated_window = w;
5515 x_clear_cursor (w); 5514 x_clear_cursor (w);
@@ -5547,7 +5546,7 @@ x_scroll_run (w, run)
5547/*********************************************************************** 5546/***********************************************************************
5548 Exposure Events 5547 Exposure Events
5549 ***********************************************************************/ 5548 ***********************************************************************/
5550 5549
5551/* Redisplay an exposed area of frame F. X and Y are the upper-left 5550/* Redisplay an exposed area of frame F. X and Y are the upper-left
5552 corner of the exposed rectangle. W and H are width and height of 5551 corner of the exposed rectangle. W and H are width and height of
5553 the exposed area. All are pixel values. W or H zero means redraw 5552 the exposed area. All are pixel values. W or H zero means redraw
@@ -5698,7 +5697,7 @@ expose_area (w, row, r, area)
5698 x += first->pixel_width; 5697 x += first->pixel_width;
5699 ++first; 5698 ++first;
5700 } 5699 }
5701 5700
5702 /* Find the last one. */ 5701 /* Find the last one. */
5703 last = first; 5702 last = first;
5704 first_x = x; 5703 first_x = x;
@@ -5730,7 +5729,7 @@ expose_line (w, row, r)
5730 RECT *r; 5729 RECT *r;
5731{ 5730{
5732 xassert (row->enabled_p); 5731 xassert (row->enabled_p);
5733 5732
5734 if (row->mode_line_p || w->pseudo_window_p) 5733 if (row->mode_line_p || w->pseudo_window_p)
5735 x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA], 5734 x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA],
5736 DRAW_NORMAL_TEXT, 0); 5735 DRAW_NORMAL_TEXT, 0);
@@ -5788,18 +5787,18 @@ expose_overlaps (w, first_overlapping_row, last_overlapping_row)
5788 struct glyph_row *last_overlapping_row; 5787 struct glyph_row *last_overlapping_row;
5789{ 5788{
5790 struct glyph_row *row; 5789 struct glyph_row *row;
5791 5790
5792 for (row = first_overlapping_row; row <= last_overlapping_row; ++row) 5791 for (row = first_overlapping_row; row <= last_overlapping_row; ++row)
5793 if (row->overlapping_p) 5792 if (row->overlapping_p)
5794 { 5793 {
5795 xassert (row->enabled_p && !row->mode_line_p); 5794 xassert (row->enabled_p && !row->mode_line_p);
5796 5795
5797 if (row->used[LEFT_MARGIN_AREA]) 5796 if (row->used[LEFT_MARGIN_AREA])
5798 x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA); 5797 x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA);
5799 5798
5800 if (row->used[TEXT_AREA]) 5799 if (row->used[TEXT_AREA])
5801 x_fix_overlapping_area (w, row, TEXT_AREA); 5800 x_fix_overlapping_area (w, row, TEXT_AREA);
5802 5801
5803 if (row->used[RIGHT_MARGIN_AREA]) 5802 if (row->used[RIGHT_MARGIN_AREA])
5804 x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA); 5803 x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA);
5805 } 5804 }
@@ -5888,7 +5887,7 @@ expose_window (w, fr)
5888 first_overlapping_row = row; 5887 first_overlapping_row = row;
5889 last_overlapping_row = row; 5888 last_overlapping_row = row;
5890 } 5889 }
5891 5890
5892 if (expose_line (w, row, &r)) 5891 if (expose_line (w, row, &r))
5893 mouse_face_overwritten_p = 1; 5892 mouse_face_overwritten_p = 1;
5894 } 5893 }
@@ -5912,7 +5911,7 @@ expose_window (w, fr)
5912 /* Fix the display of overlapping rows. */ 5911 /* Fix the display of overlapping rows. */
5913 if (first_overlapping_row) 5912 if (first_overlapping_row)
5914 expose_overlaps (w, first_overlapping_row, last_overlapping_row); 5913 expose_overlaps (w, first_overlapping_row, last_overlapping_row);
5915 5914
5916 /* Draw border between windows. */ 5915 /* Draw border between windows. */
5917 x_draw_vertical_border (w); 5916 x_draw_vertical_border (w);
5918 5917
@@ -6152,7 +6151,7 @@ glyph_to_pixel_coords (w, hpos, vpos, frame_x, frame_y)
6152/* Parse a button MESSAGE. The button index is returned in PBUTTON, and 6151/* Parse a button MESSAGE. The button index is returned in PBUTTON, and
6153 the state in PUP. XBUTTON provides extra information for extended mouse 6152 the state in PUP. XBUTTON provides extra information for extended mouse
6154 button messages. Returns FALSE if unable to parse the message. */ 6153 button messages. Returns FALSE if unable to parse the message. */
6155BOOL 6154BOOL
6156parse_button (message, xbutton, pbutton, pup) 6155parse_button (message, xbutton, pbutton, pup)
6157 int message; 6156 int message;
6158 int xbutton; 6157 int xbutton;
@@ -6161,7 +6160,7 @@ parse_button (message, xbutton, pbutton, pup)
6161{ 6160{
6162 int button = 0; 6161 int button = 0;
6163 int up = 0; 6162 int up = 0;
6164 6163
6165 switch (message) 6164 switch (message)
6166 { 6165 {
6167 case WM_LBUTTONDOWN: 6166 case WM_LBUTTONDOWN:
@@ -6211,10 +6210,10 @@ parse_button (message, xbutton, pbutton, pup)
6211 default: 6210 default:
6212 return (FALSE); 6211 return (FALSE);
6213 } 6212 }
6214 6213
6215 if (pup) *pup = up; 6214 if (pup) *pup = up;
6216 if (pbutton) *pbutton = button; 6215 if (pbutton) *pbutton = button;
6217 6216
6218 return (TRUE); 6217 return (TRUE);
6219} 6218}
6220 6219
@@ -6477,7 +6476,7 @@ x_y_to_hpos_vpos (w, x, y, hpos, vpos, area, buffer_only_p)
6477 else if (!buffer_only_p || BUFFERP (glyph->object)) 6476 else if (!buffer_only_p || BUFFERP (glyph->object))
6478 break; 6477 break;
6479 } 6478 }
6480 6479
6481 x0 += glyph->pixel_width; 6480 x0 += glyph->pixel_width;
6482 ++glyph; 6481 ++glyph;
6483 } 6482 }
@@ -6540,13 +6539,13 @@ note_mode_line_highlight (w, x, mode_line_p)
6540 struct glyph *glyph, *end; 6539 struct glyph *glyph, *end;
6541 Lisp_Object help, map; 6540 Lisp_Object help, map;
6542 int x0; 6541 int x0;
6543 6542
6544 /* Find the glyph under X. */ 6543 /* Find the glyph under X. */
6545 glyph = row->glyphs[TEXT_AREA]; 6544 glyph = row->glyphs[TEXT_AREA];
6546 end = glyph + row->used[TEXT_AREA]; 6545 end = glyph + row->used[TEXT_AREA];
6547 x0 = - (FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f) 6546 x0 = - (FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f)
6548 + FRAME_X_LEFT_FRINGE_WIDTH (f)); 6547 + FRAME_X_LEFT_FRINGE_WIDTH (f));
6549 6548
6550 while (glyph < end 6549 while (glyph < end
6551 && x >= x0 + glyph->pixel_width) 6550 && x >= x0 + glyph->pixel_width)
6552 { 6551 {
@@ -6904,7 +6903,7 @@ note_mouse_highlight (f, x, y)
6904 the text ``under'' it might have. */ 6903 the text ``under'' it might have. */
6905 struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos); 6904 struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos);
6906 int start = MATRIX_ROW_START_CHARPOS (r); 6905 int start = MATRIX_ROW_START_CHARPOS (r);
6907 6906
6908 pos = string_buffer_position (w, object, start); 6907 pos = string_buffer_position (w, object, start);
6909 if (pos > 0) 6908 if (pos > 0)
6910 mouse_face = get_char_property_and_overlay (make_number (pos), 6909 mouse_face = get_char_property_and_overlay (make_number (pos),
@@ -6928,7 +6927,7 @@ note_mouse_highlight (f, x, y)
6928 &dpyinfo->mouse_face_beg_x, 6927 &dpyinfo->mouse_face_beg_x,
6929 &dpyinfo->mouse_face_beg_y, 6928 &dpyinfo->mouse_face_beg_y,
6930 object); 6929 object);
6931 6930
6932 dpyinfo->mouse_face_past_end 6931 dpyinfo->mouse_face_past_end
6933 = !fast_find_position (w, XFASTINT (after), 6932 = !fast_find_position (w, XFASTINT (after),
6934 &dpyinfo->mouse_face_end_col, 6933 &dpyinfo->mouse_face_end_col,
@@ -6960,7 +6959,7 @@ note_mouse_highlight (f, x, y)
6960 for (i = noverlays - 1; i >= 0 && NILP (help); --i) 6959 for (i = noverlays - 1; i >= 0 && NILP (help); --i)
6961 { 6960 {
6962 overlay = overlay_vec[i]; 6961 overlay = overlay_vec[i];
6963 help = Foverlay_get (overlay, Qhelp_echo); 6962 help = Foverlay_get (overlay, Qhelp_echo);
6964 } 6963 }
6965 6964
6966 if (!NILP (help)) 6965 if (!NILP (help))
@@ -7007,7 +7006,7 @@ note_mouse_highlight (f, x, y)
7007 && charpos < ZV) 7006 && charpos < ZV)
7008 help = Fget_text_property (make_number (charpos), Qhelp_echo, 7007 help = Fget_text_property (make_number (charpos), Qhelp_echo,
7009 object); 7008 object);
7010 7009
7011 if (!NILP (help)) 7010 if (!NILP (help))
7012 { 7011 {
7013 help_echo = help; 7012 help_echo = help;
@@ -7094,7 +7093,7 @@ x_tool_bar_item (f, x, y, glyph, hpos, vpos, prop_idx)
7094 || *hpos < dpyinfo->mouse_face_end_col 7093 || *hpos < dpyinfo->mouse_face_end_col
7095 || dpyinfo->mouse_face_past_end)) 7094 || dpyinfo->mouse_face_past_end))
7096 return 0; 7095 return 0;
7097 7096
7098 return 1; 7097 return 1;
7099} 7098}
7100 7099
@@ -7115,7 +7114,7 @@ w32_handle_tool_bar_click (f, button_event)
7115 Lisp_Object enabled_p; 7114 Lisp_Object enabled_p;
7116 int x = XFASTINT (button_event->x); 7115 int x = XFASTINT (button_event->x);
7117 int y = XFASTINT (button_event->y); 7116 int y = XFASTINT (button_event->y);
7118 7117
7119 /* If not on the highlighted tool-bar item, return. */ 7118 /* If not on the highlighted tool-bar item, return. */
7120 frame_to_window_pixel_xy (w, &x, &y); 7119 frame_to_window_pixel_xy (w, &x, &y);
7121 if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) 7120 if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0)
@@ -7125,7 +7124,7 @@ w32_handle_tool_bar_click (f, button_event)
7125 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); 7124 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
7126 if (NILP (enabled_p)) 7125 if (NILP (enabled_p))
7127 return; 7126 return;
7128 7127
7129 if (button_event->modifiers & down_modifier) 7128 if (button_event->modifiers & down_modifier)
7130 { 7129 {
7131 /* Show item in pressed state. */ 7130 /* Show item in pressed state. */
@@ -7202,7 +7201,7 @@ note_tool_bar_highlight (f, x, y)
7202 goto set_help_echo; 7201 goto set_help_echo;
7203 7202
7204 clear_mouse_face (dpyinfo); 7203 clear_mouse_face (dpyinfo);
7205 7204
7206 /* Mouse is down, but on different tool-bar item? */ 7205 /* Mouse is down, but on different tool-bar item? */
7207 mouse_down_p = (dpyinfo->grabbed 7206 mouse_down_p = (dpyinfo->grabbed
7208 && f == last_mouse_frame 7207 && f == last_mouse_frame
@@ -7213,7 +7212,7 @@ note_tool_bar_highlight (f, x, y)
7213 7212
7214 dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; 7213 dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT;
7215 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; 7214 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
7216 7215
7217 /* If tool-bar item is not enabled, don't highlight it. */ 7216 /* If tool-bar item is not enabled, don't highlight it. */
7218 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); 7217 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
7219 if (!NILP (enabled_p)) 7218 if (!NILP (enabled_p))
@@ -7223,28 +7222,28 @@ note_tool_bar_highlight (f, x, y)
7223 row = MATRIX_ROW (w->current_matrix, vpos); 7222 row = MATRIX_ROW (w->current_matrix, vpos);
7224 for (i = x = 0; i < hpos; ++i) 7223 for (i = x = 0; i < hpos; ++i)
7225 x += row->glyphs[TEXT_AREA][i].pixel_width; 7224 x += row->glyphs[TEXT_AREA][i].pixel_width;
7226 7225
7227 /* Record this as the current active region. */ 7226 /* Record this as the current active region. */
7228 dpyinfo->mouse_face_beg_col = hpos; 7227 dpyinfo->mouse_face_beg_col = hpos;
7229 dpyinfo->mouse_face_beg_row = vpos; 7228 dpyinfo->mouse_face_beg_row = vpos;
7230 dpyinfo->mouse_face_beg_x = x; 7229 dpyinfo->mouse_face_beg_x = x;
7231 dpyinfo->mouse_face_beg_y = row->y; 7230 dpyinfo->mouse_face_beg_y = row->y;
7232 dpyinfo->mouse_face_past_end = 0; 7231 dpyinfo->mouse_face_past_end = 0;
7233 7232
7234 dpyinfo->mouse_face_end_col = hpos + 1; 7233 dpyinfo->mouse_face_end_col = hpos + 1;
7235 dpyinfo->mouse_face_end_row = vpos; 7234 dpyinfo->mouse_face_end_row = vpos;
7236 dpyinfo->mouse_face_end_x = x + glyph->pixel_width; 7235 dpyinfo->mouse_face_end_x = x + glyph->pixel_width;
7237 dpyinfo->mouse_face_end_y = row->y; 7236 dpyinfo->mouse_face_end_y = row->y;
7238 dpyinfo->mouse_face_window = window; 7237 dpyinfo->mouse_face_window = window;
7239 dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID; 7238 dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID;
7240 7239
7241 /* Display it as active. */ 7240 /* Display it as active. */
7242 show_mouse_face (dpyinfo, draw); 7241 show_mouse_face (dpyinfo, draw);
7243 dpyinfo->mouse_face_image_state = draw; 7242 dpyinfo->mouse_face_image_state = draw;
7244 } 7243 }
7245 7244
7246 set_help_echo: 7245 set_help_echo:
7247 7246
7248 /* Set help_echo to a help string.to display for this tool-bar item. 7247 /* Set help_echo to a help string.to display for this tool-bar item.
7249 w32_read_socket does the rest. */ 7248 w32_read_socket does the rest. */
7250 help_echo_object = help_echo_window = Qnil; 7249 help_echo_object = help_echo_window = Qnil;
@@ -7266,7 +7265,7 @@ note_tool_bar_highlight (f, x, y)
7266#if 0 /* This is a version of fast_find_position that's more correct 7265#if 0 /* This is a version of fast_find_position that's more correct
7267 in the presence of hscrolling, for example. I didn't install 7266 in the presence of hscrolling, for example. I didn't install
7268 it right away because the problem fixed is minor, it failed 7267 it right away because the problem fixed is minor, it failed
7269 in 20.x as well, and I think it's too risky to install 7268 in 20.x as well, and I think it's too risky to install
7270 so near the release of 21.1. 2001-09-25 gerd. */ 7269 so near the release of 21.1. 2001-09-25 gerd. */
7271 7270
7272static int 7271static int
@@ -7299,10 +7298,10 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop)
7299 *x = row->x; 7298 *x = row->x;
7300 *y = row->y; 7299 *y = row->y;
7301 *vpos = MATRIX_ROW_VPOS (row, w->current_matrix); 7300 *vpos = MATRIX_ROW_VPOS (row, w->current_matrix);
7302 7301
7303 glyph = row->glyphs[TEXT_AREA]; 7302 glyph = row->glyphs[TEXT_AREA];
7304 end = glyph + row->used[TEXT_AREA]; 7303 end = glyph + row->used[TEXT_AREA];
7305 7304
7306 /* Skip over glyphs not having an object at the start of the row. 7305 /* Skip over glyphs not having an object at the start of the row.
7307 These are special glyphs like truncation marks on terminal 7306 These are special glyphs like truncation marks on terminal
7308 frames. */ 7307 frames. */
@@ -7504,7 +7503,7 @@ fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p)
7504 *x += best_glyph->pixel_width; 7503 *x += best_glyph->pixel_width;
7505 ++*hpos; 7504 ++*hpos;
7506 } 7505 }
7507 7506
7508 *y = best_row->y; 7507 *y = best_row->y;
7509 *vpos = best_row - w->current_matrix->rows; 7508 *vpos = best_row - w->current_matrix->rows;
7510 } 7509 }
@@ -7523,7 +7522,7 @@ show_mouse_face (dpyinfo, draw)
7523{ 7522{
7524 struct window *w = XWINDOW (dpyinfo->mouse_face_window); 7523 struct window *w = XWINDOW (dpyinfo->mouse_face_window);
7525 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7524 struct frame *f = XFRAME (WINDOW_FRAME (w));
7526 7525
7527 if (/* If window is in the process of being destroyed, don't bother 7526 if (/* If window is in the process of being destroyed, don't bother
7528 to do anything. */ 7527 to do anything. */
7529 w->current_matrix != NULL 7528 w->current_matrix != NULL
@@ -7538,7 +7537,7 @@ show_mouse_face (dpyinfo, draw)
7538 7537
7539 first = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row); 7538 first = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row);
7540 last = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row); 7539 last = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row);
7541 7540
7542 for (row = first; row <= last && row->enabled_p; ++row) 7541 for (row = first; row <= last && row->enabled_p; ++row)
7543 { 7542 {
7544 int start_hpos, end_hpos, start_x; 7543 int start_hpos, end_hpos, start_x;
@@ -7562,7 +7561,7 @@ show_mouse_face (dpyinfo, draw)
7562 7561
7563 if (end_hpos > start_hpos) 7562 if (end_hpos > start_hpos)
7564 { 7563 {
7565 x_draw_glyphs (w, start_x, row, TEXT_AREA, 7564 x_draw_glyphs (w, start_x, row, TEXT_AREA,
7566 start_hpos, end_hpos, draw, 0); 7565 start_hpos, end_hpos, draw, 0);
7567 7566
7568 row->mouse_face_p 7567 row->mouse_face_p
@@ -7804,7 +7803,7 @@ w32_mouse_position (fp, insist, bar_window, part, x, y, time)
7804 XFRAME (frame)->mouse_moved = 0; 7803 XFRAME (frame)->mouse_moved = 0;
7805 7804
7806 last_mouse_scroll_bar = Qnil; 7805 last_mouse_scroll_bar = Qnil;
7807 7806
7808 GetCursorPos (&pt); 7807 GetCursorPos (&pt);
7809 7808
7810 /* Now we have a position on the root; find the innermost window 7809 /* Now we have a position on the root; find the innermost window
@@ -7981,14 +7980,14 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole)
7981/************************************************************************ 7980/************************************************************************
7982 Scroll bars, general 7981 Scroll bars, general
7983 ************************************************************************/ 7982 ************************************************************************/
7984 7983
7985HWND 7984HWND
7986my_create_scrollbar (f, bar) 7985my_create_scrollbar (f, bar)
7987 struct frame * f; 7986 struct frame * f;
7988 struct scroll_bar * bar; 7987 struct scroll_bar * bar;
7989{ 7988{
7990 return (HWND) SendMessage (FRAME_W32_WINDOW (f), 7989 return (HWND) SendMessage (FRAME_W32_WINDOW (f),
7991 WM_EMACS_CREATESCROLLBAR, (WPARAM) f, 7990 WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
7992 (LPARAM) bar); 7991 (LPARAM) bar);
7993} 7992}
7994 7993
@@ -8028,7 +8027,7 @@ my_set_focus (f, hwnd)
8028 struct frame * f; 8027 struct frame * f;
8029 HWND hwnd; 8028 HWND hwnd;
8030{ 8029{
8031 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS, 8030 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS,
8032 (WPARAM) hwnd, 0); 8031 (WPARAM) hwnd, 0);
8033} 8032}
8034 8033
@@ -8044,7 +8043,7 @@ my_destroy_window (f, hwnd)
8044 struct frame * f; 8043 struct frame * f;
8045 HWND hwnd; 8044 HWND hwnd;
8046{ 8045{
8047 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW, 8046 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW,
8048 (WPARAM) hwnd, 0); 8047 (WPARAM) hwnd, 0);
8049} 8048}
8050 8049
@@ -8171,7 +8170,7 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
8171 8170
8172 /* Compute the left edge of the scroll bar. */ 8171 /* Compute the left edge of the scroll bar. */
8173 if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)) 8172 if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
8174 sb_left = left + width - sb_width - (width - sb_width) / 2; 8173 sb_left = left + width - sb_width - (width - sb_width) / 2;
8175 else 8174 else
8176 sb_left = left + (width - sb_width) / 2; 8175 sb_left = left + (width - sb_width) / 2;
8177 8176
@@ -8192,7 +8191,7 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
8192 } 8191 }
8193 else 8192 else
8194 { 8193 {
8195 /* It may just need to be moved and resized. */ 8194 /* It may just need to be moved and resized. */
8196 HWND hwnd; 8195 HWND hwnd;
8197 8196
8198 bar = XSCROLL_BAR (w->vertical_scroll_bar); 8197 bar = XSCROLL_BAR (w->vertical_scroll_bar);
@@ -8414,7 +8413,7 @@ w32_scroll_bar_handle_click (bar, msg, emacs_event)
8414 8413
8415 8414
8416 last_mouse_scroll_bar_pos = msg->msg.wParam; 8415 last_mouse_scroll_bar_pos = msg->msg.wParam;
8417 8416
8418 switch (LOWORD (msg->msg.wParam)) 8417 switch (LOWORD (msg->msg.wParam))
8419 { 8418 {
8420 case SB_LINEDOWN: 8419 case SB_LINEDOWN:
@@ -8614,14 +8613,14 @@ static short temp_buffer[100];
8614 We return the number of characters stored into the buffer, 8613 We return the number of characters stored into the buffer,
8615 thus pretending to be `read'. 8614 thus pretending to be `read'.
8616 8615
8617 EXPECTED is nonzero if the caller knows input is available. 8616 EXPECTED is nonzero if the caller knows input is available.
8618 8617
8619 Some of these messages are reposted back to the message queue since the 8618 Some of these messages are reposted back to the message queue since the
8620 system calls the windows proc directly in a context where we cannot return 8619 system calls the windows proc directly in a context where we cannot return
8621 the data nor can we guarantee the state we are in. So if we dispatch them 8620 the data nor can we guarantee the state we are in. So if we dispatch them
8622 we will get into an infinite loop. To prevent this from ever happening we 8621 we will get into an infinite loop. To prevent this from ever happening we
8623 will set a variable to indicate we are in the read_socket call and indicate 8622 will set a variable to indicate we are in the read_socket call and indicate
8624 which message we are processing since the windows proc gets called 8623 which message we are processing since the windows proc gets called
8625 recursively with different messages by the system. 8624 recursively with different messages by the system.
8626*/ 8625*/
8627 8626
@@ -8662,7 +8661,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8662 case WM_PAINT: 8661 case WM_PAINT:
8663 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 8662 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
8664 8663
8665 if (f) 8664 if (f)
8666 { 8665 {
8667 if (msg.rect.right == msg.rect.left || 8666 if (msg.rect.right == msg.rect.left ||
8668 msg.rect.bottom == msg.rect.top) 8667 msg.rect.bottom == msg.rect.top)
@@ -8722,7 +8721,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8722 { 8721 {
8723 if (numchars == 0) 8722 if (numchars == 0)
8724 abort (); 8723 abort ();
8725 8724
8726 bufp->kind = LANGUAGE_CHANGE_EVENT; 8725 bufp->kind = LANGUAGE_CHANGE_EVENT;
8727 XSETFRAME (bufp->frame_or_window, f); 8726 XSETFRAME (bufp->frame_or_window, f);
8728 bufp->arg = Qnil; 8727 bufp->arg = Qnil;
@@ -8737,7 +8736,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8737 case WM_KEYDOWN: 8736 case WM_KEYDOWN:
8738 case WM_SYSKEYDOWN: 8737 case WM_SYSKEYDOWN:
8739 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 8738 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
8740 8739
8741 if (f && !f->iconified) 8740 if (f && !f->iconified)
8742 { 8741 {
8743 if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) 8742 if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
@@ -8764,7 +8763,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8764 case WM_SYSCHAR: 8763 case WM_SYSCHAR:
8765 case WM_CHAR: 8764 case WM_CHAR:
8766 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 8765 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
8767 8766
8768 if (f && !f->iconified) 8767 if (f && !f->iconified)
8769 { 8768 {
8770 if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) 8769 if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
@@ -8798,7 +8797,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8798 f = last_mouse_frame; 8797 f = last_mouse_frame;
8799 else 8798 else
8800 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 8799 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
8801 8800
8802 if (dpyinfo->mouse_face_hidden) 8801 if (dpyinfo->mouse_face_hidden)
8803 { 8802 {
8804 dpyinfo->mouse_face_hidden = 0; 8803 dpyinfo->mouse_face_hidden = 0;
@@ -8851,17 +8850,17 @@ w32_read_socket (sd, bufp, numchars, expected)
8851 int up; 8850 int up;
8852 8851
8853 emacs_event.kind = NO_EVENT; 8852 emacs_event.kind = NO_EVENT;
8854 8853
8855 if (dpyinfo->grabbed && last_mouse_frame 8854 if (dpyinfo->grabbed && last_mouse_frame
8856 && FRAME_LIVE_P (last_mouse_frame)) 8855 && FRAME_LIVE_P (last_mouse_frame))
8857 f = last_mouse_frame; 8856 f = last_mouse_frame;
8858 else 8857 else
8859 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 8858 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
8860 8859
8861 if (f) 8860 if (f)
8862 { 8861 {
8863 construct_mouse_click (&emacs_event, &msg, f); 8862 construct_mouse_click (&emacs_event, &msg, f);
8864 8863
8865 /* Is this in the tool-bar? */ 8864 /* Is this in the tool-bar? */
8866 if (WINDOWP (f->tool_bar_window) 8865 if (WINDOWP (f->tool_bar_window)
8867 && XFASTINT (XWINDOW (f->tool_bar_window)->height)) 8866 && XFASTINT (XWINDOW (f->tool_bar_window)->height))
@@ -8893,7 +8892,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8893 numchars--; 8892 numchars--;
8894 } 8893 }
8895 } 8894 }
8896 8895
8897 parse_button (msg.msg.message, HIWORD (msg.msg.wParam), 8896 parse_button (msg.msg.message, HIWORD (msg.msg.wParam),
8898 &button, &up); 8897 &button, &up);
8899 8898
@@ -8917,7 +8916,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8917 } 8916 }
8918 break; 8917 break;
8919 } 8918 }
8920 8919
8921 case WM_MOUSEWHEEL: 8920 case WM_MOUSEWHEEL:
8922 if (dpyinfo->grabbed && last_mouse_frame 8921 if (dpyinfo->grabbed && last_mouse_frame
8923 && FRAME_LIVE_P (last_mouse_frame)) 8922 && FRAME_LIVE_P (last_mouse_frame))
@@ -8927,7 +8926,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8927 8926
8928 if (f) 8927 if (f)
8929 { 8928 {
8930 if ((!dpyinfo->w32_focus_frame 8929 if ((!dpyinfo->w32_focus_frame
8931 || f == dpyinfo->w32_focus_frame) 8930 || f == dpyinfo->w32_focus_frame)
8932 && (numchars >= 1)) 8931 && (numchars >= 1))
8933 { 8932 {
@@ -8955,7 +8954,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8955 { 8954 {
8956 struct scroll_bar *bar = 8955 struct scroll_bar *bar =
8957 x_window_to_scroll_bar ((HWND)msg.msg.lParam); 8956 x_window_to_scroll_bar ((HWND)msg.msg.lParam);
8958 8957
8959 if (bar && numchars >= 1) 8958 if (bar && numchars >= 1)
8960 { 8959 {
8961 if (w32_scroll_bar_handle_click (bar, &msg, bufp)) 8960 if (w32_scroll_bar_handle_click (bar, &msg, bufp))
@@ -8967,7 +8966,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8967 } 8966 }
8968 break; 8967 break;
8969 } 8968 }
8970 8969
8971 case WM_WINDOWPOSCHANGED: 8970 case WM_WINDOWPOSCHANGED:
8972 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 8971 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
8973 if (f) 8972 if (f)
@@ -8990,7 +8989,7 @@ w32_read_socket (sd, bufp, numchars, expected)
8990 8989
8991 case WM_MOVE: 8990 case WM_MOVE:
8992 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 8991 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
8993 8992
8994 if (f && !f->async_iconified) 8993 if (f && !f->async_iconified)
8995 { 8994 {
8996 int x, y; 8995 int x, y;
@@ -9032,7 +9031,7 @@ w32_read_socket (sd, bufp, numchars, expected)
9032 9031
9033 case WM_SIZE: 9032 case WM_SIZE:
9034 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 9033 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
9035 9034
9036 /* Inform lisp of whether frame has been iconified etc. */ 9035 /* Inform lisp of whether frame has been iconified etc. */
9037 if (f) 9036 if (f)
9038 { 9037 {
@@ -9041,7 +9040,7 @@ w32_read_socket (sd, bufp, numchars, expected)
9041 case SIZE_MINIMIZED: 9040 case SIZE_MINIMIZED:
9042 f->async_visible = 0; 9041 f->async_visible = 0;
9043 f->async_iconified = 1; 9042 f->async_iconified = 1;
9044 9043
9045 bufp->kind = ICONIFY_EVENT; 9044 bufp->kind = ICONIFY_EVENT;
9046 XSETFRAME (bufp->frame_or_window, f); 9045 XSETFRAME (bufp->frame_or_window, f);
9047 bufp->arg = Qnil; 9046 bufp->arg = Qnil;
@@ -9054,11 +9053,11 @@ w32_read_socket (sd, bufp, numchars, expected)
9054 case SIZE_RESTORED: 9053 case SIZE_RESTORED:
9055 f->async_visible = 1; 9054 f->async_visible = 1;
9056 f->async_iconified = 0; 9055 f->async_iconified = 0;
9057 9056
9058 /* wait_reading_process_input will notice this and update 9057 /* wait_reading_process_input will notice this and update
9059 the frame's display structures. */ 9058 the frame's display structures. */
9060 SET_FRAME_GARBAGED (f); 9059 SET_FRAME_GARBAGED (f);
9061 9060
9062 if (f->iconified) 9061 if (f->iconified)
9063 { 9062 {
9064 int x, y; 9063 int x, y;
@@ -9096,21 +9095,21 @@ w32_read_socket (sd, bufp, numchars, expected)
9096 int columns; 9095 int columns;
9097 int width; 9096 int width;
9098 int height; 9097 int height;
9099 9098
9100 GetClientRect (msg.msg.hwnd, &rect); 9099 GetClientRect (msg.msg.hwnd, &rect);
9101 9100
9102 height = rect.bottom - rect.top; 9101 height = rect.bottom - rect.top;
9103 width = rect.right - rect.left; 9102 width = rect.right - rect.left;
9104 9103
9105 rows = PIXEL_TO_CHAR_HEIGHT (f, height); 9104 rows = PIXEL_TO_CHAR_HEIGHT (f, height);
9106 columns = PIXEL_TO_CHAR_WIDTH (f, width); 9105 columns = PIXEL_TO_CHAR_WIDTH (f, width);
9107 9106
9108 /* TODO: Clip size to the screen dimensions. */ 9107 /* TODO: Clip size to the screen dimensions. */
9109 9108
9110 /* Even if the number of character rows and columns has 9109 /* Even if the number of character rows and columns has
9111 not changed, the font size may have changed, so we need 9110 not changed, the font size may have changed, so we need
9112 to check the pixel dimensions as well. */ 9111 to check the pixel dimensions as well. */
9113 9112
9114 if (columns != f->width 9113 if (columns != f->width
9115 || rows != f->height 9114 || rows != f->height
9116 || width != f->output_data.w32->pixel_width 9115 || width != f->output_data.w32->pixel_width
@@ -9157,12 +9156,12 @@ w32_read_socket (sd, bufp, numchars, expected)
9157 } 9156 }
9158 } 9157 }
9159 break; 9158 break;
9160 9159
9161 case WM_SETFOCUS: 9160 case WM_SETFOCUS:
9162 f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd); 9161 f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd);
9163 9162
9164 dpyinfo->w32_focus_event_frame = f; 9163 dpyinfo->w32_focus_event_frame = f;
9165 9164
9166 if (f) 9165 if (f)
9167 x_new_focus_frame (dpyinfo, f); 9166 x_new_focus_frame (dpyinfo, f);
9168 9167
@@ -9214,12 +9213,12 @@ w32_read_socket (sd, bufp, numchars, expected)
9214 9213
9215 case WM_CLOSE: 9214 case WM_CLOSE:
9216 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 9215 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
9217 9216
9218 if (f) 9217 if (f)
9219 { 9218 {
9220 if (numchars == 0) 9219 if (numchars == 0)
9221 abort (); 9220 abort ();
9222 9221
9223 bufp->kind = DELETE_WINDOW_EVENT; 9222 bufp->kind = DELETE_WINDOW_EVENT;
9224 XSETFRAME (bufp->frame_or_window, f); 9223 XSETFRAME (bufp->frame_or_window, f);
9225 bufp->arg = Qnil; 9224 bufp->arg = Qnil;
@@ -9231,12 +9230,12 @@ w32_read_socket (sd, bufp, numchars, expected)
9231 9230
9232 case WM_INITMENU: 9231 case WM_INITMENU:
9233 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 9232 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
9234 9233
9235 if (f) 9234 if (f)
9236 { 9235 {
9237 if (numchars == 0) 9236 if (numchars == 0)
9238 abort (); 9237 abort ();
9239 9238
9240 bufp->kind = MENU_BAR_ACTIVATE_EVENT; 9239 bufp->kind = MENU_BAR_ACTIVATE_EVENT;
9241 XSETFRAME (bufp->frame_or_window, f); 9240 XSETFRAME (bufp->frame_or_window, f);
9242 bufp->arg = Qnil; 9241 bufp->arg = Qnil;
@@ -9262,7 +9261,7 @@ w32_read_socket (sd, bufp, numchars, expected)
9262 case WM_DISPLAYCHANGE: 9261 case WM_DISPLAYCHANGE:
9263 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 9262 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
9264 9263
9265 if (f) 9264 if (f)
9266 { 9265 {
9267 dpyinfo->width = (short) LOWORD (msg.msg.lParam); 9266 dpyinfo->width = (short) LOWORD (msg.msg.lParam);
9268 dpyinfo->height = (short) HIWORD (msg.msg.lParam); 9267 dpyinfo->height = (short) HIWORD (msg.msg.lParam);
@@ -9270,7 +9269,7 @@ w32_read_socket (sd, bufp, numchars, expected)
9270 DebPrint (("display change: %d %d\n", dpyinfo->width, 9269 DebPrint (("display change: %d %d\n", dpyinfo->width,
9271 dpyinfo->height)); 9270 dpyinfo->height));
9272 } 9271 }
9273 9272
9274 check_visibility = 1; 9273 check_visibility = 1;
9275 break; 9274 break;
9276 9275
@@ -9278,15 +9277,15 @@ w32_read_socket (sd, bufp, numchars, expected)
9278 /* Check for messages registered at runtime. */ 9277 /* Check for messages registered at runtime. */
9279 if (msg.msg.message == msh_mousewheel) 9278 if (msg.msg.message == msh_mousewheel)
9280 { 9279 {
9281 if (dpyinfo->grabbed && last_mouse_frame 9280 if (dpyinfo->grabbed && last_mouse_frame
9282 && FRAME_LIVE_P (last_mouse_frame)) 9281 && FRAME_LIVE_P (last_mouse_frame))
9283 f = last_mouse_frame; 9282 f = last_mouse_frame;
9284 else 9283 else
9285 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 9284 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
9286 9285
9287 if (f) 9286 if (f)
9288 { 9287 {
9289 if ((!dpyinfo->w32_focus_frame 9288 if ((!dpyinfo->w32_focus_frame
9290 || f == dpyinfo->w32_focus_frame) 9289 || f == dpyinfo->w32_focus_frame)
9291 && (numchars >= 1)) 9290 && (numchars >= 1))
9292 { 9291 {
@@ -9643,7 +9642,7 @@ x_erase_phys_cursor (w)
9643 screen. */ 9642 screen. */
9644 if (w->phys_cursor_type == NO_CURSOR) 9643 if (w->phys_cursor_type == NO_CURSOR)
9645 goto mark_cursor_off; 9644 goto mark_cursor_off;
9646 9645
9647 /* VPOS >= active_glyphs->nrows means that window has been resized. 9646 /* VPOS >= active_glyphs->nrows means that window has been resized.
9648 Don't bother to erase the cursor. */ 9647 Don't bother to erase the cursor. */
9649 if (vpos >= active_glyphs->nrows) 9648 if (vpos >= active_glyphs->nrows)
@@ -9654,13 +9653,13 @@ x_erase_phys_cursor (w)
9654 cursor_row = MATRIX_ROW (active_glyphs, vpos); 9653 cursor_row = MATRIX_ROW (active_glyphs, vpos);
9655 if (!cursor_row->enabled_p) 9654 if (!cursor_row->enabled_p)
9656 goto mark_cursor_off; 9655 goto mark_cursor_off;
9657 9656
9658 /* If row is completely invisible, don't attempt to delete a cursor which 9657 /* If row is completely invisible, don't attempt to delete a cursor which
9659 isn't there. This may happen if cursor is at top of window, and 9658 isn't there. This may happen if cursor is at top of window, and
9660 we switch to a buffer with a header line in that window. */ 9659 we switch to a buffer with a header line in that window. */
9661 if (cursor_row->visible_height <= 0) 9660 if (cursor_row->visible_height <= 0)
9662 goto mark_cursor_off; 9661 goto mark_cursor_off;
9663 9662
9664 /* This can happen when the new row is shorter than the old one. 9663 /* This can happen when the new row is shorter than the old one.
9665 In this case, either x_draw_glyphs or clear_end_of_line 9664 In this case, either x_draw_glyphs or clear_end_of_line
9666 should have cleared the cursor. Note that we wouldn't be 9665 should have cleared the cursor. Note that we wouldn't be
@@ -9706,7 +9705,7 @@ x_erase_phys_cursor (w)
9706 cursor_row->visible_height); 9705 cursor_row->visible_height);
9707 release_frame_dc (f, hdc); 9706 release_frame_dc (f, hdc);
9708 } 9707 }
9709 9708
9710 /* Erase the cursor by redrawing the character underneath it. */ 9709 /* Erase the cursor by redrawing the character underneath it. */
9711 if (mouse_face_here_p) 9710 if (mouse_face_here_p)
9712 hl = DRAW_MOUSE_FACE; 9711 hl = DRAW_MOUSE_FACE;
@@ -9729,7 +9728,7 @@ cursor_in_mouse_face_p (w)
9729 struct w32_display_info *dpyinfo 9728 struct w32_display_info *dpyinfo
9730 = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame)); 9729 = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame));
9731 int in_mouse_face = 0; 9730 int in_mouse_face = 0;
9732 9731
9733 if (WINDOWP (dpyinfo->mouse_face_window) 9732 if (WINDOWP (dpyinfo->mouse_face_window)
9734 && XWINDOW (dpyinfo->mouse_face_window) == w) 9733 && XWINDOW (dpyinfo->mouse_face_window) == w)
9735 { 9734 {
@@ -9784,8 +9783,8 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9784 current_glyphs = w->current_matrix; 9783 current_glyphs = w->current_matrix;
9785 glyph_row = MATRIX_ROW (current_glyphs, vpos); 9784 glyph_row = MATRIX_ROW (current_glyphs, vpos);
9786 glyph = glyph_row->glyphs[TEXT_AREA] + hpos; 9785 glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
9787 9786
9788 /* If cursor row is not enabled, we don't really know where to 9787 /* If cursor row is not enabled, we don't really know where to
9789 display the cursor. */ 9788 display the cursor. */
9790 if (!glyph_row->enabled_p) 9789 if (!glyph_row->enabled_p)
9791 { 9790 {
@@ -9819,7 +9818,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9819 { 9818 {
9820 w->phys_cursor_ascent = glyph_row->ascent; 9819 w->phys_cursor_ascent = glyph_row->ascent;
9821 w->phys_cursor_height = glyph_row->height; 9820 w->phys_cursor_height = glyph_row->height;
9822 9821
9823 /* Set phys_cursor_.* before x_draw_.* is called because some 9822 /* Set phys_cursor_.* before x_draw_.* is called because some
9824 of them may need the information. */ 9823 of them may need the information. */
9825 w->phys_cursor.x = x; 9824 w->phys_cursor.x = x;
@@ -10256,7 +10255,7 @@ x_calc_absolute_position (f)
10256 { 10255 {
10257 RECT rt; 10256 RECT rt;
10258 rt.left = rt.right = rt.top = rt.bottom = 0; 10257 rt.left = rt.right = rt.top = rt.bottom = 0;
10259 10258
10260 BLOCK_INPUT; 10259 BLOCK_INPUT;
10261 AdjustWindowRect(&rt, f->output_data.w32->dwStyle, 10260 AdjustWindowRect(&rt, f->output_data.w32->dwStyle,
10262 FRAME_EXTERNAL_MENU_BAR (f)); 10261 FRAME_EXTERNAL_MENU_BAR (f));
@@ -10336,12 +10335,12 @@ x_check_fullscreen (f)
10336 if (f->output_data.w32->want_fullscreen & FULLSCREEN_BOTH) 10335 if (f->output_data.w32->want_fullscreen & FULLSCREEN_BOTH)
10337 { 10336 {
10338 int width, height, ign; 10337 int width, height, ign;
10339 10338
10340 x_real_positions (f, &f->output_data.w32->left_pos, 10339 x_real_positions (f, &f->output_data.w32->left_pos,
10341 &f->output_data.w32->top_pos); 10340 &f->output_data.w32->top_pos);
10342 10341
10343 x_fullscreen_adjust (f, &width, &height, &ign, &ign); 10342 x_fullscreen_adjust (f, &width, &height, &ign, &ign);
10344 10343
10345 /* We do not need to move the window, it shall be taken care of 10344 /* We do not need to move the window, it shall be taken care of
10346 when setting WM manager hints. 10345 when setting WM manager hints.
10347 If the frame is visible already, the position is checked by 10346 If the frame is visible already, the position is checked by
@@ -10377,7 +10376,7 @@ x_check_fullscreen_move (f)
10377 expect_top = 0; 10376 expect_top = 0;
10378 if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH) 10377 if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH)
10379 expect_left = 0; 10378 expect_left = 0;
10380 10379
10381 if (expect_top != f->output_data.w32->top_pos 10380 if (expect_top != f->output_data.w32->top_pos
10382 || expect_left != f->output_data.w32->left_pos) 10381 || expect_left != f->output_data.w32->left_pos)
10383 x_set_offset (f, expect_left, expect_top, 1); 10382 x_set_offset (f, expect_left, expect_top, 1);
@@ -10405,11 +10404,11 @@ x_fullscreen_adjust (f, width, height, top_pos, left_pos)
10405 10404
10406 *top_pos = f->output_data.w32->top_pos; 10405 *top_pos = f->output_data.w32->top_pos;
10407 *left_pos = f->output_data.w32->left_pos; 10406 *left_pos = f->output_data.w32->left_pos;
10408 10407
10409 if (f->output_data.w32->want_fullscreen & FULLSCREEN_HEIGHT) 10408 if (f->output_data.w32->want_fullscreen & FULLSCREEN_HEIGHT)
10410 { 10409 {
10411 int ph; 10410 int ph;
10412 10411
10413 ph = FRAME_X_DISPLAY_INFO (f)->height; 10412 ph = FRAME_X_DISPLAY_INFO (f)->height;
10414 newheight = PIXEL_TO_CHAR_HEIGHT (f, ph); 10413 newheight = PIXEL_TO_CHAR_HEIGHT (f, ph);
10415 ph = CHAR_TO_PIXEL_HEIGHT (f, newheight) 10414 ph = CHAR_TO_PIXEL_HEIGHT (f, newheight)
@@ -10421,7 +10420,7 @@ x_fullscreen_adjust (f, width, height, top_pos, left_pos)
10421 if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH) 10420 if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH)
10422 { 10421 {
10423 int pw; 10422 int pw;
10424 10423
10425 pw = FRAME_X_DISPLAY_INFO (f)->width; 10424 pw = FRAME_X_DISPLAY_INFO (f)->width;
10426 newwidth = PIXEL_TO_CHAR_WIDTH (f, pw); 10425 newwidth = PIXEL_TO_CHAR_WIDTH (f, pw);
10427 pw = CHAR_TO_PIXEL_WIDTH (f, newwidth) 10426 pw = CHAR_TO_PIXEL_WIDTH (f, newwidth)
@@ -10447,9 +10446,9 @@ x_set_window_size (f, change_gravity, cols, rows)
10447 int cols, rows; 10446 int cols, rows;
10448{ 10447{
10449 int pixelwidth, pixelheight; 10448 int pixelwidth, pixelheight;
10450 10449
10451 BLOCK_INPUT; 10450 BLOCK_INPUT;
10452 10451
10453 check_frame_size (f, &rows, &cols); 10452 check_frame_size (f, &rows, &cols);
10454 f->output_data.w32->vertical_scroll_bar_extra 10453 f->output_data.w32->vertical_scroll_bar_extra
10455 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) 10454 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
@@ -10460,33 +10459,33 @@ x_set_window_size (f, change_gravity, cols, rows)
10460 10459
10461 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); 10460 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
10462 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); 10461 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
10463 10462
10464 f->output_data.w32->win_gravity = NorthWestGravity; 10463 f->output_data.w32->win_gravity = NorthWestGravity;
10465 x_wm_set_size_hint (f, (long) 0, 0); 10464 x_wm_set_size_hint (f, (long) 0, 0);
10466 10465
10467 { 10466 {
10468 RECT rect; 10467 RECT rect;
10469 10468
10470 rect.left = rect.top = 0; 10469 rect.left = rect.top = 0;
10471 rect.right = pixelwidth; 10470 rect.right = pixelwidth;
10472 rect.bottom = pixelheight; 10471 rect.bottom = pixelheight;
10473 10472
10474 AdjustWindowRect(&rect, f->output_data.w32->dwStyle, 10473 AdjustWindowRect(&rect, f->output_data.w32->dwStyle,
10475 FRAME_EXTERNAL_MENU_BAR (f)); 10474 FRAME_EXTERNAL_MENU_BAR (f));
10476 10475
10477 my_set_window_pos (FRAME_W32_WINDOW (f), 10476 my_set_window_pos (FRAME_W32_WINDOW (f),
10478 NULL, 10477 NULL,
10479 0, 0, 10478 0, 0,
10480 rect.right - rect.left, 10479 rect.right - rect.left,
10481 rect.bottom - rect.top, 10480 rect.bottom - rect.top,
10482 SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); 10481 SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
10483 } 10482 }
10484 10483
10485 /* Now, strictly speaking, we can't be sure that this is accurate, 10484 /* Now, strictly speaking, we can't be sure that this is accurate,
10486 but the window manager will get around to dealing with the size 10485 but the window manager will get around to dealing with the size
10487 change request eventually, and we'll hear how it went when the 10486 change request eventually, and we'll hear how it went when the
10488 ConfigureNotify event gets here. 10487 ConfigureNotify event gets here.
10489 10488
10490 We could just not bother storing any of this information here, 10489 We could just not bother storing any of this information here,
10491 and let the ConfigureNotify event set everything up, but that 10490 and let the ConfigureNotify event set everything up, but that
10492 might be kind of confusing to the Lisp code, since size changes 10491 might be kind of confusing to the Lisp code, since size changes
@@ -10509,7 +10508,7 @@ x_set_window_size (f, change_gravity, cols, rows)
10509 mark_window_cursors_off (XWINDOW (f->root_window)); 10508 mark_window_cursors_off (XWINDOW (f->root_window));
10510 10509
10511 /* Clear out any recollection of where the mouse highlighting was, 10510 /* Clear out any recollection of where the mouse highlighting was,
10512 since it might be in a place that's outside the new frame size. 10511 since it might be in a place that's outside the new frame size.
10513 Actually checking whether it is outside is a pain in the neck, 10512 Actually checking whether it is outside is a pain in the neck,
10514 so don't try--just let the highlighting be done afresh with new size. */ 10513 so don't try--just let the highlighting be done afresh with new size. */
10515 cancel_mouse_face (f); 10514 cancel_mouse_face (f);
@@ -10761,11 +10760,11 @@ x_make_frame_invisible (f)
10761 /* Don't keep the highlight on an invisible frame. */ 10760 /* Don't keep the highlight on an invisible frame. */
10762 if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f) 10761 if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f)
10763 FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0; 10762 FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0;
10764 10763
10765 BLOCK_INPUT; 10764 BLOCK_INPUT;
10766 10765
10767 my_show_window (f, FRAME_W32_WINDOW (f), SW_HIDE); 10766 my_show_window (f, FRAME_W32_WINDOW (f), SW_HIDE);
10768 10767
10769 /* We can't distinguish this from iconification 10768 /* We can't distinguish this from iconification
10770 just by the event that we get from the server. 10769 just by the event that we get from the server.
10771 So we can't win using the usual strategy of letting 10770 So we can't win using the usual strategy of letting
@@ -10775,7 +10774,7 @@ x_make_frame_invisible (f)
10775 FRAME_ICONIFIED_P (f) = 0; 10774 FRAME_ICONIFIED_P (f) = 0;
10776 f->async_visible = 0; 10775 f->async_visible = 0;
10777 f->async_iconified = 0; 10776 f->async_iconified = 0;
10778 10777
10779 UNBLOCK_INPUT; 10778 UNBLOCK_INPUT;
10780} 10779}
10781 10780
@@ -10819,7 +10818,7 @@ x_free_frame_resources (f)
10819 10818
10820 if (FRAME_W32_WINDOW (f)) 10819 if (FRAME_W32_WINDOW (f))
10821 my_destroy_window (f, FRAME_W32_WINDOW (f)); 10820 my_destroy_window (f, FRAME_W32_WINDOW (f));
10822 10821
10823 free_frame_menubar (f); 10822 free_frame_menubar (f);
10824 10823
10825 unload_color (f, f->output_data.x->foreground_pixel); 10824 unload_color (f, f->output_data.x->foreground_pixel);
@@ -10835,10 +10834,10 @@ x_free_frame_resources (f)
10835 10834
10836 if (FRAME_FACE_CACHE (f)) 10835 if (FRAME_FACE_CACHE (f))
10837 free_frame_faces (f); 10836 free_frame_faces (f);
10838 10837
10839 xfree (f->output_data.w32); 10838 xfree (f->output_data.w32);
10840 f->output_data.w32 = NULL; 10839 f->output_data.w32 = NULL;
10841 10840
10842 if (f == dpyinfo->w32_focus_frame) 10841 if (f == dpyinfo->w32_focus_frame)
10843 dpyinfo->w32_focus_frame = 0; 10842 dpyinfo->w32_focus_frame = 0;
10844 if (f == dpyinfo->w32_focus_event_frame) 10843 if (f == dpyinfo->w32_focus_event_frame)
@@ -10944,7 +10943,7 @@ x_check_font (f, font)
10944 xassert (font != NULL); 10943 xassert (font != NULL);
10945 10944
10946 for (i = 0; i < dpyinfo->n_fonts; i++) 10945 for (i = 0; i < dpyinfo->n_fonts; i++)
10947 if (dpyinfo->font_table[i].name 10946 if (dpyinfo->font_table[i].name
10948 && font == dpyinfo->font_table[i].font) 10947 && font == dpyinfo->font_table[i].font)
10949 break; 10948 break;
10950 10949
@@ -10988,20 +10987,20 @@ x_compute_min_glyph_bounds (f)
10988 XFontStruct *font; 10987 XFontStruct *font;
10989 int old_width = dpyinfo->smallest_char_width; 10988 int old_width = dpyinfo->smallest_char_width;
10990 int old_height = dpyinfo->smallest_font_height; 10989 int old_height = dpyinfo->smallest_font_height;
10991 10990
10992 dpyinfo->smallest_font_height = 100000; 10991 dpyinfo->smallest_font_height = 100000;
10993 dpyinfo->smallest_char_width = 100000; 10992 dpyinfo->smallest_char_width = 100000;
10994 10993
10995 for (i = 0; i < dpyinfo->n_fonts; ++i) 10994 for (i = 0; i < dpyinfo->n_fonts; ++i)
10996 if (dpyinfo->font_table[i].name) 10995 if (dpyinfo->font_table[i].name)
10997 { 10996 {
10998 struct font_info *fontp = dpyinfo->font_table + i; 10997 struct font_info *fontp = dpyinfo->font_table + i;
10999 int w, h; 10998 int w, h;
11000 10999
11001 font = (XFontStruct *) fontp->font; 11000 font = (XFontStruct *) fontp->font;
11002 xassert (font != (XFontStruct *) ~0); 11001 xassert (font != (XFontStruct *) ~0);
11003 x_font_min_bounds (font, &w, &h); 11002 x_font_min_bounds (font, &w, &h);
11004 11003
11005 dpyinfo->smallest_font_height = min (dpyinfo->smallest_font_height, h); 11004 dpyinfo->smallest_font_height = min (dpyinfo->smallest_font_height, h);
11006 dpyinfo->smallest_char_width = min (dpyinfo->smallest_char_width, w); 11005 dpyinfo->smallest_char_width = min (dpyinfo->smallest_char_width, w);
11007 } 11006 }
@@ -11041,7 +11040,7 @@ w32_initialize_display_info (display_name)
11041 w32_display_name_list = Fcons (Fcons (display_name, Qnil), 11040 w32_display_name_list = Fcons (Fcons (display_name, Qnil),
11042 w32_display_name_list); 11041 w32_display_name_list);
11043 dpyinfo->name_list_element = XCAR (w32_display_name_list); 11042 dpyinfo->name_list_element = XCAR (w32_display_name_list);
11044 11043
11045 dpyinfo->w32_id_name 11044 dpyinfo->w32_id_name
11046 = (char *) xmalloc (SCHARS (Vinvocation_name) 11045 = (char *) xmalloc (SCHARS (Vinvocation_name)
11047 + SCHARS (Vsystem_name) 11046 + SCHARS (Vsystem_name)
@@ -11079,15 +11078,15 @@ w32_term_init (display_name, xrm_option, resource_name)
11079{ 11078{
11080 struct w32_display_info *dpyinfo; 11079 struct w32_display_info *dpyinfo;
11081 HDC hdc; 11080 HDC hdc;
11082 11081
11083 BLOCK_INPUT; 11082 BLOCK_INPUT;
11084 11083
11085 if (!w32_initialized) 11084 if (!w32_initialized)
11086 { 11085 {
11087 w32_initialize (); 11086 w32_initialize ();
11088 w32_initialized = 1; 11087 w32_initialized = 1;
11089 } 11088 }
11090 11089
11091 { 11090 {
11092 int argc = 0; 11091 int argc = 0;
11093 char *argv[3]; 11092 char *argv[3];
@@ -11100,7 +11099,7 @@ w32_term_init (display_name, xrm_option, resource_name)
11100 argv[argc++] = xrm_option; 11099 argv[argc++] = xrm_option;
11101 } 11100 }
11102 } 11101 }
11103 11102
11104 w32_initialize_display_info (display_name); 11103 w32_initialize_display_info (display_name);
11105 11104
11106 dpyinfo = &one_w32_display_info; 11105 dpyinfo = &one_w32_display_info;
@@ -11108,7 +11107,7 @@ w32_term_init (display_name, xrm_option, resource_name)
11108 /* Put this display on the chain. */ 11107 /* Put this display on the chain. */
11109 dpyinfo->next = x_display_list; 11108 dpyinfo->next = x_display_list;
11110 x_display_list = dpyinfo; 11109 x_display_list = dpyinfo;
11111 11110
11112 hdc = GetDC (GetDesktopWindow ()); 11111 hdc = GetDC (GetDesktopWindow ());
11113 11112
11114 dpyinfo->height = GetDeviceCaps (hdc, VERTRES); 11113 dpyinfo->height = GetDeviceCaps (hdc, VERTRES);
@@ -11291,7 +11290,7 @@ w32_initialize ()
11291 init_crit (); 11290 init_crit ();
11292 11291
11293 dwMainThreadId = GetCurrentThreadId (); 11292 dwMainThreadId = GetCurrentThreadId ();
11294 DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), 11293 DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
11295 GetCurrentProcess (), &hMainThread, 0, TRUE, DUPLICATE_SAME_ACCESS); 11294 GetCurrentProcess (), &hMainThread, 0, TRUE, DUPLICATE_SAME_ACCESS);
11296 11295
11297 /* Wait for thread to start */ 11296 /* Wait for thread to start */
@@ -11301,13 +11300,13 @@ w32_initialize ()
11301 11300
11302 PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE); 11301 PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
11303 11302
11304 hWindowsThread = CreateThread (NULL, 0, 11303 hWindowsThread = CreateThread (NULL, 0,
11305 (LPTHREAD_START_ROUTINE) w32_msg_worker, 11304 (LPTHREAD_START_ROUTINE) w32_msg_worker,
11306 0, 0, &dwWindowsThreadId); 11305 0, 0, &dwWindowsThreadId);
11307 11306
11308 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); 11307 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
11309 } 11308 }
11310 11309
11311 /* It is desirable that mainThread should have the same notion of 11310 /* It is desirable that mainThread should have the same notion of
11312 focus window and active window as windowsThread. Unfortunately, the 11311 focus window and active window as windowsThread. Unfortunately, the
11313 following call to AttachThreadInput, which should do precisely what 11312 following call to AttachThreadInput, which should do precisely what
@@ -11387,7 +11386,7 @@ When nil, CapsLock only affects normal character input keys. */);
11387 &Vw32_recognize_altgr, 11386 &Vw32_recognize_altgr,
11388 doc: /* Recognize right-alt and left-ctrl as AltGr. 11387 doc: /* Recognize right-alt and left-ctrl as AltGr.
11389When nil, the right-alt and left-ctrl key combination is 11388When nil, the right-alt and left-ctrl key combination is
11390interpreted normally. */); 11389interpreted normally. */);
11391 Vw32_recognize_altgr = Qt; 11390 Vw32_recognize_altgr = Qt;
11392 11391
11393 DEFVAR_BOOL ("w32-enable-unicode-output", 11392 DEFVAR_BOOL ("w32-enable-unicode-output",
@@ -11420,7 +11419,7 @@ When this is non-nil, Emacs will indicate the position of point by
11420using the system caret instead of drawing its own cursor. Some screen 11419using the system caret instead of drawing its own cursor. Some screen
11421reader software does not track the system cursor properly when it is 11420reader software does not track the system cursor properly when it is
11422invisible, and gets confused by Emacs drawing its own cursor, so this 11421invisible, and gets confused by Emacs drawing its own cursor, so this
11423variable is initialized to t when Emacs detects that screen reader 11422variable is initialized to t when Emacs detects that screen reader
11424software is running as it starts up. 11423software is running as it starts up.
11425 11424
11426When this variable is set, other variables affecting the appearance of 11425When this variable is set, other variables affecting the appearance of