2 Author: Marco Costalba (C) 2005-2007
4 Copyright: See COPYING file that comes with this distribution
17 // At any given time, the Lanes class represents a single revision (row) of the history graph.
18 // The Lanes class contains a vector of the sha1 hashes of the next commit to appear in each lane (column).
19 // The Lanes class also contains a vector used to decide which glyph to draw on the history graph.
21 // For each revision (row) (from recent (top) to ancient past (bottom)), the Lanes class is updated, and the
22 // current revision (row) of glyphs is saved elsewhere (via getLanes()).
24 // The ListView class is responsible for rendering the glyphs.
30 Lanes() {} // init() will setup us later, when data is available
31 bool isEmpty() { return typeVec
.empty(); }
32 void init(const QString
& expectedSha
);
34 bool isFork(const QString
& sha
, bool& isDiscontinuity
);
35 void setBoundary(bool isBoundary
);
36 void setFork(const QString
& sha
);
37 void setMerge(const QStringList
& parents
);
40 void changeActiveLane(const QString
& sha
);
46 void nextParent(const QString
& sha
);
47 void getLanes(QVector
<int> &ln
) { ln
= typeVec
; } // O(1) vector is implicitly shared
50 int findNextSha(const QString
& next
, int pos
);
51 int findType(int type
, int pos
);
52 int add(int type
, const QString
& next
, int pos
);
55 QVector
<int> typeVec
; // Describes which glyphs should be drawn.
56 QVector
<QString
> nextShaVec
; // The sha1 hashes of the next commit to appear in each lane (column).
58 int NODE
, NODE_L
, NODE_R
;