1 
2 #ifndef EL__VIEWER_TEXT_VS_H
3 #define EL__VIEWER_TEXT_VS_H
4 
5 #include "util/lists.h"
6 
7 /* Crossdeps are evil. */
8 struct document_view;
9 struct form_state;
10 struct session;
11 struct uri;
12 
13 struct view_state {
14 	struct document_view *doc_view;
15 	struct uri *uri;
16 
17 	struct list_head forms; /* -> struct form_view */
18 	struct form_state *form_info;
19 	int form_info_len;
20 
21 	int x, y;
22 	int current_link;
23 
24 	int plain;
25 	unsigned int wrap:1;
26 	unsigned int did_fragment:1;
27 
28 #ifdef CONFIG_ECMASCRIPT
29 	/* If set, we reset the interpreter state the next time we are going to
30 	 * render document attached to this view state. This means a real
31 	 * document (not just struct document_view, which randomly appears and
32 	 * disappears during gradual rendering) is getting replaced. So set this
33 	 * always when you replace the view_state URI, but also when reloading
34 	 * the document. You also cannot reset the document right away because
35 	 * it might take some time before the first rerendering is done and
36 	 * until then the old document is still hanging there. */
37 	unsigned int ecmascript_fragile:1;
38 	struct ecmascript_interpreter *ecmascript;
39 #endif
40 };
41 
42 void init_vs(struct view_state *, struct uri *uri, int);
43 void destroy_vs(struct view_state *, int blast_ecmascript);
44 
45 void copy_vs(struct view_state *, struct view_state *);
46 void check_vs(struct document_view *);
47 
48 void next_frame(struct session *, int);
49 
50 #endif
51