* TextConverters/RTF/GNUmakefile.preamble: Add BUNDLE_LIBS.

* Source/NSImage.m: Move documentation from here.
* Header/AppKit/NSImage.h: To here.
* Headers/AppKit/NSImageRep.h, : Add documentation. (patch #5714).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24495 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2007-02-10 03:45:22 +00:00
parent ca4bba22ab
commit 3f70810790
5 changed files with 213 additions and 65 deletions

View file

@ -1,3 +1,11 @@
2007-02-09 Adam Fedor <fedor@gnu.org>
* TextConverters/RTF/GNUmakefile.preamble: Add BUNDLE_LIBS.
* Source/NSImage.m: Move documentation from here.
* Header/AppKit/NSImage.h: To here.
* Headers/AppKit/NSImageRep.h, : Add documentation. (patch #5714).
2007-02-09 Fred Kiefer <FredKiefer@gmx.de>
* Source/GNUmakefile: Install header file NSKeyValueBinding.h.

View file

@ -45,6 +45,19 @@
@class NSColor;
@class NSView;
/** Defines how an NSImage is to be cached. Possible values are:
* <list>
* <item>NSImageCacheDefault</item>
* <item>NSImageCacheAlways</item>
* <item>NSImageCacheBySize</item>
* <item>NSImageCacheNever</item>
* </list>
* <p>See Also:</p>
* <list>
* <item>-setCacheMode:</item>
* <item>-cacheMode</item>
* </list>
*/
typedef enum {
NSImageCacheDefault,
NSImageCacheAlways,
@ -82,10 +95,47 @@ typedef enum {
//
// Initializing a New NSImage Instance
//
/** Initializes and returns a NSImage from the NSString fileName.
*/
- (id) initByReferencingFile: (NSString*)fileName;
/** Initializes and returns a new NSImage from the file
* fileName. fileName should be an absolute path.
* <p>See Also:</p>
* <list>
* <item>[NSImageRep+imageRepsWithContentsOfFile:]</item>
* </list>
*/
- (id) initWithContentsOfFile: (NSString*)fileName;
/** Initializes and returns a new NSImage from the NSData data.
* <p>See Also:</p>
* <list>
* <item>[NSBitmapImageRep+imageRepWithData:]</item>
* <item>[NSEPSImageRep+imageRepWithData:]</item>
* </list>
*/
- (id) initWithData: (NSData*)data;
/** Initializes and returns a new NSImage from the data in pasteboard.
* The pasteboard types can be whose defined in
* [NSImageRep+imagePasteboardTypes] or NSFilenamesPboardType
* <p>See Also:</p>
* <list>
* <item>[NSImageRep+imageRepsWithPasteboard:]</item>
* </list>
*/
- (id) initWithPasteboard: (NSPasteboard*)pasteboard;
/** Initialize and returns a new NSImage with aSize as specified
* size.
* <p>See Also:</p>
* <list>
* <item>-setSize:</item>
* <item>-size</item>
* </list>
*/
- (id) initWithSize: (NSSize)aSize;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
@ -97,28 +147,88 @@ typedef enum {
//
// Setting the Size of the Image
//
/** Sets the NSImage size to aSize. Changing the size recreate
* the cache.
* <p>See Also:</p>
* <list>
* <item>-size</item>
* <item>-initWithSize:</item>
* </list>
*/
- (void) setSize: (NSSize)aSize;
/** Returns NSImage size if the size have been set. Returns the
* size of the best representation otherwise.
* <p>See Also:</p>
* <list>
* <item>-setSize:</item>
* <item>-initWithSize:</item>
* </list>
*/
- (NSSize) size;
//
// Referring to Images by Name
//
/** Returns the NSImage named aName. The search is done in the main bundle
* first and then in the usual images directories.
*/
+ (id) imageNamed: (NSString*)aName;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
+ (NSImage*) _standardImageWithName: (NSString*)name;
#endif
#endif
/** Sets aName as the name of the receiver.
*/
- (BOOL) setName: (NSString*)aName;
/** Returns the name of the receiver.
*/
- (NSString*) name;
//
// Specifying the Image
//
/** Adds the NSImageRep imageRep to the NSImage's representations array.
* <p>See Also:</p>
* <list>
* <item>-addRepresentations:</item>
* <item>-removeRepresentation:</item>
* </list>
*/
- (void) addRepresentation: (NSImageRep*)imageRep;
/** Adds the NSImageRep array imageRepArray to the NSImage's
* representations array.
* <p>See Also:</p>
* <list>
* <item>-addRepresentation:</item>
* <item>-removeRepresentation:</item>
* </list>
*/
- (void) addRepresentations: (NSArray*)imageRepArray;
/** Locks the focus on the best representation.
* <p>See Also:</p>
* <list>
* <item>-lockFocusOnRepresentation:</item>
* </list>
*/
- (void) lockFocus;
/** Locks the focus in the imageRep. If imageRep is nil this method
* locks the focus on the best representation.
*/
- (void) lockFocusOnRepresentation: (NSImageRep*)imageRep;
/** Unlocks the focus on the receiver.
* <p>See Also:</p>
* <list>
* <item>-lockFocus</item>
* </list>
*/
- (void) unlockFocus;
//
@ -148,7 +258,18 @@ typedef enum {
//
// Choosing Which Image Representation to Use
//
/** Sets the preferred representation of a NSImage.
* <p>See Also:</p>
* <list>
* <item>-prefersColorMatch</item>
* <item>-bestRepresentationForDevice:</item>
* </list>
*/
- (void) setPrefersColorMatch: (BOOL)flag;
/** Returns YES if color matching is the preferred representation
* and NO otherwise.
*/
- (BOOL) prefersColorMatch;
- (void) setUsesEPSOnResolutionMismatch: (BOOL)flag;
- (BOOL) usesEPSOnResolutionMismatch;
@ -158,8 +279,21 @@ typedef enum {
//
// Getting the Representations
//
/** Finds the best representation for deviceDescription. If
* deviceDescription is nil, it guesses where drawing is taking
* place and finds the best representation.
*/
- (NSImageRep*) bestRepresentationForDevice: (NSDictionary*)deviceDescription;
- (NSArray*) representations;
/** Remove the NSImageRep imageRep from the NSImage's representations
* array
* <p>See Also:</p>
* <list>
* <item>-addRepresentations:</item>
* <item>-addRepresentation:</item>
* </list>
*/
- (void) removeRepresentation: (NSImageRep*)imageRep;
//
@ -181,25 +315,27 @@ typedef enum {
inRect: (NSRect)aRect;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
/** Calls -drawAtPoint:fromRect:operation:fraction: with
<code>dstRect</code> given by <code>point</code> and the size of
<code>srcRect</code>. */
* <code>dstRect</code> given by <code>point</code> and the size of
* <code>srcRect</code>.
*/
- (void) drawAtPoint: (NSPoint)point
fromRect: (NSRect)srcRect
operation: (NSCompositingOperation)op
fraction: (float)delta;
/** <p>Takes the part of the receiver given by <code>srcRect</code> and
draws it in <code>dstRect</code> in the current coordinate system,
transforming the image as necessary.
</p><p>
The image is drawn as if it was drawn to a cleared window, then
dissolved using the fraction <code>delta</code> to another cleared
window, and finally composited using <code>op</code> to the
destination.
</p><p>
Note that compositing and dissolving doesn't work on all devices
(printers, in particular).
</p> */
* draws it in <code>dstRect</code> in the current coordinate system,
* transforming the image as necessary.
* </p><p>
* The image is drawn as if it was drawn to a cleared window, then
* dissolved using the fraction <code>delta</code> to another cleared
* window, and finally composited using <code>op</code> to the
* destination.
* </p><p>
* Note that compositing and dissolving doesn't work on all devices
* (printers, in particular).
* </p>
*/
- (void) drawInRect: (NSRect)dstRect
fromRect: (NSRect)srcRect
operation: (NSCompositingOperation)op
@ -212,7 +348,21 @@ typedef enum {
- (BOOL) isValid;
- (void) setScalesWhenResized: (BOOL)flag;
- (BOOL) scalesWhenResized;
/** Sets the color of the NSImage's background to aColor.
* <p>See Also:</p>
* <list>
* <item>-backgroundColor</item>
* </list>
*/
- (void) setBackgroundColor: (NSColor*)aColor;
/** Returns the color of the NSImage's background.
* <p>See Also:</p>
* <list>
* <item>-setBackgroundColor:</item>
* </list>
*/
- (NSColor*) backgroundColor;
- (void) recache;
- (void) setFlipped: (BOOL)flag;

View file

@ -59,7 +59,13 @@ enum {
//
// Creating an NSImageRep
//
/** Returns a NSImageRep with the contents of filename.
*/
+ (id)imageRepWithContentsOfFile:(NSString *)filename;
/** Returns an array of newly allocated NSImageRep objects with the
* contents of filename.
*/
+ (NSArray *)imageRepsWithContentsOfFile:(NSString *)filename;
+ (id)imageRepWithPasteboard:(NSPasteboard *)pasteboard;
+ (NSArray *)imageRepsWithPasteboard:(NSPasteboard *)pasteboard;
@ -71,22 +77,49 @@ enum {
//
// Checking Data Types
//
/** Returns NO. It is the subclass' responsibility to implement this method.
* <p>See Also:</p>
* <list>
* <item>[NSBitmapImageRep+canInitWithData:]</item>
* </list>
*/
+ (BOOL)canInitWithData:(NSData *)data;
+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
/** Returns array produced by calling -imageUnfilteredFileTypes.
*/
+ (NSArray *)imageFileTypes;
+ (NSArray *)imagePasteboardTypes;
/** Returns nil. It is the subclass' responsibility to implement this method.
* <p>See Also:</p>
* <list>
* <item>[NSBitmapImageRep+imageUnfilteredFileTypes]</item>
* </list>
*/
+ (NSArray *)imageUnfilteredFileTypes;
+ (NSArray *)imageUnfilteredPasteboardTypes;
//
// Setting the Size of the Image
//
/** Sets the size of the image to aSize.
*/
- (void)setSize:(NSSize)aSize;
/** Returns the size of the image.
*/
- (NSSize)size;
//
// Specifying Information about the Representation
//
/** Returns the bits per sample of the receiver.
* <p>See Also:</p>
* <list>
* <item>-setBitsPerSample:</item>
* </list>
*/
- (int)bitsPerSample;
- (NSString *)colorSpaceName;
- (BOOL)hasAlpha;
@ -94,6 +127,13 @@ enum {
- (int)pixelsHigh;
- (int)pixelsWide;
- (void)setAlpha:(BOOL)flag;
/** Sets the number of bits for each component of a pixel.
* <p>See Also:</p>
* <list>
* <item>-bitsPerSample</item>
* </list>
*/
- (void)setBitsPerSample:(int)anInt;
- (void)setColorSpaceName:(NSString *)aString;
- (void)setOpaque:(BOOL)flag;

View file

@ -193,9 +193,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
}
}
/** <p>Returns the NSImage named aName. The search is done in the main bundle
first and then in the usual images directories</p>
*/
+ (id) imageNamed: (NSString *)aName
{
NSString *realName = [nsmapping objectForKey: aName];
@ -314,9 +311,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
return [self initWithSize: NSMakeSize(0, 0)];
}
/** <p>Initialize and returns a new NSImage with <var>aSize</var> as specified
size.</p><p>See Also: -setSize: -size </p>
*/
- (id) initWithSize: (NSSize)aSize
{
[super init];
@ -357,11 +351,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
return self;
}
/** <p>Initializes and returns a new NSImage from the file
<var>fileName</var>. <var>fileName</var> should be an absolute path.</p>
<p>See Also: [NSImageRep+imageRepsWithContentsOfFile:]</p>
*/
- (id) initWithContentsOfFile: (NSString *)fileName
{
if ( ! ( self = [self init] ) )
@ -377,11 +366,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
return self;
}
/**
* <p>Initializes and returns a new NSImage from the NSData data.</p>
* <p>See Also: [NSBitmapImageRep+imageRepWithData:] or
* [NSEPSImageRep+imageRepWithData:]</p>
*/
- (id) initWithData: (NSData *)data
{
if (! ( self = [self init] ) )
@ -443,11 +427,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
return self;
}
/** <p>Initializes and returns a new NSImage from the data in pasteboard.
the pasteboard types can be whose defined in
[NSImageRep+imagePasteboardTypes] or NSFilenamesPboardType</p>
<p>See Also: [NSImageRep+imageRepsWithPasteboard:</p>
*/
- (id) initWithPasteboard: (NSPasteboard *)pasteboard
{
NSArray *reps;
@ -551,10 +530,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
return _name;
}
/** <p>Sets the NSImage size to aSize. Changing the size recreate
the cache</p>
<p>See Also: -size -initWithSize:</p>
*/
- (void) setSize: (NSSize)aSize
{
// Optimized as this is called very often from NSImageCell
@ -567,10 +542,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
[self recache];
}
/**<p> Returns NSImage size if the size have been set. Returns the
size of the best representation otherwise.</p>
<p>See Also: -setSize: -initWithSize:</p>
*/
- (NSSize) size
{
if (_size.width == 0)
@ -718,9 +689,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
return _flags.scalable;
}
/**<p>Sets the color of the NSImage's background to <var>aColor</var></p>
<p>See Also: -backgroundColor</p>
*/
- (void) setBackgroundColor: (NSColor *)aColor
{
if (aColor == nil)
@ -730,9 +698,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
ASSIGN(_color, aColor);
}
/**<p>Returns the color of the NSImage's background</p>
<p>See Also: -setBackgroundColor:</p>
*/
- (NSColor *) backgroundColor
{
return _color;
@ -1171,10 +1136,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
}
}
/** <p>Adds the NSImageRep imageRep to the NSImage's representations array.
</p><p>See Also: -addRepresentations: removeRepresentation:</p>
*/
- (void) addRepresentation: (NSImageRep *)imageRep
{
GSRepData *repd;
@ -1185,10 +1146,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
RELEASE(repd);
}
/** <p>Adds the NSImageRep array imageRepArray to the NSImage's
representations array.</p>
<p>See Also: -addRepresentation: -removeRepresentation:</p>
*/
- (void) addRepresentations: (NSArray *)imageRepArray
{
unsigned i, count;
@ -1204,9 +1161,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
}
}
/** <p>Remove the NSImageRep imageRep from the NSImage's representations
array</p><p>See Also: -addRepresentations: -addRepresentation:</p>
*/
- (void) removeRepresentation: (NSImageRep *)imageRep
{
unsigned i;
@ -1227,17 +1181,11 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
}
}
/** <p>Locks the focus on the best representation</p>
<p>See Also: -lockFocusOnRepresentation:</p>
*/
- (void) lockFocus
{
[self lockFocusOnRepresentation: nil];
}
/**<p>Locks the focus in the imageRep. if imageRep is nil this method
locks the focus on the best representation</p>
*/
- (void) lockFocusOnRepresentation: (NSImageRep *)imageRep
{
if (_cacheMode != NSImageCacheNever)

View file

@ -58,6 +58,8 @@ ADDITIONAL_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR)
#ADDITIONAL_TOOL_LIBS +=
RTFConverter_BUNDLE_LIBS += -lgnustep-gui
#
# Flags dealing with installing and uninstalling
#