mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 11:41:05 +00:00
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:
parent
985d7c9a41
commit
162768468f
5 changed files with 39 additions and 17 deletions
|
@ -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
|
||||
|
|
25
GormImage.m
25
GormImage.m
|
@ -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
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
{
|
||||
return @"GormImageInspector";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue