Murky / Source / RevisionGraphColumn.h

//  RevisionGraphColumn.h
//  Murky
//  Copyright 2008-2009 Jens Alfke. All rights reserved.

#import <Cocoa/Cocoa.h>
@class HgRevision;

/** Helper object for drawing the revision graph, one table-row at a time. */
@interface RevisionGraphColumn : NSObject
    NSArray *_revisions;
    NSUInteger _nRevisions;
    __strong UInt8 *_array;
    __strong UInt64 *_used;
    NSInteger _maxWidth;
    NSMutableSet *_laidOut;
    NSMutableArray *_parent2Queue;

- (id) initWithRevisions: (NSArray*)revisions;

@property (readonly) NSArray *revisions;

- (void) drawRevisionNumber: (NSUInteger)revNo inRect: (NSRect)bounds flipped: (BOOL)flipped;
- (void) drawRevision: (HgRevision*)rev inRect: (NSRect)bounds flipped: (BOOL)flipped;


/** An image cell for the repo controller's table view, which draws the current row's
    segment of the revision graph. */
@interface RevisionGraphCell : NSImageCell
    RevisionGraphColumn *_graph;
    NSInteger _revisionNumber;
    BOOL _flipped;

@property (copy) NSArray *revisions;
@property (readwrite) NSInteger revisionNumber;
@property (readwrite) BOOL flipped;