grafthistory: comment about downloading the pack index
[elinks/elinks-j605.git] / src / document / view.h
blob931c1ca35e75558a77bbc7c594bc2fbb7c2660a3
1 #ifndef EL__DOCUMENT_VIEW_H
2 #define EL__DOCUMENT_VIEW_H
4 #include "terminal/draw.h"
5 #include "util/lists.h"
6 #include "util/box.h"
9 struct document;
10 struct view_state;
12 struct link_bg {
13 int x, y;
14 struct screen_char c;
17 struct document_view {
18 LIST_HEAD(struct document_view);
20 unsigned char *name;
21 unsigned char **search_word;
23 struct session *session;
24 struct document *document;
25 struct view_state *vs;
27 /* The elements of this array correspond to the points of the active
28 * link. Each element stores the colour and attributes
29 * that the corresponding point had before the link was selected.
30 * The last element is an exception: it is the template character,
31 * which holds the colour and attributes that the active link was
32 * given upon being selected. */
33 /* XXX: The above is guesswork; please confirm or correct. -- Miciah */
34 struct link_bg *link_bg;
36 int link_bg_n; /* number of elements in link_bg,
37 not including the template */
38 struct box box; /* pos and size of window */
39 int last_x, last_y; /* last pos of window */
40 int depth;
41 int used;
44 #define get_current_link(doc_view) \
45 (((doc_view) \
46 && (doc_view)->vs->current_link >= 0 \
47 && (doc_view)->vs->current_link < (doc_view)->document->nlinks) \
48 ? &(doc_view)->document->links[(doc_view)->vs->current_link] : NULL)
50 #endif