[wip] draw_images(): Clean up pixel/character and box handling
[elinks/images.git] / src / viewer / text / vs.h
blob1de9e5839af0bd1297612ab477839ff9e6f77577
2 #ifndef EL__VIEWER_TEXT_VS_H
3 #define EL__VIEWER_TEXT_VS_H
5 #include "util/lists.h"
7 /* Crossdeps are evil. */
8 struct document_view;
9 struct form_state;
10 struct session;
11 struct uri;
13 struct view_state {
14 struct document_view *doc_view;
15 struct uri *uri;
17 LIST_OF(struct form_view) forms;
18 struct form_state *form_info;
19 int form_info_len;
21 /** Horizontal scrolling. If @c x is e.g. 2, then the
22 * leftmost two columns of the document have been scrolled out
23 * of sight. @c x should never be negative. */
24 int x;
26 /** Vertical scrolling. If @c y is e.g. 1, then the first
27 * line of the document has been scrolled out of sight. @c y
28 * should never be negative. */
29 int y;
31 /** The index of the focused link in the document.links array,
32 * or -1 of none. */
33 int current_link;
34 int old_current_link;
36 int plain;
37 unsigned int wrap:1;
38 unsigned int did_fragment:1;
40 #ifdef CONFIG_ECMASCRIPT
41 /** If set, we reset the interpreter state the next time we are going
42 * to render document attached to this view state. This means a real
43 * document (not just struct document_view, which randomly appears and
44 * disappears during gradual rendering) is getting replaced. So set this
45 * always when you replace the view_state URI, but also when reloading
46 * the document. You also cannot reset the document right away because
47 * it might take some time before the first rerendering is done and
48 * until then the old document is still hanging there. */
49 unsigned int ecmascript_fragile:1;
50 struct ecmascript_interpreter *ecmascript;
51 #endif
54 void init_vs(struct view_state *, struct uri *uri, int);
55 void destroy_vs(struct view_state *, int blast_ecmascript);
57 void copy_vs(struct view_state *, struct view_state *);
58 void check_vs(struct document_view *);
60 void next_frame(struct session *, int);
62 #endif