diff options
| author | YAMAMOTO Mitsuharu | 2007-02-23 08:26:06 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2007-02-23 08:26:06 +0000 |
| commit | e6509087afb424af7bcf3593b08dbdf16dd6f7c8 (patch) | |
| tree | 03c966f1fc357c1ecd14b53815fccc97244cea88 /src | |
| parent | 356ce658c89711b8c5086c97af8385929bd124da (diff) | |
| download | emacs-e6509087afb424af7bcf3593b08dbdf16dd6f7c8.tar.gz emacs-e6509087afb424af7bcf3593b08dbdf16dd6f7c8.zip | |
(mac_display_info_for_display): Remove function.
(mac_flush_display_optional) [USE_CG_DRAWING]: New function.
(x_redisplay_interface) [USE_CG_DRAWING]: Set it as handler for
flush_display_optional.
[USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press): New
argument MOUSE_POS. All uses changed. Set bar->dragging to
negative integer if scroll bar handle is pressed.
[USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release): Negative
bar->dragging means scroll bar handle is not dragged.
[USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag): Get initial
offset of scroll bar handle from negative bar->dragging.
(XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Modifiers for scroll
bar click is compared against mapped one. Set down/up_modifier
for scroll bar click event with control key.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macterm.c | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/src/macterm.c b/src/macterm.c index b5dc0e6170e..b00317baf31 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -1916,18 +1916,16 @@ x_flush (f) | |||
| 1916 | 1916 | ||
| 1917 | #define XFlush(DISPLAY) (void) 0 | 1917 | #define XFlush(DISPLAY) (void) 0 |
| 1918 | 1918 | ||
| 1919 | 1919 | #if USE_CG_DRAWING | |
| 1920 | /* Return the struct mac_display_info corresponding to DPY. There's | 1920 | static void |
| 1921 | only one. */ | 1921 | mac_flush_display_optional (f) |
| 1922 | 1922 | struct frame *f; | |
| 1923 | struct mac_display_info * | ||
| 1924 | mac_display_info_for_display (dpy) | ||
| 1925 | Display *dpy; | ||
| 1926 | { | 1923 | { |
| 1927 | return &one_mac_display_info; | 1924 | BLOCK_INPUT; |
| 1925 | mac_prepare_for_quickdraw (f); | ||
| 1926 | UNBLOCK_INPUT; | ||
| 1928 | } | 1927 | } |
| 1929 | 1928 | #endif | |
| 1930 | |||
| 1931 | 1929 | ||
| 1932 | /*********************************************************************** | 1930 | /*********************************************************************** |
| 1933 | Starting and ending an update | 1931 | Starting and ending an update |
| @@ -4649,7 +4647,7 @@ static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, | |||
| 4649 | static OSStatus get_control_part_bounds P_ ((ControlHandle, ControlPartCode, | 4647 | static OSStatus get_control_part_bounds P_ ((ControlHandle, ControlPartCode, |
| 4650 | Rect *)); | 4648 | Rect *)); |
| 4651 | static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, | 4649 | static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, |
| 4652 | ControlPartCode, | 4650 | ControlPartCode, Point, |
| 4653 | struct input_event *)); | 4651 | struct input_event *)); |
| 4654 | static void x_scroll_bar_handle_release P_ ((struct scroll_bar *, | 4652 | static void x_scroll_bar_handle_release P_ ((struct scroll_bar *, |
| 4655 | struct input_event *)); | 4653 | struct input_event *)); |
| @@ -4762,9 +4760,10 @@ get_control_part_bounds (ch, part_code, rect) | |||
| 4762 | } | 4760 | } |
| 4763 | 4761 | ||
| 4764 | static void | 4762 | static void |
| 4765 | x_scroll_bar_handle_press (bar, part_code, bufp) | 4763 | x_scroll_bar_handle_press (bar, part_code, mouse_pos, bufp) |
| 4766 | struct scroll_bar *bar; | 4764 | struct scroll_bar *bar; |
| 4767 | ControlPartCode part_code; | 4765 | ControlPartCode part_code; |
| 4766 | Point mouse_pos; | ||
| 4768 | struct input_event *bufp; | 4767 | struct input_event *bufp; |
| 4769 | { | 4768 | { |
| 4770 | int part = control_part_code_to_scroll_bar_part (part_code); | 4769 | int part = control_part_code_to_scroll_bar_part (part_code); |
| @@ -4777,10 +4776,18 @@ x_scroll_bar_handle_press (bar, part_code, bufp) | |||
| 4777 | construct_scroll_bar_click (bar, part, bufp); | 4776 | construct_scroll_bar_click (bar, part, bufp); |
| 4778 | HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); | 4777 | HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); |
| 4779 | set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY); | 4778 | set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY); |
| 4779 | bar->dragging = Qnil; | ||
| 4780 | } | ||
| 4781 | else | ||
| 4782 | { | ||
| 4783 | Rect r; | ||
| 4784 | |||
| 4785 | get_control_part_bounds (SCROLL_BAR_CONTROL_HANDLE (bar), | ||
| 4786 | kControlIndicatorPart, &r); | ||
| 4787 | XSETINT (bar->dragging, - (mouse_pos.v - r.top) - 1); | ||
| 4780 | } | 4788 | } |
| 4781 | 4789 | ||
| 4782 | last_scroll_bar_part = part; | 4790 | last_scroll_bar_part = part; |
| 4783 | bar->dragging = Qnil; | ||
| 4784 | tracked_scroll_bar = bar; | 4791 | tracked_scroll_bar = bar; |
| 4785 | } | 4792 | } |
| 4786 | 4793 | ||
| @@ -4790,7 +4797,7 @@ x_scroll_bar_handle_release (bar, bufp) | |||
| 4790 | struct input_event *bufp; | 4797 | struct input_event *bufp; |
| 4791 | { | 4798 | { |
| 4792 | if (last_scroll_bar_part != scroll_bar_handle | 4799 | if (last_scroll_bar_part != scroll_bar_handle |
| 4793 | || !GC_NILP (bar->dragging)) | 4800 | || (INTEGERP (bar->dragging) && XINT (bar->dragging) >= 0)) |
| 4794 | construct_scroll_bar_click (bar, scroll_bar_end_scroll, bufp); | 4801 | construct_scroll_bar_click (bar, scroll_bar_end_scroll, bufp); |
| 4795 | 4802 | ||
| 4796 | HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0); | 4803 | HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0); |
| @@ -4818,8 +4825,8 @@ x_scroll_bar_handle_drag (win, bar, mouse_pos, bufp) | |||
| 4818 | get_control_part_bounds (SCROLL_BAR_CONTROL_HANDLE (bar), | 4825 | get_control_part_bounds (SCROLL_BAR_CONTROL_HANDLE (bar), |
| 4819 | kControlIndicatorPart, &r); | 4826 | kControlIndicatorPart, &r); |
| 4820 | 4827 | ||
| 4821 | if (GC_NILP (bar->dragging)) | 4828 | if (INTEGERP (bar->dragging) && XINT (bar->dragging) < 0) |
| 4822 | XSETINT (bar->dragging, mouse_pos.v - r.top); | 4829 | XSETINT (bar->dragging, - (XINT (bar->dragging) + 1)); |
| 4823 | 4830 | ||
| 4824 | top = mouse_pos.v - XINT (bar->dragging) - XINT (bar->track_top); | 4831 | top = mouse_pos.v - XINT (bar->dragging) - XINT (bar->track_top); |
| 4825 | top_range = (XINT (bar->track_height) - (r.bottom - r.top)) * | 4832 | top_range = (XINT (bar->track_height) - (r.bottom - r.top)) * |
| @@ -10754,12 +10761,12 @@ XTread_socket (sd, expected, hold_quit) | |||
| 10754 | #ifdef USE_TOOLKIT_SCROLL_BARS | 10761 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 10755 | /* Make the "Ctrl-Mouse-2 splits window" work | 10762 | /* Make the "Ctrl-Mouse-2 splits window" work |
| 10756 | for toolkit scroll bars. */ | 10763 | for toolkit scroll bars. */ |
| 10757 | if (er.modifiers & controlKey) | 10764 | if (inev.modifiers & ctrl_modifier) |
| 10758 | x_scroll_bar_handle_click (bar, control_part_code, | 10765 | x_scroll_bar_handle_click (bar, control_part_code, |
| 10759 | &er, &inev); | 10766 | &er, &inev); |
| 10760 | else if (er.what == mouseDown) | 10767 | else if (er.what == mouseDown) |
| 10761 | x_scroll_bar_handle_press (bar, control_part_code, | 10768 | x_scroll_bar_handle_press (bar, control_part_code, |
| 10762 | &inev); | 10769 | mouse_loc, &inev); |
| 10763 | else | 10770 | else |
| 10764 | x_scroll_bar_handle_release (bar, &inev); | 10771 | x_scroll_bar_handle_release (bar, &inev); |
| 10765 | #else /* not USE_TOOLKIT_SCROLL_BARS */ | 10772 | #else /* not USE_TOOLKIT_SCROLL_BARS */ |
| @@ -10822,7 +10829,9 @@ XTread_socket (sd, expected, hold_quit) | |||
| 10822 | f->mouse_moved = 0; | 10829 | f->mouse_moved = 0; |
| 10823 | 10830 | ||
| 10824 | #ifdef USE_TOOLKIT_SCROLL_BARS | 10831 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 10825 | if (inev.kind == MOUSE_CLICK_EVENT) | 10832 | if (inev.kind == MOUSE_CLICK_EVENT |
| 10833 | || (inev.kind == SCROLL_BAR_CLICK_EVENT | ||
| 10834 | && (inev.modifiers & ctrl_modifier))) | ||
| 10826 | #endif | 10835 | #endif |
| 10827 | switch (er.what) | 10836 | switch (er.what) |
| 10828 | { | 10837 | { |
| @@ -11714,7 +11723,11 @@ static struct redisplay_interface x_redisplay_interface = | |||
| 11714 | x_update_window_end, | 11723 | x_update_window_end, |
| 11715 | x_cursor_to, | 11724 | x_cursor_to, |
| 11716 | x_flush, | 11725 | x_flush, |
| 11726 | #if USE_CG_DRAWING | ||
| 11727 | mac_flush_display_optional, | ||
| 11728 | #else | ||
| 11717 | 0, /* flush_display_optional */ | 11729 | 0, /* flush_display_optional */ |
| 11730 | #endif | ||
| 11718 | x_clear_window_mouse_face, | 11731 | x_clear_window_mouse_face, |
| 11719 | x_get_glyph_overhangs, | 11732 | x_get_glyph_overhangs, |
| 11720 | x_fix_overlapping_area, | 11733 | x_fix_overlapping_area, |