diff options
| author | Jason Rumney | 2000-03-01 21:05:52 +0000 |
|---|---|---|
| committer | Jason Rumney | 2000-03-01 21:05:52 +0000 |
| commit | f79e6790a1339dd4608b81939ed25623b22a5c5b (patch) | |
| tree | a3696c104aa0de14b016c8bdf5f06420f0d496fd /src | |
| parent | e5f597f0bfd8218482b8c6fba3621d96d5ad3155 (diff) | |
| download | emacs-f79e6790a1339dd4608b81939ed25623b22a5c5b.tar.gz emacs-f79e6790a1339dd4608b81939ed25623b22a5c5b.zip | |
Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 200 |
1 files changed, 125 insertions, 75 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 45ea7b1f475..dc2f86ccdb4 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -378,6 +378,10 @@ x_window_to_frame (dpyinfo, wdesc) | |||
| 378 | f = XFRAME (frame); | 378 | f = XFRAME (frame); |
| 379 | if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo) | 379 | if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo) |
| 380 | continue; | 380 | continue; |
| 381 | if (f->output_data.w32->busy_window == wdesc) | ||
| 382 | return f; | ||
| 383 | |||
| 384 | /* NTEMACS_TODO: Check tooltips when supported. */ | ||
| 381 | if (FRAME_W32_WINDOW (f) == wdesc) | 385 | if (FRAME_W32_WINDOW (f) == wdesc) |
| 382 | return f; | 386 | return f; |
| 383 | } | 387 | } |
| @@ -11597,109 +11601,156 @@ value.") | |||
| 11597 | Busy cursor | 11601 | Busy cursor |
| 11598 | ***********************************************************************/ | 11602 | ***********************************************************************/ |
| 11599 | 11603 | ||
| 11600 | /* The implementation partly follows a patch from | 11604 | /* If non-null, an asynchronous timer that, when it expires, displays |
| 11601 | F.Pierresteguy@frcl.bull.fr dated 1994. */ | 11605 | a busy cursor on all frames. */ |
| 11602 | 11606 | ||
| 11603 | /* Setting inhibit_busy_cursor to 2 inhibits busy-cursor display until | 11607 | static struct atimer *busy_cursor_atimer; |
| 11604 | the next X event is read and we enter XTread_socket again. Setting | ||
| 11605 | it to 1 inhibits busy-cursor display for direct commands. */ | ||
| 11606 | 11608 | ||
| 11607 | int inhibit_busy_cursor; | 11609 | /* Non-zero means a busy cursor is currently shown. */ |
| 11608 | 11610 | ||
| 11609 | /* Incremented with each call to x-display-busy-cursor. | 11611 | static int busy_cursor_shown_p; |
| 11610 | Decremented in x-undisplay-busy-cursor. */ | ||
| 11611 | 11612 | ||
| 11612 | static int busy_count; | 11613 | /* Number of seconds to wait before displaying a busy cursor. */ |
| 11613 | 11614 | ||
| 11615 | static Lisp_Object Vbusy_cursor_delay; | ||
| 11614 | 11616 | ||
| 11615 | DEFUN ("x-show-busy-cursor", Fx_show_busy_cursor, | 11617 | /* Default number of seconds to wait before displaying a busy |
| 11616 | Sx_show_busy_cursor, 0, 0, 0, | 11618 | cursor. */ |
| 11617 | "Show a busy cursor, if not already shown.\n\ | 11619 | |
| 11618 | Each call to this function must be matched by a call to\n\ | 11620 | #define DEFAULT_BUSY_CURSOR_DELAY 1 |
| 11619 | x-undisplay-busy-cursor to make the busy pointer disappear again.") | 11621 | |
| 11620 | () | 11622 | /* Function prototypes. */ |
| 11623 | |||
| 11624 | static void show_busy_cursor P_ ((struct atimer *)); | ||
| 11625 | static void hide_busy_cursor P_ ((void)); | ||
| 11626 | |||
| 11627 | |||
| 11628 | /* Cancel a currently active busy-cursor timer, and start a new one. */ | ||
| 11629 | |||
| 11630 | void | ||
| 11631 | start_busy_cursor () | ||
| 11632 | { | ||
| 11633 | #if 0 /* NTEMACS_TODO: cursor shape changes. */ | ||
| 11634 | EMACS_TIME delay; | ||
| 11635 | int secs; | ||
| 11636 | |||
| 11637 | cancel_busy_cursor (); | ||
| 11638 | |||
| 11639 | if (INTEGERP (Vbusy_cursor_delay) | ||
| 11640 | && XINT (Vbusy_cursor_delay) > 0) | ||
| 11641 | secs = XFASTINT (Vbusy_cursor_delay); | ||
| 11642 | else | ||
| 11643 | secs = DEFAULT_BUSY_CURSOR_DELAY; | ||
| 11644 | |||
| 11645 | EMACS_SET_SECS_USECS (delay, secs, 0); | ||
| 11646 | busy_cursor_atimer = start_atimer (ATIMER_RELATIVE, delay, | ||
| 11647 | show_busy_cursor, NULL); | ||
| 11648 | #endif | ||
| 11649 | } | ||
| 11650 | |||
| 11651 | |||
| 11652 | /* Cancel the busy cursor timer if active, hide a busy cursor if | ||
| 11653 | shown. */ | ||
| 11654 | |||
| 11655 | void | ||
| 11656 | cancel_busy_cursor () | ||
| 11657 | { | ||
| 11658 | if (busy_cursor_atimer) | ||
| 11659 | cancel_atimer (busy_cursor_atimer); | ||
| 11660 | if (busy_cursor_shown_p) | ||
| 11661 | hide_busy_cursor (); | ||
| 11662 | } | ||
| 11663 | |||
| 11664 | |||
| 11665 | /* Timer function of busy_cursor_atimer. TIMER is equal to | ||
| 11666 | busy_cursor_atimer. | ||
| 11667 | |||
| 11668 | Display a busy cursor on all frames by mapping the frames' | ||
| 11669 | busy_window. Set the busy_p flag in the frames' output_data.x | ||
| 11670 | structure to indicate that a busy cursor is shown on the | ||
| 11671 | frames. */ | ||
| 11672 | |||
| 11673 | static void | ||
| 11674 | show_busy_cursor (timer) | ||
| 11675 | struct atimer *timer; | ||
| 11621 | { | 11676 | { |
| 11622 | ++busy_count; | 11677 | #if 0 /* NTEMACS_TODO: cursor shape changes. */ |
| 11623 | if (busy_count == 1) | 11678 | /* The timer implementation will cancel this timer automatically |
| 11679 | after this function has run. Set busy_cursor_atimer to null | ||
| 11680 | so that we know the timer doesn't have to be canceled. */ | ||
| 11681 | busy_cursor_atimer = NULL; | ||
| 11682 | |||
| 11683 | if (!busy_cursor_shown_p) | ||
| 11624 | { | 11684 | { |
| 11625 | Lisp_Object rest, frame; | 11685 | Lisp_Object rest, frame; |
| 11626 | 11686 | ||
| 11687 | BLOCK_INPUT; | ||
| 11688 | |||
| 11627 | FOR_EACH_FRAME (rest, frame) | 11689 | FOR_EACH_FRAME (rest, frame) |
| 11628 | if (FRAME_X_P (XFRAME (frame))) | 11690 | if (FRAME_X_P (XFRAME (frame))) |
| 11629 | { | 11691 | { |
| 11630 | struct frame *f = XFRAME (frame); | 11692 | struct frame *f = XFRAME (frame); |
| 11631 | #if 0 /* NTEMACS_TODO : busy cursor */ | 11693 | |
| 11632 | |||
| 11633 | BLOCK_INPUT; | ||
| 11634 | f->output_data.w32->busy_p = 1; | 11694 | f->output_data.w32->busy_p = 1; |
| 11635 | 11695 | ||
| 11636 | if (!f->output_data.w32->busy_window) | 11696 | if (!f->output_data.w32->busy_window) |
| 11637 | { | 11697 | { |
| 11638 | unsigned long mask = CWCursor; | 11698 | unsigned long mask = CWCursor; |
| 11639 | XSetWindowAttributes attrs; | 11699 | XSetWindowAttributes attrs; |
| 11640 | 11700 | ||
| 11641 | attrs.cursor = f->output_data.w32->busy_cursor; | 11701 | attrs.cursor = f->output_data.w32->busy_cursor; |
| 11702 | |||
| 11642 | f->output_data.w32->busy_window | 11703 | f->output_data.w32->busy_window |
| 11643 | = XCreateWindow (FRAME_W32_DISPLAY (f), | 11704 | = XCreateWindow (FRAME_X_DISPLAY (f), |
| 11644 | FRAME_OUTER_WINDOW (f), | 11705 | FRAME_OUTER_WINDOW (f), |
| 11645 | 0, 0, 32000, 32000, 0, 0, | 11706 | 0, 0, 32000, 32000, 0, 0, |
| 11646 | InputOnly, CopyFromParent, | 11707 | InputOnly, |
| 11708 | CopyFromParent, | ||
| 11647 | mask, &attrs); | 11709 | mask, &attrs); |
| 11648 | } | 11710 | } |
| 11649 | 11711 | ||
| 11650 | XMapRaised (FRAME_W32_DISPLAY (f), f->output_data.w32->busy_window); | 11712 | XMapRaised (FRAME_X_DISPLAY (f), f->output_data.w32->busy_window); |
| 11651 | UNBLOCK_INPUT; | 11713 | XFlush (FRAME_X_DISPLAY (f)); |
| 11652 | #endif | ||
| 11653 | } | 11714 | } |
| 11654 | } | ||
| 11655 | 11715 | ||
| 11656 | return Qnil; | 11716 | busy_cursor_shown_p = 1; |
| 11717 | UNBLOCK_INPUT; | ||
| 11718 | } | ||
| 11719 | #endif | ||
| 11657 | } | 11720 | } |
| 11658 | 11721 | ||
| 11659 | 11722 | ||
| 11660 | DEFUN ("x-hide-busy-cursor", Fx_hide_busy_cursor, | 11723 | /* Hide the busy cursor on all frames, if it is currently shown. */ |
| 11661 | Sx_hide_busy_cursor, 0, 1, 0, | ||
| 11662 | "Hide a busy-cursor.\n\ | ||
| 11663 | A busy-cursor will actually be undisplayed when a matching\n\ | ||
| 11664 | `x-undisplay-busy-cursor' is called for each `x-display-busy-cursor'\n\ | ||
| 11665 | issued. FORCE non-nil means undisplay the busy-cursor forcibly,\n\ | ||
| 11666 | not counting calls.") | ||
| 11667 | (force) | ||
| 11668 | Lisp_Object force; | ||
| 11669 | { | ||
| 11670 | Lisp_Object rest, frame; | ||
| 11671 | |||
| 11672 | if (busy_count == 0) | ||
| 11673 | return Qnil; | ||
| 11674 | |||
| 11675 | if (!NILP (force) && busy_count != 0) | ||
| 11676 | busy_count = 1; | ||
| 11677 | 11724 | ||
| 11678 | --busy_count; | 11725 | static void |
| 11679 | if (busy_count != 0) | 11726 | hide_busy_cursor () |
| 11680 | return Qnil; | 11727 | { |
| 11681 | 11728 | #if 0 /* NTEMACS_TODO: cursor shape changes. */ | |
| 11682 | FOR_EACH_FRAME (rest, frame) | 11729 | if (busy_cursor_shown_p) |
| 11683 | { | 11730 | { |
| 11684 | struct frame *f = XFRAME (frame); | 11731 | Lisp_Object rest, frame; |
| 11685 | 11732 | ||
| 11686 | if (FRAME_X_P (f) | 11733 | BLOCK_INPUT; |
| 11687 | /* Watch out for newly created frames. */ | 11734 | FOR_EACH_FRAME (rest, frame) |
| 11688 | && f->output_data.w32->busy_window) | ||
| 11689 | { | 11735 | { |
| 11690 | #if 0 /* NTEMACS_TODO : busy cursor */ | 11736 | struct frame *f = XFRAME (frame); |
| 11691 | BLOCK_INPUT; | 11737 | |
| 11692 | XUnmapWindow (FRAME_W32_DISPLAY (f), f->output_data.w32->busy_window); | 11738 | if (FRAME_X_P (f) |
| 11693 | /* Sync here because XTread_socket looks at the busy_p flag | 11739 | /* Watch out for newly created frames. */ |
| 11694 | that is reset to zero below. */ | 11740 | && f->output_data.x->busy_window) |
| 11695 | XSync (FRAME_W32_DISPLAY (f), False); | 11741 | { |
| 11696 | UNBLOCK_INPUT; | 11742 | XUnmapWindow (FRAME_X_DISPLAY (f), f->output_data.x->busy_window); |
| 11697 | f->output_data.w32->busy_p = 0; | 11743 | /* Sync here because XTread_socket looks at the busy_p flag |
| 11698 | #endif | 11744 | that is reset to zero below. */ |
| 11745 | XSync (FRAME_X_DISPLAY (f), False); | ||
| 11746 | f->output_data.x->busy_p = 0; | ||
| 11747 | } | ||
| 11699 | } | 11748 | } |
| 11700 | } | ||
| 11701 | 11749 | ||
| 11702 | return Qnil; | 11750 | busy_cursor_shown_p = 0; |
| 11751 | UNBLOCK_INPUT; | ||
| 11752 | } | ||
| 11753 | #endif | ||
| 11703 | } | 11754 | } |
| 11704 | 11755 | ||
| 11705 | 11756 | ||
| @@ -12864,6 +12915,11 @@ or when you set the mouse color."); | |||
| 12864 | "Non-zero means Emacs displays a busy cursor on window systems."); | 12915 | "Non-zero means Emacs displays a busy cursor on window systems."); |
| 12865 | display_busy_cursor_p = 1; | 12916 | display_busy_cursor_p = 1; |
| 12866 | 12917 | ||
| 12918 | DEFVAR_LISP ("busy-cursor-delay", &Vbusy_cursor_delay, | ||
| 12919 | "*Seconds to wait before displaying a busy-cursor.\n\ | ||
| 12920 | Value must be an integer."); | ||
| 12921 | Vbusy_cursor_delay = make_number (DEFAULT_BUSY_CURSOR_DELAY); | ||
| 12922 | |||
| 12867 | DEFVAR_LISP ("x-sensitive-text-pointer-shape", | 12923 | DEFVAR_LISP ("x-sensitive-text-pointer-shape", |
| 12868 | &Vx_sensitive_text_pointer_shape, | 12924 | &Vx_sensitive_text_pointer_shape, |
| 12869 | "The shape of the pointer when over mouse-sensitive text.\n\ | 12925 | "The shape of the pointer when over mouse-sensitive text.\n\ |
| @@ -13060,12 +13116,6 @@ only be necessary if the default setting causes problems."); | |||
| 13060 | #endif | 13116 | #endif |
| 13061 | #endif /* NTEMACS_TODO */ | 13117 | #endif /* NTEMACS_TODO */ |
| 13062 | 13118 | ||
| 13063 | /* Busy-cursor. */ | ||
| 13064 | defsubr (&Sx_show_busy_cursor); | ||
| 13065 | defsubr (&Sx_hide_busy_cursor); | ||
| 13066 | busy_count = 0; | ||
| 13067 | inhibit_busy_cursor = 0; | ||
| 13068 | |||
| 13069 | defsubr (&Sx_show_tip); | 13119 | defsubr (&Sx_show_tip); |
| 13070 | defsubr (&Sx_hide_tip); | 13120 | defsubr (&Sx_hide_tip); |
| 13071 | staticpro (&tip_timer); | 13121 | staticpro (&tip_timer); |