Implement copying

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6405 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2000-03-31 22:53:17 +00:00
parent 9cc1ecd891
commit 41b7ca405d
3 changed files with 23 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2000-03-31 Adam Fedor <fedor@gnu.org>
* Headers/gnustep/gui/NSFont.h: Conform to NSCopying.
* Source/NSFont.m ([NSFont -copyWithZone:]): Implement.
2000-03-31 Jonathan Gapen <jagapen@whitewater.chem.wisc.edu>
* Model/GMAppKit.m: Re-organize NSCell's [-initWithModelUnarchiver:]

View file

@ -45,7 +45,7 @@ enum {
extern const float *NSFontIdentityMatrix;
@interface NSFont : NSObject <NSCoding>
@interface NSFont : NSObject <NSCoding, NSCopying>
{
NSString *fontName;
float matrix[6];

View file

@ -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
//