mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 07:50:53 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4649 72102866-910b-0410-8b05-ffd578937521
95 lines
2 KiB
Objective-C
95 lines
2 KiB
Objective-C
#include <AppKit/NSAttributedString.h>
|
|
|
|
//@implementation NSAttributedString (AppKit)
|
|
|
|
/*
|
|
* This is where the fun begins with RTF/RTFD/HTML
|
|
*/
|
|
|
|
//@end
|
|
|
|
@implementation NSMutableAttributedString (AppKit)
|
|
- (void)superscriptRange:(NSRange)range
|
|
{
|
|
id value;
|
|
int sValue;
|
|
|
|
value = [self attribute:NSSuperscriptAttributeName
|
|
atIndex:range.location effectiveRange:&range];
|
|
|
|
sValue = [value intValue];
|
|
|
|
sValue++;
|
|
|
|
[self addAttribute:NSSuperscriptAttributeName value:[[NSNumber alloc]
|
|
initWithInt:sValue] range:range];
|
|
}
|
|
|
|
- (void)subscriptRange:(NSRange)range
|
|
{
|
|
id value;
|
|
int sValue;
|
|
|
|
value = [self attribute:NSSuperscriptAttributeName
|
|
atIndex:range.location effectiveRange:&range];
|
|
|
|
sValue = [value intValue];
|
|
|
|
sValue--;
|
|
|
|
[self addAttribute:NSSuperscriptAttributeName value:[[NSNumber alloc]
|
|
initWithInt:sValue] range:range];
|
|
}
|
|
|
|
- (void)unscriptRange:(NSRange)range
|
|
{
|
|
[self addAttribute:NSSuperscriptAttributeName value:[[NSNumber alloc]
|
|
initWithInt:0] range:range];
|
|
}
|
|
|
|
- (void)applyFontTraits:(NSFontTraitMask)traitMask range:(NSRange)range
|
|
{
|
|
/* We don't use font traits yet, oops. */
|
|
/*
|
|
id value;
|
|
|
|
value = [self attribute:NSFontAttributeName
|
|
atIndex:range.location effectiveRange:range];
|
|
|
|
[value setFontTraits:traitMask];
|
|
|
|
[self addAttribute:NSFontAttributeName value:value range:range];
|
|
*/
|
|
}
|
|
|
|
- (void)setAlignment:(NSTextAlignment)alignment range:(NSRange)range
|
|
{
|
|
id value;
|
|
|
|
value = [self attribute:NSParagraphStyleAttributeName
|
|
atIndex:range.location effectiveRange:&range];
|
|
|
|
[value setAlignment:alignment];
|
|
|
|
[self addAttribute:NSParagraphStyleAttributeName value:value range:range];
|
|
}
|
|
|
|
- (void)fixAttributesInRange:(NSRange)range
|
|
{
|
|
[self fixFontAttributeInRange:range];
|
|
[self fixParagraphStyleAttributeInRange:range];
|
|
[self fixAttachmentAttributeInRange:range];
|
|
}
|
|
|
|
- (void)fixFontAttributeInRange:(NSRange)range
|
|
{
|
|
}
|
|
|
|
- (void)fixParagraphStyleAttributeInRange:(NSRange)range
|
|
{
|
|
}
|
|
|
|
- (void)fixAttachmentAttributeInRange:(NSRange)range
|
|
{
|
|
}
|
|
@end
|