diff --git a/ChangeLog b/ChangeLog index 6166e4734..31dd83536 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2000-03-25 Jonathan Gapen + * Headers/gnustep/gui/NSColorPicker.h: Added ivar. + * Headers/gnustep/gui/NSImage.h: Added setFlipped/isFlipped methods. + * Source/NSBundleAdditions.m: Fixed bug in checking filename + extension. ([-pathForImageResource:]) + * Source/NSColorPicker.m: Implement. ([-initWithPickerMask:colorPanel:] + [-colorPanel] [-insertNewButtonImage:in:] [-provideNewButtonImage:]) + * Source/NSImage.m: Initialize _flags.flipDraw in [-initWithSize:] + 2000-03-24 Jonathan Gapen * Source/NSFileWrapper.m: First implementation of NSFileWrapper * Headers/gnustep/gui/NSFileWrapper.h: Added ivars and enum diff --git a/Headers/gnustep/gui/NSColorPicker.h b/Headers/gnustep/gui/NSColorPicker.h index 8be30ddb5..cb840c715 100644 --- a/Headers/gnustep/gui/NSColorPicker.h +++ b/Headers/gnustep/gui/NSColorPicker.h @@ -40,6 +40,7 @@ @interface NSColorPicker : NSObject { // Attributes + id _colorPanel; } // diff --git a/Headers/gnustep/gui/NSImage.h b/Headers/gnustep/gui/NSImage.h index a8d4b4fc0..838b17f85 100644 --- a/Headers/gnustep/gui/NSImage.h +++ b/Headers/gnustep/gui/NSImage.h @@ -150,6 +150,8 @@ - (BOOL) drawRepresentation: (NSImageRep*)imageRep inRect: (NSRect)aRect; - (void) recache; +- (void) setFlipped: (BOOL)flag; +- (BOOL) isFlipped; // // Assigning a Delegate diff --git a/Source/NSBundleAdditions.m b/Source/NSBundleAdditions.m index d3ee5348d..60b562577 100644 --- a/Source/NSBundleAdditions.m +++ b/Source/NSBundleAdditions.m @@ -177,12 +177,7 @@ NSString *ext = [name pathExtension]; NSString *path = nil; - if (ext != nil) - { - name = [name stringByDeletingPathExtension]; - path = [self pathForResource: name ofType: ext]; - } - else + if ((ext == nil) || [ext isEqualToString:@""]) { NSArray *types = [NSImage imageUnfilteredFileTypes]; unsigned c = [types count]; @@ -194,6 +189,11 @@ path = [self pathForResource: name ofType: ext]; } } + else + { + name = [name stringByDeletingPathExtension]; + path = [self pathForResource: name ofType: ext]; + } return path; } diff --git a/Source/NSColorPicker.m b/Source/NSColorPicker.m index f9327a6a9..e1ff3a29a 100644 --- a/Source/NSColorPicker.m +++ b/Source/NSColorPicker.m @@ -1,12 +1,14 @@ /* NSColorPicker.m - Description... + Abstract superclass for NSColorPanel color pickers Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 + Author: Jonathan Gapen + Date: March 2000 This file is part of the GNUstep GUI Library. @@ -27,6 +29,7 @@ */ #include +#include #include @implementation NSColorPicker @@ -53,7 +56,8 @@ - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel { - return nil; + ASSIGN(_colorPanel, colorPanel); + return self; } // @@ -61,7 +65,7 @@ // - (NSColorPanel *)colorPanel { - return nil; + return _colorPanel; } // @@ -69,38 +73,45 @@ // - (void)insertNewButtonImage:(NSImage *)newImage in:(NSButtonCell *)newButtonCell -{} +{ + [newButtonCell setImage: newImage]; +} - (NSImage *)provideNewButtonImage { - return nil; + Class myClass = [self class]; + NSBundle *bundle = [NSBundle bundleForClass: myClass]; + NSString *file = [bundle pathForResource: NSStringFromClass(myClass) + ofType:@"tiff"]; + + return [[NSImage alloc] initWithContentsOfFile: file]; } // // Setting the Mode // - (void)setMode:(int)mode -{} +{} // does nothing; override // // Using Color Lists // - (void)attachColorList:(NSColorList *)colorList -{} +{} // does nothing; override - (void)detachColorList:(NSColorList *)colorList -{} +{} // does nothing; override // // Showing Opacity Controls // - (void)alphaControlAddedOrRemoved:(id)sender -{} +{} // does nothing; override // // Responding to a Resized View // - (void)viewSizeChanged:(id)sender -{} +{} // does nothing; override @end diff --git a/Source/NSImage.m b/Source/NSImage.m index 59c296e27..cf98fca82 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -288,6 +288,7 @@ static Class cacheClass = 0; } _flags.colorMatchPreferred = YES; _flags.multipleResolutionMatching = YES; + _flags.flipDraw = NO; _color = RETAIN(clearColor); return self;