X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fev-document.c;h=10f1d00e2800b64596e13121b15f1f286491a5fe;hb=ab8da3ce3810df8dc6a9df049031292ee03b4393;hp=4513df50e5c09e75510da5333d06b30773dfc335;hpb=79986dda7231d1ef1c530909bde8e18a507a2a2a;p=evince.git diff --git a/backend/ev-document.c b/backend/ev-document.c index 4513df50..10f1d00e 100644 --- a/backend/ev-document.c +++ b/backend/ev-document.c @@ -200,31 +200,44 @@ ev_document_get_links (EvDocument *document, return retval; } +gboolean +ev_document_has_attachments (EvDocument *document) +{ + EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); + if (iface->has_attachments == NULL) + return FALSE; + + return iface->has_attachments (document); +} -GdkPixbuf * -ev_document_render_pixbuf (EvDocument *document, - int page, - double scale) +GList * +ev_document_get_attachments (EvDocument *document) { EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); - GdkPixbuf *retval; - - LOG ("ev_document_render_pixbuf"); - g_assert (iface->render_pixbuf); + GList *retval; - retval = iface->render_pixbuf (document, page, scale); + LOG ("ev_document_get_attachments"); + if (iface->get_attachments == NULL) + return NULL; + retval = iface->get_attachments (document); return retval; } -void -ev_document_set_orientation (EvDocument *document, - EvOrientation orientation) +GdkPixbuf * +ev_document_render_pixbuf (EvDocument *document, + EvRenderContext *rc) { EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); + GdkPixbuf *retval; + + LOG ("ev_document_render_pixbuf"); + g_assert (iface->render_pixbuf); + + retval = iface->render_pixbuf (document, rc); - iface->set_orientation (document, orientation); + return retval; } void @@ -242,3 +255,22 @@ ev_document_info_free (EvDocumentInfo *info) g_free (info); } + + +/* Compares two rects. returns 0 if they're equal */ +#define EPSILON 0.0000001 + +gint +ev_rect_cmp (EvRectangle *a, + EvRectangle *b) +{ + if (a == b) + return 0; + if (a == NULL || b == NULL) + return 1; + + return ! ((ABS (a->x1 - b->x1) < EPSILON) && + (ABS (a->y1 - b->y1) < EPSILON) && + (ABS (a->x2 - b->x2) < EPSILON) && + (ABS (a->y2 - b->y2) < EPSILON)); +}