diff options
| author | Adrian Robert | 2008-07-15 13:04:01 +0000 |
|---|---|---|
| committer | Adrian Robert | 2008-07-15 13:04:01 +0000 |
| commit | 1885ab29b707bfd00da64e6a12b5fb15b57609e8 (patch) | |
| tree | c1eb94bf36b628f0b9665e198bbc3f05d4b3e554 /src | |
| parent | f5ab8ccc33beedd222e3100453f956b0b3846d4d (diff) | |
| download | emacs-1885ab29b707bfd00da64e6a12b5fb15b57609e8.tar.gz emacs-1885ab29b707bfd00da64e6a12b5fb15b57609e8.zip | |
applying patch to consolidate non-GUI portion of hourglass implementation as posted at http://thread.gmane.org/gmane.emacs.devel/98341
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 31 | ||||
| -rw-r--r-- | src/dispextern.h | 9 | ||||
| -rw-r--r-- | src/macfns.c | 100 | ||||
| -rw-r--r-- | src/w32fns.c | 30 | ||||
| -rw-r--r-- | src/xdisp.c | 89 | ||||
| -rw-r--r-- | src/xfns.c | 99 |
6 files changed, 136 insertions, 222 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 85b81de2c29..80eb85bb3f9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,34 @@ | |||
| 1 | 2008-07-15 Adrian Robert <Adrian.B.Robert@gmail.com> | ||
| 2 | |||
| 3 | * dispextern.h (hourglass_shown_p, hourglass_atimer): New extern | ||
| 4 | variables (formerly in xxxfns.c). | ||
| 5 | (show_hourglass, hide_hourglass): New prototypes (same). | ||
| 6 | * xdisp.c (display_hourglass_p, hourglass_shown_p, hourglass_atimer) | ||
| 7 | (Vhourglass_delay, DEFAULT_HOURGLASS_DELAY): New variables (formerly | ||
| 8 | in xxxfns.c). | ||
| 9 | (syms_of_xdisp): Declare/initialize display-hourglass, | ||
| 10 | hourglass-delay. Initialize hourglass_atimer, hourglass_shown_p. | ||
| 11 | (hourglass_started, start_hourglass, cancel_hourglass): New functions, | ||
| 12 | formerly in xxxfns.c. | ||
| 13 | * xfns.c (display_hourglass_p, hourglass_atimer, hourglass_shown_p) | ||
| 14 | (Vhourglass_delay, DEFAULT_HOURGLASS_DELAY, hourglass_started) | ||
| 15 | (start_hourglass, cancel_hourglass): Remove. | ||
| 16 | (show_hourglass, hide_hourglass): Remove prototypes and static | ||
| 17 | modifiers. | ||
| 18 | (syms_of_xfns): Remove display-hourglass, hourglass-delay, | ||
| 19 | hourglass_atimer, hourglass_shown_p declaration/initialization. | ||
| 20 | * macfns.c (display_hourglass_p, hourglass_atimer, hourglass_shown_p) | ||
| 21 | (Vhourglass_delay, DEFAULT_HOURGLASS_DELAY, hourglass_started) | ||
| 22 | (start_hourglass, cancel_hourglass): Remove. | ||
| 23 | (show_hourglass, hide_hourglass): Remove prototypes and static | ||
| 24 | modifiers. | ||
| 25 | (syms_of_macfns): Remove display-hourglass, hourglass-delay, | ||
| 26 | hourglass_atimer, hourglass_shown_p declaration/initialization. | ||
| 27 | * w32fns.c (display_hourglass_p, Vhourglass_delay) | ||
| 28 | (DEFAULT_HOURGLASS_DELAY): Remove. | ||
| 29 | (syms_of_w32fns): Remove display-hourglass, hourglass-delay, | ||
| 30 | hourglass_shown_p declaration/initialization. | ||
| 31 | |||
| 1 | 2008-07-14 Jason Rumney <jasonr@gnu.org> | 32 | 2008-07-14 Jason Rumney <jasonr@gnu.org> |
| 2 | 33 | ||
| 3 | * w32fns.c (w32_get_arg): Remove wrapper function. | 34 | * w32fns.c (w32_get_arg): Remove wrapper function. |
diff --git a/src/dispextern.h b/src/dispextern.h index 041d54ffdc3..e6064476d0c 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2925,6 +2925,15 @@ extern void start_hourglass P_ ((void)); | |||
| 2925 | extern void cancel_hourglass P_ ((void)); | 2925 | extern void cancel_hourglass P_ ((void)); |
| 2926 | extern int hourglass_started P_ ((void)); | 2926 | extern int hourglass_started P_ ((void)); |
| 2927 | extern int display_hourglass_p; | 2927 | extern int display_hourglass_p; |
| 2928 | extern int hourglass_shown_p; | ||
| 2929 | struct atimer; /* Defined in atimer.h. */ | ||
| 2930 | /* If non-null, an asynchronous timer that, when it expires, displays | ||
| 2931 | an hourglass cursor on all frames. */ | ||
| 2932 | extern struct atimer *hourglass_atimer; | ||
| 2933 | |||
| 2934 | /* Each GUI implements these. PENDING: move into RIF. */ | ||
| 2935 | extern void show_hourglass P_ ((struct atimer *)); | ||
| 2936 | extern void hide_hourglass P_ ((void)); | ||
| 2928 | 2937 | ||
| 2929 | /* Returns the background color of IMG, calculating one heuristically if | 2938 | /* Returns the background color of IMG, calculating one heuristically if |
| 2930 | necessary. If non-zero, XIMG is an existing XImage object to use for | 2939 | necessary. If non-zero, XIMG is an existing XImage object to use for |
diff --git a/src/macfns.c b/src/macfns.c index 82153da8847..7bf50b3a684 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -57,10 +57,6 @@ static Lisp_Object Vmac_carbon_version_string; | |||
| 57 | 57 | ||
| 58 | #endif /* TARGET_API_MAC_CARBON */ | 58 | #endif /* TARGET_API_MAC_CARBON */ |
| 59 | 59 | ||
| 60 | /* Non-zero means we're allowed to display an hourglass cursor. */ | ||
| 61 | |||
| 62 | int display_hourglass_p; | ||
| 63 | |||
| 64 | /* The background and shape of the mouse pointer, and shape when not | 60 | /* The background and shape of the mouse pointer, and shape when not |
| 65 | over text or in the modeline. */ | 61 | over text or in the modeline. */ |
| 66 | 62 | ||
| @@ -3420,89 +3416,6 @@ value. */) | |||
| 3420 | Busy cursor | 3416 | Busy cursor |
| 3421 | ***********************************************************************/ | 3417 | ***********************************************************************/ |
| 3422 | 3418 | ||
| 3423 | /* If non-null, an asynchronous timer that, when it expires, displays | ||
| 3424 | an hourglass cursor on all frames. */ | ||
| 3425 | |||
| 3426 | static struct atimer *hourglass_atimer; | ||
| 3427 | |||
| 3428 | /* Non-zero means an hourglass cursor is currently shown. */ | ||
| 3429 | |||
| 3430 | static int hourglass_shown_p; | ||
| 3431 | |||
| 3432 | /* Number of seconds to wait before displaying an hourglass cursor. */ | ||
| 3433 | |||
| 3434 | static Lisp_Object Vhourglass_delay; | ||
| 3435 | |||
| 3436 | /* Default number of seconds to wait before displaying an hourglass | ||
| 3437 | cursor. */ | ||
| 3438 | |||
| 3439 | #define DEFAULT_HOURGLASS_DELAY 1 | ||
| 3440 | |||
| 3441 | /* Function prototypes. */ | ||
| 3442 | |||
| 3443 | static void show_hourglass P_ ((struct atimer *)); | ||
| 3444 | static void hide_hourglass P_ ((void)); | ||
| 3445 | |||
| 3446 | /* Return non-zero if houglass timer has been started or hourglass is shown. */ | ||
| 3447 | |||
| 3448 | int | ||
| 3449 | hourglass_started () | ||
| 3450 | { | ||
| 3451 | return hourglass_shown_p || hourglass_atimer != NULL; | ||
| 3452 | } | ||
| 3453 | |||
| 3454 | |||
| 3455 | /* Cancel a currently active hourglass timer, and start a new one. */ | ||
| 3456 | |||
| 3457 | void | ||
| 3458 | start_hourglass () | ||
| 3459 | { | ||
| 3460 | #ifdef MAC_OSX | ||
| 3461 | EMACS_TIME delay; | ||
| 3462 | int secs, usecs = 0; | ||
| 3463 | |||
| 3464 | cancel_hourglass (); | ||
| 3465 | |||
| 3466 | if (INTEGERP (Vhourglass_delay) | ||
| 3467 | && XINT (Vhourglass_delay) > 0) | ||
| 3468 | secs = XFASTINT (Vhourglass_delay); | ||
| 3469 | else if (FLOATP (Vhourglass_delay) | ||
| 3470 | && XFLOAT_DATA (Vhourglass_delay) > 0) | ||
| 3471 | { | ||
| 3472 | Lisp_Object tem; | ||
| 3473 | tem = Ftruncate (Vhourglass_delay, Qnil); | ||
| 3474 | secs = XFASTINT (tem); | ||
| 3475 | usecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000000; | ||
| 3476 | } | ||
| 3477 | else | ||
| 3478 | secs = DEFAULT_HOURGLASS_DELAY; | ||
| 3479 | |||
| 3480 | EMACS_SET_SECS_USECS (delay, secs, usecs); | ||
| 3481 | hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, | ||
| 3482 | show_hourglass, NULL); | ||
| 3483 | #endif /* MAC_OSX */ | ||
| 3484 | } | ||
| 3485 | |||
| 3486 | |||
| 3487 | /* Cancel the hourglass cursor timer if active, hide a busy cursor if | ||
| 3488 | shown. */ | ||
| 3489 | |||
| 3490 | void | ||
| 3491 | cancel_hourglass () | ||
| 3492 | { | ||
| 3493 | #ifdef MAC_OSX | ||
| 3494 | if (hourglass_atimer) | ||
| 3495 | { | ||
| 3496 | cancel_atimer (hourglass_atimer); | ||
| 3497 | hourglass_atimer = NULL; | ||
| 3498 | } | ||
| 3499 | |||
| 3500 | if (hourglass_shown_p) | ||
| 3501 | hide_hourglass (); | ||
| 3502 | #endif /* MAC_OSX */ | ||
| 3503 | } | ||
| 3504 | |||
| 3505 | |||
| 3506 | /* Timer function of hourglass_atimer. TIMER is equal to | 3419 | /* Timer function of hourglass_atimer. TIMER is equal to |
| 3507 | hourglass_atimer. | 3420 | hourglass_atimer. |
| 3508 | 3421 | ||
| @@ -3510,7 +3423,7 @@ cancel_hourglass () | |||
| 3510 | arrows) at the upper-right corner of each frame instead of the | 3423 | arrows) at the upper-right corner of each frame instead of the |
| 3511 | hourglass pointer. */ | 3424 | hourglass pointer. */ |
| 3512 | 3425 | ||
| 3513 | static void | 3426 | void |
| 3514 | show_hourglass (timer) | 3427 | show_hourglass (timer) |
| 3515 | struct atimer *timer; | 3428 | struct atimer *timer; |
| 3516 | { | 3429 | { |
| @@ -3545,7 +3458,7 @@ show_hourglass (timer) | |||
| 3545 | /* Hide the progress indicators on all frames, if it is currently | 3458 | /* Hide the progress indicators on all frames, if it is currently |
| 3546 | shown. */ | 3459 | shown. */ |
| 3547 | 3460 | ||
| 3548 | static void | 3461 | void |
| 3549 | hide_hourglass () | 3462 | hide_hourglass () |
| 3550 | { | 3463 | { |
| 3551 | #if TARGET_API_MAC_CARBON | 3464 | #if TARGET_API_MAC_CARBON |
| @@ -4379,15 +4292,6 @@ This variable takes effect when you create a new frame | |||
| 4379 | or when you set the mouse color. */); | 4292 | or when you set the mouse color. */); |
| 4380 | Vx_hourglass_pointer_shape = Qnil; | 4293 | Vx_hourglass_pointer_shape = Qnil; |
| 4381 | 4294 | ||
| 4382 | DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, | ||
| 4383 | doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); | ||
| 4384 | display_hourglass_p = 1; | ||
| 4385 | |||
| 4386 | DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, | ||
| 4387 | doc: /* *Seconds to wait before displaying an hourglass pointer. | ||
| 4388 | Value must be an integer or float. */); | ||
| 4389 | Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); | ||
| 4390 | |||
| 4391 | #if 0 /* This doesn't really do anything. */ | 4295 | #if 0 /* This doesn't really do anything. */ |
| 4392 | DEFVAR_LISP ("x-mode-pointer-shape", &Vx_mode_pointer_shape, | 4296 | DEFVAR_LISP ("x-mode-pointer-shape", &Vx_mode_pointer_shape, |
| 4393 | doc: /* The shape of the pointer when over the mode line. | 4297 | doc: /* The shape of the pointer when over the mode line. |
diff --git a/src/w32fns.c b/src/w32fns.c index eba776fae44..f01d7a56ce5 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -151,10 +151,6 @@ static int w32_pass_multimedia_buttons_to_system; | |||
| 151 | /* Non nil if no window manager is in use. */ | 151 | /* Non nil if no window manager is in use. */ |
| 152 | Lisp_Object Vx_no_window_manager; | 152 | Lisp_Object Vx_no_window_manager; |
| 153 | 153 | ||
| 154 | /* Non-zero means we're allowed to display a hourglass pointer. */ | ||
| 155 | |||
| 156 | int display_hourglass_p; | ||
| 157 | |||
| 158 | /* If non-zero, a w32 timer that, when it expires, displays an | 154 | /* If non-zero, a w32 timer that, when it expires, displays an |
| 159 | hourglass cursor on all frames. */ | 155 | hourglass cursor on all frames. */ |
| 160 | static unsigned hourglass_timer = 0; | 156 | static unsigned hourglass_timer = 0; |
| @@ -5233,20 +5229,9 @@ value. */) | |||
| 5233 | Busy cursor | 5229 | Busy cursor |
| 5234 | ***********************************************************************/ | 5230 | ***********************************************************************/ |
| 5235 | 5231 | ||
| 5236 | /* Non-zero means an hourglass cursor is currently shown. */ | ||
| 5237 | |||
| 5238 | static int hourglass_shown_p; | ||
| 5239 | |||
| 5240 | /* Number of seconds to wait before displaying an hourglass cursor. */ | ||
| 5241 | |||
| 5242 | static Lisp_Object Vhourglass_delay; | ||
| 5243 | |||
| 5244 | /* Default number of seconds to wait before displaying an hourglass | ||
| 5245 | cursor. */ | ||
| 5246 | |||
| 5247 | #define DEFAULT_HOURGLASS_DELAY 1 | ||
| 5248 | |||
| 5249 | /* Return non-zero if houglass timer has been started or hourglass is shown. */ | 5232 | /* Return non-zero if houglass timer has been started or hourglass is shown. */ |
| 5233 | /* PENDING: if W32 can use atimers (atimer.[hc]) then the common impl in | ||
| 5234 | xdisp.c could be used. */ | ||
| 5250 | 5235 | ||
| 5251 | int | 5236 | int |
| 5252 | hourglass_started () | 5237 | hourglass_started () |
| @@ -7150,15 +7135,6 @@ This variable takes effect when you create a new frame | |||
| 7150 | or when you set the mouse color. */); | 7135 | or when you set the mouse color. */); |
| 7151 | Vx_hourglass_pointer_shape = Qnil; | 7136 | Vx_hourglass_pointer_shape = Qnil; |
| 7152 | 7137 | ||
| 7153 | DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, | ||
| 7154 | doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); | ||
| 7155 | display_hourglass_p = 1; | ||
| 7156 | |||
| 7157 | DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, | ||
| 7158 | doc: /* *Seconds to wait before displaying an hourglass pointer. | ||
| 7159 | Value must be an integer or float. */); | ||
| 7160 | Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); | ||
| 7161 | |||
| 7162 | DEFVAR_LISP ("x-sensitive-text-pointer-shape", | 7138 | DEFVAR_LISP ("x-sensitive-text-pointer-shape", |
| 7163 | &Vx_sensitive_text_pointer_shape, | 7139 | &Vx_sensitive_text_pointer_shape, |
| 7164 | doc: /* The shape of the pointer when over mouse-sensitive text. | 7140 | doc: /* The shape of the pointer when over mouse-sensitive text. |
| @@ -7274,7 +7250,7 @@ only be necessary if the default setting causes problems. */); | |||
| 7274 | 7250 | ||
| 7275 | hourglass_timer = 0; | 7251 | hourglass_timer = 0; |
| 7276 | hourglass_hwnd = NULL; | 7252 | hourglass_hwnd = NULL; |
| 7277 | hourglass_shown_p = 0; | 7253 | |
| 7278 | defsubr (&Sx_show_tip); | 7254 | defsubr (&Sx_show_tip); |
| 7279 | defsubr (&Sx_hide_tip); | 7255 | defsubr (&Sx_hide_tip); |
| 7280 | tip_timer = Qnil; | 7256 | tip_timer = Qnil; |
diff --git a/src/xdisp.c b/src/xdisp.c index f5dfd547705..f6d0d85ce6e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -852,6 +852,25 @@ Lisp_Object previous_help_echo_string; | |||
| 852 | 852 | ||
| 853 | static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 }; | 853 | static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 }; |
| 854 | 854 | ||
| 855 | /* Platform-independent portion of hourglass implementation. */ | ||
| 856 | |||
| 857 | /* Non-zero means we're allowed to display a hourglass pointer. */ | ||
| 858 | int display_hourglass_p; | ||
| 859 | |||
| 860 | /* Non-zero means an hourglass cursor is currently shown. */ | ||
| 861 | int hourglass_shown_p; | ||
| 862 | |||
| 863 | /* If non-null, an asynchronous timer that, when it expires, displays | ||
| 864 | an hourglass cursor on all frames. */ | ||
| 865 | struct atimer *hourglass_atimer; | ||
| 866 | |||
| 867 | /* Number of seconds to wait before displaying an hourglass cursor. */ | ||
| 868 | static Lisp_Object Vhourglass_delay; | ||
| 869 | |||
| 870 | /* Default number of seconds to wait before displaying an hourglass | ||
| 871 | cursor. */ | ||
| 872 | #define DEFAULT_HOURGLASS_DELAY 1 | ||
| 873 | |||
| 855 | 874 | ||
| 856 | /* Function prototypes. */ | 875 | /* Function prototypes. */ |
| 857 | 876 | ||
| @@ -25143,6 +25162,18 @@ particularly when using variable `x-use-underline-position-properties' | |||
| 25143 | with fonts that specify an UNDERLINE_POSITION relatively close to the | 25162 | with fonts that specify an UNDERLINE_POSITION relatively close to the |
| 25144 | baseline. The default value is 1. */); | 25163 | baseline. The default value is 1. */); |
| 25145 | underline_minimum_offset = 1; | 25164 | underline_minimum_offset = 1; |
| 25165 | |||
| 25166 | DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, | ||
| 25167 | doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); | ||
| 25168 | display_hourglass_p = 1; | ||
| 25169 | |||
| 25170 | DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, | ||
| 25171 | doc: /* *Seconds to wait before displaying an hourglass pointer. | ||
| 25172 | Value must be an integer or float. */); | ||
| 25173 | Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); | ||
| 25174 | |||
| 25175 | hourglass_atimer = NULL; | ||
| 25176 | hourglass_shown_p = 0; | ||
| 25146 | } | 25177 | } |
| 25147 | 25178 | ||
| 25148 | 25179 | ||
| @@ -25198,6 +25229,64 @@ init_xdisp () | |||
| 25198 | help_echo_showing_p = 0; | 25229 | help_echo_showing_p = 0; |
| 25199 | } | 25230 | } |
| 25200 | 25231 | ||
| 25232 | /* Platform-independent portion of hourglass implementation. */ | ||
| 25233 | |||
| 25234 | /* Return non-zero if houglass timer has been started or hourglass is shown. */ | ||
| 25235 | int | ||
| 25236 | hourglass_started () | ||
| 25237 | { | ||
| 25238 | return hourglass_shown_p || hourglass_atimer != NULL; | ||
| 25239 | } | ||
| 25240 | |||
| 25241 | |||
| 25242 | /* Cancel a currently active hourglass timer, and start a new one. */ | ||
| 25243 | void | ||
| 25244 | start_hourglass () | ||
| 25245 | { | ||
| 25246 | #if defined (HAVE_WINDOW_SYSTEM) | ||
| 25247 | EMACS_TIME delay; | ||
| 25248 | int secs, usecs = 0; | ||
| 25249 | |||
| 25250 | cancel_hourglass (); | ||
| 25251 | |||
| 25252 | if (INTEGERP (Vhourglass_delay) | ||
| 25253 | && XINT (Vhourglass_delay) > 0) | ||
| 25254 | secs = XFASTINT (Vhourglass_delay); | ||
| 25255 | else if (FLOATP (Vhourglass_delay) | ||
| 25256 | && XFLOAT_DATA (Vhourglass_delay) > 0) | ||
| 25257 | { | ||
| 25258 | Lisp_Object tem; | ||
| 25259 | tem = Ftruncate (Vhourglass_delay, Qnil); | ||
| 25260 | secs = XFASTINT (tem); | ||
| 25261 | usecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000000; | ||
| 25262 | } | ||
| 25263 | else | ||
| 25264 | secs = DEFAULT_HOURGLASS_DELAY; | ||
| 25265 | |||
| 25266 | EMACS_SET_SECS_USECS (delay, secs, usecs); | ||
| 25267 | hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, | ||
| 25268 | show_hourglass, NULL); | ||
| 25269 | #endif | ||
| 25270 | } | ||
| 25271 | |||
| 25272 | |||
| 25273 | /* Cancel the hourglass cursor timer if active, hide a busy cursor if | ||
| 25274 | shown. */ | ||
| 25275 | void | ||
| 25276 | cancel_hourglass () | ||
| 25277 | { | ||
| 25278 | #if defined (HAVE_WINDOW_SYSTEM) | ||
| 25279 | if (hourglass_atimer) | ||
| 25280 | { | ||
| 25281 | cancel_atimer (hourglass_atimer); | ||
| 25282 | hourglass_atimer = NULL; | ||
| 25283 | } | ||
| 25284 | |||
| 25285 | if (hourglass_shown_p) | ||
| 25286 | hide_hourglass (); | ||
| 25287 | #endif | ||
| 25288 | } | ||
| 25289 | |||
| 25201 | 25290 | ||
| 25202 | /* arch-tag: eacc864d-bb6a-4b74-894a-1a4399a1358b | 25291 | /* arch-tag: eacc864d-bb6a-4b74-894a-1a4399a1358b |
| 25203 | (do not change this comment) */ | 25292 | (do not change this comment) */ |
diff --git a/src/xfns.c b/src/xfns.c index 80e6f8d470f..6aeb04ba1f8 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -149,10 +149,6 @@ int gray_bitmap_width = gray_width; | |||
| 149 | int gray_bitmap_height = gray_height; | 149 | int gray_bitmap_height = gray_height; |
| 150 | char *gray_bitmap_bits = gray_bits; | 150 | char *gray_bitmap_bits = gray_bits; |
| 151 | 151 | ||
| 152 | /* Non-zero means we're allowed to display an hourglass cursor. */ | ||
| 153 | |||
| 154 | int display_hourglass_p; | ||
| 155 | |||
| 156 | /* Non-zero means prompt with the old GTK file selection dialog. */ | 152 | /* Non-zero means prompt with the old GTK file selection dialog. */ |
| 157 | 153 | ||
| 158 | int x_gtk_use_old_file_dialog; | 154 | int x_gtk_use_old_file_dialog; |
| @@ -4472,85 +4468,6 @@ no value of TYPE. */) | |||
| 4472 | Busy cursor | 4468 | Busy cursor |
| 4473 | ***********************************************************************/ | 4469 | ***********************************************************************/ |
| 4474 | 4470 | ||
| 4475 | /* If non-null, an asynchronous timer that, when it expires, displays | ||
| 4476 | an hourglass cursor on all frames. */ | ||
| 4477 | |||
| 4478 | static struct atimer *hourglass_atimer; | ||
| 4479 | |||
| 4480 | /* Non-zero means an hourglass cursor is currently shown. */ | ||
| 4481 | |||
| 4482 | static int hourglass_shown_p; | ||
| 4483 | |||
| 4484 | /* Number of seconds to wait before displaying an hourglass cursor. */ | ||
| 4485 | |||
| 4486 | static Lisp_Object Vhourglass_delay; | ||
| 4487 | |||
| 4488 | /* Default number of seconds to wait before displaying an hourglass | ||
| 4489 | cursor. */ | ||
| 4490 | |||
| 4491 | #define DEFAULT_HOURGLASS_DELAY 1 | ||
| 4492 | |||
| 4493 | /* Function prototypes. */ | ||
| 4494 | |||
| 4495 | static void show_hourglass P_ ((struct atimer *)); | ||
| 4496 | static void hide_hourglass P_ ((void)); | ||
| 4497 | |||
| 4498 | /* Return non-zero if houglass timer has been started or hourglass is shown. */ | ||
| 4499 | |||
| 4500 | int | ||
| 4501 | hourglass_started () | ||
| 4502 | { | ||
| 4503 | return hourglass_shown_p || hourglass_atimer != NULL; | ||
| 4504 | } | ||
| 4505 | |||
| 4506 | |||
| 4507 | /* Cancel a currently active hourglass timer, and start a new one. */ | ||
| 4508 | |||
| 4509 | void | ||
| 4510 | start_hourglass () | ||
| 4511 | { | ||
| 4512 | EMACS_TIME delay; | ||
| 4513 | int secs, usecs = 0; | ||
| 4514 | |||
| 4515 | cancel_hourglass (); | ||
| 4516 | |||
| 4517 | if (INTEGERP (Vhourglass_delay) | ||
| 4518 | && XINT (Vhourglass_delay) > 0) | ||
| 4519 | secs = XFASTINT (Vhourglass_delay); | ||
| 4520 | else if (FLOATP (Vhourglass_delay) | ||
| 4521 | && XFLOAT_DATA (Vhourglass_delay) > 0) | ||
| 4522 | { | ||
| 4523 | Lisp_Object tem; | ||
| 4524 | tem = Ftruncate (Vhourglass_delay, Qnil); | ||
| 4525 | secs = XFASTINT (tem); | ||
| 4526 | usecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000000; | ||
| 4527 | } | ||
| 4528 | else | ||
| 4529 | secs = DEFAULT_HOURGLASS_DELAY; | ||
| 4530 | |||
| 4531 | EMACS_SET_SECS_USECS (delay, secs, usecs); | ||
| 4532 | hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, | ||
| 4533 | show_hourglass, NULL); | ||
| 4534 | } | ||
| 4535 | |||
| 4536 | |||
| 4537 | /* Cancel the hourglass cursor timer if active, hide a busy cursor if | ||
| 4538 | shown. */ | ||
| 4539 | |||
| 4540 | void | ||
| 4541 | cancel_hourglass () | ||
| 4542 | { | ||
| 4543 | if (hourglass_atimer) | ||
| 4544 | { | ||
| 4545 | cancel_atimer (hourglass_atimer); | ||
| 4546 | hourglass_atimer = NULL; | ||
| 4547 | } | ||
| 4548 | |||
| 4549 | if (hourglass_shown_p) | ||
| 4550 | hide_hourglass (); | ||
| 4551 | } | ||
| 4552 | |||
| 4553 | |||
| 4554 | /* Timer function of hourglass_atimer. TIMER is equal to | 4471 | /* Timer function of hourglass_atimer. TIMER is equal to |
| 4555 | hourglass_atimer. | 4472 | hourglass_atimer. |
| 4556 | 4473 | ||
| @@ -4559,7 +4476,7 @@ cancel_hourglass () | |||
| 4559 | output_data.x structure to indicate that an hourglass cursor is | 4476 | output_data.x structure to indicate that an hourglass cursor is |
| 4560 | shown on the frames. */ | 4477 | shown on the frames. */ |
| 4561 | 4478 | ||
| 4562 | static void | 4479 | void |
| 4563 | show_hourglass (timer) | 4480 | show_hourglass (timer) |
| 4564 | struct atimer *timer; | 4481 | struct atimer *timer; |
| 4565 | { | 4482 | { |
| @@ -4624,7 +4541,7 @@ show_hourglass (timer) | |||
| 4624 | /* Hide the hourglass pointer on all frames, if it is currently | 4541 | /* Hide the hourglass pointer on all frames, if it is currently |
| 4625 | shown. */ | 4542 | shown. */ |
| 4626 | 4543 | ||
| 4627 | static void | 4544 | void |
| 4628 | hide_hourglass () | 4545 | hide_hourglass () |
| 4629 | { | 4546 | { |
| 4630 | if (hourglass_shown_p) | 4547 | if (hourglass_shown_p) |
| @@ -5905,15 +5822,6 @@ This variable takes effect when you create a new frame | |||
| 5905 | or when you set the mouse color. */); | 5822 | or when you set the mouse color. */); |
| 5906 | Vx_hourglass_pointer_shape = Qnil; | 5823 | Vx_hourglass_pointer_shape = Qnil; |
| 5907 | 5824 | ||
| 5908 | DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, | ||
| 5909 | doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); | ||
| 5910 | display_hourglass_p = 1; | ||
| 5911 | |||
| 5912 | DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, | ||
| 5913 | doc: /* *Seconds to wait before displaying an hourglass pointer. | ||
| 5914 | Value must be an integer or float. */); | ||
| 5915 | Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); | ||
| 5916 | |||
| 5917 | #if 0 /* This doesn't really do anything. */ | 5825 | #if 0 /* This doesn't really do anything. */ |
| 5918 | DEFVAR_LISP ("x-mode-pointer-shape", &Vx_mode_pointer_shape, | 5826 | DEFVAR_LISP ("x-mode-pointer-shape", &Vx_mode_pointer_shape, |
| 5919 | doc: /* The shape of the pointer when over the mode line. | 5827 | doc: /* The shape of the pointer when over the mode line. |
| @@ -6053,9 +5961,6 @@ the tool bar buttons. */); | |||
| 6053 | /* Setting callback functions for fontset handler. */ | 5961 | /* Setting callback functions for fontset handler. */ |
| 6054 | check_window_system_func = check_x; | 5962 | check_window_system_func = check_x; |
| 6055 | 5963 | ||
| 6056 | hourglass_atimer = NULL; | ||
| 6057 | hourglass_shown_p = 0; | ||
| 6058 | |||
| 6059 | defsubr (&Sx_show_tip); | 5964 | defsubr (&Sx_show_tip); |
| 6060 | defsubr (&Sx_hide_tip); | 5965 | defsubr (&Sx_hide_tip); |
| 6061 | tip_timer = Qnil; | 5966 | tip_timer = Qnil; |