changeset 50243:3fb54e5a7201

(struct redisplay_interface): Add active_p argument to draw_window_cursor member. All uses changed.
author Kim F. Storm <storm@cua.dk>
date Fri, 21 Mar 2003 21:47:46 +0000
parents 8bd070bffa46
children fef96ba449a2
files src/dispextern.h src/macterm.c src/w32term.c src/xterm.c
diffstat 4 files changed, 39 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispextern.h	Fri Mar 21 21:47:09 2003 +0000
+++ b/src/dispextern.h	Fri Mar 21 21:47:46 2003 +0000
@@ -2258,13 +2258,15 @@
   void (*clear_frame_area) P_ ((struct frame *f, int x, int y,
 				int width, int height));
 
-/* Draw specified cursor NEW_CURSOR_TYPE of width NEW_CURSOR_WIDTH
-   at row GLYPH_ROW on window W.  */
+/* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH
+   at row GLYPH_ROW on window W if ON_P is 1.  If ON_P is
+   0, don't draw cursor.  If ACTIVE_P is 1, system caret
+   should track this cursor (when applicable).  */
   void (*draw_window_cursor) P_ ((struct window *w,
 				  struct glyph_row *glyph_row,
-				  int on, int x, int y,
-				  int new_cursor_type,
-				  int new_cursor_width));
+				  int x, int y,
+				  int cursor_type, int cursor_width,
+				  int on_p, int active_p));
 
 /* Draw vertical border for window W from (X,Y0) to (X,Y1).  */
   void (*draw_vertical_window_border) P_ ((struct window *w,
--- a/src/macterm.c	Fri Mar 21 21:47:09 2003 +0000
+++ b/src/macterm.c	Fri Mar 21 21:47:46 2003 +0000
@@ -4648,19 +4648,20 @@
 /* RIF: Draw cursor on window W.  */
 
 static void
-mac_draw_window_cursor (w, glyph_row, on, x, y, new_cursor_type, new_cursor_width)
+mac_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p)
      struct window *w;
      struct glyph_row *glyph_row;
-     int on, x, y;
-     int new_cursor_type, new_cursor_width;
-{
-  if (on)
-    {
-      w->phys_cursor_type = new_cursor_type;
-      w->phys_cursor_width = new_cursor_width;
+     int x, y;
+     int cursor_type, cursor_width;
+     int on_p, active_p;
+{
+  if (on_p)
+    {
+      w->phys_cursor_type = cursor_type;
+      w->phys_cursor_width = cursor_width;
       w->phys_cursor_on_p = 1;
 
-      switch (new_cursor_type)
+      switch (cursor_type)
 	{
 	case HOLLOW_BOX_CURSOR:
 	  x_draw_hollow_cursor (w, glyph_row);
@@ -4673,7 +4674,7 @@
 	case HBAR_CURSOR:
 	  /* TODO.  For now, just draw bar cursor. */
 	case BAR_CURSOR:
-	  x_draw_bar_cursor (w, glyph_row, new_cursor_width);
+	  x_draw_bar_cursor (w, glyph_row, cursor_width);
 	  break;
 
 	case NO_CURSOR:
--- a/src/w32term.c	Fri Mar 21 21:47:09 2003 +0000
+++ b/src/w32term.c	Fri Mar 21 21:47:46 2003 +0000
@@ -5160,13 +5160,14 @@
 /* RIF: Draw or clear cursor on window W.  */
 
 static void
-w32_draw_window_cursor (w, glyph_row, on, x, y, new_cursor_type, new_cursor_width)
+w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p)
      struct window *w;
      struct glyph_row *glyph_row;
-     int on, x, y;
-     int new_cursor_type, new_cursor_width;
+     int x, y;
+     int cursor_type, cursor_width;
+     int on_p, active_p;
 {
-  if (on)
+  if (on_p)
     {
       /* If the user wants to use the system caret, make sure our own
 	 cursor remains invisible.  */
@@ -5175,12 +5176,12 @@
 	  if (w->phys_cursor_type != NO_CURSOR)
 	    erase_phys_cursor (w);
 
-	  new_cursor_type = w->phys_cursor_type = NO_CURSOR;
+	  cursor_type = w->phys_cursor_type = NO_CURSOR;
 	  w->phys_cursor_width = -1;
 	}
       else
 	{
-	  w->phys_cursor_type = new_cursor_type;
+	  w->phys_cursor_type = cursor_type;
 	}
 
       w->phys_cursor_on_p = 1;
@@ -5188,7 +5189,7 @@
       /* If this is the active cursor, we need to track it with the
 	 system caret, so third party software like screen magnifiers
 	 and speech synthesizers can follow the cursor.  */
-      if (active_cursor)
+      if (active_p)
 	{
 	  HWND hwnd = FRAME_W32_WINDOW (f);
 
@@ -5210,7 +5211,7 @@
 	  PostMessage (hwnd, WM_EMACS_TRACK_CARET, 0, 0);
 	}
 
-      switch (new_cursor_type)
+      switch (cursor_type)
 	{
 	case HOLLOW_BOX_CURSOR:
 	  x_draw_hollow_cursor (w, glyph_row);
@@ -5221,11 +5222,11 @@
 	  break;
 
 	case BAR_CURSOR:
-	  x_draw_bar_cursor (w, glyph_row, new_cursor_width, BAR_CURSOR);
+	  x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
 	  break;
 
 	case HBAR_CURSOR:
-	  x_draw_bar_cursor (w, glyph_row, new_cursor_width, HBAR_CURSOR);
+	  x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
 	  break;
 
 	case NO_CURSOR:
--- a/src/xterm.c	Fri Mar 21 21:47:09 2003 +0000
+++ b/src/xterm.c	Fri Mar 21 21:47:46 2003 +0000
@@ -7500,20 +7500,21 @@
 /* RIF: Draw cursor on window W.  */
 
 static void
-x_draw_window_cursor (w, glyph_row, on, x, y, new_cursor_type, new_cursor_width)
+x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p)
      struct window *w;
      struct glyph_row *glyph_row;
-     int on, x, y;
-     int new_cursor_type, new_cursor_width;
+     int x, y;
+     int cursor_type, cursor_width;
+     int on_p, active_p;
 {
   struct frame *f = XFRAME (WINDOW_FRAME (w));
 
-  if (on)
-    {
-      w->phys_cursor_type = new_cursor_type;
+  if (on_p)
+    {
+      w->phys_cursor_type = cursor_type;
       w->phys_cursor_on_p = 1;
 
-      switch (new_cursor_type)
+      switch (cursor_type)
 	{
 	case HOLLOW_BOX_CURSOR:
 	  x_draw_hollow_cursor (w, glyph_row);
@@ -7524,11 +7525,11 @@
 	  break;
 
 	case BAR_CURSOR:
-	  x_draw_bar_cursor (w, glyph_row, new_cursor_width, BAR_CURSOR);
+	  x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
 	  break;
 
 	case HBAR_CURSOR:
-	  x_draw_bar_cursor (w, glyph_row, new_cursor_width, HBAR_CURSOR);
+	  x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
 	  break;
 
 	case NO_CURSOR: