diff grapher.h @ 145:644bd31e8301

* Include the uncommitted item in general graph layout (in case it is not at the head, when other items will need to avoid it)
author Chris Cannam
date Wed, 01 Dec 2010 17:41:14 +0000
parents 005a54380502
children 70fe12873106
line wrap: on
line diff
--- a/grapher.h	Wed Dec 01 11:54:01 2010 +0000
+++ b/grapher.h	Wed Dec 01 17:41:14 2010 +0000
@@ -20,6 +20,7 @@
 
 #include "changeset.h"
 #include "changesetitem.h"
+#include "uncommitteditem.h"
 #include "changesetscene.h"
 
 #include <QSet>
@@ -33,10 +34,12 @@
 public:
     Grapher(ChangesetScene *scene) { m_scene = scene; }
 
-    void layout(Changesets csets);
+    void layout(Changesets csets, QString uncommittedSproutsFrom = "");
 
     ChangesetItem *getItemFor(Changeset *cs);
 
+    UncommittedItem *getUncommittedItem() { return m_uncommitted; }
+
     class LayoutException : public std::exception {
     public:
 	LayoutException(QString message) throw() : m_message(message) { }
@@ -74,11 +77,17 @@
     typedef QMap<int, QString> RowDateMap;
     RowDateMap m_rowDates;
 
+    QString m_uncommittedParentId;
+    int m_uncommittedParentRow;
+    UncommittedItem *m_uncommitted;
+    bool m_haveAllocatedUncommittedColumn;
+
     void layoutRow(QString id);
     void layoutCol(QString id);
     void allocateBranchHomes(Changesets csets);
     bool rangesConflict(const Range &r1, const Range &r2);
     int findAvailableColumn(int row, int parent, bool preferParentCol);
+    bool isAvailable(int row, int col);
 };
 
 #endif