diff options
| author | Fred Pierresteguy | 1994-04-08 16:00:13 +0000 |
|---|---|---|
| committer | Fred Pierresteguy | 1994-04-08 16:00:13 +0000 |
| commit | 95f80c7885fb82d8d8471cc115c788e2afbd7e47 (patch) | |
| tree | a452b77ddbcab1e983d487eaf69e7025c5d163af /src | |
| parent | 6bfbdaebce2e0a17f696662460c6ed45eb36ae76 (diff) | |
| download | emacs-95f80c7885fb82d8d8471cc115c788e2afbd7e47.tar.gz emacs-95f80c7885fb82d8d8471cc115c788e2afbd7e47.zip | |
(syms_of_xfns): Define Vx_cross_pointer_shape.
(Vx_cross_pointer_shape): New variable.
(Vx_cross_pointer_shape): Create a mouse face cursor for the mouse-face
properties.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/xfns.c b/src/xfns.c index 45dce7661e7..362b509eb3e 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -103,6 +103,7 @@ extern char *x_id_name; | |||
| 103 | /* The background and shape of the mouse pointer, and shape when not | 103 | /* The background and shape of the mouse pointer, and shape when not |
| 104 | over text or in the modeline. */ | 104 | over text or in the modeline. */ |
| 105 | Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; | 105 | Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; |
| 106 | Lisp_Object Vx_cross_pointer_shape; | ||
| 106 | 107 | ||
| 107 | /* Color of chars displayed in cursor box. */ | 108 | /* Color of chars displayed in cursor box. */ |
| 108 | Lisp_Object Vx_cursor_fore_pixel; | 109 | Lisp_Object Vx_cursor_fore_pixel; |
| @@ -671,7 +672,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 671 | struct frame *f; | 672 | struct frame *f; |
| 672 | Lisp_Object arg, oldval; | 673 | Lisp_Object arg, oldval; |
| 673 | { | 674 | { |
| 674 | Cursor cursor, nontext_cursor, mode_cursor; | 675 | Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; |
| 675 | int mask_color; | 676 | int mask_color; |
| 676 | 677 | ||
| 677 | if (!EQ (Qnil, arg)) | 678 | if (!EQ (Qnil, arg)) |
| @@ -715,6 +716,16 @@ x_set_mouse_color (f, arg, oldval) | |||
| 715 | } | 716 | } |
| 716 | else | 717 | else |
| 717 | mode_cursor = XCreateFontCursor (x_current_display, XC_xterm); | 718 | mode_cursor = XCreateFontCursor (x_current_display, XC_xterm); |
| 719 | x_check_errors ("bad modeline pointer cursor: %s"); | ||
| 720 | |||
| 721 | if (!EQ (Qnil, Vx_cross_pointer_shape)) | ||
| 722 | { | ||
| 723 | CHECK_NUMBER (Vx_cross_pointer_shape, 0); | ||
| 724 | cross_cursor = XCreateFontCursor (x_current_display, | ||
| 725 | XINT (Vx_cross_pointer_shape)); | ||
| 726 | } | ||
| 727 | else | ||
| 728 | cross_cursor = XCreateFontCursor (x_current_display, XC_crosshair); | ||
| 718 | 729 | ||
| 719 | /* Check and report errors with the above calls. */ | 730 | /* Check and report errors with the above calls. */ |
| 720 | x_check_errors ("can't set cursor shape: %s"); | 731 | x_check_errors ("can't set cursor shape: %s"); |
| @@ -739,6 +750,8 @@ x_set_mouse_color (f, arg, oldval) | |||
| 739 | &fore_color, &back_color); | 750 | &fore_color, &back_color); |
| 740 | XRecolorCursor (x_current_display, mode_cursor, | 751 | XRecolorCursor (x_current_display, mode_cursor, |
| 741 | &fore_color, &back_color); | 752 | &fore_color, &back_color); |
| 753 | XRecolorCursor (x_current_display, cross_cursor, | ||
| 754 | &fore_color, &back_color); | ||
| 742 | } | 755 | } |
| 743 | #else /* X10 */ | 756 | #else /* X10 */ |
| 744 | cursor = XCreateCursor (16, 16, MouseCursor, MouseMask, | 757 | cursor = XCreateCursor (16, 16, MouseCursor, MouseMask, |
| @@ -766,6 +779,10 @@ x_set_mouse_color (f, arg, oldval) | |||
| 766 | && f->display.x->modeline_cursor != 0) | 779 | && f->display.x->modeline_cursor != 0) |
| 767 | XFreeCursor (XDISPLAY f->display.x->modeline_cursor); | 780 | XFreeCursor (XDISPLAY f->display.x->modeline_cursor); |
| 768 | f->display.x->modeline_cursor = mode_cursor; | 781 | f->display.x->modeline_cursor = mode_cursor; |
| 782 | if (cross_cursor != f->display.x->cross_cursor | ||
| 783 | && f->display.x->cross_cursor != 0) | ||
| 784 | XFreeCursor (XDISPLAY f->display.x->cross_cursor); | ||
| 785 | f->display.x->cross_cursor = cross_cursor; | ||
| 769 | #endif /* HAVE_X11 */ | 786 | #endif /* HAVE_X11 */ |
| 770 | 787 | ||
| 771 | XFlushQueue (); | 788 | XFlushQueue (); |
| @@ -4150,6 +4167,8 @@ switches, if present."); | |||
| 4150 | #endif | 4167 | #endif |
| 4151 | Vx_mode_pointer_shape = Qnil; | 4168 | Vx_mode_pointer_shape = Qnil; |
| 4152 | 4169 | ||
| 4170 | Vx_cross_pointer_shape = Qnil; | ||
| 4171 | |||
| 4153 | DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, | 4172 | DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, |
| 4154 | "A string indicating the foreground color of the cursor box."); | 4173 | "A string indicating the foreground color of the cursor box."); |
| 4155 | Vx_cursor_fore_pixel = Qnil; | 4174 | Vx_cursor_fore_pixel = Qnil; |