diff options
| author | Gerd Moellmann | 2000-11-28 13:47:03 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-28 13:47:03 +0000 |
| commit | 8fb4ec9c0da89f301ea0e72751c32ac66298b71d (patch) | |
| tree | 194c44c4318890fb4619cf793a2dae9a26b854b9 /src | |
| parent | 5c2242cef12634c0009dee2ac3b8ac0152bb61f9 (diff) | |
| download | emacs-8fb4ec9c0da89f301ea0e72751c32ac66298b71d.tar.gz emacs-8fb4ec9c0da89f301ea0e72751c32ac66298b71d.zip | |
(Vx_window_horizontal_drag_shape): New variable.
(syms_of_xfns): DEFVAR_LISP it.
(x_set_mouse_color): Create frame's horizontal_drag_cursor.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/xfns.c b/src/xfns.c index 7210678952d..322b48c1179 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -149,6 +149,11 @@ Lisp_Object Vx_busy_pointer_shape; | |||
| 149 | 149 | ||
| 150 | Lisp_Object Vx_sensitive_text_pointer_shape; | 150 | Lisp_Object Vx_sensitive_text_pointer_shape; |
| 151 | 151 | ||
| 152 | /* If non-nil, the pointer shape to indicate that windows can be | ||
| 153 | dragged horizontally. */ | ||
| 154 | |||
| 155 | Lisp_Object Vx_window_horizontal_drag_shape; | ||
| 156 | |||
| 152 | /* Color of chars displayed in cursor box. */ | 157 | /* Color of chars displayed in cursor box. */ |
| 153 | 158 | ||
| 154 | Lisp_Object Vx_cursor_fore_pixel; | 159 | Lisp_Object Vx_cursor_fore_pixel; |
| @@ -1427,7 +1432,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 1427 | Lisp_Object arg, oldval; | 1432 | Lisp_Object arg, oldval; |
| 1428 | { | 1433 | { |
| 1429 | Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; | 1434 | Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; |
| 1430 | Cursor busy_cursor; | 1435 | Cursor busy_cursor, horizontal_drag_cursor; |
| 1431 | int count; | 1436 | int count; |
| 1432 | unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); | 1437 | unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
| 1433 | unsigned long mask_color = f->output_data.x->background_pixel; | 1438 | unsigned long mask_color = f->output_data.x->background_pixel; |
| @@ -1495,6 +1500,17 @@ x_set_mouse_color (f, arg, oldval) | |||
| 1495 | else | 1500 | else |
| 1496 | cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair); | 1501 | cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair); |
| 1497 | 1502 | ||
| 1503 | if (!NILP (Vx_window_horizontal_drag_shape)) | ||
| 1504 | { | ||
| 1505 | CHECK_NUMBER (Vx_window_horizontal_drag_shape, 0); | ||
| 1506 | horizontal_drag_cursor | ||
| 1507 | = XCreateFontCursor (FRAME_X_DISPLAY (f), | ||
| 1508 | XINT (Vx_window_horizontal_drag_shape)); | ||
| 1509 | } | ||
| 1510 | else | ||
| 1511 | horizontal_drag_cursor | ||
| 1512 | = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_h_double_arrow); | ||
| 1513 | |||
| 1498 | /* Check and report errors with the above calls. */ | 1514 | /* Check and report errors with the above calls. */ |
| 1499 | x_check_errors (FRAME_X_DISPLAY (f), "can't set cursor shape: %s"); | 1515 | x_check_errors (FRAME_X_DISPLAY (f), "can't set cursor shape: %s"); |
| 1500 | x_uncatch_errors (FRAME_X_DISPLAY (f), count); | 1516 | x_uncatch_errors (FRAME_X_DISPLAY (f), count); |
| @@ -1517,12 +1533,15 @@ x_set_mouse_color (f, arg, oldval) | |||
| 1517 | &fore_color, &back_color); | 1533 | &fore_color, &back_color); |
| 1518 | XRecolorCursor (FRAME_X_DISPLAY (f), busy_cursor, | 1534 | XRecolorCursor (FRAME_X_DISPLAY (f), busy_cursor, |
| 1519 | &fore_color, &back_color); | 1535 | &fore_color, &back_color); |
| 1536 | XRecolorCursor (FRAME_X_DISPLAY (f), horizontal_drag_cursor, | ||
| 1537 | &fore_color, &back_color); | ||
| 1520 | } | 1538 | } |
| 1521 | 1539 | ||
| 1522 | if (FRAME_X_WINDOW (f) != 0) | 1540 | if (FRAME_X_WINDOW (f) != 0) |
| 1523 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); | 1541 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); |
| 1524 | 1542 | ||
| 1525 | if (cursor != f->output_data.x->text_cursor && f->output_data.x->text_cursor != 0) | 1543 | if (cursor != f->output_data.x->text_cursor |
| 1544 | && f->output_data.x->text_cursor != 0) | ||
| 1526 | XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->text_cursor); | 1545 | XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->text_cursor); |
| 1527 | f->output_data.x->text_cursor = cursor; | 1546 | f->output_data.x->text_cursor = cursor; |
| 1528 | 1547 | ||
| @@ -1546,6 +1565,11 @@ x_set_mouse_color (f, arg, oldval) | |||
| 1546 | XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->cross_cursor); | 1565 | XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->cross_cursor); |
| 1547 | f->output_data.x->cross_cursor = cross_cursor; | 1566 | f->output_data.x->cross_cursor = cross_cursor; |
| 1548 | 1567 | ||
| 1568 | if (horizontal_drag_cursor != f->output_data.x->horizontal_drag_cursor | ||
| 1569 | && f->output_data.x->horizontal_drag_cursor != 0) | ||
| 1570 | XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->horizontal_drag_cursor); | ||
| 1571 | f->output_data.x->horizontal_drag_cursor = horizontal_drag_cursor; | ||
| 1572 | |||
| 1549 | XFlush (FRAME_X_DISPLAY (f)); | 1573 | XFlush (FRAME_X_DISPLAY (f)); |
| 1550 | UNBLOCK_INPUT; | 1574 | UNBLOCK_INPUT; |
| 1551 | 1575 | ||
| @@ -11105,6 +11129,13 @@ This variable takes effect when you create a new frame\n\ | |||
| 11105 | or when you set the mouse color."); | 11129 | or when you set the mouse color."); |
| 11106 | Vx_sensitive_text_pointer_shape = Qnil; | 11130 | Vx_sensitive_text_pointer_shape = Qnil; |
| 11107 | 11131 | ||
| 11132 | DEFVAR_LISP ("x-window-horizontal-drag-cursor", | ||
| 11133 | &Vx_window_horizontal_drag_shape, | ||
| 11134 | "Pointer shape to use for indicating a window can be dragged horizontally.\n\ | ||
| 11135 | This variable takes effect when you create a new frame\n\ | ||
| 11136 | or when you set the mouse color."); | ||
| 11137 | Vx_window_horizontal_drag_shape = Qnil; | ||
| 11138 | |||
| 11108 | DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, | 11139 | DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, |
| 11109 | "A string indicating the foreground color of the cursor box."); | 11140 | "A string indicating the foreground color of the cursor box."); |
| 11110 | Vx_cursor_fore_pixel = Qnil; | 11141 | Vx_cursor_fore_pixel = Qnil; |