diff options
| author | Gerd Moellmann | 2000-03-26 16:24:24 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-03-26 16:24:24 +0000 |
| commit | f02d8aa0f631a7527d0934f6b0aef2c97aada2f4 (patch) | |
| tree | 7c8106eb284140e13bce348932ad86bf66a5165c /src | |
| parent | 89e80928967971a4cd875708ce3cf3005d5cf384 (diff) | |
| download | emacs-f02d8aa0f631a7527d0934f6b0aef2c97aada2f4.tar.gz emacs-f02d8aa0f631a7527d0934f6b0aef2c97aada2f4.zip | |
(x_display_and_set_cursor): Choose cursor depending
on buffer-local value of cursor_type.
(x_draw_bar_cursor): Add parameter WIDTH.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c index 973549cdf1a..a49171aab6d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -452,7 +452,7 @@ static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *)); | |||
| 452 | static void XTframe_rehighlight P_ ((struct frame *)); | 452 | static void XTframe_rehighlight P_ ((struct frame *)); |
| 453 | static void x_frame_rehighlight P_ ((struct x_display_info *)); | 453 | static void x_frame_rehighlight P_ ((struct x_display_info *)); |
| 454 | static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); | 454 | static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); |
| 455 | static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *)); | 455 | static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int)); |
| 456 | static int x_intersect_rectangles P_ ((XRectangle *, XRectangle *, | 456 | static int x_intersect_rectangles P_ ((XRectangle *, XRectangle *, |
| 457 | XRectangle *)); | 457 | XRectangle *)); |
| 458 | static void expose_frame P_ ((struct frame *, int, int, int, int)); | 458 | static void expose_frame P_ ((struct frame *, int, int, int, int)); |
| @@ -10053,9 +10053,10 @@ x_draw_hollow_cursor (w, row) | |||
| 10053 | --gerd. */ | 10053 | --gerd. */ |
| 10054 | 10054 | ||
| 10055 | static void | 10055 | static void |
| 10056 | x_draw_bar_cursor (w, row) | 10056 | x_draw_bar_cursor (w, row, width) |
| 10057 | struct window *w; | 10057 | struct window *w; |
| 10058 | struct glyph_row *row; | 10058 | struct glyph_row *row; |
| 10059 | int width; | ||
| 10059 | { | 10060 | { |
| 10060 | /* If cursor hpos is out of bounds, don't draw garbage. This can | 10061 | /* If cursor hpos is out of bounds, don't draw garbage. This can |
| 10061 | happen in mini-buffer windows when switching between echo area | 10062 | happen in mini-buffer windows when switching between echo area |
| @@ -10091,13 +10092,15 @@ x_draw_bar_cursor (w, row) | |||
| 10091 | FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc = gc; | 10092 | FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc = gc; |
| 10092 | } | 10093 | } |
| 10093 | 10094 | ||
| 10095 | if (width < 0) | ||
| 10096 | width = f->output_data.x->cursor_width; | ||
| 10097 | |||
| 10094 | x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); | 10098 | x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); |
| 10095 | x_clip_to_row (w, row, gc, 0); | 10099 | x_clip_to_row (w, row, gc, 0); |
| 10096 | XFillRectangle (dpy, window, gc, | 10100 | XFillRectangle (dpy, window, gc, |
| 10097 | x, | 10101 | x, |
| 10098 | WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), | 10102 | WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), |
| 10099 | min (cursor_glyph->pixel_width, | 10103 | min (cursor_glyph->pixel_width, width), |
| 10100 | f->output_data.x->cursor_width), | ||
| 10101 | row->height); | 10104 | row->height); |
| 10102 | XSetClipMask (dpy, gc, None); | 10105 | XSetClipMask (dpy, gc, None); |
| 10103 | } | 10106 | } |
| @@ -10254,6 +10257,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 10254 | { | 10257 | { |
| 10255 | struct frame *f = XFRAME (w->frame); | 10258 | struct frame *f = XFRAME (w->frame); |
| 10256 | int new_cursor_type; | 10259 | int new_cursor_type; |
| 10260 | int new_cursor_width; | ||
| 10257 | struct glyph_matrix *current_glyphs; | 10261 | struct glyph_matrix *current_glyphs; |
| 10258 | struct glyph_row *glyph_row; | 10262 | struct glyph_row *glyph_row; |
| 10259 | struct glyph *glyph; | 10263 | struct glyph *glyph; |
| @@ -10292,6 +10296,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 10292 | the cursor type given by the frame parameter. If explicitly | 10296 | the cursor type given by the frame parameter. If explicitly |
| 10293 | marked off, draw no cursor. In all other cases, we want a hollow | 10297 | marked off, draw no cursor. In all other cases, we want a hollow |
| 10294 | box cursor. */ | 10298 | box cursor. */ |
| 10299 | new_cursor_width = -1; | ||
| 10295 | if (cursor_in_echo_area | 10300 | if (cursor_in_echo_area |
| 10296 | && FRAME_HAS_MINIBUF_P (f) | 10301 | && FRAME_HAS_MINIBUF_P (f) |
| 10297 | && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) | 10302 | && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) |
| @@ -10316,7 +10321,15 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 10316 | else if (w->cursor_off_p) | 10321 | else if (w->cursor_off_p) |
| 10317 | new_cursor_type = NO_CURSOR; | 10322 | new_cursor_type = NO_CURSOR; |
| 10318 | else | 10323 | else |
| 10319 | new_cursor_type = FRAME_DESIRED_CURSOR (f); | 10324 | { |
| 10325 | struct buffer *b = XBUFFER (w->buffer); | ||
| 10326 | |||
| 10327 | if (EQ (b->cursor_type, Qt)) | ||
| 10328 | new_cursor_type = FRAME_DESIRED_CURSOR (f); | ||
| 10329 | else | ||
| 10330 | new_cursor_type = x_specified_cursor_type (b->cursor_type, | ||
| 10331 | &new_cursor_width); | ||
| 10332 | } | ||
| 10320 | } | 10333 | } |
| 10321 | 10334 | ||
| 10322 | /* If cursor is currently being shown and we don't want it to be or | 10335 | /* If cursor is currently being shown and we don't want it to be or |
| @@ -10356,7 +10369,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 10356 | break; | 10369 | break; |
| 10357 | 10370 | ||
| 10358 | case BAR_CURSOR: | 10371 | case BAR_CURSOR: |
| 10359 | x_draw_bar_cursor (w, glyph_row); | 10372 | x_draw_bar_cursor (w, glyph_row, new_cursor_width); |
| 10360 | break; | 10373 | break; |
| 10361 | 10374 | ||
| 10362 | case NO_CURSOR: | 10375 | case NO_CURSOR: |