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 /src/xfns.c | |
| 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.
Diffstat (limited to 'src/xfns.c')
| -rw-r--r-- | src/xfns.c | 110 |
1 files changed, 0 insertions, 110 deletions
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 | ***********************************************************************/ |