Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 51 lines (40 sloc) 0.708 kB
a294d91 @pieter Grapher: Add colors to lane
authored
1 //
2 // PBGitLane.h
3 // GitX
4 //
5 // Created by Pieter de Bie on 27-08-08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
7 //
8 #import <Cocoa/Cocoa.h>
d2eafc2 @pieter Include libgit2 as submodule and use it to store sha's
authored
9 #include "git/oid.h"
a294d91 @pieter Grapher: Add colors to lane
authored
10
cef35ac @pieter GitGrapher: Rewrite looping code to C++
authored
11 class PBGitLane {
12 static int s_colorIndex;
13
d2eafc2 @pieter Include libgit2 as submodule and use it to store sha's
authored
14 git_oid d_sha;
cef35ac @pieter GitGrapher: Rewrite looping code to C++
authored
15 int d_index;
a294d91 @pieter Grapher: Add colors to lane
authored
16
cef35ac @pieter GitGrapher: Rewrite looping code to C++
authored
17 public:
a66ae7c @pieter Grapher: Always reset colors at start of graphing
authored
18
8372aee @pieter PBGitCommit: Use git_oids for parent shas
authored
19 PBGitLane(git_oid *sha)
d2eafc2 @pieter Include libgit2 as submodule and use it to store sha's
authored
20 {
21 d_index = s_colorIndex++;
8372aee @pieter PBGitCommit: Use git_oids for parent shas
authored
22 d_sha = *sha;
d2eafc2 @pieter Include libgit2 as submodule and use it to store sha's
authored
23 }
24
cef35ac @pieter GitGrapher: Rewrite looping code to C++
authored
25 PBGitLane(NSString *sha)
26 {
d2eafc2 @pieter Include libgit2 as submodule and use it to store sha's
authored
27 git_oid_mkstr(&d_sha, [sha UTF8String]);
cef35ac @pieter GitGrapher: Rewrite looping code to C++
authored
28 d_index = s_colorIndex++;
29 }
30
31 PBGitLane()
32 {
33 d_index = s_colorIndex++;
34 }
35
988b105 @d0k Fix compilation with GCC 4.2
d0k authored
36 bool isCommit(git_oid *sha) const
bda9060 @pieter PBGitLane: remove functions with NSString arguments
authored
37 {
38 return !git_oid_cmp(&d_sha, sha);
39 }
d2eafc2 @pieter Include libgit2 as submodule and use it to store sha's
authored
40
41 void setSha(git_oid sha);
42
43 git_oid const *sha() const
cef35ac @pieter GitGrapher: Rewrite looping code to C++
authored
44 {
d2eafc2 @pieter Include libgit2 as submodule and use it to store sha's
authored
45 return &d_sha;
cef35ac @pieter GitGrapher: Rewrite looping code to C++
authored
46 }
47
48 int index() const;
a294d91 @pieter Grapher: Add colors to lane
authored
49
cef35ac @pieter GitGrapher: Rewrite looping code to C++
authored
50 static void resetColors();
bda9060 @pieter PBGitLane: remove functions with NSString arguments
authored
51 };
Something went wrong with that request. Please try again.