1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseSVN
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 #include "LogCacheGlobals.h"
\r
23 using namespace LogCache;
\r
25 class CVisibleGraphNode;
\r
27 // Scintilla uses defines :/
\r
29 #ifdef STYLE_DEFAULT
\r
30 #undef STYLE_DEFAULT
\r
34 * Base interface to all layout info access interfaces.
\r
37 class ILayoutItemList
\r
41 /// make sub-classes deletable through the base interface
\r
43 virtual ~ILayoutItemList() {};
\r
45 /// standard data access
\r
47 virtual index_t GetCount() const = 0;
\r
49 virtual CString GetToolTip (index_t index) const = 0;
\r
51 /// lookup (return NO_INDEX if not found)
\r
53 virtual index_t GetFirstVisible (const CRect& viewRect) const = 0;
\r
54 virtual index_t GetNextVisible (index_t prev, const CRect& viewRect) const = 0;
\r
55 virtual index_t GetAt (const CPoint& point, long delta) const = 0;
\r
58 class ILayoutConnectionList : public ILayoutItemList
\r
62 /// Connections are Bezier lines.
\r
66 /// stype (usually pen) index.
\r
67 /// To be interpreted by drawing code. Starts with 0.
\r
71 /// number of Bezier points valid in @ref points.
\r
73 index_t numberOfPoints;
\r
75 /// Bezier points to draw the curve for.
\r
77 const CPoint* points;
\r
80 /// standard data access
\r
82 virtual SConnection GetConnection (index_t index) const = 0;
\r
85 class ILayoutNodeList : public ILayoutItemList
\r
89 /// Nodes occupy a rectangular area.
\r
106 /// Area occupied by this node.
\r
110 /// tree node represented by this graphical node.
\r
111 /// Can be NULL, if there is none or multiple such nodes
\r
113 const CVisibleGraphNode* node;
\r
115 /// style (shape, border, filling) index.
\r
116 /// To be interpreted by drawing code. Starts with 0.
\r
120 /// extended style info (usually presense of sub-structures).
\r
121 /// To be interpreted by drawing code. Starts with 0.
\r
127 /// standard data access
\r
129 virtual SNode GetNode (index_t index) const = 0;
\r
132 class ILayoutTextList : public ILayoutItemList
\r
136 /// Texts occupy a rectangular area.
\r
140 /// Values allowed for @a style
\r
148 /// style (shape, font, size) index.
\r
149 /// To be interpreted by drawing code. Starts with 0.
\r
153 /// style info (bold, etc.).
\r
154 /// To be interpreted by drawing code. Starts with 0.
\r
162 /// Area occupied by this text.
\r
167 /// standard data access
\r
169 virtual SText GetText (index_t index) const = 0;
\r
172 /** The 'graph' layout contains of three collections:
\r
173 * One for the nodes, one for the connecting lines and
\r
174 * one for the texts to be shown.
\r
176 * The whole graph uses a discrete coordinate system
\r
177 * confined in a rect.
\r
180 class IRevisionGraphLayout
\r
184 /// make sub-classes deletable through the base interface
\r
186 virtual ~IRevisionGraphLayout() {};
\r
188 /// total graph size (logical units)
\r
190 virtual CRect GetRect() const = 0;
\r
192 /// access to the sub-structures.
\r
193 /// The caller is required to delete the return objects.
\r
195 virtual const ILayoutNodeList* GetNodes() const = 0;
\r
196 virtual const ILayoutConnectionList* GetConnections() const = 0;
\r
197 virtual const ILayoutTextList* GetTexts() const = 0;
\r