The R Project SVN R-packages

Rev

Rev 6248 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6248 Rev 6453
1
/*
1
/*
2
 *  R.app : a Cocoa front end to: "R A Computer Language for Statistical Data Analysis"
2
 *  R.app : a Cocoa front end to: "R A Computer Language for Statistical Data Analysis"
3
 *  
3
 *  
4
 *  R.app Copyright notes:
4
 *  R.app Copyright notes:
5
 *                     Copyright (C) 2004-5  The R Foundation
5
 *                     Copyright (C) 2004-5  The R Foundation
6
 *                     written by Stefano M. Iacus and Simon Urbanek
6
 *                     written by Stefano M. Iacus and Simon Urbanek
7
 *
7
 *
8
 *                  
8
 *                  
9
 *  R Copyright notes:
9
 *  R Copyright notes:
10
 *                     Copyright (C) 1995-1996   Robert Gentleman and Ross Ihaka
10
 *                     Copyright (C) 1995-1996   Robert Gentleman and Ross Ihaka
11
 *                     Copyright (C) 1998-2001   The R Development Core Team
11
 *                     Copyright (C) 1998-2001   The R Development Core Team
12
 *                     Copyright (C) 2002-2004   The R Foundation
12
 *                     Copyright (C) 2002-2004   The R Foundation
13
 *
13
 *
14
 *  This program is free software; you can redistribute it and/or modify
14
 *  This program is free software; you can redistribute it and/or modify
15
 *  it under the terms of the GNU General Public License as published by
15
 *  it under the terms of the GNU General Public License as published by
16
 *  the Free Software Foundation; either version 2 of the License, or
16
 *  the Free Software Foundation; either version 2 of the License, or
17
 *  (at your option) any later version.
17
 *  (at your option) any later version.
18
 *
18
 *
19
 *  This program is distributed in the hope that it will be useful,
19
 *  This program is distributed in the hope that it will be useful,
20
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 *  GNU General Public License for more details.
22
 *  GNU General Public License for more details.
23
 *
23
 *
24
 *  A copy of the GNU General Public License is available via WWW at
24
 *  A copy of the GNU General Public License is available via WWW at
25
 *  http://www.gnu.org/copyleft/gpl.html.  You can also obtain it by
25
 *  http://www.gnu.org/copyleft/gpl.html.  You can also obtain it by
26
 *  writing to the Free Software Foundation, Inc., 59 Temple Place,
26
 *  writing to the Free Software Foundation, Inc., 59 Temple Place,
27
 *  Suite 330, Boston, MA  02111-1307  USA.
27
 *  Suite 330, Boston, MA  02111-1307  USA.
28
 *
28
 *
29
 *  RScriptEditorTextView.h
29
 *  RScriptEditorTextView.h
30
 *
30
 *
31
 *  Created by Hans-J. Bibiko on 15/02/2011.
31
 *  Created by Hans-J. Bibiko on 15/02/2011.
32
 *
32
 *
33
 */
33
 */
34
 
34
 
35
#import "CCComp.h"
35
#import "CCComp.h"
36
#import "RTextView.h"
36
#import "RTextView.h"
37
#import "Preferences.h"
37
#import "Preferences.h"
38
#import "PreferenceKeys.h"
38
#import "PreferenceKeys.h"
39
#import "RegexKitLite.h"
39
#import "RegexKitLite.h"
40
#import "NoodleLineNumberView.h"
40
#import "NoodleLineNumberView.h"
41
#import "REditorToolbar.h"
41
#import "REditorToolbar.h"
42
#import "RdEditorToolbar.h"
42
#import "RdEditorToolbar.h"
43
#import "RScriptEditorTextStorage.h"
43
#import "RScriptEditorTextStorage.h"
44
#import "RDocumentWinCtrl.h"
44
#import "RDocumentWinCtrl.h"
45
 
45
 
46
 
46
 
47
#define R_TEXT_SIZE_TRIGGER_FOR_PARSING_PARTLY 10000
47
#define R_TEXT_SIZE_TRIGGER_FOR_PARSING_PARTLY 10000
48
 
48
 
49
@interface RScriptEditorTextView : RTextView <PreferencesDependent, NSTextStorageDelegate>
49
@interface RScriptEditorTextView : RTextView <PreferencesDependent, NSTextStorageDelegate>
50
{
50
{
51
 
51
 
52
	NSScrollView *scrollView;
52
	NSScrollView *scrollView;
53
 
53
 
54
	NSUserDefaults *prefs;
54
	NSUserDefaults *prefs;
55
 
55
 
56
	NSColor *shColorNormal;
56
	NSColor *shColorNormal;
57
	NSColor *shColorString;
57
	NSColor *shColorString;
58
	NSColor *shColorNumber;
58
	NSColor *shColorNumber;
59
	NSColor *shColorKeyword;
59
	NSColor *shColorKeyword;
60
	NSColor *shColorComment;
60
	NSColor *shColorComment;
61
	NSColor *shColorIdentifier;
61
	NSColor *shColorIdentifier;
62
 
62
 
63
	// NSColor *rdColorNormal;
63
	// NSColor *rdColorNormal;
64
	// NSColor *rdColorSection;
64
	// NSColor *rdColorSection;
65
	// NSColor *rdColorMacroArg;
65
	// NSColor *rdColorMacroArg;
66
	// NSColor *rdColorMacroGen;
66
	// NSColor *rdColorMacroGen;
67
	// NSColor *rdColorComment;
67
	// NSColor *rdColorComment;
68
	// NSColor *rdColorDirective;
68
	// NSColor *rdColorDirective;
69
 
69
 
70
	NSColor *shColorCursor;
70
	NSColor *shColorCursor;
71
	NSColor *shColorBackground;
71
	NSColor *shColorBackground;
72
	NSColor *shColorCurrentLine;
72
	NSColor *shColorCurrentLine;
73
 
73
 
74
	RDocumentWinCtrl *selfDelegate;
74
	RDocumentWinCtrl *selfDelegate;
75
 
75
 
76
	id editorToolbar;
76
	id editorToolbar;
77
 
77
 
78
	BOOL lineNumberingEnabled;
78
	BOOL lineNumberingEnabled;
79
	BOOL syntaxHighlightingEnabled;
79
	BOOL syntaxHighlightingEnabled;
80
	BOOL argsHints;
80
	BOOL argsHints;
81
	BOOL lineWrappingEnabled;
81
	BOOL lineWrappingEnabled;
82
	BOOL deleteBackward;
82
	BOOL deleteBackward;
83
	BOOL startListeningToBoundChanges;
83
	BOOL startListeningToBoundChanges;
84
	BOOL isSyntaxHighlighting;
84
	BOOL isSyntaxHighlighting;
85
	NSInteger breakSyntaxHighlighting;
85
	NSInteger breakSyntaxHighlighting;
86
 
86
 
87
	int currentHighlight;
87
	int currentHighlight;
88
	double braceHighlightInterval; // interval to flash brace highlighting for
88
	double braceHighlightInterval; // interval to flash brace highlighting for
89
 
89
 
90
	RScriptEditorTextStorage *theTextStorage;
90
	RScriptEditorTextStorage *theTextStorage;
91
 
91
 
92
	NSDictionary *highlightColorAttr;
92
	NSDictionary *highlightColorAttr;
93
	
93
	
94
 
94
 
95
	IMP _foldedImp;
95
	IMP _foldedImp;
96
 
96
 
97
}
97
}
98
 
98
 
99
- (IBAction)foldCurrentBlock:(id)sender;
99
- (IBAction)foldCurrentBlock:(id)sender;
100
- (IBAction)unfoldCurrentBlock:(id)sender;
100
- (IBAction)unfoldCurrentBlock:(id)sender;
101
- (IBAction)foldBlockAtLevel:(id)sender;
101
- (IBAction)foldBlockAtLevel:(id)sender;
102
- (IBAction)unFoldAllBlocks:(id)sender;
102
- (IBAction)unFoldAllBlocks:(id)sender;
103
- (void)refoldLinesInRange:(NSRange)range;
103
- (void)refoldLinesInRange:(NSRange)range;
104
 
104
 
105
- (void)setTabStops;
105
- (void)setTabStops;
106
 
106
 
107
- (void)setDeleteBackward:(BOOL)delBack;
107
- (void)setDeleteBackward:(BOOL)delBack;
108
- (void)doSyntaxHighlighting;
108
- (void)doSyntaxHighlighting;
109
- (void)highlightCharacter:(NSNumber*)loc;
109
- (void)highlightCharacter:(NSNumber*)loc;
110
- (void)resetHighlights;
110
- (void)resetHighlights;
111
- (void)resetBackgroundColor:(id)sender;
111
- (void)resetBackgroundColor:(id)sender;
112
- (void)updateLineWrappingMode;
112
- (void)updateLineWrappingMode;
113
- (BOOL)lineNumberingEnabled;
113
- (BOOL)lineNumberingEnabled;
114
- (BOOL)isSyntaxHighlighting;
114
- (BOOL)isSyntaxHighlighting;
115
- (BOOL)breakSyntaxHighlighting;
115
- (BOOL)breakSyntaxHighlighting;
116
 
116
 
117
- (BOOL)foldLinesInRange:(NSRange)range blockMode:(BOOL)blockMode;
117
- (BOOL)foldLinesInRange:(NSRange)range blockMode:(BOOL)blockMode;
118
- (BOOL)unfoldLinesContainingCharacterAtIndex:(NSUInteger)charIndex;
118
- (BOOL)unfoldLinesContainingCharacterAtIndex:(NSUInteger)charIndex;
119
- (NSInteger)foldStatusAtIndex:(NSInteger)index;
119
- (NSInteger)foldStatusAtIndex:(NSInteger)index;
120
 
120
 
121
- (id)scrollView;
121
- (id)scrollView;
122
 
122
 
123
- (void)updatePreferences;
123
- (void)updatePreferences;
124
 
124
 
125
@end
125
@end