diff options
| author | Dmitry Antipov | 2014-07-25 10:01:39 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-25 10:01:39 +0400 |
| commit | 88cd403ca7cc46d9ffcf9ec3564f5526d931e113 (patch) | |
| tree | 3e88a28a35b16e38891eebd40b791d434af125ff | |
| parent | 934eeab5ff5d3dbe233f8fd1acd698b401aee44c (diff) | |
| download | emacs-88cd403ca7cc46d9ffcf9ec3564f5526d931e113.tar.gz emacs-88cd403ca7cc46d9ffcf9ec3564f5526d931e113.zip | |
Move hourglass machinery to RIF.
* dispextern.h (struct redisplay_interface): New members
show_hourglass and hide_hourglass. Indent comments.
(show_hourglass, hide_hourglass): Remove prototypes.
* nsterm.m (show_hourgass, hide_hourglass): Refactor to ...
(ns_show_hourglass, ns_hide_hourglass): ... new no-ops.
(ns_redisplay_interface): Add them.
* w32fns.c (show_hourglass, hide_hourglass): Refactor to ...
* w32term.c (w32_show_hourglass, w32_hide_hourglass): ... these.
(w32_arrow_cursor): New function to hack around non-GUI frames.
(w32_redisplay_interface): Add new functions.
* w32term.h (w32_arror_cursor): Add prototype.
* xdisp.c (show_hourglass): New function, refactored out from
platform-dependend code.
(cancel_hourglass): Now call to RIF function.
* xfns.c (show_hourglass, hide_hourglass): Refactor to ...
* xterm.c (x_show_hourglass, x_hide_hourglass): ... these.
(x_redisplay_interface): Add new functions.
| -rw-r--r-- | src/ChangeLog | 21 | ||||
| -rw-r--r-- | src/dispextern.h | 38 | ||||
| -rw-r--r-- | src/nsterm.m | 36 | ||||
| -rw-r--r-- | src/w32fns.c | 61 | ||||
| -rw-r--r-- | src/w32term.c | 38 | ||||
| -rw-r--r-- | src/w32term.h | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 56 | ||||
| -rw-r--r-- | src/xfns.c | 110 | ||||
| -rw-r--r-- | src/xterm.c | 62 |
9 files changed, 201 insertions, 222 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f5ef9cedf28..2fc559531ba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,24 @@ | |||
| 1 | 2014-07-25 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Move hourglass machinery to RIF. | ||
| 4 | * dispextern.h (struct redisplay_interface): New members | ||
| 5 | show_hourglass and hide_hourglass. Indent comments. | ||
| 6 | (show_hourglass, hide_hourglass): Remove prototypes. | ||
| 7 | * nsterm.m (show_hourgass, hide_hourglass): Refactor to ... | ||
| 8 | (ns_show_hourglass, ns_hide_hourglass): ... new no-ops. | ||
| 9 | (ns_redisplay_interface): Add them. | ||
| 10 | * w32fns.c (show_hourglass, hide_hourglass): Refactor to ... | ||
| 11 | * w32term.c (w32_show_hourglass, w32_hide_hourglass): ... these. | ||
| 12 | (w32_arrow_cursor): New function to hack around non-GUI frames. | ||
| 13 | (w32_redisplay_interface): Add new functions. | ||
| 14 | * w32term.h (w32_arror_cursor): Add prototype. | ||
| 15 | * xdisp.c (show_hourglass): New function, refactored out from | ||
| 16 | platform-dependend code. | ||
| 17 | (cancel_hourglass): Now call to RIF function. | ||
| 18 | * xfns.c (show_hourglass, hide_hourglass): Refactor to ... | ||
| 19 | * xterm.c (x_show_hourglass, x_hide_hourglass): ... these. | ||
| 20 | (x_redisplay_interface): Add new functions. | ||
| 21 | |||
| 1 | 2014-07-24 Dmitry Antipov <dmantipov@yandex.ru> | 22 | 2014-07-24 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 23 | ||
| 3 | Fix error reported by Angelo Graziosi <angelo.graziosi@alice.it> in | 24 | Fix error reported by Angelo Graziosi <angelo.graziosi@alice.it> in |
diff --git a/src/dispextern.h b/src/dispextern.h index 0e04cc466d3..a8cf9c7ee59 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2821,45 +2821,51 @@ struct redisplay_interface | |||
| 2821 | int h, int wd); | 2821 | int h, int wd); |
| 2822 | void (*destroy_fringe_bitmap) (int which); | 2822 | void (*destroy_fringe_bitmap) (int which); |
| 2823 | 2823 | ||
| 2824 | /* Compute left and right overhang of glyph string S. | 2824 | /* Compute left and right overhang of glyph string S. |
| 2825 | A NULL pointer if platform does not support this. */ | 2825 | A NULL pointer if platform does not support this. */ |
| 2826 | void (*compute_glyph_string_overhangs) (struct glyph_string *s); | 2826 | void (*compute_glyph_string_overhangs) (struct glyph_string *s); |
| 2827 | 2827 | ||
| 2828 | /* Draw a glyph string S. */ | 2828 | /* Draw a glyph string S. */ |
| 2829 | void (*draw_glyph_string) (struct glyph_string *s); | 2829 | void (*draw_glyph_string) (struct glyph_string *s); |
| 2830 | 2830 | ||
| 2831 | /* Define cursor CURSOR on frame F. */ | 2831 | /* Define cursor CURSOR on frame F. */ |
| 2832 | void (*define_frame_cursor) (struct frame *f, Cursor cursor); | 2832 | void (*define_frame_cursor) (struct frame *f, Cursor cursor); |
| 2833 | 2833 | ||
| 2834 | /* Clear the area at (X,Y,WIDTH,HEIGHT) of frame F. */ | 2834 | /* Clear the area at (X,Y,WIDTH,HEIGHT) of frame F. */ |
| 2835 | void (*clear_frame_area) (struct frame *f, int x, int y, | 2835 | void (*clear_frame_area) (struct frame *f, int x, int y, |
| 2836 | int width, int height); | 2836 | int width, int height); |
| 2837 | 2837 | ||
| 2838 | /* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH | 2838 | /* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH |
| 2839 | at row GLYPH_ROW on window W if ON_P is true. If ON_P is | 2839 | at row GLYPH_ROW on window W if ON_P is true. If ON_P is |
| 2840 | false, don't draw cursor. If ACTIVE_P is true, system caret | 2840 | false, don't draw cursor. If ACTIVE_P is true, system caret |
| 2841 | should track this cursor (when applicable). */ | 2841 | should track this cursor (when applicable). */ |
| 2842 | void (*draw_window_cursor) (struct window *w, | 2842 | void (*draw_window_cursor) (struct window *w, |
| 2843 | struct glyph_row *glyph_row, | 2843 | struct glyph_row *glyph_row, |
| 2844 | int x, int y, | 2844 | int x, int y, |
| 2845 | enum text_cursor_kinds cursor_type, | 2845 | enum text_cursor_kinds cursor_type, |
| 2846 | int cursor_width, bool on_p, bool active_p); | 2846 | int cursor_width, bool on_p, bool active_p); |
| 2847 | 2847 | ||
| 2848 | /* Draw vertical border for window W from (X,Y_0) to (X,Y_1). */ | 2848 | /* Draw vertical border for window W from (X,Y_0) to (X,Y_1). */ |
| 2849 | void (*draw_vertical_window_border) (struct window *w, | 2849 | void (*draw_vertical_window_border) (struct window *w, |
| 2850 | int x, int y_0, int y_1); | 2850 | int x, int y_0, int y_1); |
| 2851 | 2851 | ||
| 2852 | /* Draw window divider for window W from (X_0, Y_0) to (X_1, ,Y_1). */ | 2852 | /* Draw window divider for window W from (X_0, Y_0) to (X_1, ,Y_1). */ |
| 2853 | void (*draw_window_divider) (struct window *w, | 2853 | void (*draw_window_divider) (struct window *w, |
| 2854 | int x_0, int x_1, int y_0, int y_1); | 2854 | int x_0, int x_1, int y_0, int y_1); |
| 2855 | 2855 | ||
| 2856 | /* Shift display of frame F to make room for inserted glyphs. | 2856 | /* Shift display of frame F to make room for inserted glyphs. |
| 2857 | The area at pixel (X,Y) of width WIDTH and height HEIGHT is | 2857 | The area at pixel (X,Y) of width WIDTH and height HEIGHT is |
| 2858 | shifted right by SHIFT_BY pixels. */ | 2858 | shifted right by SHIFT_BY pixels. */ |
| 2859 | void (*shift_glyphs_for_insert) (struct frame *f, | 2859 | void (*shift_glyphs_for_insert) (struct frame *f, |
| 2860 | int x, int y, int width, | 2860 | int x, int y, int width, |
| 2861 | int height, int shift_by); | 2861 | int height, int shift_by); |
| 2862 | 2862 | ||
| 2863 | /* Start display hourglass cursor on frame F. */ | ||
| 2864 | void (*show_hourglass) (struct frame *f); | ||
| 2865 | |||
| 2866 | /* Cancel hourglass cursor on frame F. */ | ||
| 2867 | void (*hide_hourglass) (struct frame *f); | ||
| 2868 | |||
| 2863 | #endif /* HAVE_WINDOW_SYSTEM */ | 2869 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 2864 | }; | 2870 | }; |
| 2865 | 2871 | ||
| @@ -3396,10 +3402,6 @@ extern bool hourglass_shown_p; | |||
| 3396 | an hourglass cursor on all frames. */ | 3402 | an hourglass cursor on all frames. */ |
| 3397 | extern struct atimer *hourglass_atimer; | 3403 | extern struct atimer *hourglass_atimer; |
| 3398 | 3404 | ||
| 3399 | /* Each GUI implements these. FIXME: move into RIF. */ | ||
| 3400 | extern void show_hourglass (struct atimer *); | ||
| 3401 | extern void hide_hourglass (void); | ||
| 3402 | |||
| 3403 | /* Returns the background color of IMG, calculating one heuristically if | 3405 | /* Returns the background color of IMG, calculating one heuristically if |
| 3404 | necessary. If non-zero, XIMG is an existing XImage object to use for | 3406 | necessary. If non-zero, XIMG is an existing XImage object to use for |
| 3405 | the heuristic. */ | 3407 | the heuristic. */ |
diff --git a/src/nsterm.m b/src/nsterm.m index 64f3be6cc06..3b1c945c6bf 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -2594,38 +2594,18 @@ ns_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) | |||
| 2594 | ns_unfocus (f); | 2594 | ns_unfocus (f); |
| 2595 | } | 2595 | } |
| 2596 | 2596 | ||
| 2597 | 2597 | static void | |
| 2598 | void | 2598 | ns_show_hourglass (struct frame *f) |
| 2599 | show_hourglass (struct atimer *timer) | ||
| 2600 | { | 2599 | { |
| 2601 | if (hourglass_shown_p) | 2600 | /* TODO: add NSProgressIndicator to all frames. */ |
| 2602 | return; | ||
| 2603 | |||
| 2604 | block_input (); | ||
| 2605 | |||
| 2606 | /* TODO: add NSProgressIndicator to selected frame (see macfns.c) */ | ||
| 2607 | |||
| 2608 | hourglass_shown_p = 1; | ||
| 2609 | unblock_input (); | ||
| 2610 | } | 2601 | } |
| 2611 | 2602 | ||
| 2612 | 2603 | static void | |
| 2613 | void | 2604 | ns_hide_hourglass (struct frame *f) |
| 2614 | hide_hourglass (void) | ||
| 2615 | { | 2605 | { |
| 2616 | if (!hourglass_shown_p) | 2606 | /* TODO: remove NSProgressIndicator from all frames. */ |
| 2617 | return; | ||
| 2618 | |||
| 2619 | block_input (); | ||
| 2620 | |||
| 2621 | /* TODO: remove NSProgressIndicator from all frames */ | ||
| 2622 | |||
| 2623 | hourglass_shown_p = 0; | ||
| 2624 | unblock_input (); | ||
| 2625 | } | 2607 | } |
| 2626 | 2608 | ||
| 2627 | |||
| 2628 | |||
| 2629 | /* ========================================================================== | 2609 | /* ========================================================================== |
| 2630 | 2610 | ||
| 2631 | Glyph drawing operations | 2611 | Glyph drawing operations |
| @@ -4114,7 +4094,9 @@ static struct redisplay_interface ns_redisplay_interface = | |||
| 4114 | ns_draw_window_cursor, | 4094 | ns_draw_window_cursor, |
| 4115 | ns_draw_vertical_window_border, | 4095 | ns_draw_vertical_window_border, |
| 4116 | ns_draw_window_divider, | 4096 | ns_draw_window_divider, |
| 4117 | ns_shift_glyphs_for_insert | 4097 | ns_shift_glyphs_for_insert, |
| 4098 | ns_show_hourglass, | ||
| 4099 | ns_hide_hourglass | ||
| 4118 | }; | 4100 | }; |
| 4119 | 4101 | ||
| 4120 | 4102 | ||
diff --git a/src/w32fns.c b/src/w32fns.c index b76c81fdf1f..dbd83444c99 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -5488,67 +5488,6 @@ no value of TYPE (always string in the MS Windows case). */) | |||
| 5488 | 5488 | ||
| 5489 | #endif /* TODO */ | 5489 | #endif /* TODO */ |
| 5490 | 5490 | ||
| 5491 | |||
| 5492 | /*********************************************************************** | ||
| 5493 | Busy cursor | ||
| 5494 | ***********************************************************************/ | ||
| 5495 | |||
| 5496 | /* Display an hourglass cursor. Set the hourglass_p flag in display info | ||
| 5497 | to indicate that an hourglass cursor is shown. */ | ||
| 5498 | |||
| 5499 | void | ||
| 5500 | show_hourglass (struct atimer *timer) | ||
| 5501 | { | ||
| 5502 | hourglass_atimer = NULL; | ||
| 5503 | |||
| 5504 | if (!hourglass_shown_p) | ||
| 5505 | { | ||
| 5506 | Lisp_Object tail, frame; | ||
| 5507 | |||
| 5508 | block_input (); | ||
| 5509 | FOR_EACH_FRAME (tail, frame) | ||
| 5510 | { | ||
| 5511 | struct frame *f = XFRAME (frame); | ||
| 5512 | |||
| 5513 | if (FRAME_W32_P (f) && !menubar_in_use && !current_popup_menu) | ||
| 5514 | { | ||
| 5515 | f->output_data.w32->hourglass_p = 1; | ||
| 5516 | SetCursor (f->output_data.w32->hourglass_cursor); | ||
| 5517 | } | ||
| 5518 | } | ||
| 5519 | unblock_input (); | ||
| 5520 | hourglass_shown_p = 1; | ||
| 5521 | } | ||
| 5522 | } | ||
| 5523 | |||
| 5524 | /* Hide the hourglass cursor on all frames, if it is currently shown. */ | ||
| 5525 | |||
| 5526 | void | ||
| 5527 | hide_hourglass (void) | ||
| 5528 | { | ||
| 5529 | if (hourglass_shown_p) | ||
| 5530 | { | ||
| 5531 | Lisp_Object tail, frame; | ||
| 5532 | |||
| 5533 | block_input (); | ||
| 5534 | FOR_EACH_FRAME (tail, frame) | ||
| 5535 | { | ||
| 5536 | struct frame *f = XFRAME (frame); | ||
| 5537 | |||
| 5538 | if (FRAME_W32_P (f)) | ||
| 5539 | { | ||
| 5540 | f->output_data.w32->hourglass_p = 0; | ||
| 5541 | SetCursor (f->output_data.w32->current_cursor); | ||
| 5542 | } | ||
| 5543 | else | ||
| 5544 | /* No cursors on non GUI frames - restore to stock arrow cursor. */ | ||
| 5545 | SetCursor (w32_load_cursor (IDC_ARROW)); | ||
| 5546 | } | ||
| 5547 | unblock_input (); | ||
| 5548 | hourglass_shown_p = 0; | ||
| 5549 | } | ||
| 5550 | } | ||
| 5551 | |||
| 5552 | /*********************************************************************** | 5491 | /*********************************************************************** |
| 5553 | Tool tips | 5492 | Tool tips |
| 5554 | ***********************************************************************/ | 5493 | ***********************************************************************/ |
diff --git a/src/w32term.c b/src/w32term.c index 479744073cd..fd902ee7cd5 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -6180,8 +6180,40 @@ x_check_font (struct frame *f, struct font *font) | |||
| 6180 | 6180 | ||
| 6181 | #endif /* GLYPH_DEBUG */ | 6181 | #endif /* GLYPH_DEBUG */ |
| 6182 | 6182 | ||
| 6183 | /* Show hourglass cursor on frame F. */ | ||
| 6184 | |||
| 6185 | static void | ||
| 6186 | w32_show_hourglass (struct frame *f) | ||
| 6187 | { | ||
| 6188 | if (!menubar_in_use && !current_popup_menu) | ||
| 6189 | { | ||
| 6190 | struct w32_output *w32 = FRAME_X_OUTPUT (f); | ||
| 6191 | |||
| 6192 | w32->hourglass_p = 1; | ||
| 6193 | SetCursor (w32->hourglass_cursor); | ||
| 6194 | } | ||
| 6195 | } | ||
| 6196 | |||
| 6197 | /* Hide hourglass cursor on frame F. */ | ||
| 6198 | |||
| 6199 | static void | ||
| 6200 | w32_hide_hourglass (struct frame *f) | ||
| 6201 | { | ||
| 6202 | struct w32_output *w32 = FRAME_X_OUTPUT (f); | ||
| 6203 | |||
| 6204 | w32->hourglass_p = 0; | ||
| 6205 | SetCursor (w32->current_cursor); | ||
| 6206 | } | ||
| 6207 | |||
| 6208 | /* FIXME: old code did that, but I don't know why. Anyway, | ||
| 6209 | this is used for non-GUI frames (see cancel_hourglass). */ | ||
| 6210 | |||
| 6211 | void | ||
| 6212 | w32_arrow_cursor (void) | ||
| 6213 | { | ||
| 6214 | SetCursor (w32_load_cursor (IDC_ARROW)); | ||
| 6215 | } | ||
| 6183 | 6216 | ||
| 6184 | |||
| 6185 | /*********************************************************************** | 6217 | /*********************************************************************** |
| 6186 | Initialization | 6218 | Initialization |
| 6187 | ***********************************************************************/ | 6219 | ***********************************************************************/ |
| @@ -6297,7 +6329,9 @@ static struct redisplay_interface w32_redisplay_interface = | |||
| 6297 | w32_draw_window_cursor, | 6329 | w32_draw_window_cursor, |
| 6298 | w32_draw_vertical_window_border, | 6330 | w32_draw_vertical_window_border, |
| 6299 | w32_draw_window_divider, | 6331 | w32_draw_window_divider, |
| 6300 | w32_shift_glyphs_for_insert | 6332 | w32_shift_glyphs_for_insert, |
| 6333 | w32_show_hourglass, | ||
| 6334 | w32_hide_hourglass | ||
| 6301 | }; | 6335 | }; |
| 6302 | 6336 | ||
| 6303 | static void x_delete_terminal (struct terminal *term); | 6337 | static void x_delete_terminal (struct terminal *term); |
diff --git a/src/w32term.h b/src/w32term.h index 561a280b65f..fdf5f4420b8 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -780,6 +780,7 @@ typedef char guichar_t; | |||
| 780 | #define GUI_SDATA(x) ((guichar_t*) SDATA (x)) | 780 | #define GUI_SDATA(x) ((guichar_t*) SDATA (x)) |
| 781 | 781 | ||
| 782 | extern Lisp_Object w32_popup_dialog (struct frame *, Lisp_Object, Lisp_Object); | 782 | extern Lisp_Object w32_popup_dialog (struct frame *, Lisp_Object, Lisp_Object); |
| 783 | extern void w32_arrow_cursor (void); | ||
| 783 | 784 | ||
| 784 | extern void syms_of_w32term (void); | 785 | extern void syms_of_w32term (void); |
| 785 | extern void syms_of_w32menu (void); | 786 | extern void syms_of_w32menu (void); |
diff --git a/src/xdisp.c b/src/xdisp.c index a340c6e00dd..b1de8ba0438 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -30730,7 +30730,38 @@ init_xdisp (void) | |||
| 30730 | 30730 | ||
| 30731 | /* Platform-independent portion of hourglass implementation. */ | 30731 | /* Platform-independent portion of hourglass implementation. */ |
| 30732 | 30732 | ||
| 30733 | /* Timer function of hourglass_atimer. */ | ||
| 30734 | |||
| 30735 | static void | ||
| 30736 | show_hourglass (struct atimer *timer) | ||
| 30737 | { | ||
| 30738 | /* The timer implementation will cancel this timer automatically | ||
| 30739 | after this function has run. Set hourglass_atimer to null | ||
| 30740 | so that we know the timer doesn't have to be canceled. */ | ||
| 30741 | hourglass_atimer = NULL; | ||
| 30742 | |||
| 30743 | if (!hourglass_shown_p) | ||
| 30744 | { | ||
| 30745 | Lisp_Object tail, frame; | ||
| 30746 | |||
| 30747 | block_input (); | ||
| 30748 | |||
| 30749 | FOR_EACH_FRAME (tail, frame) | ||
| 30750 | { | ||
| 30751 | struct frame *f = XFRAME (frame); | ||
| 30752 | |||
| 30753 | if (FRAME_LIVE_P (f) && FRAME_WINDOW_P (f) | ||
| 30754 | && FRAME_RIF (f)->show_hourglass) | ||
| 30755 | FRAME_RIF (f)->show_hourglass (f); | ||
| 30756 | } | ||
| 30757 | |||
| 30758 | hourglass_shown_p = 1; | ||
| 30759 | unblock_input (); | ||
| 30760 | } | ||
| 30761 | } | ||
| 30762 | |||
| 30733 | /* Cancel a currently active hourglass timer, and start a new one. */ | 30763 | /* Cancel a currently active hourglass timer, and start a new one. */ |
| 30764 | |||
| 30734 | void | 30765 | void |
| 30735 | start_hourglass (void) | 30766 | start_hourglass (void) |
| 30736 | { | 30767 | { |
| @@ -30753,9 +30784,9 @@ start_hourglass (void) | |||
| 30753 | show_hourglass, NULL); | 30784 | show_hourglass, NULL); |
| 30754 | } | 30785 | } |
| 30755 | 30786 | ||
| 30756 | |||
| 30757 | /* Cancel the hourglass cursor timer if active, hide a busy cursor if | 30787 | /* Cancel the hourglass cursor timer if active, hide a busy cursor if |
| 30758 | shown. */ | 30788 | shown. */ |
| 30789 | |||
| 30759 | void | 30790 | void |
| 30760 | cancel_hourglass (void) | 30791 | cancel_hourglass (void) |
| 30761 | { | 30792 | { |
| @@ -30766,7 +30797,28 @@ cancel_hourglass (void) | |||
| 30766 | } | 30797 | } |
| 30767 | 30798 | ||
| 30768 | if (hourglass_shown_p) | 30799 | if (hourglass_shown_p) |
| 30769 | hide_hourglass (); | 30800 | { |
| 30801 | Lisp_Object tail, frame; | ||
| 30802 | |||
| 30803 | block_input (); | ||
| 30804 | |||
| 30805 | FOR_EACH_FRAME (tail, frame) | ||
| 30806 | { | ||
| 30807 | struct frame *f = XFRAME (frame); | ||
| 30808 | |||
| 30809 | if (FRAME_LIVE_P (f) && FRAME_WINDOW_P (f) | ||
| 30810 | && FRAME_RIF (f)->hide_hourglass) | ||
| 30811 | FRAME_RIF (f)->hide_hourglass (f); | ||
| 30812 | #ifdef HAVE_NTGUI | ||
| 30813 | /* No cursors on non GUI frames - restore to stock arrow cursor. */ | ||
| 30814 | else if (!FRAME_W32_P (f)) | ||
| 30815 | w32_arrow_cursor (); | ||
| 30816 | #endif | ||
| 30817 | } | ||
| 30818 | |||
| 30819 | hourglass_shown_p = 0; | ||
| 30820 | unblock_input (); | ||
| 30821 | } | ||
| 30770 | } | 30822 | } |
| 30771 | 30823 | ||
| 30772 | #endif /* HAVE_WINDOW_SYSTEM */ | 30824 | #endif /* HAVE_WINDOW_SYSTEM */ |
diff --git a/src/xfns.c b/src/xfns.c index 6574beddc8b..7d87ddbb2b4 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -4735,116 +4735,6 @@ no value of TYPE (always string in the MS Windows case). */) | |||
| 4735 | return prop_value; | 4735 | return prop_value; |
| 4736 | } | 4736 | } |
| 4737 | 4737 | ||
| 4738 | |||
| 4739 | |||
| 4740 | /*********************************************************************** | ||
| 4741 | Busy cursor | ||
| 4742 | ***********************************************************************/ | ||
| 4743 | |||
| 4744 | /* Timer function of hourglass_atimer. TIMER is equal to | ||
| 4745 | hourglass_atimer. | ||
| 4746 | |||
| 4747 | Display an hourglass pointer on all frames by mapping the frames' | ||
| 4748 | hourglass_window. Set the hourglass_p flag in the frames' | ||
| 4749 | output_data.x structure to indicate that an hourglass cursor is | ||
| 4750 | shown on the frames. */ | ||
| 4751 | |||
| 4752 | void | ||
| 4753 | show_hourglass (struct atimer *timer) | ||
| 4754 | { | ||
| 4755 | /* The timer implementation will cancel this timer automatically | ||
| 4756 | after this function has run. Set hourglass_atimer to null | ||
| 4757 | so that we know the timer doesn't have to be canceled. */ | ||
| 4758 | hourglass_atimer = NULL; | ||
| 4759 | |||
| 4760 | if (!hourglass_shown_p) | ||
| 4761 | { | ||
| 4762 | Lisp_Object rest, frame; | ||
| 4763 | |||
| 4764 | block_input (); | ||
| 4765 | |||
| 4766 | FOR_EACH_FRAME (rest, frame) | ||
| 4767 | { | ||
| 4768 | struct frame *f = XFRAME (frame); | ||
| 4769 | |||
| 4770 | if (FRAME_LIVE_P (f) && FRAME_X_P (f) && FRAME_X_DISPLAY (f)) | ||
| 4771 | { | ||
| 4772 | Display *dpy = FRAME_X_DISPLAY (f); | ||
| 4773 | |||
| 4774 | #ifdef USE_X_TOOLKIT | ||
| 4775 | if (f->output_data.x->widget) | ||
| 4776 | #else | ||
| 4777 | if (FRAME_OUTER_WINDOW (f)) | ||
| 4778 | #endif | ||
| 4779 | { | ||
| 4780 | f->output_data.x->hourglass_p = 1; | ||
| 4781 | |||
| 4782 | if (!f->output_data.x->hourglass_window) | ||
| 4783 | { | ||
| 4784 | unsigned long mask = CWCursor; | ||
| 4785 | XSetWindowAttributes attrs; | ||
| 4786 | #ifdef USE_GTK | ||
| 4787 | Window parent = FRAME_X_WINDOW (f); | ||
| 4788 | #else | ||
| 4789 | Window parent = FRAME_OUTER_WINDOW (f); | ||
| 4790 | #endif | ||
| 4791 | attrs.cursor = f->output_data.x->hourglass_cursor; | ||
| 4792 | |||
| 4793 | f->output_data.x->hourglass_window | ||
| 4794 | = XCreateWindow (dpy, parent, | ||
| 4795 | 0, 0, 32000, 32000, 0, 0, | ||
| 4796 | InputOnly, | ||
| 4797 | CopyFromParent, | ||
| 4798 | mask, &attrs); | ||
| 4799 | } | ||
| 4800 | |||
| 4801 | XMapRaised (dpy, f->output_data.x->hourglass_window); | ||
| 4802 | XFlush (dpy); | ||
| 4803 | } | ||
| 4804 | } | ||
| 4805 | } | ||
| 4806 | |||
| 4807 | hourglass_shown_p = 1; | ||
| 4808 | unblock_input (); | ||
| 4809 | } | ||
| 4810 | } | ||
| 4811 | |||
| 4812 | |||
| 4813 | /* Hide the hourglass pointer on all frames, if it is currently | ||
| 4814 | shown. */ | ||
| 4815 | |||
| 4816 | void | ||
| 4817 | hide_hourglass (void) | ||
| 4818 | { | ||
| 4819 | if (hourglass_shown_p) | ||
| 4820 | { | ||
| 4821 | Lisp_Object rest, frame; | ||
| 4822 | |||
| 4823 | block_input (); | ||
| 4824 | FOR_EACH_FRAME (rest, frame) | ||
| 4825 | { | ||
| 4826 | struct frame *f = XFRAME (frame); | ||
| 4827 | |||
| 4828 | if (FRAME_X_P (f) | ||
| 4829 | /* Watch out for newly created frames. */ | ||
| 4830 | && f->output_data.x->hourglass_window) | ||
| 4831 | { | ||
| 4832 | XUnmapWindow (FRAME_X_DISPLAY (f), | ||
| 4833 | f->output_data.x->hourglass_window); | ||
| 4834 | /* Sync here because XTread_socket looks at the | ||
| 4835 | hourglass_p flag that is reset to zero below. */ | ||
| 4836 | XSync (FRAME_X_DISPLAY (f), False); | ||
| 4837 | f->output_data.x->hourglass_p = 0; | ||
| 4838 | } | ||
| 4839 | } | ||
| 4840 | |||
| 4841 | hourglass_shown_p = 0; | ||
| 4842 | unblock_input (); | ||
| 4843 | } | ||
| 4844 | } | ||
| 4845 | |||
| 4846 | |||
| 4847 | |||
| 4848 | /*********************************************************************** | 4738 | /*********************************************************************** |
| 4849 | Tool tips | 4739 | Tool tips |
| 4850 | ***********************************************************************/ | 4740 | ***********************************************************************/ |
diff --git a/src/xterm.c b/src/xterm.c index 8513427972a..85835a2c7c5 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2952,8 +2952,64 @@ x_clear_frame (struct frame *f) | |||
| 2952 | unblock_input (); | 2952 | unblock_input (); |
| 2953 | } | 2953 | } |
| 2954 | 2954 | ||
| 2955 | /* RIF: Show hourglass cursor on frame F. */ | ||
| 2956 | |||
| 2957 | static void | ||
| 2958 | x_show_hourglass (struct frame *f) | ||
| 2959 | { | ||
| 2960 | Display *dpy = FRAME_X_DISPLAY (f); | ||
| 2961 | |||
| 2962 | if (dpy) | ||
| 2963 | { | ||
| 2964 | struct x_output *x = FRAME_X_OUTPUT (f); | ||
| 2965 | #ifdef USE_X_TOOLKIT | ||
| 2966 | if (x->widget) | ||
| 2967 | #else | ||
| 2968 | if (FRAME_OUTER_WINDOW (f)) | ||
| 2969 | #endif | ||
| 2970 | { | ||
| 2971 | x->hourglass_p = 1; | ||
| 2972 | |||
| 2973 | if (!x->hourglass_window) | ||
| 2974 | { | ||
| 2975 | unsigned long mask = CWCursor; | ||
| 2976 | XSetWindowAttributes attrs; | ||
| 2977 | #ifdef USE_GTK | ||
| 2978 | Window parent = FRAME_X_WINDOW (f); | ||
| 2979 | #else | ||
| 2980 | Window parent = FRAME_OUTER_WINDOW (f); | ||
| 2981 | #endif | ||
| 2982 | attrs.cursor = x->hourglass_cursor; | ||
| 2983 | |||
| 2984 | x->hourglass_window = XCreateWindow | ||
| 2985 | (dpy, parent, 0, 0, 32000, 32000, 0, 0, | ||
| 2986 | InputOnly, CopyFromParent, mask, &attrs); | ||
| 2987 | } | ||
| 2988 | |||
| 2989 | XMapRaised (dpy, x->hourglass_window); | ||
| 2990 | XFlush (dpy); | ||
| 2991 | } | ||
| 2992 | } | ||
| 2993 | } | ||
| 2994 | |||
| 2995 | /* RIF: Cancel hourglass cursor on frame F. */ | ||
| 2996 | |||
| 2997 | static void | ||
| 2998 | x_hide_hourglass (struct frame *f) | ||
| 2999 | { | ||
| 3000 | struct x_output *x = FRAME_X_OUTPUT (f); | ||
| 3001 | |||
| 3002 | /* Watch out for newly created frames. */ | ||
| 3003 | if (x->hourglass_window) | ||
| 3004 | { | ||
| 3005 | XUnmapWindow (FRAME_X_DISPLAY (f), x->hourglass_window); | ||
| 3006 | /* Sync here because XTread_socket looks at the | ||
| 3007 | hourglass_p flag that is reset to zero below. */ | ||
| 3008 | XSync (FRAME_X_DISPLAY (f), False); | ||
| 3009 | x->hourglass_p = 0; | ||
| 3010 | } | ||
| 3011 | } | ||
| 2955 | 3012 | ||
| 2956 | |||
| 2957 | /* Invert the middle quarter of the frame for .15 sec. */ | 3013 | /* Invert the middle quarter of the frame for .15 sec. */ |
| 2958 | 3014 | ||
| 2959 | static void | 3015 | static void |
| @@ -10431,7 +10487,9 @@ static struct redisplay_interface x_redisplay_interface = | |||
| 10431 | x_draw_window_cursor, | 10487 | x_draw_window_cursor, |
| 10432 | x_draw_vertical_window_border, | 10488 | x_draw_vertical_window_border, |
| 10433 | x_draw_window_divider, | 10489 | x_draw_window_divider, |
| 10434 | x_shift_glyphs_for_insert | 10490 | x_shift_glyphs_for_insert, |
| 10491 | x_show_hourglass, | ||
| 10492 | x_hide_hourglass | ||
| 10435 | }; | 10493 | }; |
| 10436 | 10494 | ||
| 10437 | 10495 | ||