diff --git a/ChangeLog b/ChangeLog index 4ef88d4e5..03ce1066a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-03-31 Adam Fedor + + * Headers/gnustep/gui/NSFont.h: Conform to NSCopying. + * Source/NSFont.m ([NSFont -copyWithZone:]): Implement. + 2000-03-31 Jonathan Gapen * Model/GMAppKit.m: Re-organize NSCell's [-initWithModelUnarchiver:] diff --git a/Headers/gnustep/gui/NSFont.h b/Headers/gnustep/gui/NSFont.h index ff1ada8f6..4e94bfbd7 100644 --- a/Headers/gnustep/gui/NSFont.h +++ b/Headers/gnustep/gui/NSFont.h @@ -45,7 +45,7 @@ enum { extern const float *NSFontIdentityMatrix; -@interface NSFont : NSObject +@interface NSFont : NSObject { NSString *fontName; float matrix[6]; diff --git a/Source/NSFont.m b/Source/NSFont.m index f22182025..37d97c9f3 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -200,6 +200,23 @@ void setNSFont(NSString* key, NSFont* font) [super dealloc]; } +// +// NSCopying Protocol +// +- copyWithZone: (NSZone *)zone +{ + NSFont *new_font; + if (NSShouldRetainWithZone(self, zone)) + new_font = RETAIN(self); + else + { + new_font = (NSFont *)NSCopyObject(self, 0, zone); + [new_font->fontName copyWithZone: zone]; + [new_font->fontInfo copyWithZone: zone]; + } + return new_font; +} + // // Setting the Font //