changeset 49371:c73ce11bb264

2003-01-21 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> * w32term.c (note_mode_line_highlight): Delete #if 0 to enable function w32_define_cursor. (note_mouse_highlight): Initialize, setup cursor accoding to mouse position, change member name output_data.x to output_data.w32 and add function w32_define_cursor. (show_mouse_face): Delete #if 0 to enable function w32_define_cursor and change member name output_data.x to output_data.w32. (w32_initialize_display_info): Setup dpyinfo->vertical_scroll_bar_cursor. 2003-01-21 David Ponce <david@dponce.com> * w32term.c (w32_encode_char): For DIM=1 charset, set ccl->reg[2] to -1 before calling ccl_driver. (Sync. with xterm.c x_encode_char change by Kenichi Handa <handa@m17n.org> on 2002-09-30. (w32_draw_relief_rect): Declare all args. (w32_define_cursor): New.
author Jason Rumney <jasonr@gnu.org>
date Tue, 21 Jan 2003 23:06:50 +0000
parents fdaa0f133d3f
children 7f36caf0f51a
files src/w32term.c
diffstat 1 files changed, 37 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Tue Jan 21 23:06:05 2003 +0000
+++ b/src/w32term.c	Tue Jan 21 23:06:50 2003 +0000
@@ -191,6 +191,7 @@
 extern void free_frame_menubar ();
 
 extern int w32_codepage_for_font (char *fontname);
+extern Cursor w32_load_cursor (LPCTSTR name);
 
 extern glyph_metric *w32_BDF_TextMetric(bdffont *fontp,
 					unsigned char *text, int dim);
@@ -369,6 +370,7 @@
 				 enum draw_glyphs_face));
 static int cursor_in_mouse_face_p P_ ((struct window *));
 static int clear_mouse_face P_ ((struct w32_display_info *));
+void w32_define_cursor P_ ((Window, Cursor));
 
 void x_lower_frame P_ ((struct frame *));
 void x_scroll_bar_clear P_ ((struct frame *));
@@ -1432,6 +1434,7 @@
 	{
 	  ccl->reg[0] = charset;
 	  ccl->reg[1] = BYTE2 (*char2b);
+	  ccl->reg[2] = -1;
 	}
       else
 	{
@@ -3730,7 +3733,7 @@
 w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
                       raised_p, left_p, right_p, clip_rect)
      struct frame *f;
-     int left_x, top_y, right_x, bottom_y, left_p, right_p, raised_p;
+     int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p;
      RECT *clip_rect;
 {
   int i;
@@ -6571,9 +6574,7 @@
 	    }
 	}
     }
-#if 0 /* TODO: mouse cursor */
-  XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
-#endif
+  w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
 }
 
 
@@ -6591,6 +6592,7 @@
   int portion;
   Lisp_Object window;
   struct window *w;
+  Cursor cursor = 0;
   struct buffer *b;
 
   /* When a menu is active, don't highlight because this looks odd. */
@@ -6646,12 +6648,12 @@
       note_mode_line_highlight (w, x, portion == 1);
       return;
     }
-#if 0 /* TODO: mouse cursor */
+
   if (portion == 2)
-    cursor = f->output_data.x->horizontal_drag_cursor;
+    cursor = f->output_data.w32->horizontal_drag_cursor;
   else
-    cursor = f->output_data.x->text_cursor;
-#endif
+    cursor = f->output_data.w32->text_cursor;
+
   /* Are we in a window whose display is up to date?
      And verify the buffer's text has not changed.  */
   b = XBUFFER (w->buffer);
@@ -6679,7 +6681,7 @@
 	  || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p)
 	{
 	  clear_mouse_face (dpyinfo);
-	  /* TODO: mouse cursor */
+	  cursor = f->output_data.w32->nontext_cursor;
 	  goto set_cursor;
 	}
 
@@ -6734,8 +6736,8 @@
 			 || hpos < dpyinfo->mouse_face_end_col
 			 || dpyinfo->mouse_face_past_end));
 
-      /* TODO: if (same_region)
-	 mouse cursor */
+      if (same_region)
+	cursor = 0;
 
       /* Check mouse-face highlighting.  */
       if (! same_region
@@ -6765,8 +6767,8 @@
 	  dpyinfo->mouse_face_overlay = overlay;
 
 	  /* Clear the display of the old active region, if any.  */
-	  clear_mouse_face (dpyinfo);
-	  /* TODO: mouse cursor changes.  */
+	  if (clear_mouse_face (dpyinfo))
+	    cursor = 0;
 
 	  /* If no overlay applies, get a text property.  */
 	  if (NILP (overlay))
@@ -6804,7 +6806,7 @@
 
 	      /* Display it as active.  */
 	      show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
-	      /* TODO: mouse cursor changes.  */
+	      cursor = 0;
 	    }
 	  /* Handle the text property case.  */
 	  else if (! NILP (mouse_face) && BUFFERP (object))
@@ -6847,7 +6849,7 @@
 
 	      /* Display it as active.  */
 	      show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
-	      /* TODO: mouse cursor changes.  */
+	      cursor = 0;
 	    }
 	  else if (!NILP (mouse_face) && STRINGP (object))
 	    {
@@ -6879,7 +6881,7 @@
 		= face_at_string_position (w, object, pos, 0, 0, 0, &ignore,
 					   glyph->face_id, 1);
 	      show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
-	      /* TODO: mouse cursor changes.  */
+	      cursor = 0;
 	    }
 	  else if (STRINGP (object) && NILP (mouse_face))
 	    {
@@ -6927,7 +6929,7 @@
 
 		  /* Display it as active.  */
 		  show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
-		  /* TODO: mouse cursor changes.  */
+		  cursor = 0;
 		}
 	    }
 	}
@@ -7007,8 +7009,8 @@
     }
 
  set_cursor:
-  /* TODO: mouse cursor changes. */
-  ;
+  if (cursor)
+    w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
 }
 
 static void
@@ -7021,6 +7023,13 @@
 			  HIWORD (last_mouse_motion_event.lParam));
 }
 
+void
+w32_define_cursor (window, cursor)
+     Window window;
+     Cursor cursor;
+{
+  PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
+}
 
 
 /***********************************************************************
@@ -7561,18 +7570,17 @@
 			  w->phys_cursor.x, w->phys_cursor.y);
     }
 
-#if 0 /* TODO: mouse cursor */
   /* Change the mouse cursor.  */
   if (draw == DRAW_NORMAL_TEXT)
-    XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-		   f->output_data.x->text_cursor);
+    w32_define_cursor (FRAME_W32_WINDOW (f),
+		       f->output_data.w32->text_cursor);
   else if (draw == DRAW_MOUSE_FACE)
-    XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-		   f->output_data.x->cross_cursor);
+    w32_define_cursor (FRAME_W32_WINDOW (f),
+		       f->output_data.w32->hand_cursor);
   else
-    XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-		   f->output_data.x->nontext_cursor);
-#endif
+    w32_define_cursor (FRAME_W32_WINDOW (f),
+		       f->output_data.w32->nontext_cursor);
+
 }
 
 /* Clear out the mouse-highlighted active region.
@@ -11065,6 +11073,8 @@
   dpyinfo->mouse_face_window = Qnil;
   dpyinfo->mouse_face_overlay = Qnil;
   dpyinfo->mouse_face_hidden = 0;
+
+  dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW);
   /* TODO: dpyinfo->gray */
 
 }