]> code.delx.au - gnu-emacs/commitdiff
(x_draw_bar_cursor): New argument KIND; callers changed.
authorJason Rumney <jasonr@gnu.org>
Wed, 22 May 2002 19:37:56 +0000 (19:37 +0000)
committerJason Rumney <jasonr@gnu.org>
Wed, 22 May 2002 19:37:56 +0000 (19:37 +0000)
Handle the `hbar' cursor type.
(x_display_and_set_cursor): Handle the HBAR_CURSOR case.

src/ChangeLog
src/w32term.c

index 6cd3d78d23bed534c6c1d79793cbecc825830414..eb8ea4f575150468d6b3ae25b6966dd4d8a447c7 100644 (file)
@@ -1,3 +1,19 @@
+2002-05-22  Jason Rumney  <jasonr@gnu.org>
+
+       * w32fns.c (enumfont_t): Remove tail, make pattern a normal
+       Lisp_Object.
+       (enum_font_cb2, enum_font_maybe_add_to_list, w32_list_fonts):
+       Use modified enumfont_t struct.
+
+       * w32term.h (text_cursor_kinds): New enumeration member HBAR_CURSOR.
+       * w32term.c (x_draw_bar_cursor): New argument KIND; callers changed.
+       Handle the `hbar' cursor type.
+       (x_display_and_set_cursor): Handle the HBAR_CURSOR case.
+
+       * w32fns.c (Qhbar): New variable.
+       (x_specified_cursor_type): Use it.
+
 2002-05-21  Ken Raeburn  <raeburn@gnu.org>
 
        * w32fns.c (enum_font_maybe_add_to_list): Use XCDR_AS_LVALUE for
index eb055dab044c1e81f4d7b9695bdb13974e12a6bb..e8797abeaf195b37ce71cb1f72da06efa63799eb 100644 (file)
@@ -9455,10 +9455,11 @@ x_draw_hollow_cursor (w, row)
    --gerd.  */
 
 static void
-x_draw_bar_cursor (w, row, width)
+x_draw_bar_cursor (w, row, width, kind)
      struct window *w;
      struct glyph_row *row;
      int width;
+     enum text_cursor_kinds kind;
 {
   struct frame *f = XFRAME (w->frame);
   struct glyph *cursor_glyph;
@@ -9488,6 +9489,7 @@ x_draw_bar_cursor (w, row, width)
 
       if (width < 0)
         width = f->output_data.w32->cursor_width;
+      width = min (cursor_glyph->pixel_width, width);
 
       /* If the glyph's background equals the color we normally draw
         the bar cursor in, the bar cursor in its normal color is
@@ -9500,10 +9502,20 @@ x_draw_bar_cursor (w, row, width)
       x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
       hdc = get_frame_dc (f);
       w32_clip_to_row (w, row, hdc, 0);
-      w32_fill_area (f, hdc, cursor_color, x,
-                     WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
-                     min (cursor_glyph->pixel_width, width),
-                     row->height);
+
+      if (kind == BAR_CURSOR)
+       {
+         w32_fill_area (f, hdc, cursor_color, x,
+                        WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
+                        width, row->height);
+       }
+      else
+       {
+         w32_fill_area (f, hdc, cursor_color, x,
+                        WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
+                                                 row->height - width),
+                        cursor_glyph->pixel_width, width);
+       }
       release_frame_dc (f, hdc);
     }
 }
@@ -9872,7 +9884,11 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
          break;
 
        case BAR_CURSOR:
-         x_draw_bar_cursor (w, glyph_row, new_cursor_width);
+         x_draw_bar_cursor (w, glyph_row, new_cursor_width, BAR_CURSOR);
+         break;
+
+       case HBAR_CURSOR:
+         x_draw_bar_cursor (w, glyph_row, new_cursor_width, HBAR_CURSOR);
          break;
 
        case NO_CURSOR: