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