1 /* Copyright (c) 2006-2013 Jonas Fonseca <fonseca@diku.dk>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
17 #define GRAPH_COLORS 7
23 unsigned int commit
:1;
24 unsigned int branch
:1;
26 unsigned int boundary
:1;
27 unsigned int initial
:1;
30 unsigned int vbranch
:1;
31 unsigned int branched
:1;
35 size_t size
; /* The width of the graph array. */
36 struct graph_symbol
*symbols
; /* Symbols for this row. */
40 struct graph_symbol symbol
;
41 char id
[SIZEOF_REV
]; /* Parent SHA1 ID. */
46 struct graph_column
*columns
;
51 struct graph_row parents
;
55 struct graph_canvas
*canvas
;
56 size_t colors
[GRAPH_COLORS
];
61 void done_graph(struct graph
*graph
);
63 bool graph_render_parents(struct graph
*graph
);
64 bool graph_add_commit(struct graph
*graph
, struct graph_canvas
*canvas
,
65 const char *id
, const char *parents
, bool is_boundary
);
66 struct graph_column
*graph_add_parent(struct graph
*graph
, const char *parent
);
68 const char *graph_symbol_to_ascii(struct graph_symbol
*symbol
);
69 const char *graph_symbol_to_utf8(struct graph_symbol
*symbol
);
70 const chtype
*graph_symbol_to_chtype(struct graph_symbol
*symbol
);
74 /* vim: set ts=8 sw=8 noexpandtab: */