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 #include "compat/hashtab.h"
19 #define GRAPH_COLORS 7
24 unsigned int commit
:1;
25 unsigned int boundary
:1;
26 unsigned int initial
:1;
29 unsigned int continued_down
:1;
30 unsigned int continued_up
:1;
31 unsigned int continued_right
:1;
32 unsigned int continued_left
:1;
33 unsigned int continued_up_left
:1;
35 unsigned int parent_down
:1;
36 unsigned int parent_right
:1;
38 unsigned int below_commit
:1;
39 unsigned int flanked
:1;
40 unsigned int next_right
:1;
41 unsigned int matches_commit
:1;
43 unsigned int shift_left
:1;
44 unsigned int continue_shift
:1;
45 unsigned int below_shift
:1;
47 unsigned int new_column
:1;
52 size_t size
; /* The width of the graph array. */
53 struct graph_symbol
*symbols
; /* Symbols for this row. */
57 struct graph_symbol symbol
;
58 char id
[SIZEOF_REV
]; /* Parent SHA1 ID. */
63 struct graph_column
*columns
;
68 size_t count
[GRAPH_COLORS
];
73 struct graph_row parents
;
74 struct graph_row prev_row
;
75 struct graph_row next_row
;
80 struct graph_canvas
*canvas
;
86 void done_graph(struct graph
*graph
);
88 bool graph_render_parents(struct graph
*graph
);
89 bool graph_add_commit(struct graph
*graph
, struct graph_canvas
*canvas
,
90 const char *id
, const char *parents
, bool is_boundary
);
91 struct graph_column
*graph_add_parent(struct graph
*graph
, const char *parent
);
93 const char *graph_symbol_to_ascii(struct graph_symbol
*symbol
);
94 const char *graph_symbol_to_utf8(struct graph_symbol
*symbol
);
95 const chtype
*graph_symbol_to_chtype(struct graph_symbol
*symbol
);
99 /* vim: set ts=8 sw=8 noexpandtab: */