Author: fredkiefer
Date: Fri Apr  3 00:54:42 2015
New Revision: 38449

URL: http://svn.gna.org/viewcvs/gnustep?rev=38449&view=rev
Log:
        * Headers/AppKit/NSColor.h,
        * Source/NSColor.m: Add OSX 10 named colours.
        * Source/NSColorList.m: Add keyed coding/decoding.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Headers/AppKit/NSColor.h
    libs/gui/trunk/Source/NSColor.m
    libs/gui/trunk/Source/NSColorList.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38449&r1=38448&r2=38449&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Fri Apr  3 00:54:42 2015
@@ -1,3 +1,9 @@
+2015-04-03 Fred Kiefer <[email protected]>
+
+       * Headers/AppKit/NSColor.h,
+       * Source/NSColor.m: Add OSX 10 named colours.
+       * Source/NSColorList.m: Add keyed coding/decoding.
+
 2015-03-27 Fred Kiefer <[email protected]>
 
        * Source/NSSavePanel.m: Fix problem with the title shown in

Modified: libs/gui/trunk/Headers/AppKit/NSColor.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Headers/AppKit/NSColor.h?rev=38449&r1=38448&r2=38449&view=diff
==============================================================================
--- libs/gui/trunk/Headers/AppKit/NSColor.h     (original)
+++ libs/gui/trunk/Headers/AppKit/NSColor.h     Fri Apr  3 00:54:42 2015
@@ -256,6 +256,12 @@
 + (NSColor*) windowBackgroundColor;
 + (NSColor*) windowFrameColor;
 + (NSColor*) windowFrameTextColor;
+#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
++ (NSColor*) labelColor;
++ (NSColor*) secondaryLabelColor;
++ (NSColor*) tertiaryLabelColor;
++ (NSColor*) quaternaryLabelColor;
+#endif
 
 #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
 + (NSArray*) controlAlternatingRowBackgroundColors;

Modified: libs/gui/trunk/Source/NSColor.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSColor.m?rev=38449&r1=38448&r2=38449&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSColor.m     (original)
+++ libs/gui/trunk/Source/NSColor.m     Fri Apr  3 00:54:42 2015
@@ -203,12 +203,14 @@
   
   colorStrings = [[NSMutableDictionary alloc]
                     initWithObjectsAndKeys:
+                    black, @"alternateSelectedControlColor",
+                    white, @"alternateSelectedControlTextColor",
                     lightGray, @"controlBackgroundColor",
                     lightGray, @"controlColor",
+                    black, @"controlDarkShadowColor",
                     lightGray, @"controlHighlightColor",
                     white, @"controlLightHighlightColor",
                     darkGray, @"controlShadowColor",
-                    black, @"controlDarkShadowColor",
                     black, @"controlTextColor",
                     darkGray, @"disabledControlTextColor",
                     gray, @"gridColor",
@@ -217,7 +219,11 @@
                     white, @"highlightColor",
                     black, @"keyboardFocusIndicatorColor",
                     lightGray, @"knobColor",
+                    black, @"labelColor",
+                    black, @"quaternaryLabelColor",
                     gray, @"scrollBarColor",
+                    black, @"secondaryLabelColor",
+                    lightGray, @"secondarySelectedControlColor",
                     white, @"selectedControlColor",
                     black, @"selectedControlTextColor",
                     lightGray, @"selectedKnobColor",
@@ -226,18 +232,15 @@
                     lightGray, @"selectedTextBackgroundColor",
                     black, @"selectedTextColor",
                     black, @"shadowColor",
+                    black, @"tertiaryLabelColor",
                     white, @"textBackgroundColor",
                     black, @"textColor",
                     lightGray, @"windowBackgroundColor",
                     black, @"windowFrameColor",
                     white, @"windowFrameTextColor",
-                    black, @"alternateSelectedControlColor",
-                    white, @"alternateSelectedControlTextColor",
+
                     white, @"rowBackgroundColor",
                     lightGray, @"alternateRowBackgroundColor",
-                    lightGray, @"secondarySelectedControlColor",
-                    //gray, @"windowFrameColor",
-                    //black, @"windowFrameTextColor",
                     nil];
   
   systemColors = RETAIN([NSColorList colorListNamed: @"System"]);
@@ -487,8 +490,8 @@
 
 + (NSColor*) colorForControlTint: (NSControlTint)controlTint
 {
-       switch (controlTint)
-               {
+  switch (controlTint)
+    {
       default:
       case NSDefaultControlTint: 
         return [self colorForControlTint: [self currentControlTint]];
@@ -498,13 +501,13 @@
         // FIXME
       case NSBlueControlTint:
         return [NSColor blueColor];
-               }
+    }
 }
 
 + (NSControlTint) currentControlTint
 {
-       // FIXME: should be made a system setting
-       return NSBlueControlTint;
+  // FIXME: should be made a system setting
+  return NSBlueControlTint;
 }
 
 + (NSColor*) colorWithPatternImage: (NSImage*)image
@@ -740,6 +743,11 @@
   return systemColorWithName(@"controlColor");
 }
 
++ (NSColor*) controlDarkShadowColor
+{
+  return systemColorWithName(@"controlDarkShadowColor");
+}
+
 + (NSColor*) controlHighlightColor
 {
   return systemColorWithName(@"controlHighlightColor");
@@ -755,11 +763,6 @@
   return systemColorWithName(@"controlShadowColor");
 }
 
-+ (NSColor*) controlDarkShadowColor
-{
-  return systemColorWithName(@"controlDarkShadowColor");
-}
-
 + (NSColor*) controlTextColor
 {
   return systemColorWithName(@"controlTextColor");
@@ -800,11 +803,26 @@
   return systemColorWithName(@"knobColor");
 }
 
++ (NSColor*) labelColor
+{
+  return systemColorWithName(@"labelColor");
+}
+
++ (NSColor*) quaternaryLabelColor
+{
+  return systemColorWithName(@"quaternaryLabelColor");
+}
+
 + (NSColor*) scrollBarColor
 {
   return systemColorWithName(@"scrollBarColor");
 }
 
++ (NSColor*) secondaryLabelColor
+{
+  return systemColorWithName(@"secondaryLabelColor");
+}
+
 + (NSColor*) secondarySelectedControlColor
 {
   return systemColorWithName(@"secondarySelectedControlColor");
@@ -848,6 +866,11 @@
 + (NSColor*) shadowColor
 {
   return systemColorWithName(@"shadowColor");
+}
+
++ (NSColor*) tertiaryLabelColor
+{
+  return systemColorWithName(@"tertiaryLabelColor");
 }
 
 + (NSColor*) textBackgroundColor

Modified: libs/gui/trunk/Source/NSColorList.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSColorList.m?rev=38449&r1=38448&r2=38449&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSColorList.m (original)
+++ libs/gui/trunk/Source/NSColorList.m Fri Apr  3 00:54:42 2015
@@ -535,8 +535,20 @@
 {
   if ([aCoder allowsKeyedCoding])
     {
-      // FIXME
-    }
+      NSMutableArray *colors = [[NSMutableArray alloc] init];
+      NSInteger i;
+
+      for (i = 0; i < [_orderedColorKeys count]; i++)
+        {
+          NSString *name = [_orderedColorKeys objectAtIndex: i];
+          [colors insertObject: [_colorDictionary objectForKey: name]
+                       atIndex: i];
+        }
+      [aCoder encodeObject: _name forKey: @"NSName"];
+      [aCoder encodeObject: _orderedColorKeys forKey: @"NSKeys"];
+      [aCoder encodeObject: colors forKey: @"NSColors"];
+      RELEASE(colors);
+     }
   else
     {
       [aCoder encodeObject: _name];
@@ -549,7 +561,14 @@
 {
   if ([aDecoder allowsKeyedCoding])
     {
-      // FIXME
+      NSArray *colors;
+
+      ASSIGN(_name, [aDecoder decodeObjectForKey: @"NSName"]);
+      ASSIGN(_orderedColorKeys, [aDecoder decodeObjectForKey: @"NSKeys"]);
+      colors = [aDecoder decodeObjectForKey: @"NSColors"];
+      _colorDictionary = [[NSMutableDictionary alloc]
+                           initWithObjects: colors
+                                   forKeys: _orderedColorKeys];
     }
   else
     {


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to