The R Project SVN R-packages

Rev

Rev 7824 | Rev 8072 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7824 Rev 7916
Line 36... Line 36...
36
#import "RScriptEditorTypesetter.h"
36
#import "RScriptEditorTypesetter.h"
37
#import "RScriptEditorTextStorage.h"
37
#import "RScriptEditorTextStorage.h"
38
#import "RScriptEditorLayoutManager.h"
38
#import "RScriptEditorLayoutManager.h"
39
#import "PreferenceKeys.h"
39
#import "PreferenceKeys.h"
40
 
40
 
41
static SEL _attrStrSel;
-
 
42
static SEL _foldSel;
-
 
43
static SEL _foldindSel;
-
 
44
 
-
 
45
@implementation RScriptEditorGlyphGenerator
41
@implementation RScriptEditorGlyphGenerator
46
 
42
 
47
+ (void)initialize
-
 
48
{
-
 
49
	if ([self class] == [RScriptEditorGlyphGenerator class]) {
-
 
50
		_attrStrSel = @selector(attributedString);
-
 
51
		_foldSel    = @selector(foldedRangeAtIndex:);
-
 
52
		_foldindSel = @selector(foldedForIndicatorAtIndex:);
-
 
53
	}
-
 
54
}
-
 
55
 
-
 
56
- (id)init
43
- (id)init
57
{
44
{
58
	self = [super init];
45
	self = [super init];
59
 
46
 
60
	if (self != nil) {
47
	if (self != nil) {
61
		_attrStrImp = [self methodForSelector:_attrStrSel];
-
 
62
		nullGlyph = NSNullGlyph;
48
		nullGlyph = NSNullGlyph;
63
		sizeOfNSGlyph = sizeof(NSGlyph);
49
		sizeOfNSGlyph = sizeof(NSGlyph);
64
	}
50
	}
65
 
51
 
66
	return self;
52
	return self;
Line 73... Line 59...
73
 
59
 
74
- (void)setTextStorage:(RScriptEditorTextStorage*)textStorage
60
- (void)setTextStorage:(RScriptEditorTextStorage*)textStorage
75
{
61
{
76
	if(theTextStorage) [theTextStorage release];
62
	if(theTextStorage) [theTextStorage release];
77
	theTextStorage = [textStorage retain];
63
	theTextStorage = [textStorage retain];
78
	_foldImp = [theTextStorage methodForSelector:_foldSel];
-
 
79
	_foldindImp = [theTextStorage methodForSelector:_foldindSel];
-
 
80
}
64
}
81
 
65
 
82
- (void)generateGlyphsForGlyphStorage:(id <NSGlyphStorage>)glyphStorage desiredNumberOfCharacters:(NSUInteger)nChars glyphIndex:(NSUInteger *)glyphIndex characterIndex:(NSUInteger *)charIndex
66
- (void)generateGlyphsForGlyphStorage:(id <NSGlyphStorage>)glyphStorage desiredNumberOfCharacters:(NSUInteger)nChars glyphIndex:(NSUInteger *)glyphIndex characterIndex:(NSUInteger *)charIndex
83
{
67
{
84
	// Stash the original requester
68
	// Stash the original requester