X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=libdocument%2Fev-document.h;h=d28289254df20796c7709d9aed0a6e3b42469e22;hb=dd1329596e725e96f991d9d0c1944ff0887f561a;hp=608e90fe961520bb6836d9d9d9b78f095fadf160;hpb=8c149ccd2a3cced2cd0a676ad6f7b8d33fd98404;p=evince.git diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index 608e90fe..d2828925 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id$ */ @@ -49,9 +49,6 @@ typedef struct _EvDocument EvDocument; typedef struct _EvDocumentClass EvDocumentClass; typedef struct _EvDocumentPrivate EvDocumentPrivate; -typedef struct _EvPageCache EvPageCache; -typedef struct _EvPageCacheClass EvPageCacheClass; - #define EV_DOCUMENT_ERROR ev_document_error_quark () #define EV_DOC_MUTEX_LOCK (ev_document_doc_mutex_lock ()) #define EV_DOC_MUTEX_UNLOCK (ev_document_doc_mutex_unlock ()) @@ -68,6 +65,20 @@ typedef struct { } EvPoint; typedef struct _EvRectangle EvRectangle; +typedef struct _EvMapping EvMapping; + +typedef struct _EvDocumentBackendInfo EvDocumentBackendInfo; +struct _EvDocumentBackendInfo +{ + const gchar *name; + const gchar *version; +}; + +typedef struct { + const gchar *filename; + gint line; + gint col; +} EvSourceLink; struct _EvDocument { @@ -98,7 +109,12 @@ struct _EvDocumentClass EvPage *page); cairo_surface_t * (* render) (EvDocument *document, EvRenderContext *rc); + GdkPixbuf * (* get_thumbnail) (EvDocument *document, + EvRenderContext *rc); EvDocumentInfo * (* get_info) (EvDocument *document); + gboolean (* get_backend_info)(EvDocument *document, + EvDocumentBackendInfo *info); + gboolean (* support_synctex) (EvDocument *document); }; GType ev_document_get_type (void) G_GNUC_CONST; @@ -117,6 +133,8 @@ void ev_document_fc_mutex_unlock (void); gboolean ev_document_fc_mutex_trylock (void); EvDocumentInfo *ev_document_get_info (EvDocument *document); +gboolean ev_document_get_backend_info (EvDocument *document, + EvDocumentBackendInfo *info); gboolean ev_document_load (EvDocument *document, const char *uri, GError **error); @@ -134,17 +152,34 @@ gchar *ev_document_get_page_label (EvDocument *document, gint page_index); cairo_surface_t *ev_document_render (EvDocument *document, EvRenderContext *rc); +GdkPixbuf *ev_document_get_thumbnail (EvDocument *document, + EvRenderContext *rc); +const gchar *ev_document_get_uri (EvDocument *document); const gchar *ev_document_get_title (EvDocument *document); gboolean ev_document_is_page_size_uniform (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); gboolean ev_document_check_dimensions (EvDocument *document); gint ev_document_get_max_label_len (EvDocument *document); gboolean ev_document_has_text_page_labels (EvDocument *document); gboolean ev_document_find_page_by_label (EvDocument *document, const gchar *page_label, gint *page_index); +gboolean ev_document_has_synctex (EvDocument *document); + +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); @@ -163,6 +198,11 @@ EvRectangle *ev_rectangle_new (void); EvRectangle *ev_rectangle_copy (EvRectangle *ev_rect); void ev_rectangle_free (EvRectangle *ev_rect); +struct _EvMapping { + EvRectangle area; + gpointer data; +}; + /* convenience macro to ease interface addition in the CODE * section of EV_BACKEND_REGISTER_WITH_CODE (this macro relies on * the g_define_type_id present within EV_BACKEND_REGISTER_WITH_CODE()). @@ -262,56 +302,6 @@ type_name##_get_type (void) return g_define_type_id__volatile; \ } -/* A convenience macro for GTypeInterface definitions, which declares - * a default vtable initialization function and defines a *_get_type() - * function. - * - * The macro expects the interface initialization function to have the - * name t_n ## _default_init, and the interface - * structure to have the name TN ## Interface. - */ -#define EV_DEFINE_INTERFACE(TypeName, type_name, TYPE_PREREQ) \ -static void type_name##_class_init (TypeName##Iface *klass); \ - \ -GType \ -type_name##_get_type (void) \ -{ \ - static volatile gsize g_define_type_id__volatile = 0; \ - if (g_once_init_enter (&g_define_type_id__volatile)) { \ - GType g_define_type_id = \ - g_type_register_static_simple (G_TYPE_INTERFACE, \ - g_intern_static_string (#TypeName), \ - sizeof (TypeName##Iface), \ - (GClassInitFunc)type_name##_class_init, \ - 0, \ - (GInstanceInitFunc)NULL, \ - (GTypeFlags) 0); \ - if (TYPE_PREREQ) \ - g_type_interface_add_prerequisite (g_define_type_id, TYPE_PREREQ); \ - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ - } \ - return g_define_type_id__volatile; \ -} - -/* - * A convenience macro for boxed type implementations, which defines a - * type_name_get_type() function registering the boxed type. - */ -#define EV_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) \ -GType \ -type_name##_get_type (void) \ -{ \ - static volatile gsize g_define_type_id__volatile = 0; \ - if (g_once_init_enter (&g_define_type_id__volatile)) { \ - GType g_define_type_id = \ - g_boxed_type_register_static (g_intern_static_string (#TypeName), \ - (GBoxedCopyFunc) copy_func, \ - (GBoxedFreeFunc) free_func); \ - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ - } \ - return g_define_type_id__volatile; \ -} - G_END_DECLS #endif /* EV_DOCUMENT_H */