mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-03 17:10:43 +00:00
Documentation tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14762 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ed00ac6d93
commit
ebf17d372b
3 changed files with 79 additions and 80 deletions
|
@ -526,17 +526,17 @@ return NO; \
|
||||||
//
|
//
|
||||||
// Naming Sounds
|
// Naming Sounds
|
||||||
//
|
//
|
||||||
+ (id)soundNamed:(NSString *)aName
|
+ (id) soundNamed: (NSString*)name
|
||||||
{
|
{
|
||||||
NSString *realName = [nsmapping objectForKey: aName];
|
NSString *realName = [nsmapping objectForKey: name];
|
||||||
NSSound *sound;
|
NSSound *sound;
|
||||||
|
|
||||||
if (realName)
|
if (realName)
|
||||||
{
|
{
|
||||||
aName = realName;
|
name = realName;
|
||||||
}
|
}
|
||||||
|
|
||||||
sound = (NSSound *)[nameDict objectForKey: aName];
|
sound = (NSSound *)[nameDict objectForKey: name];
|
||||||
|
|
||||||
if (sound == nil)
|
if (sound == nil)
|
||||||
{
|
{
|
||||||
|
@ -544,14 +544,14 @@ return NO; \
|
||||||
NSString *path = nil;
|
NSString *path = nil;
|
||||||
NSBundle *main_bundle;
|
NSBundle *main_bundle;
|
||||||
NSArray *array;
|
NSArray *array;
|
||||||
NSString *the_name = aName;
|
NSString *the_name = name;
|
||||||
|
|
||||||
// FIXME: This should use [NSBundle pathForSoundResource], but this will
|
// FIXME: This should use [NSBundle pathForSoundResource], but this will
|
||||||
// only allow soundUnfilteredFileTypes.
|
// only allow soundUnfilteredFileTypes.
|
||||||
/* If there is no sound with that name, search in the main bundle */
|
/* If there is no sound with that name, search in the main bundle */
|
||||||
|
|
||||||
main_bundle = [NSBundle mainBundle];
|
main_bundle = [NSBundle mainBundle];
|
||||||
extension = [aName pathExtension];
|
extension = [name pathExtension];
|
||||||
|
|
||||||
if (extension != nil && [extension length] == 0)
|
if (extension != nil && [extension length] == 0)
|
||||||
{
|
{
|
||||||
|
@ -565,14 +565,14 @@ return NO; \
|
||||||
{
|
{
|
||||||
/* Extension is one of the sound types
|
/* Extension is one of the sound types
|
||||||
So remove from the name */
|
So remove from the name */
|
||||||
the_name = [aName stringByDeletingPathExtension];
|
the_name = [name stringByDeletingPathExtension];
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Otherwise extension is not an sound type
|
/* Otherwise extension is not an sound type
|
||||||
So leave it alone */
|
So leave it alone */
|
||||||
the_name = aName;
|
the_name = name;
|
||||||
extension = nil;
|
extension = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,7 +655,7 @@ return NO; \
|
||||||
|
|
||||||
if (sound != nil)
|
if (sound != nil)
|
||||||
{
|
{
|
||||||
[sound setName: aName];
|
[sound setName: name];
|
||||||
RELEASE(sound);
|
RELEASE(sound);
|
||||||
sound->onlyReference = YES;
|
sound->onlyReference = YES;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,9 +85,9 @@
|
||||||
return _increment;
|
return _increment;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setIncrement: (double)newIncrement
|
- (void) setIncrement: (double)increment
|
||||||
{
|
{
|
||||||
_increment = newIncrement;
|
_increment = increment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1141,42 +1141,41 @@ sizeAttributedString(NSAttributedString *str, NSString *allText, NSRange aRange)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GNUstep extensions.
|
// GNUstep extensions.
|
||||||
- (NSSize) sizeRange: (NSRange) lineRange
|
- (NSSize) sizeRange: (NSRange)aRange
|
||||||
{
|
{
|
||||||
return sizeAttributedString(self, [self string], lineRange);
|
return sizeAttributedString(self, [self string], aRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) drawRange: (NSRange) lineRange atPoint: (NSPoint) point
|
- (void) drawRange: (NSRange)aRange atPoint: (NSPoint)aPoint
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
|
||||||
drawAttributedString(self, [self string], lineRange, point, NO_R_MARGIN,
|
drawAttributedString(self, [self string], aRange, aPoint, NO_R_MARGIN, ctxt);
|
||||||
ctxt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) drawRange: (NSRange) lineRange inRect: (NSRect)rect
|
- (void) drawRange: (NSRange)aRange inRect: (NSRect)aRect
|
||||||
{
|
{
|
||||||
NSPoint point;
|
NSPoint point;
|
||||||
NSView *view = [NSView focusView];
|
NSView *view = [NSView focusView];
|
||||||
|
|
||||||
/* FIXME: This is an extremely lossy and temporary workaround for
|
/* FIXME: This is an extremely lossy and temporary workaround for
|
||||||
the fact that we should draw only inside rect. */
|
the fact that we should draw only inside aRect. */
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
DPSgsave(ctxt);
|
DPSgsave(ctxt);
|
||||||
NSRectClip (rect);
|
NSRectClip (aRect);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since [-drawAtPoint:] positions the top-left corner of the text at
|
* Since [-drawAtPoint:] positions the top-left corner of the text at
|
||||||
* the point, we locate the top-left corner of the rectangle to do the
|
* the point, we locate the top-left corner of the rectangle to do the
|
||||||
* drawing.
|
* drawing.
|
||||||
*/
|
*/
|
||||||
point.x = rect.origin.x;
|
point.x = aRect.origin.x;
|
||||||
if ([view isFlipped])
|
if ([view isFlipped])
|
||||||
point.y = rect.origin.y;
|
point.y = aRect.origin.y;
|
||||||
else
|
else
|
||||||
point.y = rect.origin.y + rect.size.height;
|
point.y = aRect.origin.y + aRect.size.height;
|
||||||
|
|
||||||
drawAttributedString(self, [self string], lineRange, point, rect.size.width,
|
drawAttributedString(self, [self string], aRange, point, aRect.size.width,
|
||||||
ctxt);
|
ctxt);
|
||||||
/* Restore matching the DPSgsave used in the temporary workaround */
|
/* Restore matching the DPSgsave used in the temporary workaround */
|
||||||
DPSgrestore(ctxt);
|
DPSgrestore(ctxt);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue