Commits

Jens Alfke  committed b0fcdcc

File viewer window: initial checkin.

  • Participants
  • Parent commits f952174

Comments (0)

Files changed (10)

File English.lproj/FileViewer.xib

+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+	<data>
+		<int key="IBDocument.SystemTarget">1050</int>
+		<string key="IBDocument.SystemVersion">10C540</string>
+		<string key="IBDocument.InterfaceBuilderVersion">740</string>
+		<string key="IBDocument.AppKitVersion">1038.25</string>
+		<string key="IBDocument.HIToolboxVersion">458.00</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+			<string key="NS.object.0">740</string>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="3"/>
+		</object>
+		<object class="NSArray" key="IBDocument.PluginDependencies">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys" id="0">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSCustomObject" id="1001">
+				<string key="NSClassName">FileViewer</string>
+			</object>
+			<object class="NSCustomObject" id="1003">
+				<string key="NSClassName">FirstResponder</string>
+			</object>
+			<object class="NSCustomObject" id="1004">
+				<string key="NSClassName">NSApplication</string>
+			</object>
+			<object class="NSWindowTemplate" id="1005">
+				<int key="NSWindowStyleMask">15</int>
+				<int key="NSWindowBacking">2</int>
+				<string key="NSWindowRect">{{188, 186}, {578, 692}}</string>
+				<int key="NSWTFlags">544735232</int>
+				<string key="NSWindowTitle">/Path/To/File</string>
+				<string key="NSWindowClass">NSWindow</string>
+				<nil key="NSViewClass"/>
+				<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+				<string key="NSWindowContentMinSize">{250, 200}</string>
+				<object class="NSView" key="NSWindowView" id="1006">
+					<reference key="NSNextResponder"/>
+					<int key="NSvFlags">256</int>
+					<object class="NSMutableArray" key="NSSubviews">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSScrollView" id="83548836">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">274</int>
+							<object class="NSMutableArray" key="NSSubviews">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSClipView" id="64418832">
+									<reference key="NSNextResponder" ref="83548836"/>
+									<int key="NSvFlags">2304</int>
+									<object class="NSMutableArray" key="NSSubviews">
+										<bool key="EncodedWithXMLCoder">YES</bool>
+										<object class="NSTextView" id="64985884">
+											<reference key="NSNextResponder" ref="64418832"/>
+											<int key="NSvFlags">2322</int>
+											<object class="NSMutableSet" key="NSDragTypes">
+												<bool key="EncodedWithXMLCoder">YES</bool>
+												<object class="NSArray" key="set.sortedObjects">
+													<bool key="EncodedWithXMLCoder">YES</bool>
+													<string>Apple HTML pasteboard type</string>
+													<string>Apple PDF pasteboard type</string>
+													<string>Apple PICT pasteboard type</string>
+													<string>Apple PNG pasteboard type</string>
+													<string>Apple URL pasteboard type</string>
+													<string>CorePasteboardFlavorType 0x6D6F6F76</string>
+													<string>NSColor pasteboard type</string>
+													<string>NSFilenamesPboardType</string>
+													<string>NSStringPboardType</string>
+													<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+													<string>NeXT RTFD pasteboard type</string>
+													<string>NeXT Rich Text Format v1.0 pasteboard type</string>
+													<string>NeXT TIFF v4.0 pasteboard type</string>
+													<string>NeXT font pasteboard type</string>
+													<string>NeXT ruler pasteboard type</string>
+													<string>WebURLsWithTitlesPboardType</string>
+													<string>public.url</string>
+												</object>
+											</object>
+											<string key="NSFrameSize">{578, 29}</string>
+											<reference key="NSSuperview" ref="64418832"/>
+											<object class="NSTextContainer" key="NSTextContainer" id="249538336">
+												<object class="NSLayoutManager" key="NSLayoutManager">
+													<object class="NSTextStorage" key="NSTextStorage">
+														<object class="NSMutableString" key="NSString">
+															<characters key="NS.bytes"/>
+														</object>
+														<nil key="NSDelegate"/>
+													</object>
+													<object class="NSMutableArray" key="NSTextContainers">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<reference ref="249538336"/>
+													</object>
+													<int key="NSLMFlags">134</int>
+													<nil key="NSDelegate"/>
+												</object>
+												<reference key="NSTextView" ref="64985884"/>
+												<double key="NSWidth">578</double>
+												<int key="NSTCFlags">1</int>
+											</object>
+											<object class="NSTextViewSharedData" key="NSSharedData">
+												<int key="NSFlags">12263</int>
+												<int key="NSTextCheckingTypes">0</int>
+												<nil key="NSMarkedAttributes"/>
+												<object class="NSColor" key="NSBackgroundColor" id="582155242">
+													<int key="NSColorSpace">3</int>
+													<bytes key="NSWhite">MQA</bytes>
+												</object>
+												<object class="NSDictionary" key="NSSelectedAttributes">
+													<bool key="EncodedWithXMLCoder">YES</bool>
+													<object class="NSArray" key="dict.sortedKeys">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<string>NSBackgroundColor</string>
+														<string>NSColor</string>
+													</object>
+													<object class="NSMutableArray" key="dict.values">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<object class="NSColor">
+															<int key="NSColorSpace">6</int>
+															<string key="NSCatalogName">System</string>
+															<string key="NSColorName">selectedTextBackgroundColor</string>
+															<object class="NSColor" key="NSColor">
+																<int key="NSColorSpace">3</int>
+																<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+															</object>
+														</object>
+														<object class="NSColor">
+															<int key="NSColorSpace">6</int>
+															<string key="NSCatalogName">System</string>
+															<string key="NSColorName">selectedTextColor</string>
+															<object class="NSColor" key="NSColor" id="993844537">
+																<int key="NSColorSpace">3</int>
+																<bytes key="NSWhite">MAA</bytes>
+															</object>
+														</object>
+													</object>
+												</object>
+												<reference key="NSInsertionColor" ref="993844537"/>
+												<object class="NSDictionary" key="NSLinkAttributes">
+													<bool key="EncodedWithXMLCoder">YES</bool>
+													<object class="NSArray" key="dict.sortedKeys">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<string>NSColor</string>
+														<string>NSCursor</string>
+														<string>NSUnderline</string>
+													</object>
+													<object class="NSMutableArray" key="dict.values">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<object class="NSColor">
+															<int key="NSColorSpace">1</int>
+															<bytes key="NSRGB">MCAwIDEAA</bytes>
+														</object>
+														<object class="NSCursor">
+															<string key="NSHotSpot">{8, -8}</string>
+															<int key="NSCursorType">13</int>
+														</object>
+														<integer value="1"/>
+													</object>
+												</object>
+												<nil key="NSDefaultParagraphStyle"/>
+											</object>
+											<int key="NSTVFlags">6</int>
+											<string key="NSMaxSize">{1158, 1e+07}</string>
+											<string key="NSMinize">{223, 0}</string>
+											<nil key="NSDelegate"/>
+										</object>
+									</object>
+									<string key="NSFrame">{{1, 1}, {578, 638}}</string>
+									<reference key="NSSuperview" ref="83548836"/>
+									<reference key="NSNextKeyView" ref="64985884"/>
+									<reference key="NSDocView" ref="64985884"/>
+									<reference key="NSBGColor" ref="582155242"/>
+									<object class="NSCursor" key="NSCursor">
+										<string key="NSHotSpot">{4, -5}</string>
+										<int key="NSCursorType">1</int>
+									</object>
+									<int key="NScvFlags">4</int>
+								</object>
+								<object class="NSScroller" id="150741736">
+									<reference key="NSNextResponder" ref="83548836"/>
+									<int key="NSvFlags">-2147483392</int>
+									<string key="NSFrame">{{564, 1}, {15, 643}}</string>
+									<reference key="NSSuperview" ref="83548836"/>
+									<reference key="NSTarget" ref="83548836"/>
+									<string key="NSAction">_doScroller:</string>
+									<double key="NSCurValue">1</double>
+									<double key="NSPercent">0.85256409645080566</double>
+								</object>
+								<object class="NSScroller" id="993742014">
+									<reference key="NSNextResponder" ref="83548836"/>
+									<int key="NSvFlags">-2147483392</int>
+									<string key="NSFrame">{{1, 644}, {563, 15}}</string>
+									<reference key="NSSuperview" ref="83548836"/>
+									<int key="NSsFlags">1</int>
+									<reference key="NSTarget" ref="83548836"/>
+									<string key="NSAction">_doScroller:</string>
+									<double key="NSCurValue">1</double>
+									<double key="NSPercent">0.94565218687057495</double>
+								</object>
+							</object>
+							<string key="NSFrame">{{-1, 21}, {580, 640}}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<reference key="NSNextKeyView" ref="64418832"/>
+							<int key="NSsFlags">562</int>
+							<reference key="NSVScroller" ref="150741736"/>
+							<reference key="NSHScroller" ref="993742014"/>
+							<reference key="NSContentView" ref="64418832"/>
+						</object>
+						<object class="NSSlider" id="771270540">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">266</int>
+							<string key="NSFrame">{{21, 662}, {535, 26}}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSSliderCell" key="NSCell" id="1045305343">
+								<int key="NSCellFlags">-2079981824</int>
+								<int key="NSCellFlags2">0</int>
+								<string key="NSContents"/>
+								<reference key="NSControlView" ref="771270540"/>
+								<double key="NSMaxValue">100</double>
+								<double key="NSMinValue">0.0</double>
+								<double key="NSValue">0.0</double>
+								<double key="NSAltIncValue">0.0</double>
+								<int key="NSNumberOfTickMarks">3</int>
+								<int key="NSTickMarkPosition">1</int>
+								<bool key="NSAllowsTickMarkValuesOnly">YES</bool>
+								<bool key="NSVertical">NO</bool>
+							</object>
+						</object>
+						<object class="NSButton" id="660499110">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">268</int>
+							<string key="NSFrame">{{0, 664}, {16, 16}}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSButtonCell" key="NSCell" id="117490355">
+								<int key="NSCellFlags">67239424</int>
+								<int key="NSCellFlags2">134348800</int>
+								<string key="NSContents"/>
+								<object class="NSFont" key="NSSupport" id="26">
+									<string key="NSName">LucidaGrande</string>
+									<double key="NSSize">11</double>
+									<int key="NSfFlags">3100</int>
+								</object>
+								<reference key="NSControlView" ref="660499110"/>
+								<int key="NSButtonFlags">-2042347265</int>
+								<int key="NSButtonFlags2">268435462</int>
+								<object class="NSCustomResource" key="NSNormalImage">
+									<string key="NSClassName">NSImage</string>
+									<string key="NSResourceName">NSGoLeftTemplate</string>
+								</object>
+								<string key="NSAlternateContents"/>
+								<string key="NSKeyEquivalent">[</string>
+								<int key="NSPeriodicDelay">400</int>
+								<int key="NSPeriodicInterval">75</int>
+							</object>
+						</object>
+						<object class="NSButton" id="308381493">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">265</int>
+							<string key="NSFrame">{{560, 664}, {16, 16}}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSButtonCell" key="NSCell" id="1026166696">
+								<int key="NSCellFlags">67239424</int>
+								<int key="NSCellFlags2">134348800</int>
+								<string key="NSContents"/>
+								<reference key="NSSupport" ref="26"/>
+								<reference key="NSControlView" ref="308381493"/>
+								<int key="NSButtonFlags">-2042347265</int>
+								<int key="NSButtonFlags2">268435462</int>
+								<object class="NSCustomResource" key="NSNormalImage">
+									<string key="NSClassName">NSImage</string>
+									<string key="NSResourceName">NSGoRightTemplate</string>
+								</object>
+								<string key="NSAlternateContents"/>
+								<string key="NSKeyEquivalent">]</string>
+								<int key="NSPeriodicDelay">400</int>
+								<int key="NSPeriodicInterval">75</int>
+							</object>
+						</object>
+						<object class="NSSegmentedControl" id="364940944">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">292</int>
+							<string key="NSFrame">{{16, 3}, {117, 15}}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSSegmentedCell" key="NSCell" id="153085791">
+								<int key="NSCellFlags">67239424</int>
+								<int key="NSCellFlags2">262144</int>
+								<object class="NSFont" key="NSSupport">
+									<string key="NSName">LucidaGrande</string>
+									<double key="NSSize">9</double>
+									<int key="NSfFlags">3614</int>
+								</object>
+								<reference key="NSControlView" ref="364940944"/>
+								<object class="NSMutableArray" key="NSSegmentImages">
+									<bool key="EncodedWithXMLCoder">YES</bool>
+									<object class="NSSegmentItem">
+										<string key="NSSegmentItemLabel">Source</string>
+										<int key="NSSegmentItemImageScaling">0</int>
+									</object>
+									<object class="NSSegmentItem">
+										<string key="NSSegmentItemLabel">Diff</string>
+										<int key="NSSegmentItemTag">1</int>
+										<bool key="NSSegmentItemSelected">YES</bool>
+										<int key="NSSegmentItemImageScaling">0</int>
+									</object>
+									<object class="NSSegmentItem">
+										<string key="NSSegmentItemLabel">Blame</string>
+										<int key="NSSegmentItemTag">2</int>
+										<int key="NSSegmentItemImageScaling">0</int>
+									</object>
+								</object>
+								<int key="NSSelectedSegment">1</int>
+								<int key="NSSegmentStyle">1</int>
+							</object>
+						</object>
+					</object>
+					<string key="NSFrameSize">{578, 692}</string>
+					<reference key="NSSuperview"/>
+				</object>
+				<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
+				<string key="NSMinSize">{250, 222}</string>
+				<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+				<bool key="NSAutorecalculatesContentBorderThicknessMinY">NO</bool>
+				<double key="NSContentBorderThicknessMinY">22</double>
+			</object>
+		</object>
+		<object class="IBObjectContainer" key="IBDocument.Objects">
+			<object class="NSMutableArray" key="connectionRecords">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">window</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="1005"/>
+					</object>
+					<int key="connectionID">15</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">_revisionSlider</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="771270540"/>
+					</object>
+					<int key="connectionID">16</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">_textView</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="64985884"/>
+					</object>
+					<int key="connectionID">17</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">sliderChanged:</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="771270540"/>
+					</object>
+					<int key="connectionID">18</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">prevRevision:</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="660499110"/>
+					</object>
+					<int key="connectionID">26</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">nextRevision:</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="308381493"/>
+					</object>
+					<int key="connectionID">27</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBBindingConnection" key="connection">
+						<string key="label">selectedTag: viewMode</string>
+						<reference key="source" ref="364940944"/>
+						<reference key="destination" ref="1001"/>
+						<object class="NSNibBindingConnector" key="connector">
+							<reference key="NSSource" ref="364940944"/>
+							<reference key="NSDestination" ref="1001"/>
+							<string key="NSLabel">selectedTag: viewMode</string>
+							<string key="NSBinding">selectedTag</string>
+							<string key="NSKeyPath">viewMode</string>
+							<int key="NSNibBindingConnectorVersion">2</int>
+						</object>
+					</object>
+					<int key="connectionID">30</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">delegate</string>
+						<reference key="source" ref="64985884"/>
+						<reference key="destination" ref="1001"/>
+					</object>
+					<int key="connectionID">31</int>
+				</object>
+			</object>
+			<object class="IBMutableOrderedSet" key="objectRecords">
+				<object class="NSArray" key="orderedObjects">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBObjectRecord">
+						<int key="objectID">0</int>
+						<reference key="object" ref="0"/>
+						<reference key="children" ref="1000"/>
+						<nil key="parent"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-2</int>
+						<reference key="object" ref="1001"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">File's Owner</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-1</int>
+						<reference key="object" ref="1003"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">First Responder</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-3</int>
+						<reference key="object" ref="1004"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">Application</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">1</int>
+						<reference key="object" ref="1005"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1006"/>
+						</object>
+						<reference key="parent" ref="0"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">2</int>
+						<reference key="object" ref="1006"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="83548836"/>
+							<reference ref="771270540"/>
+							<reference ref="660499110"/>
+							<reference ref="308381493"/>
+							<reference ref="364940944"/>
+						</object>
+						<reference key="parent" ref="1005"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">3</int>
+						<reference key="object" ref="83548836"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="150741736"/>
+							<reference ref="993742014"/>
+							<reference ref="64985884"/>
+						</object>
+						<reference key="parent" ref="1006"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">4</int>
+						<reference key="object" ref="150741736"/>
+						<reference key="parent" ref="83548836"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">5</int>
+						<reference key="object" ref="993742014"/>
+						<reference key="parent" ref="83548836"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">6</int>
+						<reference key="object" ref="64985884"/>
+						<reference key="parent" ref="83548836"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">13</int>
+						<reference key="object" ref="771270540"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1045305343"/>
+						</object>
+						<reference key="parent" ref="1006"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">14</int>
+						<reference key="object" ref="1045305343"/>
+						<reference key="parent" ref="771270540"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">22</int>
+						<reference key="object" ref="660499110"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="117490355"/>
+						</object>
+						<reference key="parent" ref="1006"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">23</int>
+						<reference key="object" ref="117490355"/>
+						<reference key="parent" ref="660499110"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">24</int>
+						<reference key="object" ref="308381493"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1026166696"/>
+						</object>
+						<reference key="parent" ref="1006"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">25</int>
+						<reference key="object" ref="1026166696"/>
+						<reference key="parent" ref="308381493"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">28</int>
+						<reference key="object" ref="364940944"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="153085791"/>
+						</object>
+						<reference key="parent" ref="1006"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">29</int>
+						<reference key="object" ref="153085791"/>
+						<reference key="parent" ref="364940944"/>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="flattenedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>-1.IBPluginDependency</string>
+					<string>-2.IBPluginDependency</string>
+					<string>-3.IBPluginDependency</string>
+					<string>1.IBEditorWindowLastContentRect</string>
+					<string>1.IBPluginDependency</string>
+					<string>1.IBWindowTemplateEditedContentRect</string>
+					<string>1.NSWindowTemplate.visibleAtLaunch</string>
+					<string>1.WindowOrigin</string>
+					<string>1.editorWindowContentRectSynchronizationRect</string>
+					<string>1.windowTemplate.hasMinSize</string>
+					<string>1.windowTemplate.minSize</string>
+					<string>13.IBPluginDependency</string>
+					<string>14.CustomClassName</string>
+					<string>14.IBPluginDependency</string>
+					<string>2.IBPluginDependency</string>
+					<string>22.IBPluginDependency</string>
+					<string>23.IBPluginDependency</string>
+					<string>24.IBPluginDependency</string>
+					<string>25.IBPluginDependency</string>
+					<string>28.IBPluginDependency</string>
+					<string>29.IBPluginDependency</string>
+					<string>29.IBSegmentedControlInspectorSelectedSegmentMetadataKey</string>
+					<string>3.IBPluginDependency</string>
+					<string>4.IBPluginDependency</string>
+					<string>5.IBPluginDependency</string>
+					<string>6.IBPluginDependency</string>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{200, 138}, {578, 692}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{200, 138}, {578, 692}}</string>
+					<boolean value="NO"/>
+					<string>{196, 240}</string>
+					<string>{{357, 418}, {480, 270}}</string>
+					<boolean value="YES"/>
+					<string>{250, 200}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>RevisionSliderCell</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="2"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="unlocalizedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0"/>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="activeLocalization"/>
+			<object class="NSMutableDictionary" key="localizations">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0"/>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="sourceID"/>
+			<int key="maxID">31</int>
+		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes">
+			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBPartialClassDescription">
+					<string key="className">FileViewer</string>
+					<string key="superclassName">NSWindowController</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>nextRevision:</string>
+							<string>prevRevision:</string>
+							<string>sliderChanged:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="outlets">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>_infoField</string>
+							<string>_revisionSlider</string>
+							<string>_textView</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>NSTextField</string>
+							<string>NSSlider</string>
+							<string>NSTextView</string>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="603785594">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Source/FileViewer.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">../MYUtilities/MYWindowUtils.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">RevisionSliderCell</string>
+					<string key="superclassName">NSSliderCell</string>
+					<reference key="sourceIdentifier" ref="603785594"/>
+				</object>
+			</object>
+			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSActionCell</string>
+					<string key="superclassName">NSCell</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="611600068">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="499172367">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="832552500">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSButton</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSButtonCell</string>
+					<string key="superclassName">NSActionCell</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSCell</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSControl</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="591312416">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSFormatter</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSMenu</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="349735208">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="611600068"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="499172367"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="832552500"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="591312416"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="349735208"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="872860034">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSResponder</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSScrollView</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSScrollView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSScroller</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSScroller.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSSegmentedCell</string>
+					<string key="superclassName">NSActionCell</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSSegmentedCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSSegmentedControl</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSSegmentedControl.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSSlider</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSSlider.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSSliderCell</string>
+					<string key="superclassName">NSActionCell</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSSliderCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSText</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSText.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSTextField</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSTextView</string>
+					<string key="superclassName">NSText</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTextView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<string key="superclassName">NSResponder</string>
+					<reference key="sourceIdentifier" ref="872860034"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindowController</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="NSMutableDictionary" key="actions">
+						<string key="NS.key.0">showWindow:</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
+					</object>
+				</object>
+			</object>
+		</object>
+		<int key="IBDocument.localizationMode">0</int>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+			<integer value="1050" key="NS.object.0"/>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+			<integer value="3000" key="NS.object.0"/>
+		</object>
+		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+		<string key="IBDocument.LastKnownRelativeProjectPath">../Murky.xcodeproj</string>
+		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+	</data>
+</archive>

File Murky.xcodeproj/project.pbxproj

 		27E396FA10E88314009F99ED /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 27E396F810E88314009F99ED /* Localizable.strings */; };
 		27E771CC0FB01124006504EF /* BitbucketFavIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 27E771CB0FB01124006504EF /* BitbucketFavIcon.png */; };
 		27E772930FB09EA7006504EF /* MYWindowUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 27E772920FB09EA7006504EF /* MYWindowUtils.m */; };
+		27F909AC10E96E0900892C41 /* FileViewer.xib in Resources */ = {isa = PBXBuildFile; fileRef = 27F909AA10E96E0900892C41 /* FileViewer.xib */; };
+		27F909B010E96E4900892C41 /* FileViewer.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F909AF10E96E4900892C41 /* FileViewer.m */; };
 		27FEB46D0FBB200600290049 /* toolbar_add.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEB4640FBB200600290049 /* toolbar_add.png */; };
 		27FEB46E0FBB200600290049 /* toolbar_commit.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEB4650FBB200600290049 /* toolbar_commit.png */; };
 		27FEB46F0FBB200600290049 /* toolbar_commitall.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEB4660FBB200600290049 /* toolbar_commitall.png */; };
 		27E771CB0FB01124006504EF /* BitbucketFavIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = BitbucketFavIcon.png; sourceTree = "<group>"; };
 		27E772910FB09EA7006504EF /* MYWindowUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MYWindowUtils.h; sourceTree = "<group>"; };
 		27E772920FB09EA7006504EF /* MYWindowUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MYWindowUtils.m; sourceTree = "<group>"; };
+		27F909AB10E96E0900892C41 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/FileViewer.xib; sourceTree = "<group>"; };
+		27F909AE10E96E4900892C41 /* FileViewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileViewer.h; sourceTree = "<group>"; };
+		27F909AF10E96E4900892C41 /* FileViewer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileViewer.m; sourceTree = "<group>"; };
 		27FEB4640FBB200600290049 /* toolbar_add.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = toolbar_add.png; sourceTree = "<group>"; };
 		27FEB4650FBB200600290049 /* toolbar_commit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = toolbar_commit.png; sourceTree = "<group>"; };
 		27FEB4660FBB200600290049 /* toolbar_commitall.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = toolbar_commitall.png; sourceTree = "<group>"; };
 				27B042D20CA9A1390090DC04 /* RevisionGraphColumn.h */,
 				27B042D30CA9A1390090DC04 /* RevisionGraphColumn.m */,
 				27C657A30FAEA80D00CFB909 /* Repo.xib */,
+				27F909AE10E96E4900892C41 /* FileViewer.h */,
+				27F909AF10E96E4900892C41 /* FileViewer.m */,
+				27F909AA10E96E0900892C41 /* FileViewer.xib */,
 				275938640C93200B0088FFF4 /* ProjectsController.h */,
 				275938650C93200B0088FFF4 /* ProjectsController.m */,
 				27C6579F0FAEA7E800CFB909 /* Projects.xib */,
 				7300A4FA10DA29E2009C0BE4 /* toolbar_quicklook.png in Resources */,
 				7300A4FB10DA29E2009C0BE4 /* toolbar_tag.png in Resources */,
 				27E396FA10E88314009F99ED /* Localizable.strings in Resources */,
+				27F909AC10E96E0900892C41 /* FileViewer.xib in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 				27C656B90FAE046B00CFB909 /* MYDirectoryWatcher.m in Sources */,
 				27E772930FB09EA7006504EF /* MYWindowUtils.m in Sources */,
 				27C1C936104EF9F400781C99 /* SourceHighlighting.m in Sources */,
+				27F909B010E96E4900892C41 /* FileViewer.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			name = Localizable.strings;
 			sourceTree = "<group>";
 		};
+		27F909AA10E96E0900892C41 /* FileViewer.xib */ = {
+			isa = PBXVariantGroup;
+			children = (
+				27F909AB10E96E0900892C41 /* English */,
+			);
+			name = FileViewer.xib;
+			path = ..;
+			sourceTree = "<group>";
+		};
 		27FEB4840FBB209D00290049 /* InfoPlist.strings */ = {
 			isa = PBXVariantGroup;
 			children = (

File Source/FileViewer.h

+//
+//  FileViewer.h
+//  Murky
+//
+//  Created by Jens Alfke on 12/28/09.
+//  Copyright 2009 Jens Alfke. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+@class HgFile, HgRevision;
+
+
+typedef enum {
+    kViewSource,
+    kViewDiff,
+    kViewBlame
+} FileViewMode;
+
+
+@interface FileViewer : NSWindowController 
+{
+    HgFile *_file;
+    FileViewMode _viewMode;
+    NSArray *_revTooltips;
+    
+    IBOutlet NSTextView* _textView;
+    IBOutlet NSSlider* _revisionSlider;
+    IBOutlet NSTextField* _infoField;
+}
+
+- (id) initWithFile: (HgFile*)file;
+
+@property (readonly) HgFile* file;
+@property HgRevision* revision;
+
+@property FileViewMode viewMode;
+@property BOOL textWraps;
+
+- (IBAction) sliderChanged: (id)sender;
+- (IBAction) prevRevision: (id)sender;
+- (IBAction) nextRevision: (id)sender;
+
+@end
+
+
+
+@interface RevisionSliderCell : NSSliderCell
+{
+    NSArray *_revisions;
+}
+
+@property (copy) NSArray *revisions;
+@end

File Source/FileViewer.m

+//
+//  FileViewer.m
+//  Murky
+//
+//  Created by Jens Alfke on 12/28/09.
+//  Copyright 2009 Jens Alfke. All rights reserved.
+//
+
+#import "FileViewer.h"
+#import "HgFile.h"
+#import "HgDir.h"
+#import "HgRevision.h"
+#import "HgRepository.h"
+#import "SourceHighlighting.h"
+
+
+@interface FileViewer ()
+@property (readwrite) HgFile *file;
+- (void) _showFileContents;
+@end
+
+
+
+@implementation FileViewer
+
+
+@synthesize file=_file;
+
+
+- (id) initWithFile: (HgFile*)file {
+    self = [super initWithWindowNibName: @"FileViewer"];
+    if (self) {
+        _file = file;
+    }
+    return self;
+}
+
+- (void) awakeFromNib {
+    HgFile *file = _file;
+    self.window.title = $sprintf(@"%@ in %@ at %@", 
+                                 _file.name, _file.repository.name, _file.directory.path);
+    [self setTextWraps: NO];
+    
+    HgRepository *repository = file.repository;
+    int nRevisions = repository.revisions.count;
+    _revisionSlider.maxValue = nRevisions - 1;
+    
+    NSMutableArray *revisions = [file.revisions mutableCopy];
+    if (file.status != kClean)
+        [revisions addObject: repository.uncommittedRevision];
+    [_revisionSlider.cell setRevisions: revisions];
+    if (![revisions containsObject: file.revision])
+        self.revision = [revisions lastObject];
+    else
+        self.file = file;
+}
+
+- (HgFile*) file {
+    return _file;
+}
+
+- (void) setFile: (HgFile*)file {
+    Assert(file!=nil);
+    _file = file;
+    HgRevision *revision = _file.revision;
+    if (revision.isUncommitted) {
+        _revisionSlider.intValue = (int)_revisionSlider.maxValue;
+        _infoField.stringValue = @"Current contents (uncommitted)";
+    } else {
+        _revisionSlider.intValue = revision.localNumber;
+        _infoField.stringValue = $sprintf(@"r%i — %@", 
+                                          revision.localNumber, revision.date);
+    }
+    [self _showFileContents];
+}
+
+
+- (HgRevision*) revision {
+    return _file.revision;
+}
+
+- (void) setRevision: (HgRevision*)revision {
+    HgFile *file = [revision fileAtPath: _file.path];
+    if (file && file != _file)
+        self.file = file;
+}
+
+- (BOOL) skipRevision: (int)delta {
+    NSArray *revisions = [_revisionSlider.cell revisions];
+    int index = [revisions indexOfObject: self.revision];
+    if (index==NSNotFound)
+        return NO;
+    index += delta;
+    if (index<0 || index>=(int)revisions.count)
+        return NO;
+    self.revision = [revisions objectAtIndex: index];
+    return YES;
+}
+
+
+- (FileViewMode) viewMode {return _viewMode;}
+
+- (void) setViewMode:(FileViewMode)mode {
+    if (mode != _viewMode) {
+        _viewMode = mode;
+        [self _showFileContents];
+    }
+}
+
+
+- (IBAction) sliderChanged: (id)sender {
+    int revNo = _revisionSlider.intValue;
+    self.revision = [[_file.repository revisions] objectAtIndex: revNo];
+}
+
+- (IBAction) prevRevision: (id)sender {
+    if (![self skipRevision: -1])
+        NSBeep();
+}
+
+- (IBAction) nextRevision: (id)sender {
+    if (![self skipRevision: 1])
+        NSBeep();
+}
+
+
+- (BOOL) textWraps {
+    return [_textView isHorizontallyResizable];
+}
+
+- (void) setTextWraps: (BOOL)wraps {
+    [_textView setHorizontallyResizable: !wraps];
+    NSSize containerSize = _textView.textContainer.containerSize;
+    containerSize.width = wraps ?_textView.enclosingScrollView.documentVisibleRect.size.width 
+                                :FLT_MAX;
+    [[_textView textContainer] setContainerSize: containerSize];
+    [[_textView textContainer] setWidthTracksTextView: wraps];
+    [[_textView enclosingScrollView] setHasHorizontalScroller: !wraps];
+    [_textView setNeedsDisplay: YES];
+}
+
+
+- (NSArray*) revTooltips {
+    NSArray *revisions = _file.repository.revisions;
+    NSUInteger nRevisions = revisions.count;
+    if (!_revTooltips || _revTooltips.count != nRevisions) {
+        NSMutableArray *tooltips = [NSMutableArray arrayWithCapacity: nRevisions];
+        for (HgRevision *revision in revisions) {
+            NSString *tooltip = revision.formattedDescription;
+            [tooltips addObject: tooltip];
+        }
+        setObj(&_revTooltips, tooltips);
+    }
+    return _revTooltips;
+}
+
+
+- (void) _showFileContents {
+    HgRevision *revision = self.revision;
+    NSString *source = nil;
+    NSError *error = nil;
+    NSMutableAttributedString *text = nil;
+    
+    switch (_viewMode) {
+        case kViewSource: {
+            NSData *contents = [revision getFileContents: _file error: &error];
+            if (contents) {
+                source = [[NSString alloc] initWithData: contents encoding: NSUTF8StringEncoding];
+            } else {
+                source = error.localizedRecoverySuggestion;
+            }
+            text = AttributedStringForSourceCode(source);
+            break;
+        }
+        case kViewDiff: {
+            source = [revision diffFile: _file withRevision: revision.parent error: &error];
+            if (!source)
+                source = error.localizedRecoverySuggestion;
+            text = AttributedStringForSourceCode(source);
+            HighlightDiffs(text);
+            break;
+        }
+        case kViewBlame: {
+            source = [revision annotateFile: _file error: &error];
+            if (!source)
+                source = error.localizedRecoverySuggestion;
+            text = AttributedStringForSourceCode(source);
+            if (!error) {
+                int maxRev = _file.repository.revisions.count-1;
+                int revNo = revision.localNumber;
+                if (revNo == NSNotFound)
+                    revNo = maxRev;
+                HighlightAnnotatedFile(text, revNo, maxRev, self.revTooltips);
+            }
+            break;
+        }
+    }
+
+    [_textView setEditable: NO];
+    if (text) {
+        NSPoint scroll = _textView.visibleRect.origin;
+        [_textView.textStorage setAttributedString: text];
+        [_textView scrollPoint: scroll];
+    } else {
+        [_textView setString: @""];
+    }
+    [_textView setNeedsDisplay: YES];
+}
+
+- (BOOL)textView:(NSTextView *)textView clickedOnLink:(id)link atIndex:(NSUInteger)charIndex {
+    NSLog(@"clicked on: %@", link);
+    return YES;
+}
+
+@end
+
+
+
+
+@implementation RevisionSliderCell
+
+static NSDictionary *sTickAttrs;
+
++ (void) initialize {
+    if (!sTickAttrs)
+        sTickAttrs = $dict({NSFontAttributeName,
+                            [NSFont systemFontOfSize: 7]});
+}    
+
+- (NSArray*) revisions {
+    return _revisions;
+}
+
+- (void) setRevisions: (NSArray*)revisions {
+    _revisions = revisions;
+    self.numberOfTickMarks = revisions.count;
+}
+
+- (double)tickMarkValueAtIndex:(NSInteger)index {
+    int revNo = [[_revisions objectAtIndex: index] localNumber];
+    if (revNo == NSNotFound)
+        revNo = (int) self.maxValue;
+    return revNo;
+}
+
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+    float xClear = cellFrame.origin.x - 1;
+    int i = 0;
+    for (HgRevision *rev in _revisions) {
+        NSRect r = [self rectOfTickMarkAtIndex: i++];
+        if (rev.localNumber == self.intValue)
+            continue; // skip label that's drawn in knob
+        NSPoint org = {cellFrame.origin.x + r.origin.x - 2,
+                       cellFrame.origin.y + r.origin.y + 4};
+        NSString *label = rev.localString;
+        float width = [label sizeWithAttributes: sTickAttrs].width;
+        org.x = org.x + 2.0f - floorf(width/2.0f);
+        if (org.x >= xClear) {  // don't let labels overlap
+            [label drawAtPoint: org withAttributes: sTickAttrs];
+            xClear = org.x + width;
+        }
+    }
+    [super drawWithFrame: cellFrame inView: controlView];
+}
+
+- (void)drawKnob:(NSRect)knobRect {
+    [super drawKnob: knobRect];
+    NSString *label = $sprintf(@"%i", self.intValue);
+    NSSize size = [label sizeWithAttributes: sTickAttrs];
+    NSPoint org = {roundf(NSMidX(knobRect) - size.width/2.0f),
+                   roundf(NSMidY(knobRect) - size.height/2.0f)};
+    [label drawAtPoint: org withAttributes: sTickAttrs];
+}
+
+@end

File Source/HgRevision.h

 - (NSString*) getPathToFileContents: (HgFile*)file inTempDir: (HgTempDir*)tempDir error: (NSError**)outError;
 - (NSString*) diffFile: (HgFile*)file withRevisionNumber: (int)otherRev error: (NSError**)outError;
 - (NSString*) diffFile: (HgFile*)file withRevision: (HgRevision*)other error: (NSError**)outError;
-
 - (NSString*) compareFile: (HgFile*)file withRevisionNumber: (int)otherRev error: (NSError**)outError;
+- (NSString*) annotateFile: (HgFile*)file error: (NSError**)outError;
 
 - (NSArray*) outgoingRevisionsForRepository: (NSURL*)otherRepo;
 

File Source/HgRevision.m

         return [self diffFile: file withRevisionNumber: other.localNumber error: outError]; 
 }
 
+- (NSString*) annotateFile: (HgFile*)file error: (NSError**)outError
+{
+    NSString *revStr = self.isUncommitted ?@"tip"
+                                          :[NSString stringWithFormat: @"%i",_localNumber];
+    HgOperation *op = [[HgOperation alloc] initWithDirectory: file.root
+                                                     command: @"annotate",
+                       @"--number",
+                       @"--rev", revStr,
+                       @"--", file.path, nil];
+    if( ! [op run] ) {
+        if (outError) *outError = op.error;
+        return nil;
+    }
+    return op.output;    
+}
+
 
 #pragma mark -
 #pragma mark REVISION OPERATIONS:

File Source/RepoController.h

 - (IBAction) chooseRevisionFromPopUp: (id)sender;
 
 - (IBAction) openSelectedFile: (id)sender;
+- (IBAction) openSelectedFileInWindow: (id)sender;
 
 - (IBAction) showRevision: (id)sender;
 - (IBAction) showDiff: (id)sender;

File Source/RepoController_Actions.m

 //
 
 #import "RepoController.h"
+#import "FileViewer.h"
 #import "HgRepository.h"
 #import "HgDir.h"
 #import "HgUncommittedRevision.h"
 /** Called when a file is double-clicked */
 - (IBAction) openSelectedFile: (id)sender
 {
-    [self showRevision: sender];
+    [self openSelectedFileInWindow: sender];
 }
 
 
         NSBeep();
 }
 
+- (IBAction) openSelectedFileInWindow: (id)sender {
+    HgFile *file = self.selectedFile;
+    if( !(file.isFile || file.isDirectory) || file!=self.actuallySelectedFile ) {
+        NSBeep();
+        return;
+    }
+    FileViewer *viewer = [[FileViewer alloc] initWithFile: file];
+    [viewer showWindow: sender];
+}
+
 
 #pragma mark -
 #pragma mark DIFFS:

File Source/SourceHighlighting.h

 
 #import <Cocoa/Cocoa.h>
 
+#define RevisionNumberAttributeName @"HgRevisionNumber"
 
+/** Applies a default source-code text style to the string. */
 NSMutableAttributedString* AttributedStringForSourceCode (NSString *code);
 
+/** Colorize text in unified-diff format,
+    where each line begins with a "+", "-" or "@". */
 void HighlightDiffs (NSMutableAttributedString* text);
+
+/** Colorize text in "hg annotate" (aka "hg blame") format,
+    where each line is prefixed with a revision number and a ":". */
+void HighlightAnnotatedFile (NSMutableAttributedString* text, 
+                             int curRevNo, int maxRevNo,
+                             NSArray *revToolTips);

File Source/SourceHighlighting.m

 
 #import "SourceHighlighting.h"
 
+static NSDictionary *sAddedStyle, *sDeletedStyle, *sSectionStyle;
 
+static void initStyles() {
+    // Fun fact: These styles match the color scheme used for diffs by bitbucket.org.
+    if (!sAddedStyle)
+        sAddedStyle = $dict({NSBackgroundColorAttributeName, 
+            [NSColor colorWithCalibratedRed:0.87f green:1.0f 
+                                       blue:0.86f alpha:1.0f]} );
+    if (!sDeletedStyle)
+        sDeletedStyle = $dict({NSBackgroundColorAttributeName, 
+            [NSColor colorWithCalibratedRed:1.0f green:0.86f 
+                                       blue:0.87f alpha:1.0f]} );
+    if (!sSectionStyle)
+        sSectionStyle = $dict({NSBackgroundColorAttributeName, 
+            [NSColor colorWithDeviceRed:0.87f green:0.91f 
+                                   blue:0.93f alpha:1.0f]} );
+}
+
+
+/** Applies a default source-code text style to the string. */
 NSMutableAttributedString* AttributedStringForSourceCode (NSString *code) {
     if (!code) return nil;
-    NSFont *font = [NSFont fontWithName: @"Monaco" size: 10.0f];
+    NSString *fontName = [[NSUserDefaults standardUserDefaults] objectForKey: @"CodeFont"];
+    if (!fontName)
+        fontName = @"Monaco";
+    float fontSize = [[NSUserDefaults standardUserDefaults] floatForKey: @"CodeFontSize"];
+    if (!fontSize)
+        fontSize = 10.0f;
+    NSFont *font = [NSFont fontWithName: fontName size: fontSize];
     NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
     paraStyle.lineBreakMode = NSLineBreakByClipping;
     NSDictionary *attrs = $dict({NSFontAttributeName, font},
 }
 
 
+/** Colorize text in unified-diff format:
+    Each line begins with a "+", "-" or "@". */
 void HighlightDiffs (NSMutableAttributedString* text) {
-    static NSDictionary *added, *deleted, *section;
-    if (!added)
-        added = $dict({NSBackgroundColorAttributeName, 
-            [NSColor colorWithCalibratedRed:0.87f green:1.0f 
-                                       blue:0.86f alpha:1.0f]} );
-    if (!deleted)
-        deleted = $dict({NSBackgroundColorAttributeName, 
-            [NSColor colorWithCalibratedRed:1.0f green:0.86f 
-                                       blue:0.87f alpha:1.0f]} );
-    if (!section)
-        section = $dict({NSBackgroundColorAttributeName, 
-            [NSColor colorWithDeviceRed:0.87f green:0.91f 
-                                   blue:0.93f alpha:1.0f]} );
-    
+    initStyles();
     [text addAttribute: NSForegroundColorAttributeName
                  value: [NSColor colorWithCalibratedRed:0.25f green:0.25f blue:0.25f alpha:1.0f]
                  range: NSMakeRange(0,text.length)];
                          forRange: NSMakeRange(start,1)];
         NSDictionary *attrs;
         switch ([text.string characterAtIndex: start]) {
-            case '+':   attrs = added; break;
-            case '-':   attrs = deleted; break;
+            case '+':   attrs = sAddedStyle; break;
+            case '-':   attrs = sDeletedStyle; break;
             case '@':
-                attrs = section; 
+                attrs = sSectionStyle; 
                 if (firstLineStart == 0)
                     firstLineStart = start;
                 break;
     }
     [text deleteCharactersInRange: NSMakeRange(0,firstLineStart)];
 }
+
+
+/** Colorize text in "hg annotate" (aka "hg blame") format,
+    where each line is prefixed with a revision number and a ":". */
+void HighlightAnnotatedFile (NSMutableAttributedString* text,
+                             int curRevNo, int maxRevNo,
+                             NSArray *revToolTips) {
+    CAssert(curRevNo>=0);
+    CAssert(curRevNo<=maxRevNo);
+    initStyles();
+    NSDictionary* revisionStyles[maxRevNo+1];
+    memset(&revisionStyles, 0, sizeof(revisionStyles));
+    revisionStyles[curRevNo] = sAddedStyle;
+    NSString *string = text.string;
+    NSUInteger nextStart;
+    for (NSUInteger start = 0,lineNo = 0; start < text.length; start=nextStart,lineNo++) {
+        // Find the line's character range:
+        NSUInteger end;
+        [string getLineStart: &start end: &nextStart contentsEnd: &end 
+                    forRange: NSMakeRange(start,1)];
+        // Get the revision number of this line:
+        NSRange colon = [string rangeOfString: @":" options: 0 
+                                        range: NSMakeRange(start,string.length-start)];
+        CAssert(colon.length==1);
+        int revNo = [[string substringWithRange: NSMakeRange(start, colon.location-start)] intValue];
+        
+        // Make the rev number uniform width:
+        int n = 4 - (colon.location-start);
+        if (n > 0) {
+            NSString *spaces = [@"    " substringToIndex: n];
+            [text.mutableString insertString: spaces atIndex: start];
+            end += n;
+            nextStart += n;
+        }
+        int lineStart = start + 0;
+        
+        // Colorize:
+        NSDictionary *attrs = revisionStyles[revNo];
+        if (!attrs && revNo < curRevNo) {
+            // Get darker the older this rev is from the current.
+            float white = 1.0f - 0.75f*(curRevNo-revNo)/(float)maxRevNo;
+            attrs = $dict({NSBackgroundColorAttributeName,
+                            [NSColor colorWithCalibratedWhite: white alpha: 1.0f]},
+                          {RevisionNumberAttributeName, $object(revNo)});
+            revisionStyles[revNo] = attrs;
+        }
+        if (attrs) {
+            [text addAttributes: attrs range: NSMakeRange(lineStart,nextStart-lineStart)];
+            NSString *tooltip = [revToolTips objectAtIndex: revNo];
+            [text addAttributes: $dict({NSToolTipAttributeName, tooltip},
+                                       {NSLinkAttributeName, $object(revNo)})
+                          range: NSMakeRange(lineStart,lineStart+4)];
+        }
+    }
+}