Improved image handling.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20501 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-12-29 02:21:11 +00:00
parent 985d7c9a41
commit 162768468f
5 changed files with 39 additions and 17 deletions

View file

@ -1,3 +1,11 @@
2004-12-28 21:21 Gregory John Casamento <greg_casamento@yahoo.com>
* GormImageEditor.m: Added check to see if object responds
to setImage: in performDragOperation.
* GormImage.m: Moved NSImage category dec/def here.
* GormPrivate.h: Removed NSImage category declaration.
* GormViewEditor.m: Removed NSImage category definition.
2004-12-28 16:38 Gregory John Casamento <greg_casamento@yahoo.com>
* GormPalettesManager.m: Enhancment in loadPalette: to allow

View file

@ -25,6 +25,27 @@
#include <AppKit/NSImage.h>
#include "GormImage.h"
//
// To allow us to load the image by name, but save it
// within the archive. This is a bit of a cheat.
//
@interface NSImage (GormNSImageAddition)
- (void) setArchiveByName: (BOOL) archiveByName;
- (BOOL) archiveByName;
@end
@implementation NSImage (GormNSImageAddition)
- (void) setArchiveByName: (BOOL) archiveByName
{
_flags.archiveByName = archiveByName;
}
- (BOOL) archiveByName
{
return _flags.archiveByName;
}
@end
// image proxy object...
@implementation GormImage
+ (GormImage*)imageForPath: (NSString *)aPath
@ -83,6 +104,8 @@
isSystemImage = NO;
isInWrapper = NO;
[image setArchiveByName: NO];
[smallImage setArchiveByName: NO];
}
else
{
@ -134,6 +157,8 @@
- (void) setSystemImage: (BOOL)flag
{
isSystemImage = flag;
[image setArchiveByName: flag];
[smallImage setArchiveByName: flag];
}
- (BOOL) isSystemImage

View file

@ -37,7 +37,6 @@
{
return @"GormImageInspector";
}
@end

View file

@ -303,12 +303,6 @@ extern NSString *GormResizeCellNotification;
- (NSImage *) imageForViewer;
@end
// to allow us to load the image by name, but save it within the archive.
// this is a bit of a cheat.
@interface NSImage (GormNSImageAddition)
- (void) setArchiveByName: (BOOL) archiveByName;
@end
/*
* Functions for drawing knobs etc.
*/

View file

@ -35,13 +35,6 @@
#include <math.h>
#include <stdlib.h>
@implementation NSImage (GormNSImageAddition)
- (void) setArchiveByName: (BOOL) archiveByName
{
_flags.archiveByName = archiveByName;
}
@end
@implementation GormPlacementInfo
@end
@ -1332,9 +1325,12 @@ static BOOL currently_displaying = NO;
else if ([types containsObject: GormImagePboardType] == YES)
{
NSString *name = [dragPb stringForType: GormImagePboardType];
NSImage *image = [NSImage imageNamed: name];
[image setArchiveByName: NO];
[(id)_editedObject setImage: AUTORELEASE([image copy])];
if([(id)_editedObject respondsToSelector: @selector(setImage:)])
{
NSImage *image = [NSImage imageNamed: name];
// [image setArchiveByName: NO];
[(id)_editedObject setImage: AUTORELEASE([image copy])];
}
return YES;
}
else if ([types containsObject: GormSoundPboardType] == YES)