diff options
| author | Jason Rumney | 2000-07-15 12:00:51 +0000 |
|---|---|---|
| committer | Jason Rumney | 2000-07-15 12:00:51 +0000 |
| commit | ec48c3a7954046e828e98ac87c312e46a20d9acd (patch) | |
| tree | 991c9be8060b469132a24ce6393e620fd91dbeb2 /src | |
| parent | 212da13befcd3eb0a486cfd0e761d2f5d8acb2a2 (diff) | |
| download | emacs-ec48c3a7954046e828e98ac87c312e46a20d9acd.tar.gz emacs-ec48c3a7954046e828e98ac87c312e46a20d9acd.zip | |
(help_echo_object, help_echo_pos): New variables.
(note_mode_line_highlight): Store additional information about the
help-echo in help_echo_object and help_echo_pos. Check both
`local-map' and `keymap' properties for changing the cursor
(note_mouse_highlight): Store additional information about the
help-echo in help_echo_object and help_echo_pos.
(note_tool_bar_highlight): Set help_echo_object to nil and
help_echo_pos to -1.
(w32_read_socket): Use gen_help_event instead of filling
input_events manually.
(syms_of_w32term): Staticpro help_echo_object.
(x_update_window_end): Add parameter MOUSE_FACE_OVERWRITTEN_P. If
set, arrange for a mouse-highlight redisplay in
XTframe_up_to_date.
(x_clear_mouse_face): New function.
(w32_redisplay_interface): Add pointer to x_clear_mouse_face.
(x_update_window_begin): No need to turn off the mouse
highlight here.
(show_mouse_face): Set the mouse_face_p flag of glyph rows
depending on whether they contain glyphs highlighted in
mouse-face.
(x_fill_stretch_glyph_string): Consume runs of stretch
glyphs instead of a single one.
(BUILD_STRETCH_GLYPH_STRING): Call x_fill_stretch_glyph_string
with new argument list.
(x_set_glyph_string_gc): Make sure the face's GC is valid.
(x_append_glyph, x_append_composite_glyph)
(x_produce_image_glyph, x_append_stretch_glyph): Accomodate to
changes in struct glyph starting 1999-12-27. See comments for
xterm.c on 2000-07-05.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32term.c | 369 |
1 files changed, 232 insertions, 137 deletions
diff --git a/src/w32term.c b/src/w32term.c index 4b94e2db27f..127354f3461 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -161,6 +161,8 @@ int x_toolkit_scroll_bars_p; | |||
| 161 | (The display is done in read_char.) */ | 161 | (The display is done in read_char.) */ |
| 162 | 162 | ||
| 163 | static Lisp_Object help_echo; | 163 | static Lisp_Object help_echo; |
| 164 | static Lisp_Object help_echo_object; | ||
| 165 | static int help_echo_pos; | ||
| 164 | 166 | ||
| 165 | /* Temporary variable for w32_read_socket. */ | 167 | /* Temporary variable for w32_read_socket. */ |
| 166 | 168 | ||
| @@ -593,6 +595,13 @@ x_update_window_begin (w) | |||
| 593 | if (FRAME_GARBAGED_P (f)) | 595 | if (FRAME_GARBAGED_P (f)) |
| 594 | display_info->mouse_face_window = Qnil; | 596 | display_info->mouse_face_window = Qnil; |
| 595 | 597 | ||
| 598 | #if 0 /* Rows in a current matrix containing glyphs in mouse-face have | ||
| 599 | their mouse_face_p flag set, which means that they are always | ||
| 600 | unequal to rows in a desired matrix which never have that | ||
| 601 | flag set. So, rows containing mouse-face glyphs are never | ||
| 602 | scrolled, and we don't have to switch the mouse highlight off | ||
| 603 | here to prevent it from being scrolled. */ | ||
| 604 | |||
| 596 | /* Can we tell that this update does not affect the window | 605 | /* Can we tell that this update does not affect the window |
| 597 | where the mouse highlight is? If so, no need to turn off. | 606 | where the mouse highlight is? If so, no need to turn off. |
| 598 | Likewise, don't do anything if the frame is garbaged; | 607 | Likewise, don't do anything if the frame is garbaged; |
| @@ -610,6 +619,7 @@ x_update_window_begin (w) | |||
| 610 | if (i < w->desired_matrix->nrows) | 619 | if (i < w->desired_matrix->nrows) |
| 611 | clear_mouse_face (display_info); | 620 | clear_mouse_face (display_info); |
| 612 | } | 621 | } |
| 622 | #endif /* 0 */ | ||
| 613 | } | 623 | } |
| 614 | 624 | ||
| 615 | UNBLOCK_INPUT; | 625 | UNBLOCK_INPUT; |
| @@ -647,20 +657,40 @@ x_draw_vertical_border (w) | |||
| 647 | } | 657 | } |
| 648 | 658 | ||
| 649 | 659 | ||
| 650 | /* End update of window W (which is equal to updated_window). Draw | 660 | /* End update of window W (which is equal to updated_window). |
| 651 | vertical borders between horizontally adjacent windows, and display | 661 | |
| 652 | W's cursor if CURSOR_ON_P is non-zero. W may be a menu bar | 662 | Draw vertical borders between horizontally adjacent windows, and |
| 653 | pseudo-window in case we don't have X toolkit support. Such | 663 | display W's cursor if CURSOR_ON_P is non-zero. |
| 654 | windows don't have a cursor, so don't display it here. */ | 664 | |
| 665 | MOUSE_FACE_OVERWRITTEN_P non-zero means that some row containing | ||
| 666 | glyphs in mouse-face were overwritten. In that case we have to | ||
| 667 | make sure that the mouse-highlight is properly redrawn. | ||
| 668 | |||
| 669 | W may be a menu bar pseudo-window in case we don't have X toolkit | ||
| 670 | support. Such windows don't have a cursor, so don't display it | ||
| 671 | here. */ | ||
| 655 | 672 | ||
| 656 | static void | 673 | static void |
| 657 | x_update_window_end (w, cursor_on_p) | 674 | x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) |
| 658 | struct window *w; | 675 | struct window *w; |
| 659 | int cursor_on_p; | 676 | int cursor_on_p, mouse_face_overwritten_p; |
| 660 | { | 677 | { |
| 661 | if (!w->pseudo_window_p) | 678 | if (!w->pseudo_window_p) |
| 662 | { | 679 | { |
| 680 | struct w32_display_info *dpyinfo | ||
| 681 | = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame)); | ||
| 682 | |||
| 663 | BLOCK_INPUT; | 683 | BLOCK_INPUT; |
| 684 | |||
| 685 | /* If a row with mouse-face was overwritten, arrange for | ||
| 686 | XTframe_up_to_date to redisplay the mouse highlight. */ | ||
| 687 | if (mouse_face_overwritten_p) | ||
| 688 | { | ||
| 689 | dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; | ||
| 690 | dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; | ||
| 691 | dpyinfo->mouse_face_window = Qnil; | ||
| 692 | } | ||
| 693 | |||
| 664 | if (cursor_on_p) | 694 | if (cursor_on_p) |
| 665 | x_display_and_set_cursor (w, 1, output_cursor.hpos, | 695 | x_display_and_set_cursor (w, 1, output_cursor.hpos, |
| 666 | output_cursor.vpos, | 696 | output_cursor.vpos, |
| @@ -1428,24 +1458,21 @@ x_append_glyph (it) | |||
| 1428 | glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; | 1458 | glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; |
| 1429 | if (glyph < it->glyph_row->glyphs[area + 1]) | 1459 | if (glyph < it->glyph_row->glyphs[area + 1]) |
| 1430 | { | 1460 | { |
| 1431 | /* Play it safe. If sub-structures of the glyph are not all the | ||
| 1432 | same size, it otherwise be that some bits stay set. This | ||
| 1433 | would prevent a comparison with GLYPH_EQUAL_P. */ | ||
| 1434 | glyph->u.val = 0; | ||
| 1435 | |||
| 1436 | glyph->type = CHAR_GLYPH; | ||
| 1437 | glyph->pixel_width = it->pixel_width; | ||
| 1438 | glyph->u.ch = it->char_to_display; | ||
| 1439 | glyph->face_id = it->face_id; | ||
| 1440 | glyph->charpos = CHARPOS (it->position); | 1461 | glyph->charpos = CHARPOS (it->position); |
| 1441 | glyph->object = it->object; | 1462 | glyph->object = it->object; |
| 1442 | glyph->left_box_line_p = it->start_of_box_run_p; | 1463 | glyph->pixel_width = it->pixel_width; |
| 1443 | glyph->right_box_line_p = it->end_of_box_run_p; | ||
| 1444 | glyph->voffset = it->voffset; | 1464 | glyph->voffset = it->voffset; |
| 1465 | glyph->type = CHAR_GLYPH; | ||
| 1445 | glyph->multibyte_p = it->multibyte_p; | 1466 | glyph->multibyte_p = it->multibyte_p; |
| 1467 | glyph->left_box_line_p = it->start_of_box_run_p; | ||
| 1468 | glyph->right_box_line_p = it->end_of_box_run_p; | ||
| 1446 | glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent | 1469 | glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent |
| 1447 | || it->phys_descent > it->descent); | 1470 | || it->phys_descent > it->descent); |
| 1471 | glyph->padding_p = 0; | ||
| 1448 | glyph->glyph_not_available_p = it->glyph_not_available_p; | 1472 | glyph->glyph_not_available_p = it->glyph_not_available_p; |
| 1473 | glyph->face_id = it->face_id; | ||
| 1474 | glyph->u.ch = it->char_to_display; | ||
| 1475 | glyph->w32_font_type = UNKNOWN_FONT; | ||
| 1449 | ++it->glyph_row->used[area]; | 1476 | ++it->glyph_row->used[area]; |
| 1450 | } | 1477 | } |
| 1451 | } | 1478 | } |
| @@ -1465,23 +1492,21 @@ x_append_composite_glyph (it) | |||
| 1465 | glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; | 1492 | glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; |
| 1466 | if (glyph < it->glyph_row->glyphs[area + 1]) | 1493 | if (glyph < it->glyph_row->glyphs[area + 1]) |
| 1467 | { | 1494 | { |
| 1468 | /* Play it safe. If sub-structures of the glyph are not all the | ||
| 1469 | same size, it otherwise be that some bits stay set. This | ||
| 1470 | would prevent a comparison with GLYPH_EQUAL_P. */ | ||
| 1471 | glyph->u.val = 0; | ||
| 1472 | |||
| 1473 | glyph->type = COMPOSITE_GLYPH; | ||
| 1474 | glyph->pixel_width = it->pixel_width; | ||
| 1475 | glyph->u.cmp_id = it->cmp_id; | ||
| 1476 | glyph->face_id = it->face_id; | ||
| 1477 | glyph->charpos = CHARPOS (it->position); | 1495 | glyph->charpos = CHARPOS (it->position); |
| 1478 | glyph->object = it->object; | 1496 | glyph->object = it->object; |
| 1479 | glyph->left_box_line_p = it->start_of_box_run_p; | 1497 | glyph->pixel_width = it->pixel_width; |
| 1480 | glyph->right_box_line_p = it->end_of_box_run_p; | ||
| 1481 | glyph->voffset = it->voffset; | 1498 | glyph->voffset = it->voffset; |
| 1499 | glyph->type = COMPOSITE_GLYPH; | ||
| 1482 | glyph->multibyte_p = it->multibyte_p; | 1500 | glyph->multibyte_p = it->multibyte_p; |
| 1501 | glyph->left_box_line_p = it->start_of_box_run_p; | ||
| 1502 | glyph->right_box_line_p = it->end_of_box_run_p; | ||
| 1483 | glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent | 1503 | glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent |
| 1484 | || it->phys_descent > it->descent); | 1504 | || it->phys_descent > it->descent); |
| 1505 | glyph->padding_p = 0; | ||
| 1506 | glyph->glyph_not_available_p = 0; | ||
| 1507 | glyph->face_id = it->face_id; | ||
| 1508 | glyph->u.cmp_id = it->cmp_id; | ||
| 1509 | glyph->w32_font_type = UNKNOWN_FONT; | ||
| 1485 | ++it->glyph_row->used[area]; | 1510 | ++it->glyph_row->used[area]; |
| 1486 | } | 1511 | } |
| 1487 | } | 1512 | } |
| @@ -1556,16 +1581,20 @@ x_produce_image_glyph (it) | |||
| 1556 | glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; | 1581 | glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; |
| 1557 | if (glyph < it->glyph_row->glyphs[area + 1]) | 1582 | if (glyph < it->glyph_row->glyphs[area + 1]) |
| 1558 | { | 1583 | { |
| 1559 | glyph->type = IMAGE_GLYPH; | ||
| 1560 | glyph->u.img_id = img->id; | ||
| 1561 | glyph->face_id = it->face_id; | ||
| 1562 | glyph->pixel_width = it->pixel_width; | ||
| 1563 | glyph->charpos = CHARPOS (it->position); | 1584 | glyph->charpos = CHARPOS (it->position); |
| 1564 | glyph->object = it->object; | 1585 | glyph->object = it->object; |
| 1565 | glyph->left_box_line_p = it->start_of_box_run_p; | 1586 | glyph->pixel_width = it->pixel_width; |
| 1566 | glyph->right_box_line_p = it->end_of_box_run_p; | ||
| 1567 | glyph->voffset = it->voffset; | 1587 | glyph->voffset = it->voffset; |
| 1588 | glyph->type = IMAGE_GLYPH; | ||
| 1568 | glyph->multibyte_p = it->multibyte_p; | 1589 | glyph->multibyte_p = it->multibyte_p; |
| 1590 | glyph->left_box_line_p = it->start_of_box_run_p; | ||
| 1591 | glyph->right_box_line_p = it->end_of_box_run_p; | ||
| 1592 | glyph->overlaps_vertically_p = 0; | ||
| 1593 | glyph->padding_p = 0; | ||
| 1594 | glyph->glyph_not_available_p = 0; | ||
| 1595 | glyph->face_id = it->face_id; | ||
| 1596 | glyph->u.img_id = img->id; | ||
| 1597 | glyph->w32_font_type = UNKNOWN_FONT; | ||
| 1569 | ++it->glyph_row->used[area]; | 1598 | ++it->glyph_row->used[area]; |
| 1570 | } | 1599 | } |
| 1571 | } | 1600 | } |
| @@ -1592,17 +1621,21 @@ x_append_stretch_glyph (it, object, width, height, ascent) | |||
| 1592 | glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; | 1621 | glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; |
| 1593 | if (glyph < it->glyph_row->glyphs[area + 1]) | 1622 | if (glyph < it->glyph_row->glyphs[area + 1]) |
| 1594 | { | 1623 | { |
| 1595 | glyph->type = STRETCH_GLYPH; | ||
| 1596 | glyph->u.stretch.ascent = height * ascent; | ||
| 1597 | glyph->u.stretch.height = height; | ||
| 1598 | glyph->face_id = it->face_id; | ||
| 1599 | glyph->pixel_width = width; | ||
| 1600 | glyph->charpos = CHARPOS (it->position); | 1624 | glyph->charpos = CHARPOS (it->position); |
| 1601 | glyph->object = object; | 1625 | glyph->object = object; |
| 1602 | glyph->left_box_line_p = it->start_of_box_run_p; | 1626 | glyph->pixel_width = width; |
| 1603 | glyph->right_box_line_p = it->end_of_box_run_p; | ||
| 1604 | glyph->voffset = it->voffset; | 1627 | glyph->voffset = it->voffset; |
| 1628 | glyph->type = STRETCH_GLYPH; | ||
| 1605 | glyph->multibyte_p = it->multibyte_p; | 1629 | glyph->multibyte_p = it->multibyte_p; |
| 1630 | glyph->left_box_line_p = it->start_of_box_run_p; | ||
| 1631 | glyph->right_box_line_p = it->end_of_box_run_p; | ||
| 1632 | glyph->overlaps_vertically_p = 0; | ||
| 1633 | glyph->padding_p = 0; | ||
| 1634 | glyph->glyph_not_available_p = 0; | ||
| 1635 | glyph->face_id = it->face_id; | ||
| 1636 | glyph->u.stretch.ascent = height * ascent; | ||
| 1637 | glyph->u.stretch.height = height; | ||
| 1638 | glyph->w32_font_type = UNKNOWN_FONT; | ||
| 1606 | ++it->glyph_row->used[area]; | 1639 | ++it->glyph_row->used[area]; |
| 1607 | } | 1640 | } |
| 1608 | } | 1641 | } |
| @@ -2474,7 +2507,6 @@ x_set_mode_line_face_gc (s) | |||
| 2474 | struct glyph_string *s; | 2507 | struct glyph_string *s; |
| 2475 | { | 2508 | { |
| 2476 | s->gc = s->face->gc; | 2509 | s->gc = s->face->gc; |
| 2477 | xassert (s->gc != 0); | ||
| 2478 | } | 2510 | } |
| 2479 | 2511 | ||
| 2480 | 2512 | ||
| @@ -2486,6 +2518,8 @@ static INLINE void | |||
| 2486 | x_set_glyph_string_gc (s) | 2518 | x_set_glyph_string_gc (s) |
| 2487 | struct glyph_string *s; | 2519 | struct glyph_string *s; |
| 2488 | { | 2520 | { |
| 2521 | PREPARE_FACE_FOR_DISPLAY (s->f, s->face); | ||
| 2522 | |||
| 2489 | if (s->hl == DRAW_NORMAL_TEXT) | 2523 | if (s->hl == DRAW_NORMAL_TEXT) |
| 2490 | { | 2524 | { |
| 2491 | s->gc = s->face->gc; | 2525 | s->gc = s->face->gc; |
| @@ -3996,19 +4030,48 @@ x_fill_image_glyph_string (s) | |||
| 3996 | } | 4030 | } |
| 3997 | 4031 | ||
| 3998 | 4032 | ||
| 3999 | /* Fill glyph string S from stretch glyph S->first_glyph. */ | 4033 | /* Fill glyph string S from a sequence of stretch glyphs. |
| 4000 | 4034 | ||
| 4001 | static void | 4035 | ROW is the glyph row in which the glyphs are found, AREA is the |
| 4002 | x_fill_stretch_glyph_string (s) | 4036 | area within the row. START is the index of the first glyph to |
| 4037 | consider, END is the index of the last + 1. | ||
| 4038 | |||
| 4039 | Value is the index of the first glyph not in S. */ | ||
| 4040 | |||
| 4041 | static int | ||
| 4042 | x_fill_stretch_glyph_string (s, row, area, start, end) | ||
| 4003 | struct glyph_string *s; | 4043 | struct glyph_string *s; |
| 4044 | struct glyph_row *row; | ||
| 4045 | enum glyph_row_area area; | ||
| 4046 | int start, end; | ||
| 4004 | { | 4047 | { |
| 4048 | struct glyph *glyph, *last; | ||
| 4049 | int voffset, face_id; | ||
| 4050 | |||
| 4005 | xassert (s->first_glyph->type == STRETCH_GLYPH); | 4051 | xassert (s->first_glyph->type == STRETCH_GLYPH); |
| 4006 | s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); | 4052 | |
| 4053 | glyph = s->row->glyphs[s->area] + start; | ||
| 4054 | last = s->row->glyphs[s->area] + end; | ||
| 4055 | face_id = glyph->face_id; | ||
| 4056 | s->face = FACE_FROM_ID (s->f, face_id); | ||
| 4007 | s->font = s->face->font; | 4057 | s->font = s->face->font; |
| 4008 | s->width = s->first_glyph->pixel_width; | 4058 | s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); |
| 4059 | s->width = glyph->pixel_width; | ||
| 4060 | voffset = glyph->voffset; | ||
| 4061 | |||
| 4062 | for (++glyph; | ||
| 4063 | (glyph < last | ||
| 4064 | && glyph->type == STRETCH_GLYPH | ||
| 4065 | && glyph->voffset == voffset | ||
| 4066 | && glyph->face_id == face_id); | ||
| 4067 | ++glyph) | ||
| 4068 | s->width += glyph->pixel_width; | ||
| 4009 | 4069 | ||
| 4010 | /* Adjust base line for subscript/superscript text. */ | 4070 | /* Adjust base line for subscript/superscript text. */ |
| 4011 | s->ybase += s->first_glyph->voffset; | 4071 | s->ybase += voffset; |
| 4072 | |||
| 4073 | xassert (s->face && s->face->gc); | ||
| 4074 | return glyph - s->row->glyphs[s->area]; | ||
| 4012 | } | 4075 | } |
| 4013 | 4076 | ||
| 4014 | 4077 | ||
| @@ -4096,9 +4159,8 @@ x_set_glyph_string_background_width (s, start, last_x) | |||
| 4096 | { \ | 4159 | { \ |
| 4097 | s = (struct glyph_string *) alloca (sizeof *s); \ | 4160 | s = (struct glyph_string *) alloca (sizeof *s); \ |
| 4098 | w32_init_glyph_string (s, hdc, NULL, W, ROW, AREA, START, HL); \ | 4161 | w32_init_glyph_string (s, hdc, NULL, W, ROW, AREA, START, HL); \ |
| 4099 | x_fill_stretch_glyph_string (s); \ | 4162 | START = x_fill_stretch_glyph_string (s, ROW, AREA, START, END); \ |
| 4100 | x_append_glyph_string (&HEAD, &TAIL, s); \ | 4163 | x_append_glyph_string (&HEAD, &TAIL, s); \ |
| 4101 | ++START; \ | ||
| 4102 | s->x = (X); \ | 4164 | s->x = (X); \ |
| 4103 | } \ | 4165 | } \ |
| 4104 | while (0) | 4166 | while (0) |
| @@ -4137,7 +4199,7 @@ x_set_glyph_string_background_width (s, start, last_x) | |||
| 4137 | #define BUILD_CHAR_GLYPH_STRINGS(hdc, W, ROW, AREA, START, END, HEAD, TAIL, HL, X, LAST_X, OVERLAPS_P) \ | 4199 | #define BUILD_CHAR_GLYPH_STRINGS(hdc, W, ROW, AREA, START, END, HEAD, TAIL, HL, X, LAST_X, OVERLAPS_P) \ |
| 4138 | do \ | 4200 | do \ |
| 4139 | { \ | 4201 | { \ |
| 4140 | int c, charset, face_id; \ | 4202 | int c, face_id; \ |
| 4141 | wchar_t *char2b; \ | 4203 | wchar_t *char2b; \ |
| 4142 | \ | 4204 | \ |
| 4143 | c = (ROW)->glyphs[AREA][START].u.ch; \ | 4205 | c = (ROW)->glyphs[AREA][START].u.ch; \ |
| @@ -4315,10 +4377,9 @@ x_draw_glyphs (w, x, row, area, start, end, hl, real_start, real_end, | |||
| 4315 | end of the drawing area. */ | 4377 | end of the drawing area. */ |
| 4316 | if (row->full_width_p) | 4378 | if (row->full_width_p) |
| 4317 | { | 4379 | { |
| 4318 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | ||
| 4319 | |||
| 4320 | /* X is relative to the left edge of W, without scroll bars | 4380 | /* X is relative to the left edge of W, without scroll bars |
| 4321 | or flag areas. */ | 4381 | or flag areas. */ |
| 4382 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | ||
| 4322 | /* int width = FRAME_FLAGS_AREA_WIDTH (f); */ | 4383 | /* int width = FRAME_FLAGS_AREA_WIDTH (f); */ |
| 4323 | int window_left_x = WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f); | 4384 | int window_left_x = WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f); |
| 4324 | 4385 | ||
| @@ -5352,7 +5413,7 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip) | |||
| 5352 | /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to round down | 5413 | /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to round down |
| 5353 | even for negative values. */ | 5414 | even for negative values. */ |
| 5354 | if (pix_x < 0) | 5415 | if (pix_x < 0) |
| 5355 | pix_x -= FONT_WIDTH ((f)->output_data.w32->font) - 1; | 5416 | pix_x -= FONT_WIDTH (FRAME_FONT(f)) - 1; |
| 5356 | if (pix_y < 0) | 5417 | if (pix_y < 0) |
| 5357 | pix_y -= (f)->output_data.w32->line_height - 1; | 5418 | pix_y -= (f)->output_data.w32->line_height - 1; |
| 5358 | 5419 | ||
| @@ -5363,7 +5424,7 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip) | |||
| 5363 | { | 5424 | { |
| 5364 | bounds->left = CHAR_TO_PIXEL_COL (f, pix_x); | 5425 | bounds->left = CHAR_TO_PIXEL_COL (f, pix_x); |
| 5365 | bounds->top = CHAR_TO_PIXEL_ROW (f, pix_y); | 5426 | bounds->top = CHAR_TO_PIXEL_ROW (f, pix_y); |
| 5366 | bounds->right = bounds->left + FONT_WIDTH (f->output_data.w32->font) - 1; | 5427 | bounds->right = bounds->left + FONT_WIDTH (FRAME_FONT(f)) - 1; |
| 5367 | bounds->bottom = bounds->top + f->output_data.w32->line_height - 1; | 5428 | bounds->bottom = bounds->top + f->output_data.w32->line_height - 1; |
| 5368 | } | 5429 | } |
| 5369 | 5430 | ||
| @@ -5371,8 +5432,8 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip) | |||
| 5371 | { | 5432 | { |
| 5372 | if (pix_x < 0) | 5433 | if (pix_x < 0) |
| 5373 | pix_x = 0; | 5434 | pix_x = 0; |
| 5374 | else if (pix_x > f->width) | 5435 | else if (pix_x > FRAME_WINDOW_WIDTH (f)) |
| 5375 | pix_x = f->width; | 5436 | pix_x = FRAME_WINDOW_WIDTH (f); |
| 5376 | 5437 | ||
| 5377 | if (pix_y < 0) | 5438 | if (pix_y < 0) |
| 5378 | pix_y = 0; | 5439 | pix_y = 0; |
| @@ -5491,7 +5552,7 @@ parse_button (message, pbutton, pup) | |||
| 5491 | If the event is a button press, then note that we have grabbed | 5552 | If the event is a button press, then note that we have grabbed |
| 5492 | the mouse. */ | 5553 | the mouse. */ |
| 5493 | 5554 | ||
| 5494 | static void | 5555 | static Lisp_Object |
| 5495 | construct_mouse_click (result, msg, f) | 5556 | construct_mouse_click (result, msg, f) |
| 5496 | struct input_event *result; | 5557 | struct input_event *result; |
| 5497 | W32Msg *msg; | 5558 | W32Msg *msg; |
| @@ -5512,17 +5573,14 @@ construct_mouse_click (result, msg, f) | |||
| 5512 | ? up_modifier | 5573 | ? up_modifier |
| 5513 | : down_modifier)); | 5574 | : down_modifier)); |
| 5514 | 5575 | ||
| 5515 | { | 5576 | XSETINT (result->x, LOWORD (msg->msg.lParam)); |
| 5516 | int row, column; | 5577 | XSETINT (result->y, HIWORD (msg->msg.lParam)); |
| 5517 | 5578 | XSETFRAME (result->frame_or_window, f); | |
| 5518 | XSETINT (result->x, LOWORD (msg->msg.lParam)); | 5579 | result->arg = Qnil; |
| 5519 | XSETINT (result->y, HIWORD (msg->msg.lParam)); | 5580 | return Qnil; |
| 5520 | XSETFRAME (result->frame_or_window, f); | ||
| 5521 | result->arg = Qnil; | ||
| 5522 | } | ||
| 5523 | } | 5581 | } |
| 5524 | 5582 | ||
| 5525 | static void | 5583 | static Lisp_Object |
| 5526 | construct_mouse_wheel (result, msg, f) | 5584 | construct_mouse_wheel (result, msg, f) |
| 5527 | struct input_event *result; | 5585 | struct input_event *result; |
| 5528 | W32Msg *msg; | 5586 | W32Msg *msg; |
| @@ -5540,9 +5598,10 @@ construct_mouse_wheel (result, msg, f) | |||
| 5540 | XSETINT (result->y, p.y); | 5598 | XSETINT (result->y, p.y); |
| 5541 | XSETFRAME (result->frame_or_window, f); | 5599 | XSETFRAME (result->frame_or_window, f); |
| 5542 | result->arg = Qnil; | 5600 | result->arg = Qnil; |
| 5601 | return Qnil; | ||
| 5543 | } | 5602 | } |
| 5544 | 5603 | ||
| 5545 | static void | 5604 | static Lisp_Object |
| 5546 | construct_drag_n_drop (result, msg, f) | 5605 | construct_drag_n_drop (result, msg, f) |
| 5547 | struct input_event *result; | 5606 | struct input_event *result; |
| 5548 | W32Msg *msg; | 5607 | W32Msg *msg; |
| @@ -5591,6 +5650,7 @@ construct_drag_n_drop (result, msg, f) | |||
| 5591 | XSETFRAME (frame, f); | 5650 | XSETFRAME (frame, f); |
| 5592 | result->frame_or_window = Fcons (frame, files); | 5651 | result->frame_or_window = Fcons (frame, files); |
| 5593 | result->arg = Qnil; | 5652 | result->arg = Qnil; |
| 5653 | return Qnil; | ||
| 5594 | } | 5654 | } |
| 5595 | 5655 | ||
| 5596 | 5656 | ||
| @@ -5659,7 +5719,7 @@ x_y_to_hpos_vpos (w, x, y, hpos, vpos, area) | |||
| 5659 | int *hpos, *vpos, *area; | 5719 | int *hpos, *vpos, *area; |
| 5660 | { | 5720 | { |
| 5661 | struct glyph *glyph, *end; | 5721 | struct glyph *glyph, *end; |
| 5662 | struct glyph_row *row; | 5722 | struct glyph_row *row = NULL; |
| 5663 | int x0, i, left_area_width; | 5723 | int x0, i, left_area_width; |
| 5664 | 5724 | ||
| 5665 | /* Find row containing Y. Give up if some row is not enabled. */ | 5725 | /* Find row containing Y. Give up if some row is not enabled. */ |
| @@ -5805,7 +5865,11 @@ note_mode_line_highlight (w, x, mode_line_p) | |||
| 5805 | help = Fget_text_property (make_number (glyph->charpos), | 5865 | help = Fget_text_property (make_number (glyph->charpos), |
| 5806 | Qhelp_echo, glyph->object); | 5866 | Qhelp_echo, glyph->object); |
| 5807 | if (!NILP (help)) | 5867 | if (!NILP (help)) |
| 5808 | help_echo = help; | 5868 | { |
| 5869 | help_echo = help; | ||
| 5870 | help_echo_object = glyph->object; | ||
| 5871 | help_echo_pos = glyph->charpos; | ||
| 5872 | } | ||
| 5809 | 5873 | ||
| 5810 | /* Change the mouse pointer according to what is under X/Y. */ | 5874 | /* Change the mouse pointer according to what is under X/Y. */ |
| 5811 | map = Fget_text_property (make_number (glyph->charpos), | 5875 | map = Fget_text_property (make_number (glyph->charpos), |
| @@ -6065,20 +6129,32 @@ note_mouse_highlight (f, x, y) | |||
| 6065 | help = Qnil; | 6129 | help = Qnil; |
| 6066 | for (i = 0; i < noverlays && NILP (help); ++i) | 6130 | for (i = 0; i < noverlays && NILP (help); ++i) |
| 6067 | help = Foverlay_get (overlay_vec[i], Qhelp_echo); | 6131 | help = Foverlay_get (overlay_vec[i], Qhelp_echo); |
| 6068 | 6132 | ||
| 6069 | /* Try text properties. */ | 6133 | if (!NILP (help)) |
| 6070 | if (NILP (help) | 6134 | { |
| 6071 | && ((STRINGP (glyph->object) | 6135 | help_echo = help; |
| 6136 | help_echo_object = w->buffer; | ||
| 6137 | help_echo_pos = pos; | ||
| 6138 | } | ||
| 6139 | else | ||
| 6140 | { | ||
| 6141 | /* Try text properties. */ | ||
| 6142 | if ((STRINGP (glyph->object) | ||
| 6072 | && glyph->charpos >= 0 | 6143 | && glyph->charpos >= 0 |
| 6073 | && glyph->charpos < XSTRING (glyph->object)->size) | 6144 | && glyph->charpos < XSTRING (glyph->object)->size) |
| 6074 | || (BUFFERP (glyph->object) | 6145 | || (BUFFERP (glyph->object) |
| 6075 | && glyph->charpos >= BEGV | 6146 | && glyph->charpos >= BEGV |
| 6076 | && glyph->charpos < ZV))) | 6147 | && glyph->charpos < ZV)) |
| 6077 | help = Fget_text_property (make_number (glyph->charpos), | 6148 | help = Fget_text_property (make_number (glyph->charpos), |
| 6078 | Qhelp_echo, glyph->object); | 6149 | Qhelp_echo, glyph->object); |
| 6079 | 6150 | ||
| 6080 | if (!NILP (help)) | 6151 | if (!NILP (help)) |
| 6081 | help_echo = help; | 6152 | { |
| 6153 | help_echo = help; | ||
| 6154 | help_echo_object = glyph->object; | ||
| 6155 | help_echo_pos = glyph->charpos; | ||
| 6156 | } | ||
| 6157 | } | ||
| 6082 | } | 6158 | } |
| 6083 | 6159 | ||
| 6084 | BEGV = obegv; | 6160 | BEGV = obegv; |
| @@ -6309,6 +6385,8 @@ note_tool_bar_highlight (f, x, y) | |||
| 6309 | 6385 | ||
| 6310 | /* Set help_echo to a help string.to display for this tool-bar item. | 6386 | /* Set help_echo to a help string.to display for this tool-bar item. |
| 6311 | w32_read_socket does the rest. */ | 6387 | w32_read_socket does the rest. */ |
| 6388 | help_echo_object = Qnil; | ||
| 6389 | help_echo_pos = -1; | ||
| 6312 | help_echo = (XVECTOR (f->current_tool_bar_items) | 6390 | help_echo = (XVECTOR (f->current_tool_bar_items) |
| 6313 | ->contents[prop_idx + TOOL_BAR_ITEM_HELP]); | 6391 | ->contents[prop_idx + TOOL_BAR_ITEM_HELP]); |
| 6314 | if (NILP (help_echo)) | 6392 | if (NILP (help_echo)) |
| @@ -6483,8 +6561,11 @@ show_mouse_face (dpyinfo, draw) | |||
| 6483 | } | 6561 | } |
| 6484 | 6562 | ||
| 6485 | if (end_hpos > start_hpos) | 6563 | if (end_hpos > start_hpos) |
| 6486 | x_draw_glyphs (w, start_x, row, TEXT_AREA, | 6564 | { |
| 6487 | start_hpos, end_hpos, draw, NULL, NULL, 0); | 6565 | row->mouse_face_p = draw == DRAW_MOUSE_FACE; |
| 6566 | x_draw_glyphs (w, start_x, row, TEXT_AREA, | ||
| 6567 | start_hpos, end_hpos, draw, NULL, NULL, 0); | ||
| 6568 | } | ||
| 6488 | } | 6569 | } |
| 6489 | 6570 | ||
| 6490 | /* If we turned the cursor off, turn it back on. */ | 6571 | /* If we turned the cursor off, turn it back on. */ |
| @@ -6529,6 +6610,25 @@ clear_mouse_face (dpyinfo) | |||
| 6529 | dpyinfo->mouse_face_window = Qnil; | 6610 | dpyinfo->mouse_face_window = Qnil; |
| 6530 | } | 6611 | } |
| 6531 | 6612 | ||
| 6613 | |||
| 6614 | /* Clear any mouse-face on window W. This function is part of the | ||
| 6615 | redisplay interface, and is called from try_window_id and similar | ||
| 6616 | functions to ensure the mouse-highlight is off. */ | ||
| 6617 | |||
| 6618 | static void | ||
| 6619 | x_clear_mouse_face (w) | ||
| 6620 | struct window *w; | ||
| 6621 | { | ||
| 6622 | struct w32_display_info *dpyinfo | ||
| 6623 | = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame)); | ||
| 6624 | Lisp_Object window; | ||
| 6625 | |||
| 6626 | XSETWINDOW (window, w); | ||
| 6627 | if (EQ (window, dpyinfo->mouse_face_window)) | ||
| 6628 | clear_mouse_face (dpyinfo); | ||
| 6629 | } | ||
| 6630 | |||
| 6631 | |||
| 6532 | /* Just discard the mouse face information for frame F, if any. | 6632 | /* Just discard the mouse face information for frame F, if any. |
| 6533 | This is used when the size of F is changed. */ | 6633 | This is used when the size of F is changed. */ |
| 6534 | 6634 | ||
| @@ -6687,7 +6787,7 @@ w32_mouse_position (fp, insist, bar_window, part, x, y, time) | |||
| 6687 | 6787 | ||
| 6688 | /* Scroll bar support. */ | 6788 | /* Scroll bar support. */ |
| 6689 | 6789 | ||
| 6690 | /* Given an window ID, find the struct scroll_bar which manages it. | 6790 | /* Given a window ID, find the struct scroll_bar which manages it. |
| 6691 | This can be called in GC, so we have to make sure to strip off mark | 6791 | This can be called in GC, so we have to make sure to strip off mark |
| 6692 | bits. */ | 6792 | bits. */ |
| 6693 | 6793 | ||
| @@ -6831,7 +6931,7 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter, | |||
| 6831 | #endif | 6931 | #endif |
| 6832 | } | 6932 | } |
| 6833 | 6933 | ||
| 6834 | BOOL | 6934 | void |
| 6835 | my_set_focus (f, hwnd) | 6935 | my_set_focus (f, hwnd) |
| 6836 | struct frame * f; | 6936 | struct frame * f; |
| 6837 | HWND hwnd; | 6937 | HWND hwnd; |
| @@ -6840,7 +6940,7 @@ my_set_focus (f, hwnd) | |||
| 6840 | (WPARAM) hwnd, 0); | 6940 | (WPARAM) hwnd, 0); |
| 6841 | } | 6941 | } |
| 6842 | 6942 | ||
| 6843 | BOOL | 6943 | void |
| 6844 | my_set_foreground_window (hwnd) | 6944 | my_set_foreground_window (hwnd) |
| 6845 | HWND hwnd; | 6945 | HWND hwnd; |
| 6846 | { | 6946 | { |
| @@ -7624,6 +7724,7 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 7624 | || !NILP (previous_help_echo)) | 7724 | || !NILP (previous_help_echo)) |
| 7625 | { | 7725 | { |
| 7626 | Lisp_Object frame; | 7726 | Lisp_Object frame; |
| 7727 | int n; | ||
| 7627 | 7728 | ||
| 7628 | if (f) | 7729 | if (f) |
| 7629 | XSETFRAME (frame, f); | 7730 | XSETFRAME (frame, f); |
| @@ -7631,10 +7732,9 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 7631 | frame = Qnil; | 7732 | frame = Qnil; |
| 7632 | 7733 | ||
| 7633 | any_help_event_p = 1; | 7734 | any_help_event_p = 1; |
| 7634 | bufp->kind = HELP_EVENT; | 7735 | n = gen_help_event (bufp, help_echo, frame, |
| 7635 | bufp->frame_or_window = frame; | 7736 | help_echo_object, help_echo_pos); |
| 7636 | bufp->arg = help_echo; | 7737 | bufp += n, count += n, numchars -= n; |
| 7637 | ++bufp, ++count, --numchars; | ||
| 7638 | } | 7738 | } |
| 7639 | break; | 7739 | break; |
| 7640 | 7740 | ||
| @@ -7745,14 +7845,7 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 7745 | UINT menu_item = (UINT) LOWORD (msg.msg.wParam); | 7845 | UINT menu_item = (UINT) LOWORD (msg.msg.wParam); |
| 7746 | UINT flags = (UINT) HIWORD (msg.msg.wParam); | 7846 | UINT flags = (UINT) HIWORD (msg.msg.wParam); |
| 7747 | 7847 | ||
| 7748 | /* NTEMACS_TODO: Can't call the below with input blocked, | ||
| 7749 | as it may result in hooks being called if the window | ||
| 7750 | layout needs to change to display the message, and | ||
| 7751 | Feval will abort if input is blocked. But unblocking | ||
| 7752 | temporarily is not the best solution. */ | ||
| 7753 | UNBLOCK_INPUT; | ||
| 7754 | w32_menu_display_help (menu, menu_item, flags); | 7848 | w32_menu_display_help (menu, menu_item, flags); |
| 7755 | BLOCK_INPUT; | ||
| 7756 | } | 7849 | } |
| 7757 | break; | 7850 | break; |
| 7758 | 7851 | ||
| @@ -7963,11 +8056,11 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 7963 | the mouse leaves the frame. */ | 8056 | the mouse leaves the frame. */ |
| 7964 | if (any_help_event_p) | 8057 | if (any_help_event_p) |
| 7965 | { | 8058 | { |
| 8059 | int n; | ||
| 8060 | |||
| 7966 | XSETFRAME (frame, f); | 8061 | XSETFRAME (frame, f); |
| 7967 | bufp->kind = HELP_EVENT; | 8062 | n = gen_help_event (bufp, Qnil, frame, Qnil, 0); |
| 7968 | bufp->frame_or_window = frame; | 8063 | bufp += n, count += n, numchars -=n; |
| 7969 | bufp->arg = Qnil; | ||
| 7970 | ++bufp, ++count, --numchars; | ||
| 7971 | } | 8064 | } |
| 7972 | } | 8065 | } |
| 7973 | 8066 | ||
| @@ -8715,11 +8808,14 @@ x_new_font (f, fontname) | |||
| 8715 | /* Compute the scroll bar width in character columns. */ | 8808 | /* Compute the scroll bar width in character columns. */ |
| 8716 | if (f->scroll_bar_pixel_width > 0) | 8809 | if (f->scroll_bar_pixel_width > 0) |
| 8717 | { | 8810 | { |
| 8718 | int wid = FONT_WIDTH (f->output_data.w32->font); | 8811 | int wid = FONT_WIDTH (FRAME_FONT (f)); |
| 8719 | f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; | 8812 | f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; |
| 8720 | } | 8813 | } |
| 8721 | else | 8814 | else |
| 8722 | f->scroll_bar_cols = 2; | 8815 | { |
| 8816 | int wid = FONT_WIDTH (FRAME_FONT (f)); | ||
| 8817 | f->scroll_bar_cols = (14 + wid - 1) / wid; | ||
| 8818 | } | ||
| 8723 | 8819 | ||
| 8724 | /* Now make the frame display the given font. */ | 8820 | /* Now make the frame display the given font. */ |
| 8725 | if (FRAME_W32_WINDOW (f) != 0) | 8821 | if (FRAME_W32_WINDOW (f) != 0) |
| @@ -8730,7 +8826,7 @@ x_new_font (f, fontname) | |||
| 8730 | else | 8826 | else |
| 8731 | /* If we are setting a new frame's font for the first time, | 8827 | /* If we are setting a new frame's font for the first time, |
| 8732 | there are no faces yet, so this font's height is the line height. */ | 8828 | there are no faces yet, so this font's height is the line height. */ |
| 8733 | f->output_data.w32->line_height = FONT_HEIGHT (f->output_data.w32->font); | 8829 | f->output_data.w32->line_height = FONT_HEIGHT (FRAME_FONT (f)); |
| 8734 | 8830 | ||
| 8735 | return build_string (fontp->full_name); | 8831 | return build_string (fontp->full_name); |
| 8736 | } | 8832 | } |
| @@ -8948,18 +9044,8 @@ x_set_offset (f, xoff, yoff, change_gravity) | |||
| 8948 | BLOCK_INPUT; | 9044 | BLOCK_INPUT; |
| 8949 | x_wm_set_size_hint (f, (long) 0, 0); | 9045 | x_wm_set_size_hint (f, (long) 0, 0); |
| 8950 | 9046 | ||
| 8951 | /* It is a mystery why we need to add the border_width here | ||
| 8952 | when the frame is already visible, but experiment says we do. */ | ||
| 8953 | modified_left = f->output_data.w32->left_pos; | 9047 | modified_left = f->output_data.w32->left_pos; |
| 8954 | modified_top = f->output_data.w32->top_pos; | 9048 | modified_top = f->output_data.w32->top_pos; |
| 8955 | #ifndef HAVE_NTGUI | ||
| 8956 | /* Do not add in border widths under W32. */ | ||
| 8957 | if (change_gravity != 0) | ||
| 8958 | { | ||
| 8959 | modified_left += f->output_data.w32->border_width; | ||
| 8960 | modified_top += f->output_data.w32->border_width; | ||
| 8961 | } | ||
| 8962 | #endif | ||
| 8963 | 9049 | ||
| 8964 | my_set_window_pos (FRAME_W32_WINDOW (f), | 9050 | my_set_window_pos (FRAME_W32_WINDOW (f), |
| 8965 | NULL, | 9051 | NULL, |
| @@ -9021,7 +9107,7 @@ x_set_window_size (f, change_gravity, cols, rows) | |||
| 9021 | 9107 | ||
| 9022 | We could just not bother storing any of this information here, | 9108 | We could just not bother storing any of this information here, |
| 9023 | and let the ConfigureNotify event set everything up, but that | 9109 | and let the ConfigureNotify event set everything up, but that |
| 9024 | might be kind of confusing to the lisp code, since size changes | 9110 | might be kind of confusing to the Lisp code, since size changes |
| 9025 | wouldn't be reported in the frame parameters until some random | 9111 | wouldn't be reported in the frame parameters until some random |
| 9026 | point in the future when the ConfigureNotify event arrives. | 9112 | point in the future when the ConfigureNotify event arrives. |
| 9027 | 9113 | ||
| @@ -9051,6 +9137,27 @@ x_set_window_size (f, change_gravity, cols, rows) | |||
| 9051 | 9137 | ||
| 9052 | /* Mouse warping. */ | 9138 | /* Mouse warping. */ |
| 9053 | 9139 | ||
| 9140 | void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); | ||
| 9141 | |||
| 9142 | void | ||
| 9143 | x_set_mouse_position (f, x, y) | ||
| 9144 | struct frame *f; | ||
| 9145 | int x, y; | ||
| 9146 | { | ||
| 9147 | int pix_x, pix_y; | ||
| 9148 | |||
| 9149 | pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->output_data.w32->font) / 2; | ||
| 9150 | pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.w32->line_height / 2; | ||
| 9151 | |||
| 9152 | if (pix_x < 0) pix_x = 0; | ||
| 9153 | if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f); | ||
| 9154 | |||
| 9155 | if (pix_y < 0) pix_y = 0; | ||
| 9156 | if (pix_y > PIXEL_HEIGHT (f)) pix_y = PIXEL_HEIGHT (f); | ||
| 9157 | |||
| 9158 | x_set_mouse_pixel_position (f, pix_x, pix_y); | ||
| 9159 | } | ||
| 9160 | |||
| 9054 | void | 9161 | void |
| 9055 | x_set_mouse_pixel_position (f, pix_x, pix_y) | 9162 | x_set_mouse_pixel_position (f, pix_x, pix_y) |
| 9056 | struct frame *f; | 9163 | struct frame *f; |
| @@ -9071,27 +9178,10 @@ x_set_mouse_pixel_position (f, pix_x, pix_y) | |||
| 9071 | UNBLOCK_INPUT; | 9178 | UNBLOCK_INPUT; |
| 9072 | } | 9179 | } |
| 9073 | 9180 | ||
| 9074 | void | ||
| 9075 | x_set_mouse_position (f, x, y) | ||
| 9076 | struct frame *f; | ||
| 9077 | int x, y; | ||
| 9078 | { | ||
| 9079 | int pix_x, pix_y; | ||
| 9080 | |||
| 9081 | pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->output_data.w32->font) / 2; | ||
| 9082 | pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.w32->line_height / 2; | ||
| 9083 | |||
| 9084 | if (pix_x < 0) pix_x = 0; | ||
| 9085 | if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f); | ||
| 9086 | |||
| 9087 | if (pix_y < 0) pix_y = 0; | ||
| 9088 | if (pix_y > PIXEL_HEIGHT (f)) pix_y = PIXEL_HEIGHT (f); | ||
| 9089 | |||
| 9090 | x_set_mouse_pixel_position (f, pix_x, pix_y); | ||
| 9091 | } | ||
| 9092 | 9181 | ||
| 9093 | /* focus shifting, raising and lowering. */ | 9182 | /* focus shifting, raising and lowering. */ |
| 9094 | 9183 | ||
| 9184 | void | ||
| 9095 | x_focus_on_frame (f) | 9185 | x_focus_on_frame (f) |
| 9096 | struct frame *f; | 9186 | struct frame *f; |
| 9097 | { | 9187 | { |
| @@ -9109,6 +9199,7 @@ x_focus_on_frame (f) | |||
| 9109 | UNBLOCK_INPUT; | 9199 | UNBLOCK_INPUT; |
| 9110 | } | 9200 | } |
| 9111 | 9201 | ||
| 9202 | void | ||
| 9112 | x_unfocus_frame (f) | 9203 | x_unfocus_frame (f) |
| 9113 | struct frame *f; | 9204 | struct frame *f; |
| 9114 | { | 9205 | { |
| @@ -9188,11 +9279,11 @@ x_lower_frame (f) | |||
| 9188 | } | 9279 | } |
| 9189 | 9280 | ||
| 9190 | static void | 9281 | static void |
| 9191 | w32_frame_raise_lower (f, raise) | 9282 | w32_frame_raise_lower (f, raise_flag) |
| 9192 | FRAME_PTR f; | 9283 | FRAME_PTR f; |
| 9193 | int raise; | 9284 | int raise_flag; |
| 9194 | { | 9285 | { |
| 9195 | if (raise) | 9286 | if (raise_flag) |
| 9196 | x_raise_frame (f); | 9287 | x_raise_frame (f); |
| 9197 | else | 9288 | else |
| 9198 | x_lower_frame (f); | 9289 | x_lower_frame (f); |
| @@ -9207,6 +9298,7 @@ w32_frame_raise_lower (f, raise) | |||
| 9207 | but it will become visible later when the window manager | 9298 | but it will become visible later when the window manager |
| 9208 | finishes with it. */ | 9299 | finishes with it. */ |
| 9209 | 9300 | ||
| 9301 | void | ||
| 9210 | x_make_frame_visible (f) | 9302 | x_make_frame_visible (f) |
| 9211 | struct frame *f; | 9303 | struct frame *f; |
| 9212 | { | 9304 | { |
| @@ -9617,6 +9709,7 @@ static struct redisplay_interface w32_redisplay_interface = | |||
| 9617 | x_update_window_end, | 9709 | x_update_window_end, |
| 9618 | w32_cursor_to, | 9710 | w32_cursor_to, |
| 9619 | x_flush, | 9711 | x_flush, |
| 9712 | x_clear_mouse_face, | ||
| 9620 | x_get_glyph_overhangs, | 9713 | x_get_glyph_overhangs, |
| 9621 | x_fix_overlapping_area | 9714 | x_fix_overlapping_area |
| 9622 | }; | 9715 | }; |
| @@ -9780,10 +9873,12 @@ NT uses Unicode internally anyway, so this flag will probably have no\n\ | |||
| 9780 | affect on NT machines."); | 9873 | affect on NT machines."); |
| 9781 | w32_enable_unicode_output = 1; | 9874 | w32_enable_unicode_output = 1; |
| 9782 | 9875 | ||
| 9783 | staticpro (&help_echo); | ||
| 9784 | help_echo = Qnil; | 9876 | help_echo = Qnil; |
| 9785 | staticpro (&previous_help_echo); | 9877 | staticpro (&help_echo); |
| 9878 | help_echo_object = Qnil; | ||
| 9879 | staticpro (&help_echo_object); | ||
| 9786 | previous_help_echo = Qnil; | 9880 | previous_help_echo = Qnil; |
| 9881 | staticpro (&previous_help_echo); | ||
| 9787 | 9882 | ||
| 9788 | DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p, | 9883 | DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p, |
| 9789 | "*Non-nil means draw block cursor as wide as the glyph under it.\n\ | 9884 | "*Non-nil means draw block cursor as wide as the glyph under it.\n\ |