summaryrefslogtreecommitdiff
path: root/fitz/fitz.h
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-23 12:59:24 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-23 13:18:42 +0000
commit73e548cdd564c6c2099ceafaa4019a7dbb188a30 (patch)
treee2d0b498abf0f0057d7d565d6b465226e6491d60 /fitz/fitz.h
parentcc4dd0f8358d3de1594cc530b8f2691bccf194f0 (diff)
downloadmupdf-73e548cdd564c6c2099ceafaa4019a7dbb188a30.tar.xz
Generalise pdf_links to be fz_links.
Move to a non-pdf specific type for links. PDF specific parsing is done in pdf_annots.c as before, but the essential type (and handling functions for that type) are in a new file fitz/base_link.c. The new type is more expressive than before; specifically all the possible PDF modes are expressable in it. Hopefully this should allow XPS links to be represented too.
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r--fitz/fitz.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 589f22ee..9ac43d48 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -1233,4 +1233,64 @@ enum
FZ_BLEND_KNOCKOUT = 32
};
+/* Links */
+
+typedef struct fz_link_s fz_link;
+
+typedef union fz_link_dest_s fz_link_dest;
+
+typedef enum fz_link_kind_e
+{
+ FZ_LINK_GOTO = 0,
+ FZ_LINK_URI,
+ FZ_LINK_LAUNCH,
+ FZ_LINK_NAMED,
+ FZ_LINK_GOTOR
+} fz_link_kind;
+
+enum {
+ fz_link_flag_l_valid = 1, /* lt.x is valid */
+ fz_link_flag_t_valid = 2, /* lt.y is valid */
+ fz_link_flag_r_valid = 4, /* rb.x is valid */
+ fz_link_flag_b_valid = 8, /* rb.y is valid */
+ fz_link_flag_fit_h = 16, /* Fit horizontally */
+ fz_link_flag_fit_v = 32, /* Fit vertically */
+ fz_link_flag_r_is_zoom = 64 /* rb.x is actually a zoom figure */
+};
+
+union fz_link_dest_s
+{
+ struct {
+ int page;
+ int flags;
+ fz_point lt;
+ fz_point rb;
+ char *file_spec;
+ int new_window;
+ } gotor;
+ struct {
+ char *uri;
+ int is_map;
+ } uri;
+ struct {
+ char *file_spec;
+ int new_window;
+ } launch;
+ struct {
+ char *named;
+ } named;
+};
+
+
+struct fz_link_s
+{
+ fz_link_kind kind;
+ fz_rect rect;
+ fz_link_dest dest;
+ fz_link *next;
+};
+
+fz_link *fz_new_link(fz_context *ctx, fz_link_kind, fz_rect bbox, fz_link_dest dest);
+void fz_free_link(fz_context *ctx, fz_link *);
+
#endif