emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog nsfont.m nsterm.m


From: Chong Yidong
Subject: [Emacs-diffs] emacs/src ChangeLog nsfont.m nsterm.m
Date: Sun, 26 Jul 2009 12:58:58 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/07/26 12:58:58

Modified files:
        src            : ChangeLog nsfont.m nsterm.m 

Log message:
        * nsfont.m (nsfont_draw): Revert 2009-07-15 change.
        
        * nsterm.m (ns_maybe_dumpglyphs_background): Revert 2009-07-15
        change.
        (ns_get_color): Revert 2009-07-16 change.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7667&r2=1.7668
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsfont.m?cvsroot=emacs&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsterm.m?cvsroot=emacs&r1=1.80&r2=1.81

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7667
retrieving revision 1.7668
diff -u -b -r1.7667 -r1.7668
--- ChangeLog   25 Jul 2009 08:50:51 -0000      1.7667
+++ ChangeLog   26 Jul 2009 12:58:56 -0000      1.7668
@@ -1,3 +1,11 @@
+2009-07-26  Chong Yidong  <address@hidden>
+
+       * nsfont.m (nsfont_draw): Revert 2009-07-15 change.
+
+       * nsterm.m (ns_maybe_dumpglyphs_background): Revert 2009-07-15
+       change.
+       (ns_get_color): Revert 2009-07-16 change.
+
 2009-07-25  Eli Zaretskii  <address@hidden>
 
        * lread.c (syms_of_lread) <force_load_messages>: New variable.

Index: nsfont.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsfont.m,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- nsfont.m    24 Jul 2009 15:43:24 -0000      1.31
+++ nsfont.m    26 Jul 2009 12:58:57 -0000      1.32
@@ -1097,19 +1097,15 @@
           br.size.width -= 2*correction;
         }
 
-#if 0
       if (!s->face->stipple)
-#endif
         [(NS_FACE_BACKGROUND (face) != 0
           ? ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f)
           : FRAME_BACKGROUND_COLOR (s->f)) set];
-#if 0                          /* This is tiling, not stippling.  */
       else
         {
           struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (s->f);
           [[dpyinfo->bitmaps[face->stipple-1].img stippleMask] set];
         }
-#endif
       NSRectFill (br);
     }
 

Index: nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- nsterm.m    23 Jul 2009 13:21:48 -0000      1.80
+++ nsterm.m    26 Jul 2009 12:58:57 -0000      1.81
@@ -1348,11 +1348,15 @@
 /* --------------------------------------------------------------------------
 /* On *Step, we recognize several color formats, in addition to a catalog
    of colors found in the file Emacs.clr. Color formats include:
-   - #rrggbb where rr, gg, bb specify red, green and blue in hex. */
+   - #rrggbb or RGBrrggbb where rr, gg, bb specify red, green and blue in hex
+   - ARGBaarrggbb is similar, with aa being the alpha channel (FF = opaque)
+   - HSVhhssvv and AHSVaahhssvv (or HSB/AHSB) are similar for hue, saturation,
+     value;
+   - CMYKccmmyykk is similar for cyan, magenta, yellow, black. */
 {
   NSColor * new = nil;
   const char *hex = NULL;
-  enum { rgb } color_space;
+  enum { rgb, argb, hsv, ahsv, cmyk, gray } color_space;
   NSString *nsname = [NSString stringWithUTF8String: name];
 
 /*fprintf (stderr, "ns_get_color: '%s'\n", name); */
@@ -1377,11 +1381,46 @@
       return 0;
     }
 
+  /*  FIXME: emacs seems to downcase everything before passing it here,
+        which we can work around, except for GRAY, since gray##, where ## is
+        decimal between 0 and 99, is also an X11 colorname. */
   if (name[0] == '#')             /* X11 format */
     {
       hex = name + 1;
       color_space = rgb;
     }
+  else if (!memcmp (name, "RGB", 3) || !memcmp (name, "rgb", 3))
+    {
+      hex = name + 3;
+      color_space = rgb;
+    }
+  else if (!memcmp (name, "ARGB", 4) || !memcmp (name, "argb", 4))
+    {
+      hex = name + 4;
+      color_space = argb;
+    }
+  else if (!memcmp (name, "HSV", 3) || !memcmp (name, "hsv", 3) ||
+           !memcmp (name, "HSB", 3) || !memcmp (name, "hsb", 3))
+    {
+      hex = name + 3;
+      color_space = hsv;
+    }
+  else if (!memcmp (name, "AHSV", 4) || !memcmp (name, "ahsv", 4) ||
+           !memcmp (name, "AHSB", 4) || !memcmp (name, "ahsb", 4))
+    {
+      hex = name + 4;
+      color_space = ahsv;
+    }
+  else if (!memcmp (name, "CMYK", 4) || !memcmp (name, "cmyk", 4))
+    {
+      hex = name + 4;
+      color_space = cmyk;
+    }
+  else if (!memcmp (name, "GRAY", 4) /*|| !memcmp (name, "gray", 4)*/)
+    {
+      hex = name + 4;
+      color_space = gray;
+    }
 
   /* Direct colors (hex values) */
   if (hex)
@@ -1411,6 +1450,34 @@
                                                 blue: f4
                                                alpha: 1.0];
               break;
+            case argb:
+              *col = [NSColor colorWithCalibratedRed: f2
+                                               green: f3
+                                                blue: f4
+                                               alpha: f1];
+              break;
+            case hsv:
+              *col = [NSColor colorWithCalibratedHue: f2
+                                          saturation: f3
+                                          brightness: f4
+                                               alpha: 1.0];
+              break;
+            case ahsv:
+              *col = [NSColor colorWithCalibratedHue: f2
+                                          saturation: f3
+                                          brightness: f4
+                                               alpha: f1];
+              break;
+            case gray:
+              *col = [NSColor colorWithCalibratedWhite: f3 alpha: f4];
+              break;
+            case cmyk:
+              *col = [NSColor colorWithDeviceCyan: f1
+                                          magenta: f2
+                                           yellow: f3
+                                            black: f4
+                                            alpha: 1.0];
+              break;
             }
           *col = [*col colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
           UNBLOCK_INPUT;
@@ -2653,7 +2720,8 @@
     r = ns_fix_rect_ibw (r, FRAME_INTERNAL_BORDER_WIDTH (s->f),
                         FRAME_PIXEL_WIDTH (s->f));
 
-  /* TODO: Sometimes box_color is 0 and this seems wrong; should investigate. 
*/  if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color)
+  /* TODO: Sometimes box_color is 0 and this seems wrong; should investigate. 
*/
+  if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color)
     {
       ns_draw_box (r, abs (thickness),
                    ns_lookup_indexed_color (face->box_color, s->f),
@@ -2692,19 +2760,15 @@
             }
           else
             face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
-#if 0
           if (!face->stipple)
-#endif
             [(NS_FACE_BACKGROUND (face) != 0
               ? ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f)
               : FRAME_BACKGROUND_COLOR (s->f)) set];
-#if 0                          /* This is tiling, not stippling.  */
           else
             {
               struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (s->f);
               [[dpyinfo->bitmaps[face->stipple-1].img stippleMask] set];
             }
-#endif
 
           if (s->hl != DRAW_CURSOR)
             {




reply via email to

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