![]() |
![]() |
![]() |
libatrildocument Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define EV_BACKEND_IMPLEMENT_INTERFACE (TYPE_IFACE, iface_init) #define EV_BACKEND_REGISTER (BackendName, backend_name) #define EV_BACKEND_REGISTER_WITH_CODE (BackendName, backend_name, CODE) #define EV_DEFINE_BOXED_TYPE (TypeName, type_name, copy_func, free_func) #define EV_DOCUMENT_ERROR #define EV_DOC_MUTEX_LOCK #define EV_DOC_MUTEX_UNLOCK struct EvDocument; struct EvDocumentBackendInfo; struct EvDocumentClass; enum EvDocumentError; struct EvMapping; EvPoint; struct EvRectangle; EvSourceLink; gboolean ev_document_check_dimensions (EvDocument *document
); void ev_document_doc_mutex_lock (void
); gboolean ev_document_doc_mutex_trylock (void
); void ev_document_doc_mutex_unlock (void
); GQuark ev_document_error_quark (void
); void ev_document_fc_mutex_lock (void
); gboolean ev_document_fc_mutex_trylock (void
); void ev_document_fc_mutex_unlock (void
); gboolean ev_document_find_page_by_label (EvDocument *document
,const gchar *page_label
,gint *page_index
); gboolean ev_document_get_backend_info (EvDocument *document
,EvDocumentBackendInfo *info
); GMutex * ev_document_get_doc_mutex (void
); GMutex * ev_document_get_fc_mutex (void
); EvDocumentInfo * ev_document_get_info (EvDocument *document
); gint ev_document_get_max_label_len (EvDocument *document
); void ev_document_get_max_page_size (EvDocument *document
,gdouble *width
,gdouble *height
); void ev_document_get_min_page_size (EvDocument *document
,gdouble *width
,gdouble *height
); gint ev_document_get_n_pages (EvDocument *document
); EvPage * ev_document_get_page (EvDocument *document
,gint index
); gchar * ev_document_get_page_label (EvDocument *document
,gint page_index
); void ev_document_get_page_size (EvDocument *document
,gint page_index
,double *width
,double *height
); const gchar * ev_document_get_title (EvDocument *document
); const gchar * ev_document_get_uri (EvDocument *document
); gboolean ev_document_has_synctex (EvDocument *document
); gboolean ev_document_has_text_page_labels (EvDocument *document
); gboolean ev_document_is_page_size_uniform (EvDocument *document
); gboolean ev_document_load (EvDocument *document
,const char *uri
,GError **error
); cairo_surface_t * ev_document_render (EvDocument *document
,EvRenderContext *rc
); gboolean ev_document_save (EvDocument *document
,const char *uri
,GError **error
); EvSourceLink * ev_document_synctex_backward_search (EvDocument *document
,gint page_index
,gfloat x
,gfloat y
); EvMapping * ev_document_synctex_forward_search (EvDocument *document
,EvSourceLink *source_link
); gint ev_rect_cmp (EvRectangle *a
,EvRectangle *b
); EvRectangle * ev_rectangle_copy (EvRectangle *ev_rect
); void ev_rectangle_free (EvRectangle *ev_rect
); EvRectangle * ev_rectangle_new (void
);
#define EV_BACKEND_REGISTER_WITH_CODE(BackendName, backend_name, CODE)
struct EvDocumentBackendInfo { const gchar *name; const gchar *version; };
struct EvDocumentClass { GObjectClass base_class; /* Virtual Methods */ gboolean (* load) (EvDocument *document, const char *uri, GError **error); gboolean (* save) (EvDocument *document, const char *uri, GError **error); gint (* get_n_pages) (EvDocument *document); EvPage * (* get_page) (EvDocument *document, gint index); void (* get_page_size) (EvDocument *document, EvPage *page, double *width, double *height); gchar * (* get_page_label) (EvDocument *document, EvPage *page); cairo_surface_t * (* render) (EvDocument *document, EvRenderContext *rc); EvDocumentInfo * (* get_info) (EvDocument *document); gboolean (* get_backend_info)(EvDocument *document, EvDocumentBackendInfo *info); gboolean (* support_synctex) (EvDocument *document); };
typedef enum { EV_DOCUMENT_ERROR_INVALID, EV_DOCUMENT_ERROR_ENCRYPTED } EvDocumentError;
gboolean ev_document_find_page_by_label (EvDocument *document
,const gchar *page_label
,gint *page_index
);
gboolean ev_document_get_backend_info (EvDocument *document
,EvDocumentBackendInfo *info
);
void ev_document_get_max_page_size (EvDocument *document
,gdouble *width
,gdouble *height
);
void ev_document_get_min_page_size (EvDocument *document
,gdouble *width
,gdouble *height
);
gchar * ev_document_get_page_label (EvDocument *document
,gint page_index
);
void ev_document_get_page_size (EvDocument *document
,gint page_index
,double *width
,double *height
);
gboolean ev_document_has_text_page_labels (EvDocument *document
);
gboolean ev_document_is_page_size_uniform (EvDocument *document
);
gboolean ev_document_load (EvDocument *document
,const char *uri
,GError **error
);
Loads document
from uri
.
On failure, FALSE
is returned and error
is filled in.
If the document is encrypted, EV_DEFINE_ERROR_ENCRYPTED is returned.
If the backend cannot load the specific document, EV_DOCUMENT_ERROR_INVALID
is returned. Other errors are possible too, depending on the backend
used to load the document and the URI, e.g. GIOError, GFileError, and
GConvertError.
|
a EvDocument |
|
the document's URI |
|
a GError location to store an error, or NULL
|
Returns : |
TRUE on success, or FALSE on failure. |
cairo_surface_t * ev_document_render (EvDocument *document
,EvRenderContext *rc
);
gboolean ev_document_save (EvDocument *document
,const char *uri
,GError **error
);
Saves document
to uri
.
EvSourceLink * ev_document_synctex_backward_search (EvDocument *document
,gint page_index
,gfloat x
,gfloat y
);
Peforms a Synctex backward search to obtain the TeX input file, line and
(possibly) column corresponding to the position (x
,y
) (in 72dpi
coordinates) in the page
of document
.
|
the target page |
Returns : |
A pointer to the EvSourceLink structure that holds the result. NULL if synctex
is not enabled for the document or no result is found.
The EvSourceLink pointer should be freed with g_free after it is used. |
EvMapping * ev_document_synctex_forward_search (EvDocument *document
,EvSourceLink *source_link
);
Peforms a Synctex forward search to obtain the area in the document
corresponding to the position line
and column
number in the source Tex file
Returns : |
An EvMapping with the page number and area corresponfing to the given line in the source file. It must be free with g_free when done |