mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 23:40:38 +00:00
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:
parent
9cc1ecd891
commit
41b7ca405d
3 changed files with 23 additions and 1 deletions
|
@ -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:]
|
||||
|
|
|
@ -45,7 +45,7 @@ enum {
|
|||
|
||||
extern const float *NSFontIdentityMatrix;
|
||||
|
||||
@interface NSFont : NSObject <NSCoding>
|
||||
@interface NSFont : NSObject <NSCoding, NSCopying>
|
||||
{
|
||||
NSString *fontName;
|
||||
float matrix[6];
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue