Mercurial > emacs
comparison src/nsterm.m @ 111413:d53ee71e7e89
Unify mouse-highlight code for all GUI and TTY sessions.
term.c: Remove static mouse_face_* variables. All users
changed.
(term_show_mouse_face, term_clear_mouse_face)
(fast_find_position, term_mouse_highlight): Functions deleted.
(tty_draw_row_with_mouse_face): New function.
(term_mouse_movement): Call note_mouse_highlight instead of
term_mouse_highlight.
nsterm.m (ns_update_window_begin, ns_update_window_end)
(ns_update_end, x_destroy_window, ns_frame_up_to_date)
(ns_dumpglyphs_box_or_relief, ns_maybe_dumpglyphs_background)
(ns_dumpglyphs_image, ns_dumpglyphs_stretch)
(ns_initialize_display_info, keyDown, mouseMoved, mouseExited):
Replace Display_Info with Mouse_HLInfo everywhere where
mouse_face_* members were accessed for mouse highlight purposes.
xterm.c (x_update_window_begin, x_update_window_end)
(x_update_end, XTframe_up_to_date, x_set_mouse_face_gc)
(handle_one_xevent, x_free_frame_resources, x_term_init): Replace
Display_Info with Mouse_HLInfo everywhere where mouse_face_*
members were accessed for mouse highlight purposes.
w32term.c (x_update_window_begin, x_update_window_end)
(x_update_end, w32_read_socket, x_free_frame_resources)
(w32_initialize_display_info): Replace Display_Info with
Mouse_HLInfo everywhere where mouse_face_* members were accessed
for mouse highlight purposes.
xdisp.c (show_mouse_face, note_mode_line_or_margin_highlight)
(note_mouse_highlight) [HAVE_WINDOW_SYSTEM]: Don't run GUI code
unless the frame is on a window-system.
(get_tool_bar_item, handle_tool_bar_click)
(note_tool_bar_highlight, draw_glyphs, erase_phys_cursor)
(show_mouse_face, clear_mouse_face, coords_in_mouse_face_p)
(note_mode_line_or_margin_highlight, note_mouse_highlight)
(x_clear_window_mouse_face, cancel_mouse_face, expose_frame):
Replace Display_Info with Mouse_HLInfo everywhere where
mouse_face_* members were accessed for mouse highlight purposes.
(coords_in_mouse_face_p): Move prototype out of the
HAVE_WINDOW_SYSTEM conditional.
(x_y_to_hpos_vpos, frame_to_window_pixel_xy): Move out of the
HAVE_WINDOW_SYSTEM block.
(try_window_id) [HAVE_GPM || MSDOS]: Call
x_clear_window_mouse_face.
(draw_row_with_mouse_face): Implementation for HAVE_WINDOW_SYSTEM
systems. Call tty_draw_row_with_mouse_face for TTY systems.
(show_mouse_face): Call draw_row_with_mouse_face, instead of
calling draw_glyphs directly.
(show_mouse_face, clear_mouse_face, coords_in_mouse_face_p)
(cursor_in_mouse_face_p, rows_from_pos_range)
(mouse_face_from_buffer_pos, mouse_face_from_string_pos)
(note_mode_line_or_margin_highlight, note_mouse_highlight)
(x_clear_window_mouse_face, cancel_mouse_face): Move out of the
HAVE_WINDOW_SYSTEM block. Ifdef away window-system specific
fragments.
(note_mouse_highlight): Call popup_activated for MSDOS as well.
Clear mouse highlight if pointer is over glyphs whose OBJECT is an
integer.
(mouse_face_from_buffer_pos): Add parentheses around && within ||.
(x_consider_frame_title, tool_bar_lines_needed): Move
prototypes to HAVE_WINDOW_SYSTEM-only part.
(get_window_cursor_type): Move inside a HAVE_WINDOW_SYSTEM-only
part. Remove "#ifdef HAVE_WINDOW_SYSTEM" from body of function.
(null_glyph_slice): Move declaration into HAVE_WINDOW_SYSTEM-only
part.
dispnew.c (mirror_make_current): Set Y coordinate of the
mode-line and header-line rows.
(init_display): Setup initial frame's output_data for text
terminal frames.
xmenu.c (popup_activated): Don't define on MSDOS, which now has
its own definition on msdos.c.
msdos.c (show_mouse_face, clear_mouse_face)
(fast_find_position, IT_note_mode_line_highlight)
(IT_note_mouse_highlight): Functions deleted.
(IT_frame_up_to_date, dos_rawgetc): Call note_mouse_highlight
instead of IT_note_mouse_highlight.
(draw_row_with_mouse_face, popup_activated): New functions.
(dos_set_window_size, draw_row_with_mouse_face, IT_update_begin)
(IT_update_end, IT_frame_up_to_date, internal_terminal_init)
(dos_rawgetc): Replace Display_Info with Mouse_HLInfo everywhere
where mouse_face_* members were accessed for mouse highlight
purposes.
msdos.h (initialize_msdos_display): Add prototype.
frame.h (MOUSE_HL_INFO): New macro.
lisp.h (Mouse_HLInfo): New data type.
xterm.h (struct x_display_info):
w32term.h (struct w32_display_info):
nsterm.h (struct ns_display_info):
termchar.h (struct tty_display_info): Use it instead of
mouse_face_* members.
dispextern.h (show_mouse_face, clear_mouse_face): Update type of
1st argument.
(frame_to_window_pixel_xy, note_mouse_highlight)
(x_clear_window_mouse_face, cancel_mouse_face, clear_mouse_face)
(show_mouse_face, cursor_in_mouse_face_p): Move prototypes out of
HAVE_WINDOW_SYSTEM conditional.
(draw_row_with_mouse_face): Declare prototype.
(tty_draw_row_with_mouse_face): Declare prototype.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 06 Nov 2010 10:28:31 +0200 |
parents | 9a159fc42f11 f79bd5f589f7 |
children | 1303259207a9 |
comparison
equal
deleted
inserted
replaced
111412:cc7702f421a0 | 111413:d53ee71e7e89 |
---|---|
551 Prepare for a grouped sequence of drawing calls | 551 Prepare for a grouped sequence of drawing calls |
552 external (RIF) call; for one window, called after update_begin | 552 external (RIF) call; for one window, called after update_begin |
553 -------------------------------------------------------------------------- */ | 553 -------------------------------------------------------------------------- */ |
554 { | 554 { |
555 struct frame *f = XFRAME (WINDOW_FRAME (w)); | 555 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
556 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); | 556 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
557 NSTRACE (ns_update_window_begin); | 557 NSTRACE (ns_update_window_begin); |
558 | 558 |
559 updated_window = w; | 559 updated_window = w; |
560 set_output_cursor (&w->cursor); | 560 set_output_cursor (&w->cursor); |
561 | 561 |
562 BLOCK_INPUT; | 562 BLOCK_INPUT; |
563 | 563 |
564 if (f == dpyinfo->mouse_face_mouse_frame) | 564 if (f == hlinfo->mouse_face_mouse_frame) |
565 { | 565 { |
566 /* Don't do highlighting for mouse motion during the update. */ | 566 /* Don't do highlighting for mouse motion during the update. */ |
567 dpyinfo->mouse_face_defer = 1; | 567 hlinfo->mouse_face_defer = 1; |
568 | 568 |
569 /* If the frame needs to be redrawn, | 569 /* If the frame needs to be redrawn, |
570 simply forget about any prior mouse highlighting. */ | 570 simply forget about any prior mouse highlighting. */ |
571 if (FRAME_GARBAGED_P (f)) | 571 if (FRAME_GARBAGED_P (f)) |
572 dpyinfo->mouse_face_window = Qnil; | 572 hlinfo->mouse_face_window = Qnil; |
573 | 573 |
574 /* (further code for mouse faces ifdef'd out in other terms elided) */ | 574 /* (further code for mouse faces ifdef'd out in other terms elided) */ |
575 } | 575 } |
576 | 576 |
577 UNBLOCK_INPUT; | 577 UNBLOCK_INPUT; |
584 /* -------------------------------------------------------------------------- | 584 /* -------------------------------------------------------------------------- |
585 Finished a grouped sequence of drawing calls | 585 Finished a grouped sequence of drawing calls |
586 external (RIF) call; for one window called before update_end | 586 external (RIF) call; for one window called before update_end |
587 -------------------------------------------------------------------------- */ | 587 -------------------------------------------------------------------------- */ |
588 { | 588 { |
589 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (XFRAME (w->frame)); | 589 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); |
590 | 590 |
591 /* note: this fn is nearly identical in all terms */ | 591 /* note: this fn is nearly identical in all terms */ |
592 if (!w->pseudo_window_p) | 592 if (!w->pseudo_window_p) |
593 { | 593 { |
594 BLOCK_INPUT; | 594 BLOCK_INPUT; |
606 | 606 |
607 /* If a row with mouse-face was overwritten, arrange for | 607 /* If a row with mouse-face was overwritten, arrange for |
608 frame_up_to_date to redisplay the mouse highlight. */ | 608 frame_up_to_date to redisplay the mouse highlight. */ |
609 if (mouse_face_overwritten_p) | 609 if (mouse_face_overwritten_p) |
610 { | 610 { |
611 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; | 611 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; |
612 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; | 612 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; |
613 dpyinfo->mouse_face_window = Qnil; | 613 hlinfo->mouse_face_window = Qnil; |
614 } | 614 } |
615 | 615 |
616 updated_window = NULL; | 616 updated_window = NULL; |
617 NSTRACE (update_window_end); | 617 NSTRACE (update_window_end); |
618 } | 618 } |
625 external (RIF) call; for whole frame, called after update_window_end | 625 external (RIF) call; for whole frame, called after update_window_end |
626 -------------------------------------------------------------------------- */ | 626 -------------------------------------------------------------------------- */ |
627 { | 627 { |
628 NSView *view = FRAME_NS_VIEW (f); | 628 NSView *view = FRAME_NS_VIEW (f); |
629 | 629 |
630 /* if (f == FRAME_NS_DISPLAY_INFO (f)->mouse_face_mouse_frame) */ | 630 /* if (f == MOUSE_HL_INFO (f)->mouse_face_mouse_frame) */ |
631 FRAME_NS_DISPLAY_INFO (f)->mouse_face_defer = 0; | 631 MOUSE_HL_INFO (f)->mouse_face_defer = 0; |
632 | 632 |
633 BLOCK_INPUT; | 633 BLOCK_INPUT; |
634 | 634 |
635 #ifdef NS_IMPL_GNUSTEP | 635 #ifdef NS_IMPL_GNUSTEP |
636 /* trigger flush only in the rectangle we tracked as being drawn */ | 636 /* trigger flush only in the rectangle we tracked as being drawn */ |
1030 External: Delete the window | 1030 External: Delete the window |
1031 -------------------------------------------------------------------------- */ | 1031 -------------------------------------------------------------------------- */ |
1032 { | 1032 { |
1033 NSView *view = FRAME_NS_VIEW (f); | 1033 NSView *view = FRAME_NS_VIEW (f); |
1034 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); | 1034 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); |
1035 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); | |
1035 NSTRACE (x_destroy_window); | 1036 NSTRACE (x_destroy_window); |
1036 check_ns (); | 1037 check_ns (); |
1037 | 1038 |
1038 [(EmacsView *)view setWindowClosing: YES]; /* may not have been informed */ | 1039 [(EmacsView *)view setWindowClosing: YES]; /* may not have been informed */ |
1039 | 1040 |
1046 | 1047 |
1047 if (f == dpyinfo->x_focus_frame) | 1048 if (f == dpyinfo->x_focus_frame) |
1048 dpyinfo->x_focus_frame = 0; | 1049 dpyinfo->x_focus_frame = 0; |
1049 if (f == dpyinfo->x_highlight_frame) | 1050 if (f == dpyinfo->x_highlight_frame) |
1050 dpyinfo->x_highlight_frame = 0; | 1051 dpyinfo->x_highlight_frame = 0; |
1051 if (f == dpyinfo->mouse_face_mouse_frame) | 1052 if (f == hlinfo->mouse_face_mouse_frame) |
1052 { | 1053 { |
1053 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; | 1054 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; |
1054 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; | 1055 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; |
1055 dpyinfo->mouse_face_window = Qnil; | 1056 hlinfo->mouse_face_window = Qnil; |
1056 dpyinfo->mouse_face_deferred_gc = 0; | 1057 hlinfo->mouse_face_deferred_gc = 0; |
1057 dpyinfo->mouse_face_mouse_frame = 0; | 1058 hlinfo->mouse_face_mouse_frame = 0; |
1058 } | 1059 } |
1059 | 1060 |
1060 xfree (f->output_data.ns); | 1061 xfree (f->output_data.ns); |
1061 | 1062 |
1062 [[view window] close]; | 1063 [[view window] close]; |
1770 { | 1771 { |
1771 NSTRACE (ns_frame_up_to_date); | 1772 NSTRACE (ns_frame_up_to_date); |
1772 | 1773 |
1773 if (FRAME_NS_P (f)) | 1774 if (FRAME_NS_P (f)) |
1774 { | 1775 { |
1775 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); | 1776 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
1776 if ((dpyinfo->mouse_face_deferred_gc||f ==dpyinfo->mouse_face_mouse_frame) | 1777 if ((hlinfo->mouse_face_deferred_gc || f ==hlinfo->mouse_face_mouse_frame) |
1777 /*&& dpyinfo->mouse_face_mouse_frame*/) | 1778 /*&& hlinfo->mouse_face_mouse_frame*/) |
1778 { | 1779 { |
1779 BLOCK_INPUT; | 1780 BLOCK_INPUT; |
1780 ns_update_begin(f); | 1781 ns_update_begin(f); |
1781 if (dpyinfo->mouse_face_mouse_frame) | 1782 if (hlinfo->mouse_face_mouse_frame) |
1782 note_mouse_highlight (dpyinfo->mouse_face_mouse_frame, | 1783 note_mouse_highlight (hlinfo->mouse_face_mouse_frame, |
1783 dpyinfo->mouse_face_mouse_x, | 1784 hlinfo->mouse_face_mouse_x, |
1784 dpyinfo->mouse_face_mouse_y); | 1785 hlinfo->mouse_face_mouse_y); |
1785 dpyinfo->mouse_face_deferred_gc = 0; | 1786 hlinfo->mouse_face_deferred_gc = 0; |
1786 ns_update_end(f); | 1787 ns_update_end(f); |
1787 UNBLOCK_INPUT; | 1788 UNBLOCK_INPUT; |
1788 } | 1789 } |
1789 } | 1790 } |
1790 } | 1791 } |
1791 | 1792 |
2593 int thickness; | 2594 int thickness; |
2594 struct face *face; | 2595 struct face *face; |
2595 | 2596 |
2596 if (s->hl == DRAW_MOUSE_FACE) | 2597 if (s->hl == DRAW_MOUSE_FACE) |
2597 { | 2598 { |
2598 face = FACE_FROM_ID | 2599 face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); |
2599 (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); | |
2600 if (!face) | 2600 if (!face) |
2601 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); | 2601 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); |
2602 } | 2602 } |
2603 else | 2603 else |
2604 face = s->face; | 2604 face = s->face; |
2661 || s->font_not_found_p || s->extends_to_end_of_line_p || force_p) | 2661 || s->font_not_found_p || s->extends_to_end_of_line_p || force_p) |
2662 { | 2662 { |
2663 struct face *face; | 2663 struct face *face; |
2664 if (s->hl == DRAW_MOUSE_FACE) | 2664 if (s->hl == DRAW_MOUSE_FACE) |
2665 { | 2665 { |
2666 face = FACE_FROM_ID | 2666 face = FACE_FROM_ID (s->f, |
2667 (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); | 2667 MOUSE_HL_INFO (s->f)->mouse_face_face_id); |
2668 if (!face) | 2668 if (!face) |
2669 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); | 2669 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); |
2670 } | 2670 } |
2671 else | 2671 else |
2672 face = FACE_FROM_ID (s->f, s->first_glyph->face_id); | 2672 face = FACE_FROM_ID (s->f, s->first_glyph->face_id); |
2747 /* Draw BG: if we need larger area than image itself cleared, do that, | 2747 /* Draw BG: if we need larger area than image itself cleared, do that, |
2748 otherwise, since we composite the image under NS (instead of mucking | 2748 otherwise, since we composite the image under NS (instead of mucking |
2749 with its background color), we must clear just the image area. */ | 2749 with its background color), we must clear just the image area. */ |
2750 if (s->hl == DRAW_MOUSE_FACE) | 2750 if (s->hl == DRAW_MOUSE_FACE) |
2751 { | 2751 { |
2752 face = FACE_FROM_ID | 2752 face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); |
2753 (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); | |
2754 if (!face) | 2753 if (!face) |
2755 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); | 2754 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); |
2756 } | 2755 } |
2757 else | 2756 else |
2758 face = FACE_FROM_ID (s->f, s->first_glyph->face_id); | 2757 face = FACE_FROM_ID (s->f, s->first_glyph->face_id); |
2871 | 2870 |
2872 ns_focus (s->f, r, n); | 2871 ns_focus (s->f, r, n); |
2873 | 2872 |
2874 if (s->hl == DRAW_MOUSE_FACE) | 2873 if (s->hl == DRAW_MOUSE_FACE) |
2875 { | 2874 { |
2876 face = FACE_FROM_ID | 2875 face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); |
2877 (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); | |
2878 if (!face) | 2876 if (!face) |
2879 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); | 2877 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); |
2880 } | 2878 } |
2881 else | 2879 else |
2882 face = FACE_FROM_ID (s->f, s->first_glyph->face_id); | 2880 face = FACE_FROM_ID (s->f, s->first_glyph->face_id); |
3543 Initialize global info and storage for display. | 3541 Initialize global info and storage for display. |
3544 -------------------------------------------------------------------------- */ | 3542 -------------------------------------------------------------------------- */ |
3545 { | 3543 { |
3546 NSScreen *screen = [NSScreen mainScreen]; | 3544 NSScreen *screen = [NSScreen mainScreen]; |
3547 NSWindowDepth depth = [screen depth]; | 3545 NSWindowDepth depth = [screen depth]; |
3546 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; | |
3548 | 3547 |
3549 dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected */ | 3548 dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected */ |
3550 dpyinfo->resy = 72.27; | 3549 dpyinfo->resy = 72.27; |
3551 dpyinfo->color_p = ![NSDeviceWhiteColorSpace isEqualToString: | 3550 dpyinfo->color_p = ![NSDeviceWhiteColorSpace isEqualToString: |
3552 NSColorSpaceFromDepth (depth)] | 3551 NSColorSpaceFromDepth (depth)] |
3557 dpyinfo->color_table | 3556 dpyinfo->color_table |
3558 = (struct ns_color_table *)xmalloc (sizeof (struct ns_color_table)); | 3557 = (struct ns_color_table *)xmalloc (sizeof (struct ns_color_table)); |
3559 dpyinfo->color_table->colors = NULL; | 3558 dpyinfo->color_table->colors = NULL; |
3560 dpyinfo->root_window = 42; /* a placeholder.. */ | 3559 dpyinfo->root_window = 42; /* a placeholder.. */ |
3561 | 3560 |
3562 dpyinfo->mouse_face_mouse_frame = NULL; | 3561 hlinfo->mouse_face_mouse_frame = NULL; |
3563 dpyinfo->mouse_face_deferred_gc = 0; | 3562 hlinfo->mouse_face_deferred_gc = 0; |
3564 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; | 3563 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; |
3565 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; | 3564 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; |
3566 dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; | 3565 hlinfo->mouse_face_face_id = DEFAULT_FACE_ID; |
3567 dpyinfo->mouse_face_window = dpyinfo->mouse_face_overlay = Qnil; | 3566 hlinfo->mouse_face_window = hlinfo->mouse_face_overlay = Qnil; |
3568 dpyinfo->mouse_face_hidden = 0; | 3567 hlinfo->mouse_face_hidden = 0; |
3569 | 3568 |
3570 dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0; | 3569 hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0; |
3571 dpyinfo->mouse_face_defer = 0; | 3570 hlinfo->mouse_face_defer = 0; |
3572 | 3571 |
3573 dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame = NULL; | 3572 dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame = NULL; |
3574 | 3573 |
3575 dpyinfo->n_fonts = 0; | 3574 dpyinfo->n_fonts = 0; |
3576 dpyinfo->smallest_font_height = 1; | 3575 dpyinfo->smallest_font_height = 1; |
4349 /* Keyboard handling. */ | 4348 /* Keyboard handling. */ |
4350 #define NS_KEYLOG 0 | 4349 #define NS_KEYLOG 0 |
4351 | 4350 |
4352 - (void)keyDown: (NSEvent *)theEvent | 4351 - (void)keyDown: (NSEvent *)theEvent |
4353 { | 4352 { |
4354 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe); | 4353 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe); |
4355 int code; | 4354 int code; |
4356 unsigned fnKeysym = 0; | 4355 unsigned fnKeysym = 0; |
4357 int flags; | 4356 int flags; |
4358 static NSMutableArray *nsEvArray; | 4357 static NSMutableArray *nsEvArray; |
4359 static BOOL firstTime = YES; | 4358 static BOOL firstTime = YES; |
4387 if (nsEvArray == nil) | 4386 if (nsEvArray == nil) |
4388 nsEvArray = [[NSMutableArray alloc] initWithCapacity: 1]; | 4387 nsEvArray = [[NSMutableArray alloc] initWithCapacity: 1]; |
4389 | 4388 |
4390 [NSCursor setHiddenUntilMouseMoves: YES]; | 4389 [NSCursor setHiddenUntilMouseMoves: YES]; |
4391 | 4390 |
4392 if (dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) | 4391 if (hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) |
4393 { | 4392 { |
4394 clear_mouse_face (dpyinfo); | 4393 clear_mouse_face (hlinfo); |
4395 dpyinfo->mouse_face_hidden = 1; | 4394 hlinfo->mouse_face_hidden = 1; |
4396 } | 4395 } |
4397 | 4396 |
4398 if (!processingCompose) | 4397 if (!processingCompose) |
4399 { | 4398 { |
4400 code = ([[theEvent charactersIgnoringModifiers] length] == 0) ? | 4399 code = ([[theEvent charactersIgnoringModifiers] length] == 0) ? |
4827 | 4826 |
4828 | 4827 |
4829 /* Tell emacs the mouse has moved. */ | 4828 /* Tell emacs the mouse has moved. */ |
4830 - (void)mouseMoved: (NSEvent *)e | 4829 - (void)mouseMoved: (NSEvent *)e |
4831 { | 4830 { |
4832 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe); | 4831 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe); |
4833 Lisp_Object frame; | 4832 Lisp_Object frame; |
4834 | 4833 |
4835 // NSTRACE (mouseMoved); | 4834 // NSTRACE (mouseMoved); |
4836 | 4835 |
4837 last_mouse_movement_time = EV_TIMESTAMP (e); | 4836 last_mouse_movement_time = EV_TIMESTAMP (e); |
4838 last_mouse_motion_position | 4837 last_mouse_motion_position |
4839 = [self convertPoint: [e locationInWindow] fromView: nil]; | 4838 = [self convertPoint: [e locationInWindow] fromView: nil]; |
4840 | 4839 |
4841 /* update any mouse face */ | 4840 /* update any mouse face */ |
4842 if (dpyinfo->mouse_face_hidden) | 4841 if (hlinfo->mouse_face_hidden) |
4843 { | 4842 { |
4844 dpyinfo->mouse_face_hidden = 0; | 4843 hlinfo->mouse_face_hidden = 0; |
4845 clear_mouse_face (dpyinfo); | 4844 clear_mouse_face (hlinfo); |
4846 } | 4845 } |
4847 | 4846 |
4848 /* tooltip handling */ | 4847 /* tooltip handling */ |
4849 previous_help_echo_string = help_echo_string; | 4848 previous_help_echo_string = help_echo_string; |
4850 help_echo_string = Qnil; | 4849 help_echo_string = Qnil; |
5306 | 5305 |
5307 - (void)mouseExited: (NSEvent *)theEvent | 5306 - (void)mouseExited: (NSEvent *)theEvent |
5308 { | 5307 { |
5309 NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; | 5308 NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; |
5310 NSRect r; | 5309 NSRect r; |
5311 struct ns_display_info *dpyinfo | 5310 Mouse_HLInfo *hlinfo = emacsframe ? MOUSE_HL_INFO (emacsframe) : NULL; |
5312 = emacsframe ? FRAME_NS_DISPLAY_INFO (emacsframe) : NULL; | |
5313 | 5311 |
5314 NSTRACE (mouseExited); | 5312 NSTRACE (mouseExited); |
5315 | 5313 |
5316 if (!dpyinfo) | 5314 if (!hlinfo) |
5317 return; | 5315 return; |
5318 | 5316 |
5319 last_mouse_movement_time = EV_TIMESTAMP (theEvent); | 5317 last_mouse_movement_time = EV_TIMESTAMP (theEvent); |
5320 | 5318 |
5321 if (emacsframe == dpyinfo->mouse_face_mouse_frame) | 5319 if (emacsframe == hlinfo->mouse_face_mouse_frame) |
5322 { | 5320 { |
5323 clear_mouse_face (dpyinfo); | 5321 clear_mouse_face (hlinfo); |
5324 dpyinfo->mouse_face_mouse_frame = 0; | 5322 hlinfo->mouse_face_mouse_frame = 0; |
5325 } | 5323 } |
5326 } | 5324 } |
5327 | 5325 |
5328 | 5326 |
5329 - menuDown: sender | 5327 - menuDown: sender |