Merge pull request #457 from vivien/text-variable
[tig.git] / include / tig / main.h
blob6903b754d2d26ac734b131729ce792ec50a5d86c
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.
14 #ifndef TIG_MAIN_H
15 #define TIG_MAIN_H
17 #include "tig/view.h"
18 #include "tig/graph.h"
19 #include "tig/util.h"
21 struct commit {
22 char id[SIZEOF_REV]; /* SHA1 ID. */
23 const struct ident *author; /* Author of the commit. */
24 struct time time; /* Date from the author ident. */
25 struct graph_canvas graph; /* Ancestry chain graphics. */
26 char title[1]; /* First line of the commit message. */
29 struct main_state {
30 struct graph *graph;
31 struct commit current;
32 char **reflog;
33 size_t reflogs;
34 int reflog_width;
35 char reflogmsg[SIZEOF_STR / 2];
36 enum line_type goto_line_type;
37 bool in_header;
38 bool with_graph;
39 bool first_parent;
40 bool add_changes_staged;
41 bool add_changes_unstaged;
44 bool main_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data);
45 bool main_read(struct view *view, struct buffer *buf);
46 enum request main_request(struct view *view, enum request request, struct line *line);
47 void main_select(struct view *view, struct line *line);
48 void main_done(struct view *view);
49 bool main_status_exists(struct view *view, enum line_type type);
51 extern struct view main_view;
53 static inline void
54 open_main_view(struct view *prev, enum open_flags flags)
56 open_view(prev, &main_view, flags);
59 #endif
60 /* vim: set ts=8 sw=8 noexpandtab: */