The R Project SVN R-packages

Rev

Rev 6245 | Details | Compare with Previous | Last modification | View Log | RSS feed

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