emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xdisp.c


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c
Date: Thu, 27 Jan 2005 17:33:53 -0500

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.973 emacs/src/xdisp.c:1.974
*** emacs/src/xdisp.c:1.973     Thu Jan 27 00:16:28 2005
--- emacs/src/xdisp.c   Thu Jan 27 22:33:52 2005
***************
*** 1876,1881 ****
--- 1876,1939 ----
  #endif
  }
  
+ 
+ /* EXPORT:
+    Return the position and height of the phys cursor in window W.
+    Set w->phys_cursor_width to width of phys cursor.
+ */
+ 
+ int
+ get_phys_cursor_geometry (w, row, glyph, heightp)
+      struct window *w;
+      struct glyph_row *row;
+      struct glyph *glyph;
+      int *heightp;
+ {
+   struct frame *f = XFRAME (WINDOW_FRAME (w));
+   int x, y, wd, h, h0, y0;
+ 
+   /* Compute the width of the rectangle to draw.  If on a stretch
+      glyph, and `x-stretch-block-cursor' is nil, don't draw a
+      rectangle as wide as the glyph, but use a canonical character
+      width instead.  */
+   wd = glyph->pixel_width - 1;
+ #ifdef HAVE_NTGUI
+   wd++; /* Why? */
+ #endif
+   if (glyph->type == STRETCH_GLYPH
+       && !x_stretch_cursor_p)
+     wd = min (FRAME_COLUMN_WIDTH (f), wd);
+   w->phys_cursor_width = wd;
+ 
+   y = w->phys_cursor.y + row->ascent - glyph->ascent;
+ 
+   /* If y is below window bottom, ensure that we still see a cursor.  */
+   h0 = min (FRAME_LINE_HEIGHT (f), row->visible_height);
+ 
+   h = max (h0, glyph->ascent + glyph->descent);
+   h0 = min (h0, glyph->ascent + glyph->descent);
+ 
+   y0 = WINDOW_HEADER_LINE_HEIGHT (w);
+   if (y < y0)
+     {
+       h = max (h - (y0 - y) + 1, h0);
+       y = y0 - 1;
+     }
+   else
+     {
+       y0 = window_text_bottom_y (w) - h0;
+       if (y > y0)
+       {
+         h += y - y0;
+         y = y0;
+       }
+     }
+ 
+   *heightp = h - 1;
+   return WINDOW_TO_FRAME_PIXEL_Y (w, y);
+ }
+ 
+ 
  #endif /* HAVE_WINDOW_SYSTEM */
  
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]