Back to index

tetex-bin  3.0
hypertex.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2002-2004 the xdvik development team
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a copy
00005  * of this software and associated documentation files (the "Software"), to
00006  * deal in the Software without restriction, including without limitation the
00007  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
00008  * sell copies of the Software, and to permit persons to whom the Software is
00009  * furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included in
00012  * all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00017  * PAUL VOJTA OR ANY OTHER AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM,
00018  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00020  * OTHER DEALINGS IN THE SOFTWARE.
00021  */
00022 
00023 #ifndef HYPERTEX_H_
00024 #define HTEXTEX_H_
00025 
00026 /* fallbacks if parsing user-specified colors fails */
00027 #define LINK_COLOR_FALLBACK "BLUE2"
00028 #define VISITED_LINK_COLOR_FALLBACK "Purple4"
00029 
00030 extern const char *is_local_file(const char *filename);
00031 extern void launch_program(const char *filename);
00032 extern void launch_xdvi(const char *filename, const char *anchor_name);
00033 extern Boolean htex_handleref(int x, int y, Boolean newwindow);
00034 extern void htex_reinit(void);
00035 extern void htex_resize_page(void);
00036 extern void htex_draw_anchormarkers(void);
00037 extern void htex_record_position(int, int, int, int);
00038 
00039 extern void htex_initpage(Boolean dvi_file_changed, Boolean size_changed, int pageno);
00040 
00041 typedef enum { HTEX_ANCHOR_NUM, HTEX_ANCHOR_STRING } htexPrescanTypeT;
00042 
00043 struct htex_prescan_data {
00044     int pageno;
00045     int anchor_num;
00046     htexPrescanTypeT scan_type;
00047 };
00048     
00049 typedef enum { HTEX_TEXT, HTEX_IMG } htexObjectT;
00050 
00051 /* prescanning stuff */
00052 extern Boolean htex_prescan_special(const char *str, int str_len, struct htex_prescan_data *data);
00053 extern int htex_prescan_get_depth(void);
00054 extern size_t htex_prescan_get_mismatched_anchor_num(size_t depth);
00055 extern void htex_prescan_save(void);
00056 extern void htex_prescan_reset_firstpass(void);
00057 extern void htex_prescan_restore(int pageno);
00058 extern void htex_prescan_initpage(void);
00059 extern void htex_prescan_carry_over(int old_page, int new_page);
00060 extern void htex_set_anchorsize(int x, int y, int w, int h);
00061 extern void htex_set_objecttype(htexObjectT type);
00062 
00063 extern void htex_reset_page(int pageno);
00064 extern void htex_displayanchor(int, int);
00065 extern void htex_set_anchormarker(int y);
00066 extern void htex_back(void);
00067 extern void htex_forward(void);
00068 
00069 extern Boolean htex_scan_anchor(const char *special, size_t len);
00070 
00071 #endif /* HTEXTEX_H_ */