emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/nsterm.m,v


From: Adrian Robert
Subject: [Emacs-diffs] Changes to emacs/src/nsterm.m,v
Date: Fri, 01 Aug 2008 11:48:31 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Adrian Robert <arobert> 08/08/01 11:48:29

Index: src/nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- src/nsterm.m        28 Jul 2008 01:41:57 -0000      1.17
+++ src/nsterm.m        1 Aug 2008 11:48:28 -0000       1.18
@@ -2313,7 +2313,7 @@
   r.size.height = h;
   r.size.width = w->phys_cursor_width;
 
-  /* PENDING: if we overwrite the internal border area, it does not get erased;
+  /* FIXME: if we overwrite the internal border area, it does not get erased;
      fix by truncating cursor, but better would be to erase properly */
   overspill = r.origin.x + r.size.width -
     WINDOW_TEXT_TO_FRAME_PIXEL_X (w, WINDOW_BOX_RIGHT_EDGE_X (w) 
@@ -2321,13 +2321,13 @@
   if (overspill > 0)
     r.size.width -= overspill;
 
-  /* PENDING: 23: use emacs stored f->cursor_type instead of ns-specific */
+  /* TODO: 23: use emacs stored f->cursor_type instead of ns-specific */
   oldCursorType = FRAME_CURSOR (f);
   cursorType = FRAME_CURSOR (f) = FRAME_NEW_CURSOR (f);
   f->output_data.ns->current_cursor_color
     = f->output_data.ns->desired_cursor_color;
 
-  /* PENDING: only needed in rare cases with last-resort font in HELLO..
+  /* TODO: only needed in rare cases with last-resort font in HELLO..
      should we do this more efficiently? */
   ns_clip_to_row (w, glyph_row, -1, NULL);
 /*  ns_focus (f, &r, 1); */
@@ -2434,6 +2434,8 @@
   if (!hourglass_shown_p)
     return;
 
+  BLOCK_INPUT;
+
   /* TODO: remove NSProgressIndicator from all frames */
 
   hourglass_shown_p = 0;
@@ -3822,37 +3824,37 @@
     ns_selection_color = NS_SELECTION_COLOR_DEFAULT;
 
   {
-    id cl;
-    Lisp_Object tem, tem1;
-    extern Lisp_Object Vsource_directory;
-
-    cl = [NSColorList colorListNamed: @"Emacs"];
+    NSColorList *cl = [NSColorList colorListNamed: @"Emacs"];
 
     if ( cl == nil )
       {
-        /* first try data_dir, then invocation-dir
-           and finally source-directory/etc */
-        tem1 = tem
-         = Fexpand_file_name (build_string ("Emacs.clr"), Vdata_directory);
-        if (NILP (Ffile_exists_p (tem)))
-          {
-            tem = Fexpand_file_name (build_string ("Emacs.clr"),
-                                     Vinvocation_directory);
-            if (NILP (Ffile_exists_p (tem)))
-              {
-                Lisp_Object newdir
-                 = Fexpand_file_name (build_string ("etc/"),
-                                      Vsource_directory);
-                tem = Fexpand_file_name (build_string ("Emacs.clr"),
-                                         newdir);
+        Lisp_Object color_file, color_map, color;
+        int r,g,b;
+        unsigned long c;
+        char *name;
+
+        color_file = Fexpand_file_name (build_string ("rgb.txt"),
+                         Fsymbol_value (intern ("data-directory")));
+        if (NILP (Ffile_readable_p (color_file)))
+          fatal ("Could not find %s.\n", SDATA (color_file));
+
+        color_map = Fx_load_color_file (color_file);
+        if (NILP (color_map))
+          fatal ("Could not read %s.\n", SDATA (color_file));
+
+        cl = [[NSColorList alloc] initWithName: @"Emacs"];
+        for ( ; CONSP (color_map); color_map = XCDR (color_map))
+          {
+            color = XCAR (color_map);
+            name = SDATA (XCAR (color));
+            c = XINT (XCDR (color));
+            [cl setColor:
+                  [NSColor colorWithCalibratedRed: RED_FROM_ULONG (c) / 255.0
+                                            green: GREEN_FROM_ULONG (c) / 255.0
+                                             blue: BLUE_FROM_ULONG (c) / 255.0
+                                            alpha: 1.0]
+                  forKey: [NSString stringWithUTF8String: name]];
               }
-          }
-
-        cl = [[NSColorList alloc]
-               initWithName: @"Emacs"
-                   fromFile: [NSString stringWithCString: SDATA (tem)]];
-        if (cl ==nil)
-          fatal ("Could not find %s.\n", SDATA (tem1));
         [cl writeToFile: nil];
       }
   }
@@ -6553,7 +6555,7 @@
   Qcontrol = intern ("control");
   Fput (Qcontrol, Qmodifier_value, make_number (ctrl_modifier));
 
-  /*PENDING: move to common code */
+  /* TODO: move to common code */
   DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
               doc: /* If not nil, Emacs uses toolkit scroll bars.  */);
 #ifdef USE_TOOLKIT_SCROLL_BARS
@@ -6586,7 +6588,7 @@
 
   /* Tell emacs about this window system. */
   Fprovide (intern ("ns"), Qnil);
-  /* PENDING: try to move this back into lisp,  ns-win.el loaded too late
+  /* TODO: try to move this back into lisp,  ns-win.el loaded too late
               right now */
   {
     Lisp_Object args[3] = { intern ("ns-version-string"), build_string ("9.0"),




reply via email to

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