mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 06:51:44 +00:00
Implement encoding
This commit is contained in:
parent
a06dc3bef4
commit
80bab3fa5a
2 changed files with 18 additions and 3 deletions
|
@ -34,7 +34,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
@class NSFontDescriptor, NSLocale, NSError, NSArray, NSDictionary;
|
||||
@class NSFontDescriptor, NSLocale, NSError, NSArray, NSMutableArray, NSDictionary, NSMutableDictionary;
|
||||
|
||||
enum {
|
||||
NSFontCollectionVisibilityProcess = (1UL << 0),
|
||||
|
@ -51,8 +51,6 @@ APPKIT_EXPORT NSFontCollectionMatchingOptionKey const NSFontCollectionDisallowAu
|
|||
|
||||
typedef NSString* NSFontCollectionName;
|
||||
|
||||
@class NSMutableDictionary, NSMutableArray, NSArray, NSDictionary, NSError;
|
||||
|
||||
@interface NSFontCollection : NSObject <NSCopying, NSMutableCopying, NSCoding>
|
||||
{
|
||||
NSMutableArray *_queryDescriptors;
|
||||
|
@ -60,6 +58,7 @@ typedef NSString* NSFontCollectionName;
|
|||
NSMutableArray *_queryAttributes;
|
||||
NSString *_fullFileName;
|
||||
NSString *_name;
|
||||
NSString *_fileName;
|
||||
}
|
||||
|
||||
// Initializers...
|
||||
|
|
|
@ -507,6 +507,14 @@ static NSLock *_fontCollectionLock = nil;
|
|||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
[coder encodeObject: _queryDescriptors
|
||||
forKey: @"NSFontCollectionFontDescriptors"];
|
||||
[coder encodeObject: _queryAttributes
|
||||
forKey: @"NSFontCollectionAttributes"];
|
||||
[coder encodeObject: _name
|
||||
forKey: @"NSFontCollectionName"];
|
||||
[coder encodeObject: _fileName
|
||||
forKey: @"NSFontCollectionFileName"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -519,6 +527,14 @@ static NSLock *_fontCollectionLock = nil;
|
|||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
_queryDescriptors = [coder decodeObjectForKey: @"NSFontCollectionFontDescriptors"];
|
||||
RETAIN(_queryDescriptors);
|
||||
_queryAttributes = [coder decodeObjectForKey: @"NSFontCollectionAttributes"];
|
||||
RETAIN(_queryAttributes);
|
||||
_name = [coder decodeObjectForKey: @"NSFontCollectionName"];
|
||||
RETAIN(_name);
|
||||
_fileName = [coder decodeObjectForKey: @"NSFontCollectionFileName"];
|
||||
RETAIN(_fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue