Permalink
Browse files

Initial check-in.

git-svn-id: svn://witness.is-a-geek.org/svn@1 378c4bed-2673-4746-83ae-d22ddc8c5b7c
  • Loading branch information...
0 parents commit 4deff4d8547a56c61b121f11fb99ee185d130b32 uli committed Jul 4, 2009
Showing with 5,759 additions and 0 deletions.
  1. +12 −0 English.lproj/Credits.rtf
  2. BIN English.lproj/InfoPlist.strings
  3. +72 −0 English.lproj/MainMenu.nib/classes.nib
  4. +22 −0 English.lproj/MainMenu.nib/info.nib
  5. BIN English.lproj/MainMenu.nib/objects.nib
  6. +48 −0 English.lproj/UKMultiSyntaxColoredTextDocument.nib/classes.nib
  7. +17 −0 English.lproj/UKMultiSyntaxColoredTextDocument.nib/info.nib
  8. BIN English.lproj/UKMultiSyntaxColoredTextDocument.nib/keyedobjects.nib
  9. +41 −0 English.lproj/UKSyntaxColoredTextDocument.nib/classes.nib
  10. +17 −0 English.lproj/UKSyntaxColoredTextDocument.nib/info.nib
  11. BIN English.lproj/UKSyntaxColoredTextDocument.nib/keyedobjects.nib
  12. +14 −0 English.lproj/locversion.plist
  13. +68 −0 Info.plist
  14. BIN InsertionMark.tiff
  15. +33 −0 NSArray+Color.h
  16. +61 −0 NSArray+Color.m
  17. +33 −0 NSMenu+DeepSearch.h
  18. +54 −0 NSMenu+DeepSearch.m
  19. +16 −0 NSScanner+SkipUpToCharset.h
  20. +36 −0 NSScanner+SkipUpToCharset.m
  21. +2 −0 ProblematicCSSFile.css.m
  22. +141 −0 README.txt
  23. BIN SelectionRange.tiff
  24. +1 −0 Syntax Definitions/CSS 1.plist
  25. +34 −0 Syntax Definitions/HTML (Old).plist
  26. +107 −0 Syntax Definitions/HTML.plist
  27. +72 −0 Syntax Definitions/Objective C (Old).plist
  28. +207 −0 Syntax Definitions/Objective C.plist
  29. +54 −0 SyntaxColorDefaults.plist
  30. +100 −0 SyntaxDefinition.plist
  31. +78 −0 UKMultiSyntaxColoredTextDocument.h
  32. +357 −0 UKMultiSyntaxColoredTextDocument.m
  33. +54 −0 UKSCTDColorWellPrefsController.h
  34. +217 −0 UKSCTDColorWellPrefsController.m
  35. +41 −0 UKSCTDUserIdentifiersPrefsController.h
  36. +162 −0 UKSCTDUserIdentifiersPrefsController.m
  37. +481 −0 UKSyntaxColoredDocument.xcodeproj/project.pbxproj
  38. +1,459 −0 UKSyntaxColoredDocument.xcodeproj/witness.mode2
  39. +7 −0 UKSyntaxColoredDocument_Prefix.pch
  40. +120 −0 UKSyntaxColoredTextDocument.h
  41. +1,358 −0 UKSyntaxColoredTextDocument.m
  42. +76 −0 UKTextDocGoToBox.m
  43. +57 −0 UKTextDocGotoBox.h
  44. +14 −0 main.m
  45. +16 −0 version.plist
12 English.lproj/Credits.rtf
@@ -0,0 +1,12 @@
+{\rtf1\mac\ansicpg10000\cocoartf102
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+
+\f0\b\fs24 \cf0 Engineering:
+\f1\b0 \
+ M. Uli Kusterer\
+\
+
+\f2\i The witnesses of TeachText are everywhere...}
BIN English.lproj/InfoPlist.strings
Binary file not shown.
72 English.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,72 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {
+ indentSelection = id;
+ recolorCompleteFile = id;
+ showGoToPanel = id;
+ takeSyntaxDefinitionFilenameFromTagOf = id;
+ toggleAutoSyntaxColoring = id;
+ toggleMaintainIndentation = id;
+ unindentSelection = id;
+ };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {
+ resetColors = id;
+ takeComments2ColorFrom = id;
+ takeCommentsColorFrom = id;
+ takeIdentifiers2ColorFrom = id;
+ takeIdentifiersColorFrom = id;
+ takePreprocessorColorFrom = id;
+ takeStringsColorFrom = id;
+ takeTagsColorFrom = id;
+ };
+ CLASS = UKSCTDColorWellPrefsController;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ comments2Color = NSColorWell;
+ commentsColor = NSColorWell;
+ identifiers2Color = NSColorWell;
+ identifiersColor = NSColorWell;
+ preprocessorColor = NSColorWell;
+ stringsColor = NSColorWell;
+ tagsColor = NSColorWell;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {createNewIdentifier = id; deleteIdentifier = id; };
+ CLASS = UKSCTDUserIdentifiersPrefsController;
+ LANGUAGE = ObjC;
+ OUTLETS = {identifiersList = NSTableView; removeButton = NSButton; };
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {
+ indentSelection = id;
+ recolorCompleteFile = id;
+ recolorCompleteFileDeferred = id;
+ recolorSyntaxTimer = id;
+ showGoToPanel = id;
+ toggleAutoSyntaxColoring = id;
+ toggleMaintainIndentation = id;
+ unindentSelection = id;
+ };
+ CLASS = UKSyntaxColoredTextDocument;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ gotoPanel = UKTextDocGoToBox;
+ progress = NSProgressIndicator;
+ selectionKindImage = NSImageView;
+ status = NSTextField;
+ textView = NSTextView;
+ };
+ SUPERCLASS = NSDocument;
+ }
+ );
+ IBVersion = 1;
+}
22 English.lproj/MainMenu.nib/info.nib
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>202 161 356 240 0 0 1024 746 </string>
+ <key>IBEditorPositions</key>
+ <dict>
+ <key>29</key>
+ <string>295 698 386 44 0 0 1024 746 </string>
+ </dict>
+ <key>IBFramework Version</key>
+ <string>443.0</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>29</integer>
+ <integer>222</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>8P135</string>
+</dict>
+</plist>
BIN English.lproj/MainMenu.nib/objects.nib
Binary file not shown.
48 English.lproj/UKMultiSyntaxColoredTextDocument.nib/classes.nib
@@ -0,0 +1,48 @@
+{
+ IBClasses = (
+ {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
+ {
+ ACTIONS = {takeSyntaxDefinitionFilenameFromTagOf = id; };
+ CLASS = UKMultiSyntaxColoredTextDocument;
+ LANGUAGE = ObjC;
+ OUTLETS = {syntaxDefinitionMenu = NSMenu; };
+ SUPERCLASS = UKSyntaxColoredTextDocument;
+ },
+ {
+ ACTIONS = {
+ indentSelection = id;
+ recolorCompleteFile = id;
+ recolorCompleteFileDeferred = id;
+ recolorSyntaxTimer = id;
+ showGoToPanel = id;
+ toggleAutoSyntaxColoring = id;
+ toggleMaintainIndentation = id;
+ unindentSelection = id;
+ };
+ CLASS = UKSyntaxColoredTextDocument;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ gotoPanel = UKTextDocGoToBox;
+ progress = NSProgressIndicator;
+ selectionKindImage = NSImageView;
+ status = NSTextField;
+ textView = NSTextView;
+ };
+ SUPERCLASS = NSDocument;
+ },
+ {
+ ACTIONS = {goToLineOrChar = id; hideGoToSheet = id; showGoToSheet = id; };
+ CLASS = UKTextDocGoToBox;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ goToPanel = NSPanel;
+ lineCharChooser = NSMatrix;
+ lineNumField = NSTextField;
+ okayButton = NSButton;
+ targetDocument = id;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+}
17 English.lproj/UKMultiSyntaxColoredTextDocument.nib/info.nib
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>63 37 356 240 0 0 1024 746 </string>
+ <key>IBFramework Version</key>
+ <string>362.0</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>31</integer>
+ <integer>5</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>7F44</string>
+</dict>
+</plist>
BIN English.lproj/UKMultiSyntaxColoredTextDocument.nib/keyedobjects.nib
Binary file not shown.
41 English.lproj/UKSyntaxColoredTextDocument.nib/classes.nib
@@ -0,0 +1,41 @@
+{
+ IBClasses = (
+ {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
+ {
+ ACTIONS = {
+ indentSelection = id;
+ recolorCompleteFile = id;
+ recolorCompleteFileDeferred = id;
+ recolorSyntaxTimer = id;
+ showGoToPanel = id;
+ toggleAutoSyntaxColoring = id;
+ toggleMaintainIndentation = id;
+ unindentSelection = id;
+ };
+ CLASS = UKSyntaxColoredTextDocument;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ gotoPanel = UKTextDocGoToBox;
+ progress = NSProgressIndicator;
+ selectionKindImage = NSImageView;
+ status = NSTextField;
+ textView = NSTextView;
+ };
+ SUPERCLASS = NSDocument;
+ },
+ {
+ ACTIONS = {goToLineOrChar = id; hideGoToSheet = id; showGoToSheet = id; };
+ CLASS = UKTextDocGoToBox;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ goToPanel = NSPanel;
+ lineCharChooser = NSMatrix;
+ lineNumField = NSTextField;
+ okayButton = NSButton;
+ targetDocument = id;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+}
17 English.lproj/UKSyntaxColoredTextDocument.nib/info.nib
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>63 37 356 240 0 0 1024 746 </string>
+ <key>IBFramework Version</key>
+ <string>362.0</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>31</integer>
+ <integer>5</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>7F44</string>
+</dict>
+</plist>
BIN English.lproj/UKSyntaxColoredTextDocument.nib/keyedobjects.nib
Binary file not shown.
14 English.lproj/locversion.plist
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>LprojCompatibleVersion</key>
+ <string>108.1</string>
+ <key>LprojLocale</key>
+ <string>en</string>
+ <key>LprojRevisionLevel</key>
+ <string>1</string>
+ <key>LprojVersion</key>
+ <string>110</string>
+</dict>
+</plist>
68 Info.plist
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>m</string>
+ <string>mm</string>
+ <string>h</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string></string>
+ <key>CFBundleTypeName</key>
+ <string>ObjC Source Code</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>TEXT</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>NSDocumentClass</key>
+ <string>UKMultiSyntaxColoredTextDocument</string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>htm</string>
+ <string>html</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>HTML Source File</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>TEXT</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>NSDocumentClass</key>
+ <string>UKMultiSyntaxColoredTextDocument</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>UKSyntaxColoredDocument</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.ulikusterer.uksctd-sample</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.4</string>
+ <key>NSAppleScriptEnabled</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
BIN InsertionMark.tiff
Binary file not shown.
33 NSArray+Color.h
@@ -0,0 +1,33 @@
+//
+// NSArray+Color.h
+// CocoaTADS
+//
+// Created by Uli Kusterer on Mon Jun 02 2003.
+// Copyright (c) 2003 M. Uli Kusterer. All rights reserved.
+//
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+
+// -----------------------------------------------------------------------------
+// Category:
+// -----------------------------------------------------------------------------
+
+// Methods to treat an NSArray with three/four elements as an RGB/RGBA color.
+// Useful for storing colors in NSUserDefaults and other Property Lists.
+// Note that this isn't quite the same as storing an NSData of the color, as
+// some colors can't be correctly represented in RGB, but this makes for more
+// readable property lists than NSData.
+// If we wanted to get fancy, we could use an NSDictionary instead and save
+// different color types in different ways.
+
+@interface NSArray (Color)
+
++(NSArray*) arrayWithColor: (NSColor*) col;
+-(NSColor*) colorValue;
+
+@end
61 NSArray+Color.m
@@ -0,0 +1,61 @@
+//
+// NSArray+Color.m
+// CocoaTADS
+//
+// Created by Uli Kusterer on Mon Jun 02 2003.
+// Copyright (c) 2003 M. Uli Kusterer. All rights reserved.
+//
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import "NSArray+Color.h"
+
+
+@implementation NSArray (Color)
+
+// -----------------------------------------------------------------------------
+// arrayWithColor:
+// Converts the color to an RGB color if needed, and then creates an array
+// with its red, green, blue and alpha components (in that order).
+//
+// REVISIONS:
+// 2004-05-18 witness documented.
+// -----------------------------------------------------------------------------
+
++(NSArray*) arrayWithColor: (NSColor*) col
+{
+ float fRed, fGreen, fBlue, fAlpha;
+
+ col = [col colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
+ [col getRed: &fRed green: &fGreen blue: &fBlue alpha: &fAlpha];
+
+ return [self arrayWithObjects: [NSNumber numberWithFloat:fRed], [NSNumber numberWithFloat:fGreen],
+ [NSNumber numberWithFloat:fBlue], [NSNumber numberWithFloat:fAlpha], nil];
+}
+
+
+// -----------------------------------------------------------------------------
+// colorValue:
+// Converts an NSArray with three (or four) NSValues into an RGB Color
+// (plus alpha, if specified).
+//
+// REVISIONS:
+// 2004-05-18 witness documented.
+// -----------------------------------------------------------------------------
+
+-(NSColor*) colorValue
+{
+ float fRed, fGreen, fBlue, fAlpha = 1.0;
+
+ fRed = [[self objectAtIndex:0] floatValue];
+ fGreen = [[self objectAtIndex:1] floatValue];
+ fBlue = [[self objectAtIndex:2] floatValue];
+ if( [self count] > 3 ) // Have alpha info?
+ fAlpha = [[self objectAtIndex:3] floatValue];
+
+ return [NSColor colorWithCalibratedRed: fRed green: fGreen blue: fBlue alpha: fAlpha];
+}
+
+@end
33 NSMenu+DeepSearch.h
@@ -0,0 +1,33 @@
+//
+// NSMenu+DeepSearch.h
+// UKSyntaxColoredDocument
+//
+// Created by Uli Kusterer on Tue May 18 2004.
+// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+//
+
+/*
+ This category adds a method to NSMenu that lets you perform a deep search
+ in a menu for an item with a particular target and action. This is e.g.
+ very handy when you're looking for an item and don't know what menu it is
+ in. Simply pass [NSApp mainMenu] as the menu, and get back the menu item,
+ which knows what menu it belongs to.
+*/
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+
+// -----------------------------------------------------------------------------
+// Interface:
+// -----------------------------------------------------------------------------
+
+@interface NSMenu (DeepSearch)
+
+// Perform a deep search on a menu and its submenus: (returns NIL if the item couldn't be found)
+-(id <NSMenuItem>) findItemWithTarget: (id)targ andAction: (SEL)action;
+
+@end
54 NSMenu+DeepSearch.m
@@ -0,0 +1,54 @@
+//
+// NSMenu+DeepSearch.m
+// UKSyntaxColoredDocument
+//
+// Created by Uli Kusterer on Tue May 18 2004.
+// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+//
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import "NSMenu+DeepSearch.h"
+
+
+@implementation NSMenu (DeepSearch)
+
+// -----------------------------------------------------------------------------
+// findItemWithTarget:andAction:
+// Calls indexOfItemWithTarget:andAction: on the menu, and if it doesn't
+// find an item, calls itself recursively on the submenus of all items
+// in the specified menu.
+//
+// REVISIONS:
+// 2004-05-18 witness Created.
+// -----------------------------------------------------------------------------
+
+-(id <NSMenuItem>) findItemWithTarget: (id)targ andAction: (SEL)action
+{
+ // Look in this menu:
+ int itemIndex = [self indexOfItemWithTarget: targ andAction: action];
+ if( itemIndex >= 0 )
+ return [self itemAtIndex: itemIndex]; // Return the item we found in this menu.
+
+ // If not found, search our items' submenus:
+ NSArray* items = [self itemArray];
+ NSEnumerator* enny = [items objectEnumerator];
+ id<NSMenuItem> currItem = nil;
+
+ while( (currItem = [enny nextObject]) )
+ {
+ if( [currItem hasSubmenu] )
+ {
+ currItem = [[currItem submenu] findItemWithTarget: targ andAction: action]; // Recurse deeper.
+ if( currItem )
+ return currItem; // Found, exit & return item from submenu.
+ }
+ }
+
+ // Nothing found? Report failure:
+ return nil;
+}
+
+@end
16 NSScanner+SkipUpToCharset.h
@@ -0,0 +1,16 @@
+//
+// NSScanner+SkipUpToCharset.h
+// UKSyntaxColoredDocument
+//
+// Created by Uli Kusterer on Sat Dec 13 2003.
+// Copyright (c) 2003 M. Uli Kusterer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface NSScanner (SkipUpToCharset)
+
+-(BOOL) skipUpToCharactersFromSet:(NSCharacterSet*)set;
+
+@end
36 NSScanner+SkipUpToCharset.m
@@ -0,0 +1,36 @@
+//
+// NSScanner+SkipUpToCharset.m
+// UKSyntaxColoredDocument
+//
+// Created by Uli Kusterer on Sat Dec 13 2003.
+// Copyright (c) 2003 M. Uli Kusterer. All rights reserved.
+//
+
+#import "NSScanner+SkipUpToCharset.h"
+
+
+@implementation NSScanner (SkipUpToCharset)
+
+-(BOOL) skipUpToCharactersFromSet:(NSCharacterSet*)set
+{
+ NSString* vString = [self string];
+ int x = [self scanLocation];
+
+ while( x < [vString length] )
+ {
+ if( ![set characterIsMember: [vString characterAtIndex: x]] )
+ x++;
+ else
+ break;
+ }
+
+ if( x > [self scanLocation] )
+ {
+ [self setScanLocation: x];
+ return YES;
+ }
+ else
+ return NO;
+}
+
+@end
2 ProblematicCSSFile.css.m
@@ -0,0 +1,2 @@
+/* General Body Settings */
+
141 README.txt
@@ -0,0 +1,141 @@
+UKSYNTAXCOLOREDTEXTDOCUMENT 0.4
+
+This is a document class that implements a text editor that performs "live"
+syntax coloring on its documents, and generally tries to be helpful to editing
+structured text documents for programming.
+
+
+FEATURES?
+
+-> Live syntax coloring as you type, fast through localized updates
+-> Most information about the things to colorize is kept in a
+ SyntaxDefinitions.plist file that can easily be adapted to other programming
+ languages than the included Objective C and HTML.
+-> All colors used have aesthetically pleasing defaults and are read from the
+ user defaults database. That means no more pink, turquoise and brown unless
+ you want these colors. And the defaults are initially fetched from the syntax
+ definitions, which you can adjust for your apps.
+-> Built-in support for "Go To Line" and "Go To Character" to select parts of
+ the text, also useful for highlighting lines when reporting coding errors.
+-> Controller classes for editing preferences included.
+-> Maintains indentation (if desired).
+
+
+ADAPTING TO OTHER PROGRAMMING LANGUAGES
+
+To adapt the syntax coloring to another language, change the
+SyntaxDefinition.plist file using Apple's Property List Editor. A syntax
+definition file is an NSDictionary saved as a property list (and can thus be
+edited using Apple's Property List Editor). It currently contains two entries.
+The first has the key "Components", which is an array of dictionaries each
+describing one "thing" that can be colorized. Here's what the various keys mean:
+
+Name - The name of this component that can be colorized. Used
+ internally to mark some text styles, and also used to refer to
+ this component from other components. (NSString)
+Color - The default color to use for coloring this component. This will
+ only be used when the user didn't specify a different color in
+ the NSUserDefaults. Colors in the user defaults should have the
+ key "SyntaxColoring:Color:COMPNAME" where COMPNAME is the name
+ you specified as "Name" for this component.
+ (NSArray, Red, Green, Blue, Alpha)
+Type - The type of this component. This can be any one of "String",
+ "BlockComment", "Tag", "OneLineComment" or "Keywords" and
+ decides what other keys you should put into this component.
+ (NSString)
+
+Start - The character or character sequence that indicates the beginning
+ of a range of text belonging to this component. (Not needed for
+ "Keywords"). (NSString)
+End - The character or character sequence that indicates the end of a
+ range of text belonging to this component. (Not needed for
+ "Keywords" or "OneLineComment"). (NSString)
+EscapeChar - The character to use for indicating an "Escape sequence" in a
+ "String". This character will cause the next character to be
+ ignored in determining if this is an end of a "String".
+ (NSString)
+IgnoredComponent -
+ The "Name" of another component in which this "Tag" range may
+ not start or end. This can be used, when parsing HTML tags, to
+ ignore '>' characters when they are specified inside a quoted
+ character, so they're not accidentally considered as being the
+ end of the tag. (NSString)
+Keywords - An array of keyword strings to be colorized (Only used for
+ "Keywords"-type components). If this isn't specified for a
+ "Keywords" component, this will look in NSUserDefaults for an
+ array under the key "SyntaxColoring:Keywords:COMPNAME", where
+ COMPNAME is the "Name" you specified for this component. You can
+ use this to colorize keywords or to colorize user-defined keywords.
+ (NSArray of NSStrings)
+Charset - All characters that are valid in a keyword for this "Keywords"
+ style. Specify both upper- and lowercase characters separately.
+ If this is specified, only keywords that are preceded and
+ followed by characters not listed here will be colored, thus
+ enforcing complete matches. Otherwise, parts of keywords will
+ be colored as well, if they match an item in the "Keywords"
+ list. (NSString)
+
+Colorizing is done in the order the components are listed in the array. So, if
+you colorize strings first and comments afterward, any strings occurring inside
+a comment will get the comment color, because that color was applied last.
+
+The second entry is "FileNameSuffixes", which is an array of strings, each
+designating one file name extension which UKMultiSyntaxColoredTextDocument will
+use to determine the syntax coloring file to use for an opened file.
+
+
+WHAT LICENSE IS THIS UNDER?
+
+UKSyntaxColoredTextDocument is free for use in Freeware and in-house
+applications, as long as you put a notice somewhere visible (about screen is OK)
+in the application that states that you're using UKSyntaxColoredTextDocument
+(c) 2003-07 by M. Uli Kusterer.
+
+For use in commercial products (including Shareware), contact me to obtain a license.
+Please include some information about the program you're using
+UKSyntaxColoredTextDocument in.
+
+Another requirement for use of UKSyntaxColoredTextDocument is that you make any
+changes you do to the source code available to me so I can consider them for
+inclusion in the official distribution.
+
+You may distribute the source code as long as no more than the cost price
+of the actual transfer medium (online fees or media cost) are charged, and
+the code is unchanged, and this readme file is included. If you want to
+distribute this code otherwise, contact me to get a license.
+
+
+REVISIONS:
+ 0.1 - First public release.
+ 0.1.1 - Fixed a tiny bug that could cause a crash when the last character in
+ the document was deleted. Removed a couple of outdated files and
+ added some missing identifiers to the example SyntaxDefinition.plist.
+ 0.1.5 - Added option to maintain indentation of previous line for new lines
+ when a return key is typed, added accessors for auto syntax coloring
+ and maintain indentation flags.
+ 0.2.0 - Added "Identifiers2" list, "comments2", coloring of "tags",
+ -syntaxDictionary method, support for specifying the escape
+ character for coloring strings, HTML sample syntax definition,
+ leaving out the charset for identifiers, icons indicating selection
+ type, UKSCTDColorWellPrefsController, new-style syntax definitions
+ and UKSCTDUserIdentifiersPrefsController, and UKMultiSyntaxColoredTextDocument.
+ 0.3.0 - Fixed exceptions when undoing, hopefully finally fixed the bug where
+ editing an empty document would occasionally crash.
+ 0.4.0 - Fixed indent/unindent to not indent the next line after a full-line
+ (triple click) selection and made it support undo. Made "new" ObjC
+ coloring scheme support user identifiers, added more identifiers.
+ Multi syntax colored document now tries to pick the right syntax
+ coloring definition file based on extension. Misc. stability fixes.
+
+
+CONTACT INFORMATION
+
+You can find the newest version of UKSyntaxColoredTextDocument at
+ http://www.zathras.de/sourcecode.htm
+
+E-Mail: witness_dot_of_dot_teachtext_at_gmx_dot_net
+
+
+
+
+M. Uli Kusterer, Heidelberg, 2007-04-21
BIN SelectionRange.tiff
Binary file not shown.
1 Syntax Definitions/CSS 1.plist
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?>
34 Syntax Definitions/HTML (Old).plist
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>BlockComment2:End</key>
+ <string>?&gt;</string>
+ <key>BlockComment2:Start</key>
+ <string>&lt;?</string>
+ <key>BlockComment:End</key>
+ <string>--&gt;</string>
+ <key>BlockComment:Start</key>
+ <string>&lt;!--</string>
+ <key>Identifiers</key>
+ <array>
+ <string>&amp;lt;</string>
+ <string>&amp;gt;</string>
+ <string>&amp;amp;</string>
+ <string>&amp;auml;</string>
+ <string>&amp;ouml;</string>
+ <string>&amp;uuml;</string>
+ <string>&amp;Auml;</string>
+ <string>&amp;Ouml;</string>
+ <string>&amp;Uuml;</string>
+ </array>
+ <key>String:EscapeChar</key>
+ <string></string>
+ <key>Tag:End</key>
+ <string>&gt;</string>
+ <key>Tag:IgnoredStyle</key>
+ <string>SyntaxColoring:DoubleQuotedString</string>
+ <key>Tag:Start</key>
+ <string>&lt;</string>
+</dict>
+</plist>
107 Syntax Definitions/HTML.plist
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Components</key>
+ <array>
+ <dict>
+ <key>Color</key>
+ <array>
+ <integer>1</integer>
+ <integer>1</integer>
+ <integer>1</integer>
+ </array>
+ <key>End</key>
+ <string>"</string>
+ <key>EscapeChar</key>
+ <string></string>
+ <key>Name</key>
+ <string>Strings</string>
+ <key>Start</key>
+ <string>"</string>
+ <key>Type</key>
+ <string>String</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <integer>0</integer>
+ <integer>0</integer>
+ <integer>1</integer>
+ </array>
+ <key>End</key>
+ <string>&gt;</string>
+ <key>IgnoredComponent</key>
+ <string>Strings</string>
+ <key>Name</key>
+ <string>Tags</string>
+ <key>Start</key>
+ <string>&lt;</string>
+ <key>Type</key>
+ <string>Tag</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <real>0.29999999999999999</real>
+ <real>0.29999999999999999</real>
+ <real>0.29999999999999999</real>
+ </array>
+ <key>End</key>
+ <string>"</string>
+ <key>EscapeChar</key>
+ <string></string>
+ <key>Name</key>
+ <string>Strings</string>
+ <key>Start</key>
+ <string>"</string>
+ <key>Type</key>
+ <string>String</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <real>0.20000000000000001</real>
+ <real>0.5</real>
+ <real>0.20000000000000001</real>
+ </array>
+ <key>Keywords</key>
+ <array>
+ <string>&amp;lt;</string>
+ <string>&amp;gt;</string>
+ <string>&amp;amp;</string>
+ <string>&amp;auml;</string>
+ <string>&amp;uuml;</string>
+ <string>&amp;ouml;</string>
+ </array>
+ <key>Name</key>
+ <string>Identifiers</string>
+ <key>Type</key>
+ <string>Keywords</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <integer>1</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ </array>
+ <key>End</key>
+ <string>--&gt;</string>
+ <key>Name</key>
+ <string>Comments</string>
+ <key>Start</key>
+ <string>&lt;!--</string>
+ <key>Type</key>
+ <string>BlockComment</string>
+ </dict>
+ </array>
+ <key>FileNameSuffixes</key>
+ <array>
+ <string>htm</string>
+ <string>html</string>
+ <string>phtm</string>
+ <string>phtml</string>
+ </array>
+</dict>
+</plist>
72 Syntax Definitions/Objective C (Old).plist
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>BlockComment:End</key>
+ <string>*/</string>
+ <key>BlockComment:Start</key>
+ <string>/*</string>
+ <key>Identifiers</key>
+ <array>
+ <string>super</string>
+ <string>id</string>
+ <string>void</string>
+ <string>self</string>
+ <string>return</string>
+ <string>@selector</string>
+ <string>@interface</string>
+ <string>@protocol</string>
+ <string>@implementation</string>
+ <string>enum</string>
+ <string>typedef</string>
+ <string>unsigned</string>
+ <string>signed</string>
+ <string>char</string>
+ <string>unichar</string>
+ <string>long</string>
+ <string>int</string>
+ <string>short</string>
+ <string>float</string>
+ <string>double</string>
+ <string>@end</string>
+ <string>nil</string>
+ <string>else</string>
+ <string>if</string>
+ <string>do</string>
+ <string>while</string>
+ <string>for</string>
+ <string>break</string>
+ <string>case</string>
+ <string>default</string>
+ <string>continue</string>
+ <string>goto</string>
+ <string>switch</string>
+ <string>IBAction</string>
+ <string>IBOutlet</string>
+ <string>BOOL</string>
+ <string>YES</string>
+ <string>NO</string>
+ <string>NS_DURING</string>
+ <string>NS_HANDLER</string>
+ <string>NS_ENDHANDLER</string>
+ <string>NS_VOIDRETURN</string>
+ <string>NS_VALUERETURN</string>
+ </array>
+ <key>Identifiers:Charset</key>
+ <string>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@_1234567890</string>
+ <key>OneLineComment:Start</key>
+ <string>//</string>
+ <key>PreprocessorDirectives</key>
+ <array>
+ <string>#include</string>
+ <string>#import</string>
+ <string>#define</string>
+ <string>#ifdef</string>
+ <string>#if</string>
+ <string>#else</string>
+ <string>#elif</string>
+ <string>#endif</string>
+ <string>#undef</string>
+ </array>
+</dict>
+</plist>
207 Syntax Definitions/Objective C.plist
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Components</key>
+ <array>
+ <dict>
+ <key>Color</key>
+ <array>
+ <integer>1</integer>
+ <integer>1</integer>
+ <integer>1</integer>
+ </array>
+ <key>End</key>
+ <string>"</string>
+ <key>EscapeChar</key>
+ <string>\</string>
+ <key>Name</key>
+ <string>Strings</string>
+ <key>Start</key>
+ <string>"</string>
+ <key>Type</key>
+ <string>String</string>
+ </dict>
+ <dict>
+ <key>Charset</key>
+ <string>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@_1234567890</string>
+ <key>Color</key>
+ <array>
+ <real>0.20000000000000001</real>
+ <real>0.5</real>
+ <real>0.20000000000000001</real>
+ </array>
+ <key>Keywords</key>
+ <array>
+ <string>super</string>
+ <string>id</string>
+ <string>void</string>
+ <string>self</string>
+ <string>return</string>
+ <string>@selector</string>
+ <string>@interface</string>
+ <string>@protocol</string>
+ <string>@implementation</string>
+ <string>@class</string>
+ <string>@try</string>
+ <string>@catch</string>
+ <string>@finally</string>
+ <string>enum</string>
+ <string>typedef</string>
+ <string>unsigned</string>
+ <string>signed</string>
+ <string>char</string>
+ <string>unichar</string>
+ <string>long</string>
+ <string>int</string>
+ <string>short</string>
+ <string>float</string>
+ <string>double</string>
+ <string>@end</string>
+ <string>nil</string>
+ <string>else</string>
+ <string>if</string>
+ <string>do</string>
+ <string>while</string>
+ <string>for</string>
+ <string>break</string>
+ <string>case</string>
+ <string>default</string>
+ <string>continue</string>
+ <string>goto</string>
+ <string>switch</string>
+ <string>const</string>
+ <string>static</string>
+ <string>volatile</string>
+ <string>extern</string>
+ <string>IBAction</string>
+ <string>IBOutlet</string>
+ <string>BOOL</string>
+ <string>YES</string>
+ <string>NO</string>
+ <string>NS_DURING</string>
+ <string>NS_HANDLER</string>
+ <string>NS_ENDHANDLER</string>
+ <string>NS_VOIDRETURN</string>
+ <string>NS_VALUERETURN</string>
+ <string>Class</string>
+ <string>SEL</string>
+ </array>
+ <key>Name</key>
+ <string>Identifiers</string>
+ <key>Type</key>
+ <string>Keywords</string>
+ </dict>
+ <dict>
+ <key>Charset</key>
+ <string>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@_1234567890</string>
+ <key>Name</key>
+ <string>UserIdentifiers</string>
+ <key>Type</key>
+ <string>Keywords</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#define</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#include</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#import</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#if</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#else</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#elif</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#endif</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#undef</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Preprocessor</string>
+ <key>Start</key>
+ <string>#pragma</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Name</key>
+ <string>Comments</string>
+ <key>Start</key>
+ <string>//</string>
+ <key>Type</key>
+ <string>OneLineComment</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <integer>1</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ </array>
+ <key>End</key>
+ <string>*/</string>
+ <key>Name</key>
+ <string>Comments</string>
+ <key>Start</key>
+ <string>/*</string>
+ <key>Type</key>
+ <string>BlockComment</string>
+ </dict>
+ </array>
+ <key>FileNameSuffixes</key>
+ <array>
+ <string>m</string>
+ <string>mm</string>
+ <string>h</string>
+ </array>
+</dict>
+</plist>
54 SyntaxColorDefaults.plist
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SyntaxColoring:Color:Comments</key>
+ <array>
+ <integer>1</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ </array>
+ <key>SyntaxColoring:Color:Comments2</key>
+ <array>
+ <real>0.80000000000000004</real>
+ <integer>0</integer>
+ <integer>0</integer>
+ </array>
+ <key>SyntaxColoring:Color:Identifiers</key>
+ <array>
+ <integer>0</integer>
+ <integer>0</integer>
+ <integer>1</integer>
+ </array>
+ <key>SyntaxColoring:Color:Identifiers2</key>
+ <array>
+ <real>0.0</real>
+ <real>0.25097999999999998</real>
+ <real>0.50196099999999999</real>
+ </array>
+ <key>SyntaxColoring:Color:Preprocessor</key>
+ <array>
+ <integer>0</integer>
+ <real>0.40000000000000002</real>
+ <integer>0</integer>
+ </array>
+ <key>SyntaxColoring:Color:Strings</key>
+ <array>
+ <real>0.40000000596046448</real>
+ <real>0.40000000596046448</real>
+ <real>0.40000000596046448</real>
+ </array>
+ <key>SyntaxColoring:Color:Tags</key>
+ <array>
+ <integer>0</integer>
+ <integer>0</integer>
+ <real>0.59999999999999998</real>
+ </array>
+ <key>SyntaxColoring:Color:UserIdentifiers</key>
+ <array>
+ <real>0.0</real>
+ <real>0.25097999999999998</real>
+ <real>0.50196099999999999</real>
+ </array>
+</dict>
+</plist>
100 SyntaxDefinition.plist
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Components</key>
+ <array>
+ <dict>
+ <key>Color</key>
+ <array>
+ <integer>1</integer>
+ <integer>1</integer>
+ <integer>1</integer>
+ </array>
+ <key>End</key>
+ <string>"</string>
+ <key>EscapeChar</key>
+ <string></string>
+ <key>Name</key>
+ <string>Strings</string>
+ <key>Start</key>
+ <string>"</string>
+ <key>Type</key>
+ <string>String</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <integer>0</integer>
+ <integer>0</integer>
+ <integer>1</integer>
+ </array>
+ <key>End</key>
+ <string>&gt;</string>
+ <key>IgnoredComponent</key>
+ <string>Strings</string>
+ <key>Name</key>
+ <string>Tags</string>
+ <key>Start</key>
+ <string>&lt;</string>
+ <key>Type</key>
+ <string>Tag</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <real>0.29999999999999999</real>
+ <real>0.29999999999999999</real>
+ <real>0.29999999999999999</real>
+ </array>
+ <key>End</key>
+ <string>"</string>
+ <key>EscapeChar</key>
+ <string></string>
+ <key>Name</key>
+ <string>Strings</string>
+ <key>Start</key>
+ <string>"</string>
+ <key>Type</key>
+ <string>String</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <real>0.20000000000000001</real>
+ <real>0.5</real>
+ <real>0.20000000000000001</real>
+ </array>
+ <key>Keywords</key>
+ <array>
+ <string>&amp;lt;</string>
+ <string>&amp;gt;</string>
+ <string>&amp;amp;</string>
+ <string>&amp;auml;</string>
+ <string>&amp;uuml;</string>
+ <string>&amp;ouml;</string>
+ </array>
+ <key>Name</key>
+ <string>Identifiers</string>
+ <key>Type</key>
+ <string>Keywords</string>
+ </dict>
+ <dict>
+ <key>Color</key>
+ <array>
+ <integer>1</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ </array>
+ <key>End</key>
+ <string>--&gt;</string>
+ <key>Name</key>
+ <string>Comments</string>
+ <key>Start</key>
+ <string>&lt;!--</string>
+ <key>Type</key>
+ <string>BlockComment</string>
+ </dict>
+ </array>
+</dict>
+</plist>
78 UKMultiSyntaxColoredTextDocument.h
@@ -0,0 +1,78 @@
+//
+// UKMultiSyntaxColoredTextDocument.h
+// UKSyntaxColoredDocument
+//
+// Created by Uli Kusterer on Mon May 17 2004.
+// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+//
+
+/*
+ This is a variant of UKSyntaxColoredTextDocument that allows switching between
+ different syntax definitions. Syntax definitions go into a "Syntax Definitions"
+ folder (either in your Bundle's Resources folder, in the user's Application
+ Support folder, or in the Computer's Application Support folder).
+
+ Create a submenu or menu somewhere in which you put one menu item whose action
+ is takeSyntaxDefinitionFilenameFromTagOf: and whose target is the first responder.
+ UKMultiSyntaxColoredTextDocument will remove that menu item and replace it with
+ a list of the syntax definitions in those three folders. Right now this menu
+ item must be at the bottom of the menu, or the only one in the menu.
+
+ You can also use a popup menu in the window instead and hook it up to the
+ syntaxDefinitionMenu outlet (like UKMultiSyntaxColoredTextDocument.nib does
+ it) to have it populated instead of the main menu.
+*/
+
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import "UKSyntaxColoredTextDocument.h"
+
+
+// -----------------------------------------------------------------------------
+// Constants:
+// -----------------------------------------------------------------------------
+
+// Define UKSCTD_APPLICATION_NAME to be an NSString containing your app's name
+// in your prefix header to make sure the subfolder of "Application Support"
+// where UKSCTD will look for the "Syntax Definitions" folder is the right one.
+// If the constant isn't defined, this will simply choose the display name of
+// the application, which will be the right thing until one of your users
+// decides to rename the application. :-S
+
+#ifndef UKSCTD_APPLICATION_NAME
+#define UKSCTD_APPLICATION_NAME [[NSFileManager defaultManager] displayNameAtPath: [[NSBundle mainBundle] bundlePath]]
+#warning Please define UKSCTD_APPLICATION_NAME to be a constant NSString containing your app name, so users can rename your application without ill results.
+#endif
+
+
+// -----------------------------------------------------------------------------
+// Class:
+// -----------------------------------------------------------------------------
+
+@interface UKMultiSyntaxColoredTextDocument : UKSyntaxColoredTextDocument
+{
+ NSString* syntaxDefinitionFilename; // Name of currently selected syntax definition.
+ IBOutlet NSMenu* syntaxDefinitionMenu; // If you use a popup menu, connect its menu to this outlet.
+}
+
+-(NSString*) syntaxDefinitionFilename;
+-(void) setSyntaxDefinitionFilename:(NSString *)aSyntaxDefinitionFileName;
+
+-(IBAction) takeSyntaxDefinitionFilenameFromTagOf: (id)sender; // Menu action!
+
+// Private:
+-(void) addSyntaxFilesFromFolderToArray: (NSString*)fpath;
+-(void) reloadSyntaxDefinitionFiles;
+-(void) rebuildSyntaxMenu;
+
+@end
+
+
+// -----------------------------------------------------------------------------
+// Notifications:
+// -----------------------------------------------------------------------------
+
+extern NSString* UKMultiSyntaxColoredTextDocumentSyntaxDefinitionChanged;
357 UKMultiSyntaxColoredTextDocument.m
@@ -0,0 +1,357 @@
+//
+// UKMultiSyntaxColoredTextDocument.m
+// UKSyntaxColoredDocument
+//
+// Created by Uli Kusterer on Mon May 17 2004.
+// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+//
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import "UKMultiSyntaxColoredTextDocument.h"
+#import "NSMenu+DeepSearch.h"
+
+
+// -----------------------------------------------------------------------------
+// Globals:
+// -----------------------------------------------------------------------------
+
+static NSMutableArray* sUKMSCTDSyntaxDefinitionFiles = nil; // Array of syntax definition file paths in NSStrings.
+static NSMutableDictionary* sUKMSCTDSuffixToTagMappings = nil;
+
+NSString* UKMultiSyntaxColoredTextDocumentSyntaxDefinitionChanged = @"UKMultiSyntaxColoredTextDocumentSyntaxDefinitionChanged";
+
+
+@implementation UKMultiSyntaxColoredTextDocument
+
+// -----------------------------------------------------------------------------
+// syntaxDefinitionFiles:
+// Return and, if needed, lazily allocate the array of available syntax
+// definition files. This also updates the syntax definition menu by
+// writing the file names without suffixes of the syntax definition files
+// into the menu as menu items, whose tags are the indices into the array
+// corresponding to them.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// 2004-05-17 witness Created.
+// -----------------------------------------------------------------------------
+
+-(NSArray*) syntaxDefinitionFiles
+{
+ if( !sUKMSCTDSyntaxDefinitionFiles )
+ {
+ sUKMSCTDSyntaxDefinitionFiles = [[NSMutableArray alloc] init];
+ sUKMSCTDSuffixToTagMappings = [[NSMutableDictionary alloc] init];
+
+ // Load from User's Application support:
+ NSString* fpath = [NSString stringWithFormat: @"%@/Library/Application Support/%@/Syntax Definitions/",
+ NSHomeDirectory(), UKSCTD_APPLICATION_NAME];
+ [self addSyntaxFilesFromFolderToArray: fpath];
+
+ // Load from global application support:
+ fpath = [NSString stringWithFormat: @"/Library/Application Support/%@/Syntax Definitions/",
+ UKSCTD_APPLICATION_NAME];
+ [self addSyntaxFilesFromFolderToArray: fpath];
+
+ // Load from folder in app bundle:
+ fpath = [[NSBundle mainBundle] pathForResource: @"Syntax Definitions" ofType: @""];
+ [self addSyntaxFilesFromFolderToArray: fpath];
+
+ // Now make the menu match:
+ [self rebuildSyntaxMenu];
+ }
+
+ return sUKMSCTDSyntaxDefinitionFiles;
+}
+
+
+// -----------------------------------------------------------------------------
+// rebuildSyntaxMenu:
+// Remove the old items from the syntax definition menu and add new menu
+// items for them based on the syntax definition files array.
+//
+// REVISIONS:
+// 2004-05-18 witness Extracted from syntaxDefinitionFiles.
+// -----------------------------------------------------------------------------
+
+-(void) rebuildSyntaxMenu
+{
+ id <NSMenuItem> foundItem = nil;
+ NSMenu* syntaxMenu = nil;
+
+ // Find menu with menu items for syntax definitions:
+ if( !syntaxDefinitionMenu )
+ {
+ foundItem = [[NSApp mainMenu] findItemWithTarget:nil andAction: @selector(takeSyntaxDefinitionFilenameFromTagOf:)];
+ syntaxMenu = [foundItem menu];
+ }
+ else // If we have a menu in our outlet, use that instead:
+ {
+ syntaxMenu = syntaxDefinitionMenu;
+ foundItem = [syntaxDefinitionMenu itemAtIndex: 0]; // Assume we own the popup.
+ }
+
+ // Remove all old menu items from our menu:
+ id <NSMenuItem> currMItem = foundItem;
+ int currItemNum = [syntaxMenu indexOfItem: currMItem];
+
+ while( [currMItem action] == @selector(takeSyntaxDefinitionFilenameFromTagOf:) )
+ {
+ [syntaxMenu removeItem: currMItem];
+ if( currItemNum < [syntaxMenu numberOfItems] )
+ currMItem = [syntaxMenu itemAtIndex: currItemNum];
+ else
+ break;
+ }
+ /* Warning! This croaks if the code below doesn't find any syntax
+ definition files, because then all menu items have been removed
+ and it won't find the menu the next time! */
+
+ NSEnumerator* enny = [sUKMSCTDSyntaxDefinitionFiles objectEnumerator];
+ NSString* currPath = nil;
+ int x = 0;
+
+ while( (currPath = [enny nextObject]) )
+ {
+ NSString* dName = [[currPath lastPathComponent] stringByDeletingPathExtension];
+ NSMenuItem* currItem = [syntaxMenu addItemWithTitle: dName action: @selector(takeSyntaxDefinitionFilenameFromTagOf:)
+ keyEquivalent:@""];
+ [currItem setTag: x++]; // Remember array index of this one.
+
+ NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile: currPath];
+ NSEnumerator* suffixEnny = [[dict objectForKey: @"FileNameSuffixes"] objectEnumerator];
+ NSString* suffix = nil;
+ while(( suffix = [suffixEnny nextObject] ))
+ [sUKMSCTDSuffixToTagMappings setObject: [NSNumber numberWithInt: x -1] forKey: suffix];
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+// addSyntaxFilesFromFolder:
+// Scan the specified folder for files and add all files (except the ones
+// starting with a period) to our array of syntax definition file paths,
+// as well as adding menu items for them.
+//
+// This appends to the array, so can be called several times in a row to
+// scan several folders.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// 2004-05-17 witness Created.
+// -----------------------------------------------------------------------------
+
+-(void) addSyntaxFilesFromFolderToArray: (NSString*)fpath
+{
+ NSDirectoryEnumerator* enny = [[NSFileManager defaultManager] enumeratorAtPath: fpath];
+ NSString* currPath = nil;
+ NSString* currName = nil;
+
+ while( (currName = [enny nextObject]) )
+ {
+ if( [currName characterAtIndex: 0] == '.' )
+ continue;
+
+ currPath = [fpath stringByAppendingPathComponent: currName];
+ [sUKMSCTDSyntaxDefinitionFiles addObject: currPath];
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+// reloadSyntaxDefinitionFiles:
+// Kill and recreate the list of syntax definition files.
+//
+// REVISIONS:
+// 2004-05-18 witness Created.
+// -----------------------------------------------------------------------------
+
+-(void) reloadSyntaxDefinitionFiles
+{
+ [sUKMSCTDSyntaxDefinitionFiles release];
+ sUKMSCTDSyntaxDefinitionFiles = nil;
+
+ [self syntaxDefinitionFiles];
+}
+
+
+// -----------------------------------------------------------------------------
+// * CONSTRUCTOR:
+// Lazily instantiate our array of syntax definition file paths and also
+// init the syntax coloring scheme to use to the first item from that list.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// 2004-05-17 witness Created.
+// -----------------------------------------------------------------------------
+
+-(id) init
+{
+ self = [super init];
+ if( self )
+ {
+ syntaxDefinitionFilename = [[[self syntaxDefinitionFiles] objectAtIndex: 0] retain];
+ }
+ return self;
+}
+
+
+// -----------------------------------------------------------------------------
+// * DESTRUCTOR:
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// 2004-05-17 witness Created.
+// -----------------------------------------------------------------------------
+
+-(void) dealloc
+{
+ [syntaxDefinitionFilename release];
+ syntaxDefinitionFilename = nil;
+
+ [super dealloc];
+}
+
+
+// -----------------------------------------------------------------------------
+// windowControllerDidLoadNib:
+// If we're using a popup, reload the syntax definition list now that the
+// NIB's been loaded and in the process populate the menu.
+//
+// REVISIONS:
+// 2004-05-18 witness Created.
+// -----------------------------------------------------------------------------
+
+-(void) windowControllerDidLoadNib:(NSWindowController *)windowController
+{
+ if( syntaxDefinitionMenu ) // Connected to a popup in our NIB?
+ [self rebuildSyntaxMenu];
+
+ NSString* fileSuffix = [[self fileName] pathExtension];
+ NSNumber* numObj = [sUKMSCTDSuffixToTagMappings objectForKey: fileSuffix];
+ if( numObj )
+ [self setSyntaxDefinitionFilename: [sUKMSCTDSyntaxDefinitionFiles objectAtIndex: [numObj intValue]]];
+
+ [super windowControllerDidLoadNib: windowController];
+}
+
+
+// -----------------------------------------------------------------------------
+// syntaxDefinitionDictionary:
+// Return the syntax definition dictionary to use for colorizing. This
+// overrides a method in UKSyntaxColoredTextDocument since UKSCTD only
+// looks for its files in the application bundle.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// 2004-05-17 witness Created.
+// -----------------------------------------------------------------------------
+
+-(NSDictionary*) syntaxDefinitionDictionary
+{
+ NSString* synDefName = [self syntaxDefinitionFilename];
+ return [NSDictionary dictionaryWithContentsOfFile: synDefName];
+}
+
+
+// -----------------------------------------------------------------------------
+// syntaxDefinitionFilename:
+// Return the full pathname of the syntax definition file to use for
+// syntax coloring.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// 2004-05-17 witness Created.
+// -----------------------------------------------------------------------------
+
+-(NSString*) syntaxDefinitionFilename
+{
+ return [[syntaxDefinitionFilename retain] autorelease];
+}
+
+
+// -----------------------------------------------------------------------------
+// setSyntaxDefinitionFilename:
+// Select a different syntax definition file name to be used for coloring.
+// This also causes a recoloring of the text using the new coloring scheme.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// 2004-05-17 witness Created.
+// -----------------------------------------------------------------------------
+
+-(void) setSyntaxDefinitionFilename:(NSString *)aSyntaxDefinitionFileName
+{
+ [aSyntaxDefinitionFileName retain];
+ [syntaxDefinitionFilename release];
+ syntaxDefinitionFilename = aSyntaxDefinitionFileName;
+
+ [[NSNotificationCenter defaultCenter] postNotificationName: UKMultiSyntaxColoredTextDocumentSyntaxDefinitionChanged object: self];
+
+ [self recolorCompleteFile: self];
+}
+
+
+// -----------------------------------------------------------------------------
+// takeSyntaxDefinitionFilenameFromTagOf:
+// Menu action for our menu items that allow changing the syntax definition
+// to use.
+//
+// REVISIONS:
+// 2004-05-18 witness Created.
+// -----------------------------------------------------------------------------
+
+-(IBAction) takeSyntaxDefinitionFilenameFromTagOf: (id)sender
+{
+ [self setSyntaxDefinitionFilename: [sUKMSCTDSyntaxDefinitionFiles objectAtIndex: [sender tag]]];
+}
+
+
+// -----------------------------------------------------------------------------
+// validateMenuItem:
+// Make sure the menu item for the syntax coloring scheme this file uses
+// is selectable and checked.
+//
+// REVISIONS:
+// 2004-05-18 witness Created.
+// -----------------------------------------------------------------------------
+
+-(BOOL) validateMenuItem: (NSMenuItem*)anItem
+{
+ if( [anItem action] == @selector(takeSyntaxDefinitionFilenameFromTagOf:) )
+ {
+ [anItem setState: ([[sUKMSCTDSyntaxDefinitionFiles objectAtIndex: [anItem tag]] isEqualToString: [self syntaxDefinitionFilename]])];
+
+ return( [anItem tag] < [sUKMSCTDSyntaxDefinitionFiles count] );
+ }
+ else
+ return [super validateMenuItem: anItem];
+}
+
+
+// -----------------------------------------------------------------------------
+// windowNibName:
+// By default, UKMultiSyntaxColoredTextDocument uses a different NIB which
+// includes a popup menu in the status bar. If you want the menu in the
+// main menu bar instead, just subclass this and override this method to
+// return [super windowNibName], which gets you the regular NIB from the
+// superclass without the popup, and it'll cause the code in here to look
+// for its menu in the menu bar because the syntaxDefinitionMenu outlet
+// won't be set. Of course you can also return any other NIB you create
+// here, though then it'll be your duty to keep it in sync with the
+// "official" ones from me.
+//
+// REVISIONS:
+// 2004-05-18 witness Created.
+// -----------------------------------------------------------------------------
+
+-(NSString*) windowNibName
+{
+ return @"UKMultiSyntaxColoredTextDocument";
+}
+
+
+@end
54 UKSCTDColorWellPrefsController.h
@@ -0,0 +1,54 @@
+//
+// UKSCTDColorWellPrefsController.h
+// CocoaTADS
+//
+// Created by Uli Kusterer on Wed Feb 11 2004.
+// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+//
+
+/*
+ This is a simple controller class for displaying and changing the colors
+ used for syntax coloring.
+
+ Simply hook up the outlets to the NSColorWells of your "Preferences" window
+ and then connect their actions to the corresponding takeXXXColorFrom:
+ methods of an instance of this object.
+*/
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+
+// -----------------------------------------------------------------------------
+// Class:
+// -----------------------------------------------------------------------------
+
+@interface UKSCTDColorWellPrefsController : NSObject
+{
+ IBOutlet NSColorWell* commentsColor; // Make these point at the NSColorWells.
+ IBOutlet NSColorWell* identifiersColor;
+ IBOutlet NSColorWell* preprocessorColor;
+ IBOutlet NSColorWell* stringsColor;
+ IBOutlet NSColorWell* tagsColor;
+ IBOutlet NSColorWell* identifiers2Color;
+ IBOutlet NSColorWell* comments2Color;
+}
+
+// Actions for NSColorWells:
+-(IBAction) takeCommentsColorFrom: (NSColorWell*)cw;
+-(IBAction) takeIdentifiersColorFrom: (NSColorWell*)cw;
+-(IBAction) takePreprocessorColorFrom: (NSColorWell*)cw;
+-(IBAction) takeStringsColorFrom: (NSColorWell*)cw;
+-(IBAction) takeTagsColorFrom: (NSColorWell*)cw;
+-(IBAction) takeIdentifiers2ColorFrom: (NSColorWell*)cw;
+-(IBAction) takeComments2ColorFrom: (NSColorWell*)cw;
+
+-(IBAction) resetColors: (id)sender; // For "reset to defaults" button.
+
+// Private:
+-(void) updateUIFromPrefs: (id)sender;
+
+@end
217 UKSCTDColorWellPrefsController.m
@@ -0,0 +1,217 @@
+//
+// UKSCTDColorWellPrefsController.m
+// CocoaTADS
+//
+// Created by Uli Kusterer on Wed Feb 11 2004.
+// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+//
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import "UKSCTDColorWellPrefsController.h"
+#import "NSArray+Color.h"
+#import "UKSyntaxColoredTextDocument.h"
+
+
+@implementation UKSCTDColorWellPrefsController
+
+// -----------------------------------------------------------------------------
+// awakeFromNib:
+// This object has just been loaded from its NIB. Initialize the prefs
+// and display them in the color wells we are connected to.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(void) awakeFromNib
+{
+ [UKSyntaxColoredTextDocument makeSurePrefsAreInited];
+ [self updateUIFromPrefs: self];
+}
+
+// -----------------------------------------------------------------------------
+// updateUIFromPrefs:
+// Assign the colors from user defaults to the corresponding color wells.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(void) updateUIFromPrefs: (id)sender
+{
+ NSArray* arr = [[NSUserDefaults standardUserDefaults] objectForKey: @"SyntaxColoring:Color:Comments"];
+ if( arr )
+ [commentsColor setColor: [arr colorValue]];
+
+ arr = [[NSUserDefaults standardUserDefaults] objectForKey: @"SyntaxColoring:Color:Identifiers"];
+ if( arr )
+ [identifiersColor setColor: [arr colorValue]];
+
+ arr = [[NSUserDefaults standardUserDefaults] objectForKey: @"SyntaxColoring:Color:Preprocessor"];
+ if( arr )
+ [preprocessorColor setColor: [arr colorValue]];
+
+ arr = [[NSUserDefaults standardUserDefaults] objectForKey: @"SyntaxColoring:Color:Strings"];
+ if( arr )
+ [stringsColor setColor: [arr colorValue]];
+
+ arr = [[NSUserDefaults standardUserDefaults] objectForKey: @"SyntaxColoring:Color:Tags"];
+ if( arr )
+ [tagsColor setColor: [arr colorValue]];
+
+ arr = [[NSUserDefaults standardUserDefaults] objectForKey: @"SyntaxColoring:Color:UserIdentifiers"];
+ if( !arr )
+ arr = [[NSUserDefaults standardUserDefaults] objectForKey: @"SyntaxColoring:Color:Identifiers2"];
+ if( arr )
+ [identifiers2Color setColor: [arr colorValue]];
+
+ arr = [[NSUserDefaults standardUserDefaults] objectForKey: @"SyntaxColoring:Color:Comments2"];
+ if( arr )
+ [comments2Color setColor: [arr colorValue]];
+}
+
+
+// -----------------------------------------------------------------------------
+// takeCommentsColorFrom:
+// Action for "comments" color well that takes the new color and saves
+// it to the user defaults.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) takeCommentsColorFrom: (NSColorWell*)cw
+{
+ NSArray* theColor = [NSArray arrayWithColor: [cw color]];
+ [[NSUserDefaults standardUserDefaults] setObject: theColor forKey: @"SyntaxColoring:Color:Comments"];
+}
+
+
+// -----------------------------------------------------------------------------
+// takeIdentifiersColorFrom:
+// Action for "identifiers" color well that takes the new color and saves
+// it to the user defaults.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) takeIdentifiersColorFrom: (NSColorWell*)cw
+{
+ NSArray* theColor = [NSArray arrayWithColor: [cw color]];
+ [[NSUserDefaults standardUserDefaults] setObject: theColor forKey: @"SyntaxColoring:Color:Identifiers"];
+}
+
+
+// -----------------------------------------------------------------------------
+// takeIdentifiers2ColorFrom:
+// Action for "identifiers2" color well that takes the new color and saves
+// it to the user defaults.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) takeIdentifiers2ColorFrom: (NSColorWell*)cw
+{
+ NSArray* theColor = [NSArray arrayWithColor: [cw color]];
+ [[NSUserDefaults standardUserDefaults] setObject: theColor forKey: @"SyntaxColoring:Color:Identifiers2"];
+ [[NSUserDefaults standardUserDefaults] setObject: theColor forKey: @"SyntaxColoring:Color:UserIdentifiers"];
+}
+
+
+// -----------------------------------------------------------------------------
+// takePreprocessorColorFrom:
+// Action for "preprocessor" color well that takes the new color and saves
+// it to the user defaults.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) takePreprocessorColorFrom: (NSColorWell*)cw
+{
+ NSArray* theColor = [NSArray arrayWithColor: [cw color]];
+ [[NSUserDefaults standardUserDefaults] setObject: theColor forKey: @"SyntaxColoring:Color:Preprocessor"];
+}
+
+
+// -----------------------------------------------------------------------------
+// takeStringsColorFrom:
+// Action for "strings" color well that takes the new color and saves
+// it to the user defaults.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) takeStringsColorFrom: (NSColorWell*)cw
+{
+ NSArray* theColor = [NSArray arrayWithColor: [cw color]];
+ [[NSUserDefaults standardUserDefaults] setObject: theColor forKey: @"SyntaxColoring:Color:Strings"];
+}
+
+
+// -----------------------------------------------------------------------------
+// takeTagsColorFrom:
+// Action for "tags" color well that takes the new color and saves
+// it to the user defaults.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) takeTagsColorFrom: (NSColorWell*)cw
+{
+ NSArray* theColor = [NSArray arrayWithColor: [cw color]];
+ [[NSUserDefaults standardUserDefaults] setObject: theColor forKey: @"SyntaxColoring:Color:Tags"];
+}
+
+
+// -----------------------------------------------------------------------------
+// takeComments2ColorFrom:
+// Action for "comments2" color well that takes the new color and saves
+// it to the user defaults.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) takeComments2ColorFrom: (NSColorWell*)cw
+{
+ NSArray* theColor = [NSArray arrayWithColor: [cw color]];
+ [[NSUserDefaults standardUserDefaults] setObject: theColor forKey: @"SyntaxColoring:Color:Comments2"];
+}
+
+
+// -----------------------------------------------------------------------------
+// resetColors:
+// Load the list of colors from the SyntaxColorDefaults file and re-apply
+// them to the prefs.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) resetColors: (id)sender
+{
+ NSDictionary* newValues = [NSDictionary dictionaryWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @"SyntaxColorDefaults" ofType:@"plist"]];
+ NSEnumerator* keysEnny = [newValues keyEnumerator];
+ NSString* currKey = nil;
+ id currValue = nil;
+ NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
+
+ while( (currKey = [keysEnny nextObject]) )
+ {
+ currValue = [newValues objectForKey: currKey];
+ [ud setObject: currValue forKey: currKey];
+ }
+
+ [self updateUIFromPrefs: self];
+}
+
+
+@end
41 UKSCTDUserIdentifiersPrefsController.h
@@ -0,0 +1,41 @@
+//
+// UKSCTDUserIdentifiersPrefsController.h
+// UKSyntaxColoredDocument
+//
+// Created by Uli Kusterer on Sat May 15 2004.
+// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+//
+
+/*
+ This is a simple controller class that handles changing the list of user-
+ defined identifiers that UKSyntaxColoredTextDocument uses (except if the
+ Syntax definition provides its own). You simply set up "add" and "remove"
+ buttons and a table view, connect them to an instance of this object, and
+ it will take care of the rest.
+*/
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+
+// -----------------------------------------------------------------------------
+// Class:
+// -----------------------------------------------------------------------------
+
+@interface UKSCTDUserIdentifiersPrefsController : NSObject
+{
+ IBOutlet NSTableView* identifiersList; // The list view for editing and viewing identifiers. This object is its data source and delegate.
+ IBOutlet NSButton* removeButton; // The "remove" button so we can enable/disable it.
+ NSMutableArray* identifiers; // Our internal, editable copy of the list of identifiers.
+}
+
+-(IBAction) createNewIdentifier: (id)sender; // Action for "Add" button.
+-(IBAction) deleteIdentifier: (id)sender; // Action for "Remove" button.
+
+// Private:
+-(NSMutableArray*) identifiers; // Accessor that lazily instantiates the "identifiers" array when first needed.
+
+@end
162 UKSCTDUserIdentifiersPrefsController.m
@@ -0,0 +1,162 @@
+//
+// UKSCTDUserIdentifiersPrefsController.m
+// UKSyntaxColoredDocument
+//
+// Created by Uli Kusterer on Sat May 15 2004.
+// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+//
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#import "UKSCTDUserIdentifiersPrefsController.h"
+#import "UKSyntaxColoredTextDocument.h"
+
+
+@implementation UKSCTDUserIdentifiersPrefsController
+
+// -----------------------------------------------------------------------------
+// * CONSTRUCTOR:
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(id) init
+{
+ self = [super init];
+ if( self )
+ {
+ identifiers = nil; // Is instantiated lazily when we need it.
+ }
+
+ return self;
+}
+
+
+// -----------------------------------------------------------------------------
+// * DESTRUCTOR:
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(void) dealloc
+{
+ [identifiers release];
+ identifiers = nil;
+
+ [super dealloc];
+}
+
+
+// -----------------------------------------------------------------------------
+// awakeFromNib:
+// Make sure GUI looks right after it's been loaded.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(void) awakeFromNib
+{
+ [self tableViewSelectionDidChange:nil]; // Make sure "remove" button looks right.
+}
+
+
+// -----------------------------------------------------------------------------
+// createNewIdentifier:
+// Action for "Add Identifier" button. Creates a new untitled identifier
+// entry that the user can then edit.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) createNewIdentifier: (id)sender
+{
+ [[self identifiers] addObject: NSLocalizedString(@"untitled", nil)];
+ int theRow = [[self identifiers] count] -1;
+
+ [identifiersList noteNumberOfRowsChanged];
+
+ [identifiersList selectRow: theRow byExtendingSelection: NO];
+ [identifiersList editColumn: 0 row: theRow withEvent: nil select: YES];
+}
+
+
+// -----------------------------------------------------------------------------
+// deleteIdentifier:
+// Action for "Remove Identifier" button. Removes the selected identifier
+// from the list and the user defaults.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(IBAction) deleteIdentifier: (id)sender
+{
+ [identifiers removeObjectAtIndex: [identifiersList selectedRow]];
+ [identifiersList noteNumberOfRowsChanged];
+
+ [[NSUserDefaults standardUserDefaults] setObject: [self identifiers]
+ forKey: TD_USER_DEFINED_IDENTIFIERS];
+}
+
+
+// -----------------------------------------------------------------------------
+// identifiers:
+// Return and, if needed, lazily instantiate our array of user-defined
+// identifiers.
+//
+// REVISIONS:
+// 2004-05-18 witness Documented.
+// -----------------------------------------------------------------------------
+
+-(NSMutableArray*) identifiers
+{
+ if( !identifiers )
+ {
+ identifiers = [[[NSUserDefaults standardUserDefaults] objectForKey: TD_USER_DEFINED_IDENTIFIERS] mutableCopy];
+ if( !identifiers )
+ identifiers = [[NSMutableArray alloc] init];
+ }
+
+ return identifiers;
+}
+
+
+// -----------------------------------------------------------------------------
+// Table view data source methods:
+// -----------------------------------------------------------------------------
+
+-(int) numberOfRowsInTableView:(NSTableView *)tableView
+{
+ return [[self identifiers] count];
+}
+
+
+-(void) tableViewSelectionDidChange:(NSNotification *)notification
+{
+ [removeButton setEnabled: ([identifiersList selectedRow] != -1)]; // Make sure "remove" button is only enabled if we have a selection.
+}
+
+
+-(id) tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+ return [[self identifiers] objectAtIndex: row];
+}
+
+
+-(void) tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+ [identifiers replaceObjectAtIndex: row withObject: object];
+
+ [[NSUserDefaults standardUserDefaults] setObject: [self identifiers]
+ forKey: TD_USER_DEFINED_IDENTIFIERS];
+}
+
+
+
+@end
481 UKSyntaxColoredDocument.xcodeproj/project.pbxproj
@@ -0,0 +1,481 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 3D1A27F6058B611800E623FD /* UKSyntaxColoredTextDocument.nib in Resources */ = {isa = PBXBuildFile; fileRef = 3D1A27F4058B611800E623FD /* UKSyntaxColoredTextDocument.nib */; };
+ 3D1A2808058B947200E623FD /* SyntaxColorDefaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3D1A2807058B947200E623FD /* SyntaxColorDefaults.plist */; };
+ 3D1A2836058BA91800E623FD /* UKTextDocGoToBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1A2834058BA91800E623FD /* UKTextDocGoToBox.h */; };
+ 3D1A2837058BA91800E623FD /* UKTextDocGoToBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1A2835058BA91800E623FD /* UKTextDocGoToBox.m */; };
+ 3D1A2A02058BC64100E623FD /* SyntaxDefinition.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3D1A2A01058BC64100E623FD /* SyntaxDefinition.plist */; };
+ 3D1A2A19058BC7B200E623FD /* NSScanner+SkipUpToCharset.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1A2A17058BC7B200E623FD /* NSScanner+SkipUpToCharset.h */; };
+ 3D1A2A1A058BC7B200E623FD /* NSScanner+SkipUpToCharset.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1A2A18058BC7B200E623FD /* NSScanner+SkipUpToCharset.m */; };
+ 3D5D9F3808873A3600058C2B /* UKSyntaxColoredTextDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5D9F3608873A3600058C2B /* UKSyntaxColoredTextDocument.h */; };
+ 3D5D9F3908873A3600058C2B /* UKSyntaxColoredTextDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D5D9F3708873A3600058C2B /* UKSyntaxColoredTextDocument.m */; };
+ 3D5D9F3C08873A4B00058C2B /* NSArray+Color.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5D9F3A08873A4B00058C2B /* NSArray+Color.h */; };
+ 3D5D9F3D08873A4B00058C2B /* NSArray+Color.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D5D9F3B08873A4B00058C2B /* NSArray+Color.m */; };
+ 3D70D4BD06594E70006EC8D8 /* UKMultiSyntaxColoredTextDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D70D4BB06594E70006EC8D8 /* UKMultiSyntaxColoredTextDocument.h */; };
+ 3D70D4BE06594E70006EC8D8 /* UKMultiSyntaxColoredTextDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D70D4BC06594E70006EC8D8 /* UKMultiSyntaxColoredTextDocument.m */; };
+ 3D70D4CB065A179C006EC8D8 /* NSMenu+DeepSearch.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D70D4C9065A179C006EC8D8 /* NSMenu+DeepSearch.h */; };
+ 3D70D4CC065A179C006EC8D8 /* NSMenu+DeepSearch.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D70D4CA065A179C006EC8D8 /* NSMenu+DeepSearch.m */; };
+ 3D70D4D3065A1C29006EC8D8 /* Syntax Definitions in Resources */ = {isa = PBXBuildFile; fileRef = 3D70D4CD065A1C28006EC8D8 /* Syntax Definitions */; };
+ 3DBD9D29065A9C31009A2536 /* UKMultiSyntaxColoredTextDocument.nib in Resources */ = {isa = PBXBuildFile; fileRef = 3DBD9D27065A9C31009A2536 /* UKMultiSyntaxColoredTextDocument.nib */; };
+ 3DCE61A40655566B00B36B62 /* UKSCTDColorWellPrefsController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DCE61A20655566B00B36B62 /* UKSCTDColorWellPrefsController.h */; };
+ 3DCE61A50655566B00B36B62 /* UKSCTDColorWellPrefsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DCE61A30655566B00B36B62 /* UKSCTDColorWellPrefsController.m */; };
+ 3DFECEC606558AD20059B4E8 /* SelectionRange.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3DFECEC406558AD20059B4E8 /* SelectionRange.tiff */; };
+ 3DFECEC706558AD20059B4E8 /* InsertionMark.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3DFECEC506558AD20059B4E8 /* InsertionMark.tiff */; };
+ 3DFECED2065592BE0059B4E8 /* UKSCTDUserIdentifiersPrefsController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DFECED0065592BE0059B4E8 /* UKSCTDUserIdentifiersPrefsController.h */; };
+ 3DFECED3065592BE0059B4E8 /* UKSCTDUserIdentifiersPrefsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DFECED1065592BE0059B4E8 /* UKSCTDUserIdentifiersPrefsController.m */; };
+ 8D15AC290486D014006FF6A4 /* UKSyntaxColoredDocument_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF750370BD2300C91783 /* UKSyntaxColoredDocument_Prefix.pch */; };
+ 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; };
+ 8D15AC2D0486D014006FF6A4 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */; };
+ 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; };
+ 8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
+ 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 2A37F4B7FDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
+ 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; };
+ 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32DBCF750370BD2300C91783 /* UKSyntaxColoredDocument_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKSyntaxColoredDocument_Prefix.pch; sourceTree = "<group>"; };
+ 3D1A27F5058B611800E623FD /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/UKSyntaxColoredTextDocument.nib; sourceTree = "<group>"; };
+ 3D1A2807058B947200E623FD /* SyntaxColorDefaults.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist; path = SyntaxColorDefaults.plist; sourceTree = "<group>"; };
+ 3D1A2834058BA91800E623FD /* UKTextDocGoToBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UKTextDocGoToBox.h; sourceTree = "<group>"; };
+ 3D1A2835058BA91800E623FD /* UKTextDocGoToBox.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UKTextDocGoToBox.m; sourceTree = "<group>"; };
+ 3D1A2A01058BC64100E623FD /* SyntaxDefinition.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist; path = SyntaxDefinition.plist; sourceTree = "<group>"; };
+ 3D1A2A17058BC7B200E623FD /* NSScanner+SkipUpToCharset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSScanner+SkipUpToCharset.h"; sourceTree = "<group>"; };
+ 3D1A2A18058BC7B200E623FD /* NSScanner+SkipUpToCharset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSScanner+SkipUpToCharset.m"; sourceTree = "<group>"; };
+ 3D1A2A52058BD4EC00E623FD /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
+ 3D5D9F3608873A3600058C2B /* UKSyntaxColoredTextDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UKSyntaxColoredTextDocument.h; sourceTree = "<group>"; };
+ 3D5D9F3708873A3600058C2B /* UKSyntaxColoredTextDocument.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UKSyntaxColoredTextDocument.m; sourceTree = "<group>"; };
+ 3D5D9F3A08873A4B00058C2B /* NSArray+Color.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "NSArray+Color.h"; sourceTree = "<group>"; };
+ 3D5D9F3B08873A4B00058C2B /* NSArray+Color.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Color.m"; sourceTree = "<group>"; };
+ 3D70D4BB06594E70006EC8D8 /* UKMultiSyntaxColoredTextDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKMultiSyntaxColoredTextDocument.h; sourceTree = "<group>"; };
+ 3D70D4BC06594E70006EC8D8 /* UKMultiSyntaxColoredTextDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKMultiSyntaxColoredTextDocument.m; sourceTree = "<group>"; };
+ 3D70D4C9065A179C006EC8D8 /* NSMenu+DeepSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMenu+DeepSearch.h"; sourceTree = "<group>"; };
+ 3D70D4CA065A179C006EC8D8 /* NSMenu+DeepSearch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMenu+DeepSearch.m"; sourceTree = "<group>"; };
+ 3D70D4CD065A1C28006EC8D8 /* Syntax Definitions */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Syntax Definitions"; sourceTree = "<group>"; };
+ 3DBD9D28065A9C31009A2536 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/UKMultiSyntaxColoredTextDocument.nib; sourceTree = "<group>"; };
+ 3DCE61A20655566B00B36B62 /* UKSCTDColorWellPrefsController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UKSCTDColorWellPrefsController.h; sourceTree = "<group>"; };
+ 3DCE61A30655566B00B36B62 /* UKSCTDColorWellPrefsController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UKSCTDColorWellPrefsController.m; sourceTree = "<group>"; };
+ 3DFECEC406558AD20059B4E8 /* SelectionRange.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = SelectionRange.tiff; sourceTree = "<group>"; };
+ 3DFECEC506558AD20059B4E8 /* InsertionMark.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = InsertionMark.tiff; sourceTree = "<group>"; };
+ 3DFECED0065592BE0059B4E8 /* UKSCTDUserIdentifiersPrefsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKSCTDUserIdentifiersPrefsController.h; sourceTree = "<group>"; };
+ 3DFECED1065592BE0059B4E8 /* UKSCTDUserIdentifiersPrefsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKSCTDUserIdentifiersPrefsController.m; sourceTree = "<group>"; };
+ 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 8D15AC370486D014006FF6A4 /* UKSyntaxColoredDocument.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UKSyntaxColoredDocument.app; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D15AC330486D014006FF6A4 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */,
+ 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FB0FE9D524F11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D15AC370486D014006FF6A4 /* UKSyntaxColoredDocument.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 2A37F4AAFDCFA73011CA2CEA /* UKSyntaxColoredDocument */ = {
+ isa = PBXGroup;
+ children = (
+ 3D1A2A52058BD4EC00E623FD /* README.txt */,
+ 2A37F4ABFDCFA73011CA2CEA /* Classes */,
+ 2A37F4AFFDCFA73011CA2CEA /* Other Sources */,
+ 2A37F4B8FDCFA73011CA2CEA /* Resources */,
+ 2A37F4C3FDCFA73011CA2CEA /* Frameworks */,
+ 19C28FB0FE9D524F11CA2CBB /* Products */,
+ );
+ name = UKSyntaxColoredDocument;
+ sourceTree = "<group>";
+ };
+ 2A37F4ABFDCFA73011CA2CEA /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 3D5D9F3608873A3600058C2B /* UKSyntaxColoredTextDocument.h */,
+ 3D5D9F3708873A3600058C2B /* UKSyntaxColoredTextDocument.m */,
+ 3D70D4BB06594E70006EC8D8 /* UKMultiSyntaxColoredTextDocument.h */,
+ 3D70D4BC06594E70006EC8D8 /* UKMultiSyntaxColoredTextDocument.m */,
+ 3D1A2834058BA91800E623FD /* UKTextDocGoToBox.h */,
+ 3D1A2835058BA91800E623FD /* UKTextDocGoToBox.m */,
+ 3DFECECD065592860059B4E8 /* Preferences */,
+ 3DFECED806559F770059B4E8 /* Categories */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32DBCF750370BD2300C91783 /* UKSyntaxColoredDocument_Prefix.pch */,
+ 2A37F4B0FDCFA73011CA2CEA /* main.m */,
+ );
+ name = "Other Sources";