diff src/nsfns.m @ 98458:5db459c2e438

* nsterm.h (ns_cursor_types, ns_output.desired_cursor_color)(ns_output.current_cursor, ns_output.desired_cursor) (ns_output.last_inactive, FRAME_CURSOR, FRAME_NEW_CURSOR) (FRAME_NEW_CURSOR_COLOR,): Remove. * nsfns.m (ns_set_cursor_color): Use FRAME_CURSOR_COLOR. (ns_lisp_to_cursor_type, ns_cursor_type_to_lisp): Use core emacs enumeration (HOLLOW_BOX_CURSOR, etc.). * nsterm.m (ns_frame_rehighlight): Remove commented code. (draw_window_cursor): Simplify code. (EmacsView-windowDidBecomeKey:,-windowDidResignKey:): Don't change cursor type. In latter, call rehighlight instead of doing updates manually. (EmacsPrefsController-setPanelFromValues,-setValuesFromPanel): Use core emacs cursor types. * xdisp.c (draw_glyphs): Don't call notice_overwritten_cursor() under NS.
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Thu, 02 Oct 2008 13:57:39 +0000
parents 6a64532bbc7b
children a3386be0b080
line wrap: on
line diff
--- a/src/nsfns.m	Thu Oct 02 08:04:54 2008 +0000
+++ b/src/nsfns.m	Thu Oct 02 13:57:39 2008 +0000
@@ -413,8 +413,6 @@
 }
 
 
-/* FIXME: adapt to generics */
-
 static void
 ns_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
@@ -426,8 +424,8 @@
       error ("Unknown color");
     }
 
-  [f->output_data.ns->desired_cursor_color release];
-  f->output_data.ns->desired_cursor_color = [col retain];
+  [FRAME_CURSOR_COLOR (f) release];
+  FRAME_CURSOR_COLOR (f) = [col retain];
 
   if (FRAME_VISIBLE_P (f))
     {
@@ -437,6 +435,7 @@
   update_face_from_frame_parameter (f, Qcursor_color, arg);
 }
 
+
 static void
 ns_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
@@ -906,11 +905,11 @@
   else if (XTYPE (arg) == Lisp_Symbol)
     str = SDATA (SYMBOL_NAME (arg));
   else return -1;
-  if (!strcmp (str, "box"))	 return filled_box;
-  if (!strcmp (str, "hollow"))	 return hollow_box;
-  if (!strcmp (str, "underscore")) return underscore;
-  if (!strcmp (str, "bar"))	 return bar;
-  if (!strcmp (str, "no"))	 return no_highlight;
+  if (!strcmp (str, "box"))	return FILLED_BOX_CURSOR;
+  if (!strcmp (str, "hollow"))	return HOLLOW_BOX_CURSOR;
+  if (!strcmp (str, "hbar"))	return HBAR_CURSOR;
+  if (!strcmp (str, "bar"))	return BAR_CURSOR;
+  if (!strcmp (str, "no"))	return NO_CURSOR;
   return -1;
 }
 
@@ -920,12 +919,12 @@
 {
   switch (arg)
     {
-    case filled_box: return Qbox;
-    case hollow_box: return intern ("hollow");
-    case underscore: return intern ("underscore");
-    case bar:	     return intern ("bar");
-    case no_highlight:
-    default:	     return intern ("no");
+    case FILLED_BOX_CURSOR: return Qbox;
+    case HOLLOW_BOX_CURSOR: return intern ("hollow");
+    case HBAR_CURSOR:	    return intern ("hbar");
+    case BAR_CURSOR:	    return intern ("bar");
+    case NO_CURSOR:
+    default:		    return intern ("no");
     }
 }