File: programming/cocoa/

//  UKSyntaxColoredTextDocument.h
//  CocoaTADS
//  Created by Uli Kusterer on Tue May 27 2003.
//  Copyright (c) 2003 M. Uli Kusterer. All rights reserved.
#import <Cocoa/Cocoa.h>
#import "UKTextDocGotoBox.h"
// Define the constant below to 0 if you don't need support for old-style
//  (pre-0.2.0) syntax definition files. Old-style syntax definitions are being
//  phased out. Remember to update your definitions to the new one!
// Attribute values for TD_SYNTAX_COLORING_MODE_ATTR added along with styles to program text:
//		These are only used for old-style syntax definitions. The post-0.2 style allows whatever
//		names you choose for the styles.
#define	TD_MULTI_LINE_COMMENT_ATTR			@"SyntaxColoring:MultiLineComment"		// Multi-line comment.
#define	TD_MULTI_LINE_COMMENT2_ATTR			@"SyntaxColoring:MultiLineComment2"		// A second kind of multi-line comment.
#define	TD_ONE_LINE_COMMENT_ATTR			@"SyntaxColoring:OneLineComment"		// One-line comment.
#define	TD_DOUBLE_QUOTED_STRING_ATTR		@"SyntaxColoring:DoubleQuotedString"	// Double-quoted string.
#define	TD_SINGLE_QUOTED_STRING_ATTR		@"SyntaxColoring:SingleQuotedString"	// ** unused **
#define	TD_PREPROCESSOR_ATTR				@"SyntaxColoring:Preprocessor"			// Preprocessor directive.
#define	TD_IDENTIFIER_ATTR					@"SyntaxColoring:Identifier"			// Identifier.
#define	TD_IDENTIFIER2_ATTR					@"SyntaxColoring:Identifier2"			// Identifier from group 2.
#define	TD_TAG_ATTR							@"SyntaxColoring:Tag"					// An HTML tag.
#define TD_USER_DEFINED_IDENTIFIERS			@"SyntaxColoring:UserIdentifiers"		// Key in user defaults holding user-defined identifiers to colorize.
#define TD_SYNTAX_COLORING_MODE_ATTR		@"UKTextDocumentSyntaxColoringMode"		// Anything we colorize gets this attribute.
// Syntax-colored text file viewer:
// The text view used for editing code.
// Progress indicator while coloring syntax.
// Status display for things like syntax coloring or background syntax checks.
// Controller for our "go to line" panel.
// Image indicating whether it's an insertion mark or a selection range.
// Temp. storage for data from file until NIB has been read.
// Automatically refresh syntax coloring when text is changed?
// Keep new lines indented at same depth as their predecessor?
// Timer used to do the actual recoloring a little while after the last keypress.
// Set while recolorRange is busy, so we don't recursively call recolorRange.
// No need to call this.
// Override any of the following in one of your subclasses to customize this object further:
// Defaults to "SyntaxDefinition.plist" in the app bundle's "Resources" directory.
// Defaults to loading from -syntaxDefinitionFilename.
// Style attributes dictionary for an NSAttributedString.
// Private:
// Called by recolorRange as needed.
// Support for external editor interface:
//	(Doesn't really work yet ... *sigh*)
#pragma options align=mac68k
// 0 (not used)
// line to select (< 0 to specify range)
// start of selection range (if line < 0)
// end of selection range (if line < 0)
// 0 (not used)
// modification date/time
#pragma options align=reset

This code uses the PclZip Zip File reading code, which is subject to the GNU LGPL. It also uses the GeSHi syntax highlighter, subject to the GPL. Ask if you want this for your own web site, it's free.