Tidy up nsimage a bit

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5357 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-12-02 06:48:02 +00:00
parent 91169ffc3c
commit c53db9fc31
3 changed files with 21 additions and 23 deletions

View file

@ -1,7 +1,8 @@
Thu Dec 2 6:07:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSImage.m: Use opacity values from image reps to cache more
intelligently, and set the opacity of caches correctly.
intelligently, and set the opacity of caches correctly. Removed an ivar
* Headers/AppKit/NSImage.h: removed _repList ivar - not needed
Thu Dec 2 01:28:34 1999 Nicola Pero <n.pero@mi.flashnet.it>

View file

@ -68,7 +68,6 @@
unsigned syncLoad:1;
} _flags;
NSMutableArray *_reps;
NSMutableArray *_repList;
NSColor *_color;
NSView *_lockedView;
id delegate;

View file

@ -131,7 +131,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
- (BOOL) useFromFile: (NSString *)fileName;
- (BOOL) loadFromData: (NSData *)data;
- (BOOL) loadFromFile: (NSString *)fileName;
- (NSImageRep *) lastRepresentation;
- (NSImageRep*) cacheForRep: (NSImageRep*)rep
onDevice: (NSDictionary*)deviceDescription;
- (NSImageRep*) _doImageCache: (NSDictionary*)deviceDescription;
@ -370,7 +369,6 @@ static Class cacheClass = 0;
- (void) dealloc
{
[self representations];
RELEASE(_repList);
RELEASE(_reps);
/* Make sure we don't remove name from the nameDict if we are just a copy
of the named image, not the original image */
@ -389,7 +387,6 @@ static Class cacheClass = 0;
RETAIN(name);
copy->_reps = [NSMutableArray new];
copy->_repList = [NSMutableArray new];
RETAIN(_color);
_lockedView = nil;
[copy addRepresentations: [self representations]];
@ -832,13 +829,6 @@ static Class cacheClass = 0;
}
}
- (NSImageRep *) lastRepresentation
{
// Reconstruct the rep list if it has changed
[self representations];
return [_repList lastObject];
}
- (NSImageRep*) bestRepresentationForDevice: (NSDictionary*)deviceDescription
{
NSImageRep *rep = nil;
@ -998,21 +988,29 @@ static Class cacheClass = 0;
- (NSArray *) representations
{
unsigned i, count;
unsigned count;
if (!_repList)
_repList = [[NSMutableArray alloc] init];
if (_flags.syncLoad)
[self _loadImageFilenames];
[_repList removeAllObjects];
count = [_reps count];
for (i = 0; i < count; i++)
{
GSRepData *repd = [_reps objectAtIndex: i];
[_repList addObject: repd->rep];
[self _loadImageFilenames];
}
count = [_reps count];
if (count == 0)
{
return [NSArray array];
}
else
{
id repList[count];
unsigned i;
[_reps getObjects: repList];
for (i = 0; i < count; i++)
{
repList[i] = ((GSRepData*)repList[i])->rep;
}
return [NSArray arrayWithObjects: repList count: count];
}
return _repList;
}
- (void) setDelegate: anObject