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/xterm.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/xterm.c')
| -rw-r--r-- | src/xterm.c | 62 |
1 files changed, 60 insertions, 2 deletions
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 | ||