home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 4.2
/
Openstep-4.2-Intel-Developer.iso
/
NextLibrary
/
Frameworks
/
AppKit.framework
/
Versions
/
B
/
Headers
/
NSImage.h
< prev
next >
Wrap
Text File
|
1996-10-17
|
4KB
|
121 lines
/*
NSImage.h
Application Kit
Copyright (c) 1994-1996, NeXT Software, Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <AppKit/NSGraphics.h>
#import <AppKit/NSBitmapImageRep.h>
@class NSColor;
@class NSImageRep;
@class NSPasteboard;
@class NSArray;
@interface NSImage : NSObject <NSCopying, NSCoding> {
NSString *_name;
NSSize _size;
struct __imageFlags {
unsigned int scalable:1;
unsigned int dataRetained:1;
unsigned int uniqueWindow:1;
unsigned int sizeWasExplicitlySet:1;
unsigned int builtIn:1;
unsigned int needsToExpand:1;
unsigned int useEPSOnResolutionMismatch:1;
unsigned int colorMatchPreferred:1;
unsigned int multipleResolutionMatching:1;
unsigned int subImage:1;
unsigned int archiveByName:1;
unsigned int unboundedCacheDepth:1;
unsigned int flipped:1;
unsigned int reserved1:19;
} _flags;
void *_reps;
NSColor *_color;
}
+ (id)imageNamed:(NSString *)name; /* If this finds & creates the image, only name is saved when archived */
- (id)initWithSize:(NSSize)aSize;
- (id)initWithData:(NSData *)data; /* When archived, saves contents */
- (id)initWithContentsOfFile:(NSString *)fileName; /* When archived, saves contents */
- (id)initByReferencingFile:(NSString *)fileName; /* When archived, saves fileName */
- (id)initWithPasteboard:(NSPasteboard *)pasteboard;
- (void)setSize:(NSSize)aSize;
- (NSSize)size;
- (BOOL)setName:(NSString *)string;
- (NSString *)name;
- (void)setScalesWhenResized:(BOOL)flag;
- (BOOL)scalesWhenResized;
- (void)setDataRetained:(BOOL)flag;
- (BOOL)isDataRetained;
- (void)setCachedSeparately:(BOOL)flag;
- (BOOL)isCachedSeparately;
- (void)setCacheDepthMatchesImageDepth:(BOOL)flag;
- (BOOL)cacheDepthMatchesImageDepth;
- (void)setBackgroundColor:(NSColor *)aColor;
- (NSColor *)backgroundColor;
- (void)setUsesEPSOnResolutionMismatch:(BOOL)flag;
- (BOOL)usesEPSOnResolutionMismatch;
- (void)setPrefersColorMatch:(BOOL)flag;
- (BOOL)prefersColorMatch;
- (void)setMatchesOnMultipleResolution:(BOOL)flag;
- (BOOL)matchesOnMultipleResolution;
- (void)dissolveToPoint:(NSPoint)point fraction:(float)aFloat;
- (void)dissolveToPoint:(NSPoint)point fromRect:(NSRect)rect fraction:(float)aFloat;
- (void)compositeToPoint:(NSPoint)point operation:(NSCompositingOperation)op;
- (void)compositeToPoint:(NSPoint)point fromRect:(NSRect)rect operation:(NSCompositingOperation)op;
- (BOOL)drawRepresentation:(NSImageRep *)imageRep inRect:(NSRect)rect;
- (void)recache;
- (NSData *)TIFFRepresentation;
- (NSData *)TIFFRepresentationUsingCompression:(NSTIFFCompression)comp factor:(float)aFloat;
- (NSArray *)representations;
- (void)addRepresentations:(NSArray *)imageReps;
- (void)addRepresentation:(NSImageRep *)imageRep;
- (void)removeRepresentation:(NSImageRep *)imageRep;
- (BOOL)isValid;
- (void)lockFocus;
- (void)lockFocusOnRepresentation:(NSImageRep *)imageRepresentation;
- (void)unlockFocus;
- (NSImageRep *)bestRepresentationForDevice:(NSDictionary *)deviceDescription;
- (void)setDelegate:(id)anObject;
- (id)delegate;
/* These return union of all the types registered with NSImageRep.
*/
+ (NSArray *)imageUnfilteredFileTypes;
+ (NSArray *)imageUnfilteredPasteboardTypes;
+ (NSArray *)imageFileTypes;
+ (NSArray *)imagePasteboardTypes;
+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
- (void)setFlipped:(BOOL)flag;
- (BOOL)isFlipped;
@end
#if !defined(STRICT_OPENSTEP) && defined(WIN32)
@interface NSImage (NSWindowsExtensions)
- (id)initWithIconHandle:(void * /* HICON */)icon;
- (id)initWithBitmapHandle:(void * /* HBITMAP */)bitmap;
@end
#endif
@interface NSObject(NSImageDelegate)
- (NSImage *)imageDidNotDraw:(id)sender inRect:(NSRect)aRect;
@end
@interface NSBundle(NSBundleImageExtension)
- (NSString *)pathForImageResource:(NSString *)name; /* May return nil if no file found */
@end