1 /* Copyright (c) 2006-2015 Jonas Fonseca <jonas.fonseca@gmail.com>
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 "tig/types.h"
19 #define GRAPH_COMMIT_COLOR (-1)
20 #define GRAPH_COLORS 14
26 size_t size
; /* The width of the graph array. */
27 struct graph_symbol
*symbols
; /* Symbols for this row. */
30 typedef bool (*graph_symbol_iterator_fn
)(void *, const struct graph
*graph
, const struct graph_symbol
*, int color_id
, bool);
35 void (*done
)(struct graph
*graph
);
36 void (*done_rendering
)(struct graph
*graph
);
38 bool (*add_commit
)(struct graph
*graph
, struct graph_canvas
*canvas
,
39 const char *id
, const char *parents
, bool is_boundary
);
40 bool (*add_parent
)(struct graph
*graph
, const char *parent
);
41 bool (*render_parents
)(struct graph
*graph
, struct graph_canvas
*canvas
);
43 void (*foreach_symbol
)(const struct graph
*graph
, const struct graph_canvas
*canvas
, graph_symbol_iterator_fn fn
, void *data
);
45 const char *(*symbol_to_ascii
)(const struct graph_symbol
*symbol
);
46 const char *(*symbol_to_utf8
)(const struct graph_symbol
*symbol
);
47 const chtype
*(*symbol_to_chtype
)(const struct graph_symbol
*symbol
);
50 struct graph
*init_graph(enum graph_display display
);
54 /* vim: set ts=8 sw=8 noexpandtab: */