Add new MacOSX methods. Code mostly by Nikolaus Schaller.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25270 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2007-06-18 21:08:54 +00:00
parent 86d97a419f
commit 4835a35c1c
21 changed files with 831 additions and 84 deletions

View file

@ -487,6 +487,13 @@ glyphs to be drawn upside-down, so we need to tell NSFont to flip the fonts.
}
}
- (void) drawWithRect:(NSRect)rect
options:(NSStringDrawingOptions)options
{
// FIXME: This ignores options
[self drawInRect: rect];
}
- (NSSize) size
{
int ci;
@ -499,6 +506,21 @@ glyphs to be drawn upside-down, so we need to tell NSFont to flip the fonts.
return cache[ci].usedRect.size;
}
- (NSRect) boundingRectWithSize: (NSSize)size
options: (NSStringDrawingOptions)options
{
int ci;
// FIXME: This ignores options
ci = cache_lookup_attributed_string(self, 1, size, 1);
/*
An argument could be made for using NSMaxX/NSMaxY here, but that fails
horribly on right-aligned strings. For now, we handle that case in a
useful way and ignore indents.
*/
return cache[ci].usedRect;
}
@end
/*
@ -614,6 +636,14 @@ NSAttributedString to do the job.
}
}
- (void) drawWithRect: (NSRect)rect
options: (NSStringDrawingOptions)options
attributes: (NSDictionary *)attributes
{
// FIXME: This ignores options
[self drawInRect: rect withAttributes: attributes];
}
- (NSSize) sizeWithAttributes: (NSDictionary *)attrs
{
int ci;
@ -626,6 +656,22 @@ NSAttributedString to do the job.
return cache[ci].usedRect.size;
}
- (NSRect) boundingRectWithSize: (NSSize)size
options: (NSStringDrawingOptions)options
attributes: (NSDictionary *)attributes
{
int ci;
// FIXME: This ignores options
ci = cache_lookup_string(self, attributes, 1, size, 1);
/*
An argument could be made for using NSMaxX/NSMaxY here, but that fails
horribly on right-aligned strings (which may be the right thing). For now,
we handle that case in a useful way and ignore indents.
*/
return cache[ci].usedRect;
}
@end