mupdf
Loading...
Searching...
No Matches
link.h File Reference
Include dependency graph for link.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

Macros

#define fz_new_derived_link(CTX, TYPE, RECT, URI)

Typedefs

typedef struct fz_link fz_link
typedef void fz_link_set_rect_fn(fz_context *ctx, fz_link *link, fz_rect rect)
typedef void fz_link_set_uri_fn(fz_context *ctx, fz_link *link, const char *uri)
typedef void fz_link_drop_link_fn(fz_context *ctx, fz_link *link)

Enumerations

enum  fz_link_dest_type {
  FZ_LINK_DEST_FIT , FZ_LINK_DEST_FIT_B , FZ_LINK_DEST_FIT_H , FZ_LINK_DEST_FIT_BH ,
  FZ_LINK_DEST_FIT_V , FZ_LINK_DEST_FIT_BV , FZ_LINK_DEST_FIT_R , FZ_LINK_DEST_XYZ
}

Functions

fz_link_dest fz_make_link_dest_none (void)
fz_link_dest fz_make_link_dest_xyz (int chapter, int page, float x, float y, float z)
fz_linkfz_new_link_of_size (fz_context *ctx, int size, fz_rect rect, const char *uri)
fz_linkfz_keep_link (fz_context *ctx, fz_link *link)
void fz_drop_link (fz_context *ctx, fz_link *link)
int fz_is_external_link (fz_context *ctx, const char *uri)
void fz_set_link_rect (fz_context *ctx, fz_link *link, fz_rect rect)
void fz_set_link_uri (fz_context *ctx, fz_link *link, const char *uri)

Macro Definition Documentation

◆ fz_new_derived_link

#define fz_new_derived_link ( CTX,
TYPE,
RECT,
URI )
Value:
((TYPE *)Memento_label(fz_new_link_of_size(CTX,sizeof(TYPE),RECT,URI),#TYPE))
#define Memento_label(A, B)
Definition memento.h:388

Typedef Documentation

◆ fz_link

typedef struct fz_link fz_link

fz_link is a list of interactive links on a page.

There is no relation between the order of the links in the list and the order they appear on the page. The list of links for a given page can be obtained from fz_load_links.

A link is reference counted. Dropping a reference to a link is done by calling fz_drop_link.

rect: The hot zone. The area that can be clicked in untransformed coordinates.

uri: Link destinations come in two forms: internal and external. Internal links refer to other pages in the same document. External links are URLs to other documents.

next: A pointer to the next link on the same page.

◆ fz_link_drop_link_fn

typedef void fz_link_drop_link_fn(fz_context *ctx, fz_link *link)

◆ fz_link_set_rect_fn

typedef void fz_link_set_rect_fn(fz_context *ctx, fz_link *link, fz_rect rect)

◆ fz_link_set_uri_fn

typedef void fz_link_set_uri_fn(fz_context *ctx, fz_link *link, const char *uri)

Enumeration Type Documentation

◆ fz_link_dest_type

Enumerator
FZ_LINK_DEST_FIT 
FZ_LINK_DEST_FIT_B 
FZ_LINK_DEST_FIT_H 
FZ_LINK_DEST_FIT_BH 
FZ_LINK_DEST_FIT_V 
FZ_LINK_DEST_FIT_BV 
FZ_LINK_DEST_FIT_R 
FZ_LINK_DEST_XYZ 

Function Documentation

◆ fz_drop_link()

void fz_drop_link ( fz_context * ctx,
fz_link * link )

Decrement the reference count for a link. When the reference count reaches zero, the link is destroyed.

When a link is freed, the reference for any linked link (next) is dropped too, thus an entire linked list of fz_link's can be freed by just dropping the head.

◆ fz_is_external_link()

int fz_is_external_link ( fz_context * ctx,
const char * uri )

Query whether a link is external to a document (determined by uri containing a ':', intended to match with '://' which separates the scheme from the scheme specific parts in URIs).

◆ fz_keep_link()

fz_link * fz_keep_link ( fz_context * ctx,
fz_link * link )

Increment the reference count for a link. The same pointer is returned.

Never throws exceptions.

◆ fz_make_link_dest_none()

fz_link_dest fz_make_link_dest_none ( void )

◆ fz_make_link_dest_xyz()

fz_link_dest fz_make_link_dest_xyz ( int chapter,
int page,
float x,
float y,
float z )

◆ fz_new_link_of_size()

fz_link * fz_new_link_of_size ( fz_context * ctx,
int size,
fz_rect rect,
const char * uri )

Create a new link record.

next is set to NULL with the expectation that the caller will handle the linked list setup. Internal function.

Different document types will be implemented by deriving from fz_link. This macro allocates such derived structures, and initialises the base sections.

◆ fz_set_link_rect()

void fz_set_link_rect ( fz_context * ctx,
fz_link * link,
fz_rect rect )

◆ fz_set_link_uri()

void fz_set_link_uri ( fz_context * ctx,
fz_link * link,
const char * uri )