documentation cleanups

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24035 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-11-06 13:58:37 +00:00
parent fc21139a69
commit 45acf44de1
135 changed files with 810 additions and 402 deletions

View file

@ -609,13 +609,46 @@ GSCurrentServer(void)
[self subclassResponsibility: _cmd];
}
/** Causes the window to be ordered onto or off the screen depending
on the value of op. The window is ordered relative to otherWin.
The window will never be ordered in front of the current key/main
window except in the special case where otherWin is negative (This
is a special feature that [NSWindow-orderWindow:relativeTo:] uses
to place the window correctly).
*/
/**
* <p>Causes the window to be ordered onto or off the screen depending
* on the value of op. The window is ordered relative to otherWin.
* </p>
* <p>The effect of the various combinations of op and otherWin are:
* </p>
* <deflist>
* <term>op is NSWindowOut</term>
* <desc>
* The window is removed from the display and otherWinm is ignored.
* </desc>
* <term>op is NSWindowAbove and otherWin is zero</term>
* <desc>
* The window is placed above all other windows at the same level
* unless doing the current key window is at this level (in which
* case the window will be placed immediately below that).
* </desc>
* <term>op is NSWindowAbove and otherWin is minus one</term>
* <desc>
* The window is placed above all other windows at the same level
* even if doing that would place it above the current key window.<br />
* This is a special feature that [NSWindow-orderWindow:relativeTo:] uses
* to place the window correctly.
* </desc>
* <term>op is NSWindowBelow and otherWin is zero</term>
* <desc>
* The window is placed above all other windows at the same level.
* </desc>
* <term>op is NSWindowAbove and otherWin is a window on the display</term>
* <desc>
* The level of the window is set to be the same as that of
* otherWin and the window is placed immediately above otherWin.
* </desc>
* <term>op is NSWindowBelow and otherWin is a window on the display</term>
* <desc>
* The level of the window is set to be the same as that of
* otherWin and the window is placed immediately below otherWin.
* </desc>
* </deflist>
*/
- (void) orderwindow: (int) op : (int) otherWin : (int) win
{
[self subclassResponsibility: _cmd];
@ -652,7 +685,12 @@ GSCurrentServer(void)
return NSZeroRect;
}
/** Set the level of the window as in [NSWindow -setLevel] */
/** Set the level of the window as in the [NSWindow -setLevel] method.<br />
* The use of window levels organises the window hierarchy into groups
* of windows at each level. It effects the operation of the
* -orderwindow::: method in the case where the position is 'above' or
* 'below' and the other window number is zero.
*/
- (void) setwindowlevel: (int) level : (int) win
{
[self subclassResponsibility: _cmd];

View file

@ -647,7 +647,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
* <p>Typically, -run is called by an application's <code>main</code> method
* after the NSApplication instance is created, which never returns. However,
* applications needing to integrate other event loops may strategically call
* the -stop method, followed by -run later on.</p>
* the -stop: method, followed by -run later on.</p>
*
* <p>To avoid most common needs for subclassing, NSApplication allows you to
* specify a <em>delegate</em> that is messaged in particular situations.
@ -1077,6 +1077,10 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
{
GSDisplayServer *srv = GSServerForWindow(_app_icon_window);
if (srv == nil)
{
srv = GSCurrentServer();
}
[[[NSWorkspace sharedWorkspace] notificationCenter]
removeObserver: self];
[nc removeObserver: self];

View file

@ -136,7 +136,7 @@ Class converter_bundles(NSString *format, BOOL producer)
if (aBundle && ((bclass = [aBundle principalClass])))
{
if ([bclass respondsToSelector:
@selector(classForFormat:producer:)])
@selector(classForFormat: producer: )])
{
converter_class = (Class)[bclass classForFormat: format
producer: producer];
@ -276,14 +276,14 @@ static Class converter_class(NSString *format, BOOL producer)
if (NSMaxRange(range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -fontAttributesInRange:"];
format: @"RangeError in method -fontAttributesInRange: "];
}
all = [self attributesAtIndex: range.location
effectiveRange: &range];
if (sel == 0)
{
sel = @selector (objectForKey:);
sel = @selector (objectForKey: );
}
objForKey = [all methodForSelector: sel];
@ -319,7 +319,7 @@ static Class converter_class(NSString *format, BOOL producer)
if (NSMaxRange (range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -rulerAttributesInRange:"];
format: @"RangeError in method -rulerAttributesInRange: "];
}
style = [self attribute: NSParagraphStyleAttributeName
@ -348,7 +348,7 @@ static Class converter_class(NSString *format, BOOL producer)
if (NSMaxRange (aRange) > length || location > length)
{
[NSException raise: NSRangeException
format: @"RangeError in method -lineBreakBeforeIndex:withinRange:"];
format: @"RangeError in method -lineBreakBeforeIndex: withinRange: "];
}
if (!NSLocationInRange (location, aRange))
@ -362,7 +362,7 @@ static Class converter_class(NSString *format, BOOL producer)
range: scanRange];
while (startRange.length > 0 && startRange.location > 0
&& [str characterAtIndex: startRange.location] == '\''
&& [wordCSet characterIsMember:
&& [wordCSet characterIsMember:
[str characterAtIndex: startRange.location-1]])
{
location = startRange.location - 1;
@ -393,7 +393,7 @@ static Class converter_class(NSString *format, BOOL producer)
if (location > length)
{
[NSException raise: NSRangeException
format: @"RangeError in method -doubleClickAtIndex:"];
format: @"RangeError in method -doubleClickAtIndex: "];
}
/*
@ -419,9 +419,9 @@ static Class converter_class(NSString *format, BOOL producer)
while (startRange.length > 0
&& startRange.location > 0 && startRange.location < length - 1
&& [str characterAtIndex: startRange.location] == '\''
&& [wordCSet characterIsMember:
&& [wordCSet characterIsMember:
[str characterAtIndex: startRange.location - 1]]
&& [wordCSet characterIsMember:
&& [wordCSet characterIsMember:
[str characterAtIndex: startRange.location + 1]])
{
location = startRange.location - 1;
@ -437,9 +437,9 @@ static Class converter_class(NSString *format, BOOL producer)
while (endRange.length > 0
&& endRange.location > 0 && endRange.location < length - 1
&& [str characterAtIndex: endRange.location] == '\''
&& [wordCSet characterIsMember:
&& [wordCSet characterIsMember:
[str characterAtIndex: endRange.location - 1]]
&& [wordCSet characterIsMember:
&& [wordCSet characterIsMember:
[str characterAtIndex: endRange.location + 1]])
{
location = endRange.location + 1;
@ -478,7 +478,7 @@ static Class converter_class(NSString *format, BOOL producer)
if (location > length)
{
[NSException raise: NSRangeException
format: @"RangeError in method -nextWordFromIndex:forward:"];
format: @"RangeError in method -nextWordFromIndex: forward: "];
}
/* Please note that we consider ' a valid word separator. This is
@ -508,7 +508,7 @@ static Class converter_class(NSString *format, BOOL producer)
{
return length;
}
/* rangeOfCharacterFromSet:options:range: only returns the range
/* rangeOfCharacterFromSet: options: range: only returns the range
of the first word-separator character ... we want to skip
them all! So we need to search again, this time for the
first non-word-separator character, and return the first such
@ -545,7 +545,7 @@ static Class converter_class(NSString *format, BOOL producer)
return 0;
}
/* rangeOfCharacterFromSet:options:range: only returns the range
/* rangeOfCharacterFromSet: options: range: only returns the range
of the first non-word-separator character ... we want to skip
them all! So we need to search again, this time for the
first word-separator character. */
@ -719,7 +719,7 @@ documentAttributes: (NSDictionary **)dict
if (NSMaxRange (range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -superscriptRange:"];
format: @"RangeError in method -superscriptRange: "];
}
// We take the value from the first character and use it for the whole range
@ -751,7 +751,7 @@ documentAttributes: (NSDictionary **)dict
if (NSMaxRange (range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -subscriptRange:"];
format: @"RangeError in method -subscriptRange: "];
}
// We take the value form the first character and use it for the whole range
@ -778,7 +778,7 @@ documentAttributes: (NSDictionary **)dict
if (NSMaxRange (range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -unscriptRange:"];
format: @"RangeError in method -unscriptRange: "];
}
[self removeAttribute: NSSuperscriptAttributeName
@ -796,7 +796,7 @@ documentAttributes: (NSDictionary **)dict
if (NSMaxRange (range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -applyFontTraits:range:"];
format: @"RangeError in method -applyFontTraits: range: "];
}
while (loc < NSMaxRange (range))
@ -830,7 +830,7 @@ documentAttributes: (NSDictionary **)dict
if (NSMaxRange(range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -setAlignment:range:"];
format: @"RangeError in method -setAlignment: range: "];
}
while (loc < NSMaxRange(range))
@ -879,7 +879,7 @@ documentAttributes: (NSDictionary **)dict
if (NSMaxRange (range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -fixFontAttributeInRange:"];
format: @"RangeError in method -fixFontAttributeInRange: "];
}
// FIXME: Should check for each character if it is supported by the
// assigned font
@ -899,7 +899,7 @@ documentAttributes: (NSDictionary **)dict
if (NSMaxRange (range) > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -fixParagraphStyleAttributeInRange:"];
format: @"RangeError in method -fixParagraphStyleAttributeInRange: "];
}
while (loc < NSMaxRange (range))
@ -965,76 +965,76 @@ documentAttributes: (NSDictionary **)dict
}
}
- (void) fixAttachmentAttributeInRange: (NSRange)aRange
- (void) fixAttachmentAttributeInRange: (NSRange)range
{
NSString *string = [self string];
unsigned location = aRange.location;
unsigned end = NSMaxRange (aRange);
unsigned location = range.location;
unsigned end = NSMaxRange (range);
cache_init ();
if (end > [self length])
{
[NSException raise: NSRangeException
format: @"RangeError in method -fixAttachmentAttributeInRange:"];
format: @"RangeError in method -fixAttachmentAttributeInRange: "];
}
// Check for attachments with the wrong character
while (location < end)
{
NSDictionary *attr;
NSRange range;
NSRange eRange;
attr = [self attributesAtIndex: location effectiveRange: &range];
attr = [self attributesAtIndex: location effectiveRange: &eRange];
if ([attr objectForKey: NSAttachmentAttributeName] != nil)
{
unichar buf[range.length];
unichar buf[eRange.length];
unsigned pos = 0;
unsigned start = range.location;
unsigned start = eRange.location;
// Leave only one character with the attachment
[string getCharacters: buf range: range];
while (pos < range.length && buf[pos] != NSAttachmentCharacter)
pos++;
[string getCharacters: buf range: eRange];
while (pos < eRange.length && buf[pos] != NSAttachmentCharacter)
pos++;
if (pos)
[self removeAttribute: NSAttachmentAttributeName
range: NSMakeRange (start, pos)];
pos++;
if (pos < range.length)
if (pos < eRange.length)
[self removeAttribute: NSAttachmentAttributeName
range: NSMakeRange (start + pos, range.length - pos)];
range: NSMakeRange (start + pos, eRange.length - pos)];
}
location = NSMaxRange (range);
location = NSMaxRange (eRange);
}
// Check for attachment characters without attachments
location = aRange.location;
location = range.location;
while (location < end)
{
NSRange range = [string rangeOfString: attachmentString
NSRange eRange = [string rangeOfString: attachmentString
options: NSLiteralSearch
range: NSMakeRange (location, end - location)];
NSTextAttachment *attachment;
if (!range.length)
if (!eRange.length)
break;
attachment = [self attribute: NSAttachmentAttributeName
atIndex: range.location
atIndex: eRange.location
effectiveRange: NULL];
if (attachment == nil)
{
[self deleteCharactersInRange: NSMakeRange (range.location, 1)];
range.length--;
[self deleteCharactersInRange: NSMakeRange (eRange.location, 1)];
eRange.length--;
end--;
}
location = NSMaxRange (range);
location = NSMaxRange (eRange);
}
}
- (void)updateAttachmentsFromPath:(NSString *)path
- (void) updateAttachmentsFromPath: (NSString *)path
{
NSString *string = [self string];
unsigned location = 0;

View file

@ -464,7 +464,8 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
/**<p>Returns the document visible rectangle in the document views coordinate
* system.
<p>See Also: -documentRect [NSView-convertRect:toView:]</p>
* </p>
* <p>See Also: -documentRect [NSView-convertRect:toView:]</p>
*/
- (NSRect) documentVisibleRect
{

View file

@ -377,8 +377,10 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
return self;
}
/**<p>Initializes and returns a new NSImage from the NSData data.</p>
<p>See Also: [NSImageRep+imageRepWithData:]</p>
/**
* <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
{
@ -823,7 +825,7 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
}
- (void) compositeToPoint: (NSPoint)aPoint
fromRect: (NSRect)aRect
fromRect: (NSRect)srcRect
operation: (NSCompositingOperation)op
fraction: (float)delta
{
@ -832,27 +834,28 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
NS_DURING
{
if ([GSCurrentContext() isDrawingToScreen] == YES)
rep = [self _doImageCache];
rep = [self _doImageCache];
if (rep
&&_cacheMode != NSImageCacheNever
&& [rep isKindOfClass: cachedClass])
&&_cacheMode != NSImageCacheNever
&& [rep isKindOfClass: cachedClass])
{
NSRect rect;
rect = [(NSCachedImageRep *)rep rect];
NSDebugLLog(@"NSImage", @"composite rect %@ in %@",
NSStringFromRect(rect), NSStringFromRect(aRect));
NSStringFromRect(rect), NSStringFromRect(srcRect));
// Move the drawing rectangle to the origin of the image rep
// and intersect the two rects.
aRect.origin.x += rect.origin.x;
aRect.origin.y += rect.origin.y;
rect = NSIntersectionRect(aRect, rect);
srcRect.origin.x += rect.origin.x;
srcRect.origin.y += rect.origin.y;
rect = NSIntersectionRect(srcRect, rect);
[GSCurrentContext() GScomposite: [[(NSCachedImageRep *)rep window] gState]
toPoint: aPoint
fromRect: rect
operation: op
fraction: delta];
[GSCurrentContext() GScomposite:
[[(NSCachedImageRep *)rep window] gState]
toPoint: aPoint
fromRect: rect
operation: op
fraction: delta];
}
else
{
@ -864,17 +867,18 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
}
NS_HANDLER
{
NSLog(@"NSImage: compositeToPoint:fromRect:operation:fraction: failed due to %@: %@",
[localException name], [localException reason]);
NSLog(@"NSImage: compositeToPoint:fromRect:operation:fraction:"
@"failed due to %@: %@",
[localException name], [localException reason]);
if ([_delegate respondsToSelector: @selector(imageDidNotDraw:inRect:)])
{
NSImage *image = [_delegate imageDidNotDraw: self inRect: aRect];
NSImage *image = [_delegate imageDidNotDraw: self inRect: srcRect];
if (image != nil)
[image compositeToPoint: aPoint
fromRect: aRect
operation: op
fraction: delta];
fromRect: srcRect
operation: op
fraction: delta];
}
}
NS_ENDHANDLER
@ -995,7 +999,7 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
- (void) drawInRect: (NSRect)dstRect
fromRect: (NSRect)srcRect
operation: (NSCompositingOperation)op
fraction: (float)fraction
fraction: (float)delta
{
NSGraphicsContext *ctxt = GSCurrentContext();
NSAffineTransform *transform;
@ -1042,7 +1046,7 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
/* If the effective transform is the identity transform and there's
no dissolve, we can composite from our cache. */
if (fraction == 1.0
if (delta == 1.0
&& fabs(transform->matrix.m11 - 1.0) < 0.01
&& fabs(transform->matrix.m12) < 0.01
&& fabs(transform->matrix.m21) < 0.01
@ -1141,9 +1145,9 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
/* If we're doing a dissolve, use a DestinationIn composite to lower
the alpha of the pixels. */
if (fraction != 1.0)
if (delta != 1.0)
{
DPSsetalpha(ctxt, fraction);
DPSsetalpha(ctxt, delta);
DPScompositerect(ctxt, 0, 0, s.width, s.height,
NSCompositeDestinationIn);
}

View file

@ -1482,22 +1482,22 @@ many times.
}
/**
Orders the window to the back of its level. Equivalent to
-orderWindow: NSWindowBelow relativeTo: 0.
*/
* Orders the window to the back of its level. Equivalent to
* -orderWindow:relativeTo: with arguments NSWindowBelow and 0.
*/
- (void) orderBack: (id)sender
{
[self orderWindow: NSWindowBelow relativeTo: 0];
}
/**
If the application is active, orders the window to the front in its
level. If the application is not active, the window is ordered in as
far forward as possible in its level without being ordered in front
of the key or main window of the currently active app. The current key
and main window status is not changed. Equivalent to -orderWindow:
NSWindowAbove relativeTo: 0.
*/
* If the application is active, orders the window to the front in its
* level. If the application is not active, the window is ordered in as
* far forward as possible in its level without being ordered in front
* of the key or main window of the currently active app. The current key
* and main window status is not changed. Equivalent to
* -orderWindow:relativeTo: with arguments NSWindowAbove and 0.
*/
- (void) orderFront: (id)sender
{
[self orderWindow: NSWindowAbove relativeTo: 0];
@ -1516,9 +1516,9 @@ many times.
}
/**
Orders the window out from the screen. Equivalent to -orderWindow:
NSWindowOut relativeTo: 0.
*/
* Orders the window out from the screen. Equivalent to
* -orderWindow:relativeTo: with arguments NSWindowOut and 0.
*/
- (void) orderOut: (id)sender
{
[self orderWindow: NSWindowOut relativeTo: 0];
@ -1532,6 +1532,9 @@ many times.
place is NSWindowBelow, places the window directly below otherWin,
or directly below all windows in its level if otherWin is 0.
</p>
<p>If otherWin is zero and the key window is at the same window level
as the receiver, the receiver cannot be positioned above the key window.
</p>
<p>
If place is NSWindowAbove or NSWindowBelow and the application is
hidden, the application is unhidden.
@ -1539,7 +1542,7 @@ many times.
*/
/*
As a special undocumented case (for -orderFrontRegardless), if otherWin
is negative, then the backend should not try to keep the window below the
is minus one, then the backend should not try to keep the window below the
current key/main window
*/
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin