diff --git a/ChangeLog b/ChangeLog
index 3000de4e7..56ec044b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
+2006-10-15 Richard Frith-Macdonald
+ * FillStyleMatrix is provided for the use of theme editors wishing
+ * to display the tile.
*/
typedef enum {
- FillStyleNone, /** The image is not drawn */
- FillStyleScale, /** The image is scaled to fit */
- FillStyleRepeat, /** The image is tiled from bottom left */
- FillStyleCenter /** The image is tiled from the center */
+ GSThemeFillStyleNone, /** CM image is not drawn */
+ GSThemeFillStyleScale, /** CM image is scaled to fit */
+ GSThemeFillStyleRepeat, /** CM image is tiled from bottom left */
+ GSThemeFillStyleCenter, /** CM image is tiled from the center */
+ GSThemeFillStyleMatrix /** a matrix of nine separated images */
} GSThemeFillStyle;
@@ -349,9 +353,11 @@ APPKIT_EXPORT NSString *GSThemeDidDeactivateNotification;
* The GUI library uses this internally to handling tiling of image
* information to draw user interface elements. The tile information
* returned by this method can be passed to the
- * -fillRect:withTiles:background:fillStyle: method.
+ * -fillRect:withTiles:background:fillStyle: method.
+ * The useCache argument controls whether the information is retrieved
+ * from cache or regenerated from information in the theme bundle.
*/
-- (GSDrawTiles*) tilesNamed: (NSString*)aName;
+- (GSDrawTiles*) tilesNamed: (NSString*)aName cache: (BOOL)useCache;
@end
/**
diff --git a/Source/GSGormLoader.m b/Source/GSGormLoader.m
index 8d557ef90..1b29f9467 100644
--- a/Source/GSGormLoader.m
+++ b/Source/GSGormLoader.m
@@ -135,7 +135,7 @@
withZone: zone];
// report a problem if there is one.
- if(loaded == NO)
+ if (loaded == NO)
{
NSLog(@"Could not load Gorm file: %@",fileName);
}
diff --git a/Source/GSHbox.m b/Source/GSHbox.m
index ba670a695..748589efa 100644
--- a/Source/GSHbox.m
+++ b/Source/GSHbox.m
@@ -160,7 +160,7 @@ enablingXResizing: (BOOL)aFlag
-(void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
- if([aCoder allowsKeyedCoding])
+ if ([aCoder allowsKeyedCoding])
{
[aCoder encodeBool: _haveViews forKey: @"GSHaveViews"];
[aCoder encodeFloat: _defaultMinXMargin forKey: @"GSDefaultMinXMargin"];
@@ -175,7 +175,7 @@ enablingXResizing: (BOOL)aFlag
-(id) initWithCoder: (NSCoder*)aDecoder
{
[super initWithCoder: aDecoder];
- if([aDecoder allowsKeyedCoding])
+ if ([aDecoder allowsKeyedCoding])
{
_haveViews = [aDecoder decodeBoolForKey: @"GSHaveViews"];
_defaultMinXMargin = [aDecoder decodeFloatForKey: @"GSDefaultMinXMargin"];
diff --git a/Source/GSModelLoaderFactory.m b/Source/GSModelLoaderFactory.m
index 86caf43da..038cdbe09 100644
--- a/Source/GSModelLoaderFactory.m
+++ b/Source/GSModelLoaderFactory.m
@@ -63,11 +63,11 @@
{
NSComparisonResult result = NSOrderedSame;
- if([self priority] < [loader priority])
+ if ([self priority] < [loader priority])
{
result = NSOrderedAscending;
}
- if([self priority] > [loader priority])
+ if ([self priority] > [loader priority])
{
result = NSOrderedDescending;
}
@@ -85,7 +85,7 @@ static NSMutableDictionary *_modelMap = nil;
NSEnumerator *en = [classes objectEnumerator];
Class cls = nil;
- while((cls = [en nextObject]) != nil)
+ while ((cls = [en nextObject]) != nil)
{
[self registerModelLoaderClass: cls];
}
@@ -93,7 +93,7 @@ static NSMutableDictionary *_modelMap = nil;
+ (void) registerModelLoaderClass: (Class)aClass
{
- if(_modelMap == nil)
+ if (_modelMap == nil)
{
_modelMap = [[NSMutableDictionary alloc] initWithCapacity: 5];
}
@@ -112,7 +112,7 @@ static NSMutableDictionary *_modelMap = nil;
NSFileManager *mgr = [NSFileManager defaultManager];
NSString *ext = [modelPath pathExtension];
- if([ext isEqual: @""])
+ if ([ext isEqual: @""])
{
NSArray *objectArray = [_modelMap allValues];
NSArray *sortedArray = [objectArray sortedArrayUsingSelector:
@@ -120,11 +120,11 @@ static NSMutableDictionary *_modelMap = nil;
NSEnumerator *oen = [sortedArray objectEnumerator];
Class cls = nil;
- while((cls = [oen nextObject]) != nil && result == NO)
+ while ((cls = [oen nextObject]) != nil && result == NO)
{
NSString *path = [modelPath stringByAppendingPathExtension:
(NSString *)[cls type]];
- if([mgr isReadableFileAtPath: path])
+ if ([mgr isReadableFileAtPath: path])
{
result = path;
}
@@ -132,9 +132,9 @@ static NSMutableDictionary *_modelMap = nil;
}
else
{
- if([_modelMap objectForKey: ext] != nil)
+ if ([_modelMap objectForKey: ext] != nil)
{
- if([mgr isReadableFileAtPath: modelPath])
+ if ([mgr isReadableFileAtPath: modelPath])
{
result = modelPath;
}
@@ -149,7 +149,7 @@ static NSMutableDictionary *_modelMap = nil;
Class aClass = [GSModelLoaderFactory classForType: type];
GSModelLoader *loader = nil;
- if(aClass != nil)
+ if (aClass != nil)
{
loader = AUTORELEASE([[aClass alloc] init]);
}
@@ -167,7 +167,7 @@ static NSMutableDictionary *_modelMap = nil;
NSString *path = [GSModelLoaderFactory supportedModelFileAtPath: modelPath];
GSModelLoader *result = nil;
- if(path != nil)
+ if (path != nil)
{
NSString *ext = [path pathExtension];
result = [self modelLoaderForFileType: ext];
diff --git a/Source/GSNibCompatibility.m b/Source/GSNibCompatibility.m
index 5ea847391..d67ef7a2a 100644
--- a/Source/GSNibCompatibility.m
+++ b/Source/GSNibCompatibility.m
@@ -70,9 +70,9 @@ static BOOL _isInInterfaceBuilder = NO;
{
NSEnumerator *en = [[self subviews] objectEnumerator];
id v = nil;
- while((v = [en nextObject]) != nil)
+ while ((v = [en nextObject]) != nil)
{
- if([v window] != [self window] ||
+ if ([v window] != [self window] ||
[v superview] != self)
{
[v _setWindow: [self window]];
@@ -113,9 +113,9 @@ static BOOL _isInInterfaceBuilder = NO;
wantsToBeColor: (BOOL) wantsToBeColor
autoPositionMask: (int) autoPositionMask
{
- if((self = [super init]) != nil)
+ if ((self = [super init]) != nil)
{
- if(window != nil)
+ if (window != nil)
{
// object members
ASSIGN(_title, [window title]);
@@ -163,7 +163,7 @@ static BOOL _isInInterfaceBuilder = NO;
{
_windowStyle = [coder decodeIntForKey: @"NSWindowStyleMask"];
}
- if([coder containsValueForKey: @"NSWindowBacking"])
+ if ([coder containsValueForKey: @"NSWindowBacking"])
{
_backingStoreType = [coder decodeIntForKey: @"NSWindowBacking"];
}
@@ -234,13 +234,13 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) nibInstantiate
{
- if(_realObject == nil)
+ if (_realObject == nil)
{
Class aClass;
NSEnumerator *en;
id v = nil;
- if([NSClassSwapper isInInterfaceBuilder])
+ if ([NSClassSwapper isInInterfaceBuilder])
{
aClass = [self baseWindowClass];
}
@@ -290,9 +290,9 @@ static BOOL _isInInterfaceBuilder = NO;
// swap out any views which need to be swapped...
en = [[[_realObject contentView] subviews] objectEnumerator];
- while((v = [en nextObject]) != nil)
+ while ((v = [en nextObject]) != nil)
{
- if([v respondsToSelector: @selector(nibInstantiate)])
+ if ([v respondsToSelector: @selector(nibInstantiate)])
{
[v nibInstantiate];
}
@@ -436,9 +436,9 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithCoder: (NSCoder *)coder
{
self = [super initWithCoder: coder];
- if(self != nil)
+ if (self != nil)
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
_className = [coder decodeObjectForKey: @"NSClassName"];
}
@@ -454,7 +454,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (void) encodeWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
[coder encodeObject: (id)_className forKey: @"NSClassName"];
}
@@ -462,10 +462,10 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) nibInstantiate
{
- if(_realObject == nil)
+ if (_realObject == nil)
{
Class aClass = NSClassFromString(_className);
- if(aClass == nil)
+ if (aClass == nil)
{
[NSException raise: NSInternalInconsistencyException
format: @"Unable to find class '%@'", _className];
@@ -520,10 +520,10 @@ static BOOL _isInInterfaceBuilder = NO;
- (id)nibInstantiate
{
- if(_realObject == nil)
+ if (_realObject == nil)
{
Class aClass = NSClassFromString(_className);
- if(aClass == nil)
+ if (aClass == nil)
{
[NSException raise: NSInternalInconsistencyException
format: @"Unable to find class '%@'", _className];
@@ -612,7 +612,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]);
@@ -628,7 +628,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (void) encodeWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
[coder encodeObject: (id)_className forKey: @"NSClassName"];
[coder encodeConditionalObject: (id)_extension forKey: @"NSExtension"];
@@ -644,11 +644,11 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) nibInstantiate
{
- if(_object == nil)
+ if (_object == nil)
{
Class aClass;
- if([NSClassSwapper isInInterfaceBuilder])
+ if ([NSClassSwapper isInInterfaceBuilder])
{
aClass = [self class];
}
@@ -657,7 +657,7 @@ static BOOL _isInInterfaceBuilder = NO;
aClass = NSClassFromString(_className);
}
- if(aClass == nil)
+ if (aClass == nil)
{
[NSException raise: NSInternalInconsistencyException
format: @"Unable to find class '%@'", _className];
@@ -698,11 +698,11 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) nibInstantiate
{
- if(_view == nil)
+ if (_view == nil)
{
Class aClass;
- if([NSClassSwapper isInInterfaceBuilder])
+ if ([NSClassSwapper isInInterfaceBuilder])
{
aClass = [self class];
}
@@ -711,7 +711,7 @@ static BOOL _isInInterfaceBuilder = NO;
aClass = NSClassFromString(_className);
}
- if(aClass == nil)
+ if (aClass == nil)
{
[NSException raise: NSInternalInconsistencyException
format: @"Unable to find class '%@'", _className];
@@ -731,9 +731,9 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithCoder: (NSCoder *)coder
{
self = [super initWithCoder: coder];
- if(self != nil)
+ if (self != nil)
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]);
@@ -751,7 +751,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (void) encodeWithCoder: (NSCoder *)coder
{
[super encodeWithCoder: coder];
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
[coder encodeObject: _className forKey: @"NSClassName"];
[coder encodeObject: _extension forKey: @"NSExtension"];
@@ -794,23 +794,23 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithCoder: (NSCoder *)coder
{
id realObject = nil;
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
ASSIGN(_resourceName, [coder decodeObjectForKey: @"NSResourceName"]);
// this is a hack, but for now it should do.
- if([_className isEqual: @"NSSound"])
+ if ([_className isEqual: @"NSSound"])
{
realObject = RETAIN([NSSound soundNamed: _resourceName]);
}
- else if([_className isEqual: @"NSImage"])
+ else if ([_className isEqual: @"NSImage"])
{
realObject = RETAIN([NSImage imageNamed: _resourceName]);
}
// if an object has been substituted, then release the placeholder.
- if(realObject != nil)
+ if (realObject != nil)
{
RELEASE(self);
}
@@ -827,7 +827,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (void) encodeWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
[coder encodeObject: (id)_className forKey: @"NSClassName"];
[coder encodeObject: (id)_resourceName forKey: @"NSResourceName"];
@@ -845,14 +845,14 @@ static BOOL _isInInterfaceBuilder = NO;
{
unsigned int i = 0;
unsigned int count = GSIArrayCount(_objMap);
- for(i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
{
id obj = GSIArrayItemAtIndex(_objMap, i).obj;
- if(obj == oldObj)
+ if (obj == oldObj)
break;
}
- if(i < count)
+ if (i < count)
{
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)newObj, i);
return YES;
@@ -872,7 +872,7 @@ static BOOL _isInInterfaceBuilder = NO;
withClassName: (NSString *)className
originalClassName: (NSString *)origClassName
{
- if((self = [super init]) != nil)
+ if ((self = [super init]) != nil)
{
[self setTemplate: object];
[self setClassName: className];
@@ -930,12 +930,12 @@ static BOOL _isInInterfaceBuilder = NO;
Class origCellClass = nil;
// if there is a replacement class, use it, otherwise, use the one specified.
- if((aClass = [(NSKeyedUnarchiver *)coder classForClassName: className]) == nil)
+ if ((aClass = [(NSKeyedUnarchiver *)coder classForClassName: className]) == nil)
{
aClass = NSClassFromString(className);
}
- if(aClass == nil)
+ if (aClass == nil)
{
[NSException raise: NSInternalInconsistencyException
format: @"NSClassSwapper unable to find class '%@'", className];
@@ -943,7 +943,7 @@ static BOOL _isInInterfaceBuilder = NO;
// if this is a class which uses cells, override with the new cellClass, if the
// subclass responds to cellClass.
- if([aClass respondsToSelector: @selector(cellClass)] &&
+ if ([aClass respondsToSelector: @selector(cellClass)] &&
[className isEqualToString: _originalClassName] == NO)
{
Class origClass = NSClassFromString(_originalClassName);
@@ -958,12 +958,12 @@ static BOOL _isInInterfaceBuilder = NO;
object = [aClass allocWithZone: NSDefaultMallocZone()];
[(NSKeyedUnarchiver *)coder replaceObject: self withObject: object];
[self setTemplate: [object initWithCoder: coder]];
- if(object != _template)
+ if (object != _template)
{
[(NSKeyedUnarchiver *)coder replaceObject: object withObject: _template];
}
- if(newCellClass != nil && origCellClass != nil)
+ if (newCellClass != nil && origCellClass != nil)
{
[(NSKeyedUnarchiver *)coder setClass: origCellClass forClassName: nil];
}
@@ -971,13 +971,13 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
ASSIGN(_originalClassName, [coder decodeObjectForKey: @"NSOriginalClassName"]);
// build the real object...
- if([NSClassSwapper isInInterfaceBuilder] == YES)
+ if ([NSClassSwapper isInInterfaceBuilder] == YES)
{
[self instantiateRealObject: coder withClassName: _originalClassName];
}
@@ -998,7 +998,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (void) encodeWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
[coder encodeObject: _originalClassName forKey: @"NSOriginalClassName"];
[coder encodeObject: _className forKey: @"NSClassName"];
@@ -1032,7 +1032,7 @@ static BOOL _isInInterfaceBuilder = NO;
NSRange colonRange = [_tag rangeOfString: @":"];
unsigned int location = colonRange.location;
- if(location == NSNotFound)
+ if (location == NSNotFound)
{
NSString *newTag = [NSString stringWithFormat: @"%@:",_tag];
[self setLabel: (id)newTag];
@@ -1046,10 +1046,10 @@ static BOOL _isInInterfaceBuilder = NO;
- (id)instantiateObject: (id)obj
{
id newObject = obj;
- if([obj respondsToSelector: @selector(nibInstantiate)])
+ if ([obj respondsToSelector: @selector(nibInstantiate)])
{
newObject = [obj nibInstantiate];
- if([newObject respondsToSelector: @selector(awakeFromNib)])
+ if ([newObject respondsToSelector: @selector(awakeFromNib)])
{
// awaken the object.
[newObject awakeFromNib];
@@ -1074,9 +1074,9 @@ static BOOL _isInInterfaceBuilder = NO;
[_root setObject: owner];
// iterate over connections, instantiate, and then establish them.
- while((obj = [en nextObject]) != nil)
+ while ((obj = [en nextObject]) != nil)
{
- if([obj respondsToSelector: @selector(instantiateWithInstantiator:)])
+ if ([obj respondsToSelector: @selector(instantiateWithInstantiator:)])
{
[obj instantiateWithInstantiator: self];
[obj establishConnection];
@@ -1085,11 +1085,11 @@ static BOOL _isInInterfaceBuilder = NO;
// instantiate all windows and fill in the top level array.
en = [objs objectEnumerator];
- while((obj = [en nextObject]) != nil)
+ while ((obj = [en nextObject]) != nil)
{
- if([obj isKindOfClass: [NSWindowTemplate class]])
+ if ([obj isKindOfClass: [NSWindowTemplate class]])
{
- if([obj realObject] == nil)
+ if ([obj realObject] == nil)
{
id o = [self instantiateObject: obj];
[topLevelObjects addObject: o];
@@ -1098,7 +1098,7 @@ static BOOL _isInInterfaceBuilder = NO;
else
{
id v = NSMapGet(_objects, obj);
- if(v == nil || v == owner)
+ if (v == nil || v == owner)
{
[topLevelObjects addObject: obj];
}
@@ -1107,7 +1107,7 @@ static BOOL _isInInterfaceBuilder = NO;
// bring visible windows to front...
en = [_visibleWindows objectEnumerator];
- while((obj = [en nextObject]) != nil)
+ while ((obj = [en nextObject]) != nil)
{
id w = [obj realObject];
[w orderFront: self];
@@ -1115,7 +1115,7 @@ static BOOL _isInInterfaceBuilder = NO;
// add the menu...
menu = [self objectForName: @"MainMenu"];
- if(menu != nil)
+ if (menu != nil)
{
menu = [self instantiateObject: menu];
[NSApp setMainMenu: menu];
@@ -1176,7 +1176,7 @@ static BOOL _isInInterfaceBuilder = NO;
int i = [nameValues indexOfObject: name];
id result = nil;
- if(i != NSNotFound)
+ if (i != NSNotFound)
{
result = [nameKeys objectAtIndex: i];
}
@@ -1201,7 +1201,7 @@ static BOOL _isInInterfaceBuilder = NO;
NSMutableArray *result = [NSMutableArray array];
NSEnumerator *en = [keys objectEnumerator];
id key = nil;
- while((key = [en nextObject]) != nil)
+ while ((key = [en nextObject]) != nil)
{
id value = (id)NSMapGet(map,key);
[result addObject: value];
@@ -1211,7 +1211,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (void) encodeWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
NSArray *accessibilityOidsKeys = (NSArray *)NSAllMapTableKeys(_accessibilityOids);
NSArray *accessibilityOidsValues = [self _valuesForKeys: accessibilityOidsKeys inMap: _accessibilityOids];
@@ -1261,7 +1261,7 @@ static BOOL _isInInterfaceBuilder = NO;
id key = nil;
id value = nil;
- while((key = [ken nextObject]) != nil && (value = [ven nextObject]) != nil)
+ while ((key = [ken nextObject]) != nil && (value = [ven nextObject]) != nil)
{
NSMapInsert(mapTable, key, value);
}
@@ -1269,7 +1269,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
ASSIGN(_root, [coder decodeObjectForKey: @"NSRoot"]);
ASSIGN(_visibleWindows, (NSMutableArray *)[coder decodeObjectForKey: @"NSVisibleWindows"]);
@@ -1347,7 +1347,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) init
{
- if((self = [super init]) != nil)
+ if ((self = [super init]) != nil)
{
// instantiate the maps..
_objects = NSCreateMapTable(NSObjectMapKeyCallBacks,
@@ -1417,7 +1417,7 @@ static BOOL _isInInterfaceBuilder = NO;
@implementation NSButtonImageSource
- (id) initWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
ASSIGN(imageName, [coder decodeObjectForKey: @"NSImageName"]);
}
@@ -1434,7 +1434,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (void) encodeWithCoder: (NSCoder *)coder
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
[coder encodeObject: imageName forKey: @"NSImageName"];
}
@@ -1448,7 +1448,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithImageNamed: (NSString *)name
{
- if((self = [super init]) != nil)
+ if ((self = [super init]) != nil)
{
ASSIGN(imageName,name);
}
@@ -1470,7 +1470,7 @@ static BOOL _isInInterfaceBuilder = NO;
@implementation NSIBHelpConnector
- (id) init
{
- if((self = [super init]) != nil)
+ if ((self = [super init]) != nil)
{
_file = nil;
_marker = @"NSToolTipHelpKey";
@@ -1480,15 +1480,15 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithCoder: (NSCoder *)coder
{
- if((self = [super initWithCoder: coder]) != nil)
+ if ((self = [super initWithCoder: coder]) != nil)
{
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
- if([coder containsValueForKey: @"NSFile"])
+ if ([coder containsValueForKey: @"NSFile"])
{
_file = RETAIN([coder decodeObjectForKey: @"NSFile"]);
}
- if([coder containsValueForKey: @"NSMarker"])
+ if ([coder containsValueForKey: @"NSMarker"])
{
_marker = RETAIN([coder decodeObjectForKey: @"NSMarker"]);
}
@@ -1505,13 +1505,13 @@ static BOOL _isInInterfaceBuilder = NO;
- (void) encodeWithCoder: (NSCoder *)coder
{
[super encodeWithCoder: coder];
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
- if(_file != nil)
+ if (_file != nil)
{
[coder encodeObject: _file forKey: @"NSFile"];
}
- if(_marker != nil)
+ if (_marker != nil)
{
[coder encodeObject: _file forKey: @"NSMarker"];
}
@@ -1556,7 +1556,7 @@ static BOOL _isInInterfaceBuilder = NO;
- (id) initWithCoder: (NSCoder *)coder
{
NSDecimalNumber *dn = nil;
- if([coder allowsKeyedCoding])
+ if ([coder allowsKeyedCoding])
{
unsigned int len = 0;
short exponent = (short)[coder decodeIntForKey: @"NS.exponent"];
diff --git a/Source/GSNibLoader.m b/Source/GSNibLoader.m
index fa3489172..94ae28d3c 100644
--- a/Source/GSNibLoader.m
+++ b/Source/GSNibLoader.m
@@ -134,7 +134,7 @@
withZone: zone];
// report a problem if there is one.
- if(loaded == NO)
+ if (loaded == NO)
{
NSLog(@"Could not load Gorm file: %@",fileName);
}
diff --git a/Source/GSTable.m b/Source/GSTable.m
index 798662228..9ccb69908 100644
--- a/Source/GSTable.m
+++ b/Source/GSTable.m
@@ -722,7 +722,7 @@
int i;
[super encodeWithCoder: aCoder];
- if([aCoder allowsKeyedCoding])
+ if ([aCoder allowsKeyedCoding])
{
[aCoder encodeInt: _numberOfRows forKey: @"GSNumberOfRows"];
[aCoder encodeInt: _numberOfColumns forKey: @"GSNumberOfColumns"];
@@ -792,7 +792,7 @@
[super initWithCoder: aDecoder];
[super setAutoresizesSubviews: NO];
- if([aDecoder allowsKeyedCoding])
+ if ([aDecoder allowsKeyedCoding])
{
_numberOfRows = [aDecoder decodeIntForKey: @"GSNumberOfRows"];
_numberOfColumns = [aDecoder decodeIntForKey: @"GSNumberOfColumns"];
diff --git a/Source/GSTextStorage.m b/Source/GSTextStorage.m
index be47cd1db..39f3bd878 100644
--- a/Source/GSTextStorage.m
+++ b/Source/GSTextStorage.m
@@ -178,7 +178,7 @@ unCacheAttributes(NSDictionary *attrs)
- (void) encodeWithCoder: (NSCoder*)aCoder
{
- if([aCoder allowsKeyedCoding] == NO)
+ if ([aCoder allowsKeyedCoding] == NO)
{
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &loc];
[aCoder encodeValueOfObjCType: @encode(id) at: &attrs];
@@ -193,7 +193,7 @@ unCacheAttributes(NSDictionary *attrs)
- (id) initWithCoder: (NSCoder*)aCoder
{
- if([aCoder allowsKeyedCoding] == NO)
+ if ([aCoder allowsKeyedCoding] == NO)
{
NSDictionary *a;
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &loc];
diff --git a/Source/GSTheme.m b/Source/GSTheme.m
index f25602e1e..930e8dd8e 100644
--- a/Source/GSTheme.m
+++ b/Source/GSTheme.m
@@ -397,8 +397,8 @@ static NSNull *null = nil;
}
/*
- * We could cache tile info here, but it's probabaly better for the
- * tilesNamed: method to do it lazily.
+ * We could cache tile info here, but it's probably better for the
+ * tilesNamed:cache: method to do it lazily.
*/
/*
@@ -566,10 +566,11 @@ static NSNull *null = nil;
return [GSThemeInspector sharedThemeInspector];
}
-- (GSDrawTiles*) tilesNamed: (NSString*)aName
+- (GSDrawTiles*) tilesNamed: (NSString*)aName cache: (BOOL)useCache
{
- GSDrawTiles *tiles = [_tiles objectForKey: aName];
+ GSDrawTiles *tiles;
+ tiles = (useCache == YES) ? [_tiles objectForKey: aName] : nil;
if (tiles == nil)
{
NSDictionary *info;
@@ -1074,7 +1075,129 @@ withRepeatedImage: (NSImage*)image
}
NSRectFill(rect);
- if (flipped)
+ if (style == GSThemeFillStyleMatrix)
+ {
+ NSRect grid;
+ float x;
+ float y;
+
+ if (tiles->images[TileTM] == nil)
+ {
+ grid.size.width = (tiles->rects[TileTL].size.width
+ + tiles->rects[TileTR].size.width
+ + 9);
+ }
+ else
+ {
+ grid.size.width = (tiles->rects[TileTL].size.width
+ + tiles->rects[TileTM].size.width
+ + tiles->rects[TileTR].size.width
+ + 12);
+ }
+ grid.origin.x = rect.origin.x + (rect.size.width - grid.size.width) / 2;
+ x = grid.origin.x;
+ if (flipped)
+ {
+ grid.origin.y
+ = NSMaxY(rect) - (rect.size.height - grid.size.height) / 2;
+ y = NSMaxY(grid);
+ }
+ else
+ {
+ grid.origin.y
+ = rect.origin.y + (rect.size.height - grid.size.height) / 2;
+ y = grid.origin.y;
+ }
+
+ /* Draw bottom row
+ */
+ if (flipped)
+ {
+ y -= (tiles->rects[TileBL].size.height + 3);
+ }
+ else
+ {
+ y += 3;
+ }
+ [tiles->images[TileBL] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ x += tiles->rects[TileBL].size.width + 3;
+ if (tiles->images[TileBM] != nil)
+ {
+ [tiles->images[TileBM] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ x += tiles->rects[TileBM].size.width + 3;
+ }
+ [tiles->images[TileBR] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ if (!flipped)
+ {
+ y += tiles->rects[TileBL].size.height;
+ }
+
+ if (tiles->images[TileCL] != nil)
+ {
+ /* Draw middle row
+ */
+ x = grid.origin.x;
+ if (flipped)
+ {
+ y -= (tiles->rects[TileCL].size.height + 3);
+ }
+ else
+ {
+ y += 3;
+ }
+ [tiles->images[TileCL] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ x += tiles->rects[TileCL].size.width + 3;
+ if (tiles->images[TileCM] != nil)
+ {
+ [tiles->images[TileCM] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ x += tiles->rects[TileCM].size.width + 3;
+ }
+ [tiles->images[TileCR] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ if (!flipped)
+ {
+ y += tiles->rects[TileCL].size.height;
+ }
+ }
+
+ /* Draw top row
+ */
+ x = grid.origin.x;
+ if (flipped)
+ {
+ y -= (tiles->rects[TileTL].size.height + 3);
+ }
+ else
+ {
+ y += 3;
+ }
+ [tiles->images[TileTL] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ x += tiles->rects[TileTL].size.width + 3;
+ if (tiles->images[TileTM] != nil)
+ {
+ [tiles->images[TileTM] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ x += tiles->rects[TileTM].size.width + 3;
+ }
+ [tiles->images[TileTR] compositeToPoint:
+ NSMakePoint(x, y)
+ operation: NSCompositeSourceOver];
+ }
+ else if (flipped)
{
[self fillHorizontalRect:
NSMakeRect (rect.origin.x + bls.width,
@@ -1131,25 +1254,25 @@ withRepeatedImage: (NSImage*)image
operation: NSCompositeSourceOver];
inFill = NSMakeRect (rect.origin.x +cls.width,
- rect.origin.y + bms.height,
+ rect.origin.y + bms.height,
rect.size.width - cls.width - crs.width,
rect.size.height - bms.height - tms.height);
- if (style == FillStyleCenter)
+ if (style == GSThemeFillStyleCenter)
{
[self fillRect: inFill
withRepeatedImage: tiles->images[TileCM]
fromRect: tiles->rects[TileCM]
center: NO];
}
- else if (style == FillStyleRepeat)
+ else if (style == GSThemeFillStyleRepeat)
{
[self fillRect: inFill
withRepeatedImage: tiles->images[TileCM]
fromRect: tiles->rects[TileCM]
center: NO];
}
- else if (style == FillStyleScale)
- {
+ else if (style == GSThemeFillStyleScale)
+ {
[tiles->images[TileCM] setScalesWhenResized: YES];
[tiles->images[TileCM] setSize: inFill.size];
[tiles->images[TileCM] compositeToPoint: inFill.origin
@@ -1222,25 +1345,25 @@ withRepeatedImage: (NSImage*)image
operation: NSCompositeSourceOver];
inFill = NSMakeRect (rect.origin.x +cls.width,
- rect.origin.y + bms.height,
+ rect.origin.y + bms.height,
rect.size.width - cls.width - crs.width,
rect.size.height - bms.height - tms.height);
- if (style == FillStyleCenter)
+ if (style == GSThemeFillStyleCenter)
{
[self fillRect: inFill
withRepeatedImage: tiles->images[TileCM]
fromRect: tiles->rects[TileCM]
center: NO];
}
- else if (style == FillStyleRepeat)
+ else if (style == GSThemeFillStyleRepeat)
{
[self fillRect: inFill
withRepeatedImage: tiles->images[TileCM]
fromRect: tiles->rects[TileCM]
center: YES];
}
- else if (style == FillStyleScale)
+ else if (style == GSThemeFillStyleScale)
{
[tiles->images[TileCM] setScalesWhenResized: YES];
[tiles->images[TileCM] setSize: inFill.size];
diff --git a/Source/GSTrackingRect.m b/Source/GSTrackingRect.m
index 807a4abd9..ec557d92f 100644
--- a/Source/GSTrackingRect.m
+++ b/Source/GSTrackingRect.m
@@ -114,7 +114,7 @@
*/
- (void) encodeWithCoder: (NSCoder*)aCoder
{
- if([aCoder allowsKeyedCoding] == NO)
+ if ([aCoder allowsKeyedCoding] == NO)
{
BOOL inside = flags.inside;
@@ -127,7 +127,7 @@
- (id) initWithCoder: (NSCoder*)aDecoder
{
- if([aDecoder allowsKeyedCoding] == NO)
+ if ([aDecoder allowsKeyedCoding] == NO)
{
BOOL inside;
diff --git a/Source/GSVbox.m b/Source/GSVbox.m
index 85db97a12..2af5e38d3 100644
--- a/Source/GSVbox.m
+++ b/Source/GSVbox.m
@@ -163,7 +163,7 @@ enablingYResizing: (BOOL)aFlag
-(void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
- if([aCoder allowsKeyedCoding])
+ if ([aCoder allowsKeyedCoding])
{
[aCoder encodeBool: _haveViews forKey: @"GSHaveViews"];
[aCoder encodeFloat: _defaultMinYMargin forKey: @"GSDefaultMinYMargin"];
@@ -178,7 +178,7 @@ enablingYResizing: (BOOL)aFlag
-(id) initWithCoder: (NSCoder*)aDecoder
{
[super initWithCoder: aDecoder];
- if([aDecoder allowsKeyedCoding])
+ if ([aDecoder allowsKeyedCoding])
{
_haveViews = [aDecoder decodeBoolForKey: @"GSHaveViews"];
_defaultMinYMargin = [aDecoder decodeFloatForKey: @"GSDefaultMinYMargin"];
diff --git a/Source/NSActionCell.m b/Source/NSActionCell.m
index f9ad4020b..dab0ec05d 100644
--- a/Source/NSActionCell.m
+++ b/Source/NSActionCell.m
@@ -285,7 +285,7 @@ static Class controlClass;
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
- if([aCoder allowsKeyedCoding])
+ if ([aCoder allowsKeyedCoding])
{
[aCoder encodeInt: [self tag] forKey: @"NSTag"];
[aCoder encodeObject: [self target] forKey: @"NSTarget"];
diff --git a/Source/NSApplication.m b/Source/NSApplication.m
index abd02090f..6d9bd665f 100644
--- a/Source/NSApplication.m
+++ b/Source/NSApplication.m
@@ -3292,10 +3292,10 @@ image.
See Also: -applicationIconImage
- (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { /* - if(_delegate != nil) + if (_delegate != nil) { [aCoder encodeObject: _delegate forKey: @"NSDelegate"]; } @@ -3316,10 +3316,10 @@ image.See Also: -applicationIconImage
id obj; [super initWithCoder: aDecoder]; - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { /* - if([aDecoder containsValueForKey: @"NSDelegate"]) + if ([aDecoder containsValueForKey: @"NSDelegate"]) { obj = [aDecoder decodeObjectForKey: @"NSDelegate"]; [self setDelegate: obj]; diff --git a/Source/NSBitmapImageRep.m b/Source/NSBitmapImageRep.m index 4a9985229..5d4992ac1 100644 --- a/Source/NSBitmapImageRep.m +++ b/Source/NSBitmapImageRep.m @@ -948,7 +948,7 @@ static BOOL supports_lzw_compression = NO; NSData *data = [self TIFFRepresentation]; [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: data forKey: @"NSTIFFRepresentation"]; } diff --git a/Source/NSBrowser.m b/Source/NSBrowser.m index 4a5fe0e43..4a1837a2b 100644 --- a/Source/NSBrowser.m +++ b/Source/NSBrowser.m @@ -152,7 +152,7 @@ static NSTextFieldCell *titleCell; - (void) encodeWithCoder: (NSCoder *)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { } else @@ -169,7 +169,7 @@ static NSTextFieldCell *titleCell; - (id) initWithCoder: (NSCoder *)aDecoder { - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { } @@ -2501,7 +2501,7 @@ static NSTextFieldCell *titleCell; - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { long flags = 0; diff --git a/Source/NSBrowserCell.m b/Source/NSBrowserCell.m index 1d9853a1c..20e629b28 100644 --- a/Source/NSBrowserCell.m +++ b/Source/NSBrowserCell.m @@ -339,7 +339,7 @@ static NSFont *_leafFont; - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { // simply encodes prescence... } diff --git a/Source/NSBundleAdditions.m b/Source/NSBundleAdditions.m index e21cc77e9..82706b27a 100644 --- a/Source/NSBundleAdditions.m +++ b/Source/NSBundleAdditions.m @@ -72,15 +72,15 @@ { if ([aCoder allowsKeyedCoding]) { - if(_src != nil) + if (_src != nil) { [aCoder encodeObject: _src forKey: @"NSSource"]; } - if(_dst != nil) + if (_dst != nil) { [aCoder encodeObject: _dst forKey: @"NSDestination"]; } - if(_tag != nil) + if (_tag != nil) { [aCoder encodeObject: _tag forKey: @"NSLabel"]; } @@ -101,15 +101,15 @@ { if ([aDecoder allowsKeyedCoding]) { - if([aDecoder containsValueForKey: @"NSDestination"]) + if ([aDecoder containsValueForKey: @"NSDestination"]) { ASSIGN(_dst, [aDecoder decodeObjectForKey: @"NSDestination"]); } - if([aDecoder containsValueForKey: @"NSSource"]) + if ([aDecoder containsValueForKey: @"NSSource"]) { ASSIGN(_src, [aDecoder decodeObjectForKey: @"NSSource"]); } - if([aDecoder containsValueForKey: @"NSLabel"]) + if ([aDecoder containsValueForKey: @"NSLabel"]) { ASSIGN(_tag, [aDecoder decodeObjectForKey: @"NSLabel"]); } @@ -323,7 +323,7 @@ NSString *modelPath = [rootPath stringByAppendingPathComponent: fileName]; NSString *path = [GSModelLoaderFactory supportedModelFileAtPath: modelPath]; - if(path != nil) + if (path != nil) { return path; } diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index 3c9bff6c3..8078f17ba 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -1448,7 +1448,7 @@ typedef struct _GSButtonCellFlags BOOL tmp; [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { GSButtonCellFlags buttonCellFlags; unsigned int bFlags = 0; @@ -1456,15 +1456,15 @@ typedef struct _GSButtonCellFlags NSImage *image = [self image]; NSButtonImageSource *bi = nil; - if([self keyEquivalent] != nil) + if ([self keyEquivalent] != nil) { [aCoder encodeObject: [self keyEquivalent] forKey: @"NSKeyEquivalent"]; } - if([self image] != nil) + if ([self image] != nil) { [aCoder encodeObject: [self image] forKey: @"NSNormalImage"]; } - if([self alternateTitle] != nil) + if ([self alternateTitle] != nil) { [aCoder encodeObject: [self alternateTitle] forKey: @"NSAlternateContents"]; } @@ -1503,15 +1503,15 @@ typedef struct _GSButtonCellFlags [aCoder encodeInt: bFlags2 forKey: @"NSButtonFlags2"]; // alternate image encoding... - if(image != nil) + if (image != nil) { if ([image isKindOfClass: [NSImage class]] && buttonCellFlags.useButtonImageSource) { - if([NSImage imageNamed: @"NSSwitch"] == image) + if ([NSImage imageNamed: @"NSSwitch"] == image) { bi = [[NSButtonImageSource alloc] initWithImageNamed: @"NSHighlightedSwitch"]; } - else if([NSImage imageNamed: @"NSRadioButton"] == image) + else if ([NSImage imageNamed: @"NSRadioButton"] == image) { bi = [[NSButtonImageSource alloc] initWithImageNamed: @"NSHighlightedRadioButton"]; } @@ -1519,11 +1519,11 @@ typedef struct _GSButtonCellFlags } // encode button image source, if it exists... - if(bi != nil) + if (bi != nil) { [aCoder encodeObject: bi forKey: @"NSAlternateImage"]; } - else if(_altImage != nil) + else if (_altImage != nil) { [aCoder encodeObject: _altImage forKey: @"NSAlternateImage"]; } @@ -1657,18 +1657,18 @@ typedef struct _GSButtonCellFlags image = [aDecoder decodeObjectForKey: @"NSAlternateImage"]; if ([image isKindOfClass: [NSImage class]]) { - if([NSImage imageNamed: @"NSSwitch"] == image) + if ([NSImage imageNamed: @"NSSwitch"] == image) { image = [NSImage imageNamed: @"NSHighlightedSwitch"]; - if([self image] == nil) + if ([self image] == nil) { [self setImage: [NSImage imageNamed: @"NSSwitch"]]; } } - else if([NSImage imageNamed: @"NSRadioButton"] == image) + else if ([NSImage imageNamed: @"NSRadioButton"] == image) { image = [NSImage imageNamed: @"NSHighlightedRadioButton"]; - if([self image] == nil) + if ([self image] == nil) { [self setImage: [NSImage imageNamed: @"NSRadioButton"]]; } diff --git a/Source/NSCachedImageRep.m b/Source/NSCachedImageRep.m index 860b52180..3ad99cd1d 100644 --- a/Source/NSCachedImageRep.m +++ b/Source/NSCachedImageRep.m @@ -167,7 +167,7 @@ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding] == NO) + if ([aCoder allowsKeyedCoding] == NO) { [aCoder encodeObject: _window]; [aCoder encodeRect: _rect]; @@ -177,7 +177,7 @@ - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; - if([aDecoder allowsKeyedCoding] == NO) + if ([aDecoder allowsKeyedCoding] == NO) { [aDecoder decodeValueOfObjCType: @encode(id) at: &_window]; _rect = [aDecoder decodeRect]; diff --git a/Source/NSCell.m b/Source/NSCell.m index c9a56b774..157721b5c 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -2179,7 +2179,7 @@ static NSColor *shadowCol; */ - (void) encodeWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { unsigned long cFlags = 0; unsigned int cFlags2 = 0; @@ -2216,7 +2216,7 @@ static NSColor *shadowCol; // font and formatter. [aCoder encodeObject: [self font] forKey: @"NSSupport"]; - if([self formatter]) + if ([self formatter]) { [aCoder encodeObject: [self formatter] forKey: @"NSFormatter"]; } @@ -2292,11 +2292,11 @@ static NSColor *shadowCol; id contents = [aDecoder decodeObjectForKey: @"NSContents"]; // initialize based on content... - if([contents isKindOfClass: [NSString class]]) + if ([contents isKindOfClass: [NSString class]]) { self = [self initTextCell: contents]; } - else if([contents isKindOfClass: [NSImage class]]) + else if ([contents isKindOfClass: [NSImage class]]) { self = [self initImageCell: contents]; } diff --git a/Source/NSClipView.m b/Source/NSClipView.m index fcdc5accc..58d4c1f53 100644 --- a/Source/NSClipView.m +++ b/Source/NSClipView.m @@ -753,16 +753,16 @@ static inline NSRect integralRect (NSRect rect, NSView *view) - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { unsigned int flags = 0; [aCoder encodeObject: [self backgroundColor] forKey: @"NSBGColor"]; [aCoder encodeObject: [self documentCursor] forKey: @"NSCursor"]; [aCoder encodeObject: [self documentView] forKey: @"NSDocView"]; - if([self drawsBackground]) + if ([self drawsBackground]) flags |= 4; - if([self copiesOnScroll] == NO) + if ([self copiesOnScroll] == NO) flags |= 2; [aCoder encodeInt: flags forKey: @"NScvFlags"]; diff --git a/Source/NSColorWell.m b/Source/NSColorWell.m index 0aa2cc0b0..ae5056f4b 100644 --- a/Source/NSColorWell.m +++ b/Source/NSColorWell.m @@ -235,7 +235,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification = - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _the_color forKey: @"NSColor"]; // [aCoder encodeBool: _is_active forKey: @"NSEnabled"]; @@ -258,7 +258,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification = self = [super initWithCoder: aDecoder]; if (self != nil) { - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { NSString *action; diff --git a/Source/NSComboBoxCell.m b/Source/NSComboBoxCell.m index cba121de4..4b3d1f3b0 100644 --- a/Source/NSComboBoxCell.m +++ b/Source/NSComboBoxCell.m @@ -1654,7 +1654,7 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect) { [super encodeWithCoder: coder]; - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { [coder encodeBool: [self hasVerticalScroller] forKey: @"NSHasVerticalScroller"]; [coder encodeInt: [self numberOfVisibleItems] forKey: @"NSVisibleItemCount"]; diff --git a/Source/NSControl.m b/Source/NSControl.m index ddb1a7fb6..aee75c34e 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -833,7 +833,7 @@ static Class actionCellClass; - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: [self cell] forKey: @"NSCell"]; [aCoder encodeBool: [self isEnabled] forKey: @"NSEnabled"]; diff --git a/Source/NSDataLink.m b/Source/NSDataLink.m index afe4e1ba0..de3870ae5 100644 --- a/Source/NSDataLink.m +++ b/Source/NSDataLink.m @@ -270,7 +270,7 @@ { BOOL flag = NO; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: linkNumber forKey: @"GSLinkNumber"]; [aCoder encodeInt: disposition forKey: @"GSUpdateMode"]; @@ -337,7 +337,7 @@ - (id) initWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { id obj; diff --git a/Source/NSDataLinkManager.m b/Source/NSDataLinkManager.m index a5c741aad..197e6e1fc 100644 --- a/Source/NSDataLinkManager.m +++ b/Source/NSDataLinkManager.m @@ -333,7 +333,7 @@ { BOOL flag = NO; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: filename forKey: @"GSFilename"]; [aCoder encodeObject: sourceLinks forKey: @"GSSourceLinks"]; @@ -367,7 +367,7 @@ - (id) initWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { BOOL flag = NO; id obj; diff --git a/Source/NSDocument.m b/Source/NSDocument.m index acc6fc670..7a91ec4ad 100644 --- a/Source/NSDocument.m +++ b/Source/NSDocument.m @@ -464,7 +464,7 @@ ASSIGN(_saveType, [controller _nameForHumanReadableType: [sender titleOfSelectedItem]]); extensions = [controller fileExtensionsFromType: _saveType]; - if([extensions count] > 0) + if ([extensions count] > 0) { [(NSSavePanel *)[sender window] setRequiredFileType: [extensions objectAtIndex:0]]; } @@ -484,7 +484,7 @@ - (void) _createPanelAccessory { - if(savePanelAccessory == nil) + if (savePanelAccessory == nil) { NSRect accessoryFrame = NSMakeRect(0,0,380,70); NSRect spaFrame = NSMakeRect(115,14,150,22); @@ -507,7 +507,7 @@ NSString *title = nil; int i = 0; - while((title = [en nextObject]) != nil) + while ((title = [en nextObject]) != nil) { [spaButton addItemWithTitle: title]; i++; @@ -517,11 +517,11 @@ [spaButton setEnabled: (i > 0)]; // if we have some items, select the current filetype. - if(i > 0) + if (i > 0) { NSString *title = [[NSDocumentController sharedDocumentController] displayNameForType: [self fileType]]; - if([spaButton itemWithTitle: title] != nil) + if ([spaButton itemWithTitle: title] != nil) { [spaButton selectItemWithTitle: title]; } @@ -558,7 +558,7 @@ { NSArray *extensions = [[NSDocumentController sharedDocumentController] fileExtensionsFromType: [self fileTypeFromLastRunSavePanel]]; - if([extensions count] > 0) + if ([extensions count] > 0) { [savePanel setRequiredFileType:[extensions objectAtIndex:0]]; } @@ -736,7 +736,7 @@ NSArray *extensions = [[NSDocumentController sharedDocumentController] fileExtensionsFromType: fileType]; - if([extensions count] > 0) + if ([extensions count] > 0) { NSString *extension = [extensions objectAtIndex: 0]; NSString *newFileName = [[fileName stringByDeletingPathExtension] diff --git a/Source/NSDocumentController.m b/Source/NSDocumentController.m index 718d311e0..6dd4871c9 100644 --- a/Source/NSDocumentController.m +++ b/Source/NSDocumentController.m @@ -873,7 +873,7 @@ static NSString *NSViewerRole = @"Viewer"; NSEnumerator *en = [types objectEnumerator]; NSString *type = nil; NSMutableArray *result = [NSMutableArray arrayWithCapacity: 10]; - while((type = (NSString *)[en nextObject]) != nil) + while ((type = (NSString *)[en nextObject]) != nil) { NSString *name = [self displayNameForType: type]; [result addObject: name]; diff --git a/Source/NSFormCell.m b/Source/NSFormCell.m index cc2ece69d..cfb9b1275 100644 --- a/Source/NSFormCell.m +++ b/Source/NSFormCell.m @@ -395,10 +395,10 @@ static NSColor *shadowCol; - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { /* - if([self stringValue] != nil) + if ([self stringValue] != nil) { [aCoder encodeObject: [self stringValue] forKey: @"NSContents"]; } diff --git a/Source/NSImage.m b/Source/NSImage.m index 8b4262cf6..735e9c1c5 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -1479,11 +1479,11 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep) { BOOL flag; - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { // FIXME: Not sure this is the way it goes... /* - if(_flags.archiveByName == NO) + if (_flags.archiveByName == NO) { NSMutableArray *container = [NSMutableArray array]; NSMutableArray *reps = [NSMutableArray array]; @@ -1492,7 +1492,7 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep) // add the reps to the container... [container addObject: reps]; - while((rd = [en nextObject]) != nil) + while ((rd = [en nextObject]) != nil) { [reps addObject: rd->rep]; } diff --git a/Source/NSImageCell.m b/Source/NSImageCell.m index 4c969701a..a603d4834 100644 --- a/Source/NSImageCell.m +++ b/Source/NSImageCell.m @@ -369,7 +369,7 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect) - (void) encodeWithCoder: (NSCoder *)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: _imageAlignment forKey: @"NSAlign"]; [aCoder encodeInt: _imageScaling forKey: @"NSScale"]; @@ -387,7 +387,7 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect) - (id) initWithCoder: (NSCoder *)aDecoder { - if((self = [super initWithCoder: aDecoder]) != nil) + if ((self = [super initWithCoder: aDecoder]) != nil) { if ([aDecoder allowsKeyedCoding]) { diff --git a/Source/NSImageView.m b/Source/NSImageView.m index fb7d1b885..21d3c0ca0 100644 --- a/Source/NSImageView.m +++ b/Source/NSImageView.m @@ -278,7 +278,7 @@ static Class imageCellClass; - (void) encodeWithCoder: (NSCoder *)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeBool: [self isEditable] forKey: @"NSEditable"]; } diff --git a/Source/NSMenu.m b/Source/NSMenu.m index f26e88567..0d7c94840 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -1277,13 +1277,13 @@ static NSNotificationCenter *nc; */ - (void) encodeWithCoder: (NSCoder*)encoder { - if([encoder allowsKeyedCoding]) + if ([encoder allowsKeyedCoding]) { [encoder encodeObject: _title forKey: @"NSTitle"]; [encoder encodeObject: _items forKey: @"NSMenuItems"]; // if there is no supermenu, make it the main menu. - if([self supermenu] == nil) + if ([self supermenu] == nil) { [encoder encodeObject: @"_NSMainMenu" forKey: @"NSName"]; } diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index 58bbf6b4c..f52ce659b 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -1592,7 +1592,7 @@ _addLeftBorderOffsetToRect(NSRect aRect) - (void) encodeWithCoder: (NSCoder*)encoder { [super encodeWithCoder: encoder]; - if([encoder allowsKeyedCoding] == NO) + if ([encoder allowsKeyedCoding] == NO) { [encoder encodeObject: _itemCells]; [encoder encodeObject: _font]; @@ -1605,7 +1605,7 @@ _addLeftBorderOffsetToRect(NSRect aRect) - (id) initWithCoder: (NSCoder*)decoder { self = [super initWithCoder: decoder]; - if([decoder allowsKeyedCoding] == NO) + if ([decoder allowsKeyedCoding] == NO) { [decoder decodeValueOfObjCType: @encode(id) at: &_itemCells]; diff --git a/Source/NSNib.m b/Source/NSNib.m index 94ee6a8d6..4141be9eb 100644 --- a/Source/NSNib.m +++ b/Source/NSNib.m @@ -206,7 +206,7 @@ // objects and is going to be deprecated in the future. There just so // happens to be a one to one correspondence here. // - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { // TODO_NIB: Need to verify this key... ASSIGN(_nibData, [coder decodeObjectForKey: @"NSData"]); @@ -225,7 +225,7 @@ - (void) encodeWithCoder: (NSCoder *)coder { - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { // TODO_NIB: Need to verify this key... [coder encodeObject: _nibData diff --git a/Source/NSPanel.m b/Source/NSPanel.m index bd7c64b7e..a61ec80fa 100644 --- a/Source/NSPanel.m +++ b/Source/NSPanel.m @@ -163,7 +163,7 @@ BOOL flag; [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { // Nothing to do here, for keyed coding this is handled by NSWindowTemplate. // Calling the above method should throw an NSInvalidArgumentException. @@ -184,7 +184,7 @@ BOOL flag; [super initWithCoder: aDecoder]; - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { // Nothing to do here, for keyed coding this is handled by NSWindowTemplate. // Calling the above method should throw an NSInvalidArgumentException. diff --git a/Source/NSParagraphStyle.m b/Source/NSParagraphStyle.m index b08ce9bbd..003f29b0b 100644 --- a/Source/NSParagraphStyle.m +++ b/Source/NSParagraphStyle.m @@ -314,7 +314,7 @@ static NSParagraphStyle *defaultStyle = nil; - (id) initWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSParagraphStyle, if there are any. } @@ -371,7 +371,7 @@ static NSParagraphStyle *defaultStyle = nil; - (void) encodeWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSParagraphStyle, if there are any. } diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index f8c7ef3a5..d5af3d89d 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -959,7 +959,7 @@ static NSImage *_pbc_image[2]; - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeBool: [self altersStateOfSelectedItem] forKey: @"NSAltersState"]; [aCoder encodeBool: [self usesItemFromMenu] forKey: @"NSUsesItemFromMenu"]; @@ -967,7 +967,7 @@ static NSImage *_pbc_image[2]; [aCoder encodeInt: [self preferredEdge] forKey: @"NSPreferredEdge"]; // encode the menu, if present. - if(_menu != nil) + if (_menu != nil) { [aCoder encodeObject: _menu forKey: @"NSMenu"]; } diff --git a/Source/NSPrinter.m b/Source/NSPrinter.m index 03cb0e4a7..895b9ac78 100644 --- a/Source/NSPrinter.m +++ b/Source/NSPrinter.m @@ -646,7 +646,7 @@ static NSMutableDictionary* printerCache; // - (void) encodeWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { // TODO: Determine keys for NSPrinter. } @@ -662,7 +662,7 @@ static NSMutableDictionary* printerCache; - (id) initWithCoder: (NSCoder*)aDecoder { - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { // TODO: Determine keys for NSPrinter. } diff --git a/Source/NSProgressIndicator.m b/Source/NSProgressIndicator.m index 641180094..b7e1e0249 100644 --- a/Source/NSProgressIndicator.m +++ b/Source/NSProgressIndicator.m @@ -290,7 +290,7 @@ static NSColor *fillColour = nil; - (void)encodeWithCoder:(NSCoder *)aCoder { [super encodeWithCoder:aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { unsigned long flags = 0; id matrix = AUTORELEASE([[NSPSMatrix alloc] init]); diff --git a/Source/NSScrollView.m b/Source/NSScrollView.m index 8a4505247..9ec486a0c 100644 --- a/Source/NSScrollView.m +++ b/Source/NSScrollView.m @@ -1218,7 +1218,7 @@ static float scrollerWidth; { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { unsigned long flags = 0; GSScrollViewFlags scrollViewFlags; @@ -1228,7 +1228,7 @@ static float scrollerWidth; [aCoder encodeObject: _contentView forKey: @"NSContentView"]; // only encode this, if it's not null... - if(_headerClipView != nil) + if (_headerClipView != nil) { [aCoder encodeObject: _headerClipView forKey: @"NSHeaderClipView"]; } @@ -1316,7 +1316,7 @@ static float scrollerWidth; NSRect frame = [content frame]; float w = [vScroller frame].size.width; - if(_hasVertScroller) + if (_hasVertScroller) { // // Slide the content view over, since on Mac OS X the scroller is on the diff --git a/Source/NSSearchFieldCell.m b/Source/NSSearchFieldCell.m index 62b524937..9e7eacb3b 100644 --- a/Source/NSSearchFieldCell.m +++ b/Source/NSSearchFieldCell.m @@ -284,7 +284,7 @@ NSDivideRect(rect, &search, &part, ICON_WIDTH, NSMinXEdge); } - if(!_cancel_button_cell) + if (!_cancel_button_cell) { // nothing to split off text = part; diff --git a/Source/NSSecureTextField.m b/Source/NSSecureTextField.m index ba7261084..1c929511e 100644 --- a/Source/NSSecureTextField.m +++ b/Source/NSSecureTextField.m @@ -135,7 +135,7 @@ - (id) initWithCoder: (NSCoder *)decoder { self = [super initWithCoder: decoder]; - if([decoder allowsKeyedCoding]) + if ([decoder allowsKeyedCoding]) { // do nothing for now... } diff --git a/Source/NSSelection.m b/Source/NSSelection.m index cd78ad1ab..1764c5a91 100644 --- a/Source/NSSelection.m +++ b/Source/NSSelection.m @@ -211,7 +211,7 @@ typedef enum // - (void) encodeWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeBool: _isWellKnownSelection forKey: @"GSIsWellKnownSelection"]; @@ -234,7 +234,7 @@ typedef enum - (id) initWithCoder: (NSCoder*)aDecoder { [super init]; - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { _isWellKnownSelection = [aDecoder decodeBoolForKey: @"GSIsWellKnownSelection"]; _selectionType = [aDecoder decodeIntForKey: @"GSSelectionType"]; diff --git a/Source/NSSliderCell.m b/Source/NSSliderCell.m index 9f93247b8..2dd438fed 100644 --- a/Source/NSSliderCell.m +++ b/Source/NSSliderCell.m @@ -727,7 +727,7 @@ float _floatValueForMousePoint (NSPoint point, NSRect knobRect, - (id) initWithCoder: (NSCoder*)decoder { self = [super initWithCoder: decoder]; - if([decoder allowsKeyedCoding]) + if ([decoder allowsKeyedCoding]) { _allowsTickMarkValuesOnly = [decoder decodeBoolForKey: @"NSAllowsTickMarkValuesOnly"]; _numberOfTickMarks = [decoder decodeIntForKey: @"NSNumberOfTickMarks"]; @@ -769,7 +769,7 @@ float _floatValueForMousePoint (NSPoint point, NSRect knobRect, - (void) encodeWithCoder: (NSCoder*)coder { [super encodeWithCoder: coder]; - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { [coder encodeBool: _allowsTickMarkValuesOnly forKey: @"NSAllowsTickMarkValuesOnly"]; [coder encodeInt: _numberOfTickMarks forKey: @"NSNumberOfTickMarks"]; diff --git a/Source/NSSound.m b/Source/NSSound.m index b441e7ebf..0bfd44a2f 100644 --- a/Source/NSSound.m +++ b/Source/NSSound.m @@ -667,7 +667,7 @@ return NO; \ // - (void) encodeWithCoder: (NSCoder *)coder { - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSSound. } @@ -701,7 +701,7 @@ return NO; \ - (id) initWithCoder: (NSCoder*)decoder { - if([decoder allowsKeyedCoding]) + if ([decoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSSound. } diff --git a/Source/NSStepperCell.m b/Source/NSStepperCell.m index 429991108..55c4de842 100644 --- a/Source/NSStepperCell.m +++ b/Source/NSStepperCell.m @@ -449,7 +449,7 @@ static inline void HighlightDownButton(NSRect aRect) { [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeDouble: [self increment] forKey: @"NSIncrement"]; [aCoder encodeDouble: [self maxValue] forKey: @"NSMaxValue"]; @@ -481,13 +481,13 @@ static inline void HighlightDownButton(NSRect aRect) { [super initWithCoder: aDecoder]; - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { _autorepeat = [aDecoder decodeBoolForKey: @"NSAutorepeat"]; _valueWraps = [aDecoder decodeBoolForKey: @"NSValueWraps"]; _increment = [aDecoder decodeDoubleForKey: @"NSIncrement"]; _maxValue = [aDecoder decodeDoubleForKey: @"NSMaxValue"]; - if([aDecoder containsValueForKey: @"NSMinValue"]) + if ([aDecoder containsValueForKey: @"NSMinValue"]) { _minValue = [aDecoder decodeDoubleForKey: @"NSMinValue"]; } diff --git a/Source/NSTableColumn.m b/Source/NSTableColumn.m index fdc73c5e5..2903923b4 100644 --- a/Source/NSTableColumn.m +++ b/Source/NSTableColumn.m @@ -370,7 +370,7 @@ - (void) encodeWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _identifier forKey: @"NSIdentifier"]; [aCoder encodeObject: _dataCell forKey: @"NSDataCell"]; diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 3f284e94a..7df8d6510 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -5120,19 +5120,19 @@ static inline float computePeriod(NSPoint mouseLocationWin, // make sure the corner view is properly encoded... [super encodeWithCoder: aCoder]; - if([self dataSource]) + if ([self dataSource]) { [aCoder encodeObject: [self dataSource] forKey: @"NSDataSource"]; } - if([self delegate]) + if ([self delegate]) { [aCoder encodeObject: [self delegate] forKey: @"NSDelegate"]; } - if([self target]) + if ([self target]) { [aCoder encodeObject: [self target] forKey: @"NSTarget"]; } - if([self action]) + if ([self action]) { [aCoder encodeObject: NSStringFromSelector([self action]) forKey: @"NSAction"]; } @@ -5144,11 +5144,11 @@ static inline float computePeriod(NSPoint mouseLocationWin, [aCoder encodeFloat: [self rowHeight] forKey: @"NSRowHeight"]; [aCoder encodeObject: [self tableColumns] forKey: @"NSTableColumns"]; - if(_headerView) + if (_headerView) { [aCoder encodeObject: _headerView forKey: @"NSHeaderView"]; } - if(_cornerView) + if (_cornerView) { [aCoder encodeObject: _cornerView forKey: @"NSCornerView"]; } diff --git a/Source/NSTextAttachment.m b/Source/NSTextAttachment.m index 2d09678fc..192112d74 100644 --- a/Source/NSTextAttachment.m +++ b/Source/NSTextAttachment.m @@ -323,7 +323,7 @@ */ - (void) encodeWithCoder: (NSCoder*)aCoder { - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSTextAttachment. } @@ -336,7 +336,7 @@ - (id) initWithCoder: (NSCoder*)aDecoder { - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSTextAttachment. } diff --git a/Source/NSTextContainer.m b/Source/NSTextContainer.m index 1a39f3199..598586b7f 100644 --- a/Source/NSTextContainer.m +++ b/Source/NSTextContainer.m @@ -464,7 +464,7 @@ framework intact. - (void) encodeWithCoder: (NSCoder *)coder { - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { NSSize size = _containerRect.size; int flags = ((_widthTracksTextView)?1:0) | diff --git a/Source/NSTextField.m b/Source/NSTextField.m index f6d39f2bf..bf034c0d3 100644 --- a/Source/NSTextField.m +++ b/Source/NSTextField.m @@ -709,7 +709,7 @@ static Class textFieldCellClass; - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; - if(![aCoder allowsKeyedCoding]) + if (![aCoder allowsKeyedCoding]) { [aCoder encodeConditionalObject: _delegate]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_error_action]; @@ -719,7 +719,7 @@ static Class textFieldCellClass; - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { // do nothing for now... } diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index d371273c6..615878ebf 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -208,7 +208,7 @@ static NSColor *txtCol; BOOL tmp; [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: [self backgroundColor] forKey: @"NSBackgroundColor"]; [aCoder encodeObject: [self textColor] forKey: @"NSTextColor"]; diff --git a/Source/NSTextStorage.m b/Source/NSTextStorage.m index a4bf79b61..542654374 100644 --- a/Source/NSTextStorage.m +++ b/Source/NSTextStorage.m @@ -355,7 +355,7 @@ static NSNotificationCenter *nc = nil; - (void) encodeWithCoder: (NSCoder *)coder { - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { [coder encodeObject: [self delegate] forKey: @"NSDelegate"]; [coder encodeObject: [self string] forKey: @"NSString"]; diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 737925646..7632cb383 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -149,7 +149,7 @@ Interface for a bunch of internal methods that need to be cleaned up. - (id) initWithTextView: (NSTextView *)tv { - if((self = [super init]) != nil) + if ((self = [super init]) != nil) { flags = (([tv isEditable]?0x01:0) | ([tv isSelectable]?0x02:0) | @@ -198,7 +198,7 @@ Interface for a bunch of internal methods that need to be cleaned up. - (void) encodeWithCoder: (NSCoder *)coder { - if([coder allowsKeyedCoding]) + if ([coder allowsKeyedCoding]) { [coder encodeObject: backgroundColor forKey: @"NSBackgroundColor"]; [coder encodeObject: paragraphStyle forKey: @"NSDefaultParagraphStyle"]; @@ -696,7 +696,7 @@ that makes decoding and encoding compatible with the old code. [super encodeWithCoder: aCoder]; - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { NSTextViewSharedData *tvsd = [[NSTextViewSharedData alloc] initWithTextView: self]; diff --git a/Source/NSView.m b/Source/NSView.m index 04f5120c5..39201ff37 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -3964,7 +3964,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) // Don't attempt to archive the superview of a view which is the // content view for a window. // - if(([[self window] contentView] != self) && _super_view != nil) + if (([[self window] contentView] != self) && _super_view != nil) { [aCoder encodeObject: _super_view forKey: @"NSSuperview"]; } diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 942ba58ae..13f88c743 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -4343,7 +4343,7 @@ resetCursorRectsForView(NSView *theView) // If were're being initialized from a keyed coder... - if([aCoder allowsKeyedCoding]) + if ([aCoder allowsKeyedCoding]) { // The docs indicate that there should be an error when directly encoding with // a keyed coding archiver. We should only encode NSWindow and subclasses @@ -4402,7 +4402,7 @@ resetCursorRectsForView(NSView *theView) // If were're being initialized from a keyed coder... - if([aDecoder allowsKeyedCoding]) + if ([aDecoder allowsKeyedCoding]) { // The docs indicate that there should be an error when directly encoding with // a keyed coding archiver. We should only encode NSWindow and subclasses