1. Jens Alfke
  2. Murky

Source

Murky / Source / SourceHighlighting.h

//
//  SourceHighlighting.h
//  Murky
//
//  Created by Jens Alfke on 9/2/09.
//  Copyright 2009 Jens Alfke. All rights reserved.
//

#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);