Debian Codegraph @

texk/xdvik/hypertex.h

raw
1 /*
2 * Copyright (c) 2002-2004 the xdvik development team
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * PAUL VOJTA OR ANY OTHER AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23 #ifndef HYPERTEX_H_
24 #define HYPERTEX_H_
25
26 /* fallbacks if parsing user-specified colors fails */
27 #define LINK_COLOR_FALLBACK "BLUE2"
28 #define VISITED_LINK_COLOR_FALLBACK "Purple4"
29
30 extern const char *is_local_file(const char *filename);
31 extern void launch_program(const char *filename);
32 extern void launch_xdvi(const char *filename, const char *anchor_name);
33 extern Boolean htex_handleref(int x, int y, Boolean newwindow);
34 extern void htex_reinit(void);
35 extern void htex_resize_page(void);
36 extern void htex_draw_anchormarkers(void);
37 extern void htex_record_position(int, int, int, int);
38
39 extern void htex_initpage(Boolean dvi_file_changed, Boolean size_changed, int pageno);
40
41 typedef enum { HTEX_ANCHOR_NUM, HTEX_ANCHOR_STRING } htexPrescanTypeT;
42
43 struct htex_prescan_data {
44 int pageno;
45 int anchor_num;
46 htexPrescanTypeT scan_type;
47 };
48
49 typedef enum { HTEX_TEXT, HTEX_IMG } htexObjectT;
50
51 /* prescanning stuff */
52 extern Boolean htex_prescan_special(const char *str, int str_len, struct htex_prescan_data *data);
53 extern int htex_prescan_get_depth(void);
54 extern size_t htex_prescan_get_mismatched_anchor_num(size_t depth);
55 extern void htex_prescan_save(void);
56 extern void htex_prescan_reset_firstpass(void);
57 extern void htex_prescan_restore(int pageno);
58 extern void htex_prescan_initpage(void);
59 extern void htex_prescan_carry_over(int old_page, int new_page);
60 extern void htex_set_anchorsize(int x, int y, int w, int h);
61 extern void htex_set_objecttype(htexObjectT type);
62
63 extern void htex_reset_page(int pageno);
64 extern void htex_displayanchor(int, int);
65 extern void htex_set_anchormarker(int y);
66 extern void htex_back(void);
67 extern void htex_forward(void);
68
69 extern Boolean htex_scan_anchor(const char *special, size_t len);
70
71 #endif /* HTEXTEX_H_ */