2001-12-17 16:51:51 +00:00
|
|
|
/** <title>NSFileWrapper</title>
|
1998-09-02 15:05:13 +00:00
|
|
|
|
2001-12-17 16:51:51 +00:00
|
|
|
<abstract>Hold a file's contents in dynamic memory.</abstract>
|
1998-09-02 15:05:13 +00:00
|
|
|
|
|
|
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
|
|
|
|
2001-12-17 16:51:51 +00:00
|
|
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
1998-09-02 15:05:13 +00:00
|
|
|
Date: Sept 1998
|
2001-12-17 16:51:51 +00:00
|
|
|
Author: Jonathan Gapen <jagapen@whitewater.chem.wisc.edu>
|
2000-03-25 02:09:31 +00:00
|
|
|
Date: Dec 1999
|
1998-09-02 15:05:13 +00:00
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-10-29 21:16:17 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
1998-09-02 15:05:13 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-10 04:01:49 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2007-10-29 21:16:17 +00:00
|
|
|
|
1998-09-02 15:05:13 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-10-29 21:16:17 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
1998-09-02 15:05:13 +00:00
|
|
|
|
2007-10-29 21:16:17 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
1998-09-02 15:05:13 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
2007-10-29 21:16:17 +00:00
|
|
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
|
|
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
1998-09-02 15:05:13 +00:00
|
|
|
*/
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
#include "config.h"
|
1998-09-02 15:05:13 +00:00
|
|
|
|
2011-03-04 11:33:22 +00:00
|
|
|
#import <Foundation/NSArchiver.h>
|
|
|
|
#import <Foundation/NSArray.h>
|
|
|
|
#import <Foundation/NSAutoreleasePool.h>
|
|
|
|
#import <Foundation/NSData.h>
|
|
|
|
#import <Foundation/NSDebug.h>
|
|
|
|
#import <Foundation/NSException.h>
|
|
|
|
#import <Foundation/NSFileManager.h>
|
2013-10-17 21:05:15 +00:00
|
|
|
#import <Foundation/NSURL.h>
|
2011-03-04 11:33:22 +00:00
|
|
|
#import <Foundation/NSValue.h>
|
|
|
|
#import "AppKit/NSFileWrapper.h"
|
|
|
|
#import "AppKit/NSFont.h"
|
2013-10-17 21:05:15 +00:00
|
|
|
#import "AppKit/NSImage.h"
|
2011-03-04 11:33:22 +00:00
|
|
|
#import "AppKit/NSWorkspace.h"
|
1998-09-02 15:05:13 +00:00
|
|
|
|
2019-09-08 21:32:05 +00:00
|
|
|
@implementation NSFileWrapper (NSExtensions)
|
1998-09-02 15:05:13 +00:00
|
|
|
|
2000-03-25 09:15:23 +00:00
|
|
|
- (void) setIcon: (NSImage*)icon
|
1998-09-02 15:05:13 +00:00
|
|
|
{
|
2000-03-25 02:09:31 +00:00
|
|
|
ASSIGN(_iconImage, icon);
|
1998-09-02 15:05:13 +00:00
|
|
|
}
|
|
|
|
|
2001-12-17 16:51:51 +00:00
|
|
|
- (NSImage*) icon
|
1998-09-02 15:05:13 +00:00
|
|
|
{
|
2011-01-03 11:48:57 +00:00
|
|
|
if (_iconImage == nil && [self filename])
|
2001-09-26 22:51:51 +00:00
|
|
|
{
|
|
|
|
return [[NSWorkspace sharedWorkspace] iconForFile: [self filename]];
|
|
|
|
}
|
2000-03-25 02:09:31 +00:00
|
|
|
else
|
2001-09-26 22:51:51 +00:00
|
|
|
{
|
|
|
|
return _iconImage;
|
|
|
|
}
|
1998-09-02 15:05:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
2000-07-02 16:54:51 +00:00
|
|
|
|