Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend/ev-document.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2005-06-30 05:44:28 (GMT)
committer Jonathan Blandford <jrb@src.gnome.org>2005-06-30 05:44:28 (GMT)
commite93b3a265bbc02546d230204402e3f41e83d6ab5 (patch)
tree9a56861f73e0b9a523a2d8cba2d817318a639605 /backend/ev-document.c
parenta50ca0528a09e8e001c4600371048774e4029057 (diff)
Massive changes. We now support text selection of pdfs, and not just
Thu Jun 30 01:43:00 2005 Jonathan Blandford <jrb@redhat.com> * shell/*: * backend/ev-render-context.[ch]: * backend/ev-selection.[ch]: Massive changes. We now support text selection of pdfs, and not just rectangular selection. This is pretty broken still, but I want to get something into CVS.
Diffstat (limited to 'backend/ev-document.c')
-rw-r--r--backend/ev-document.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/backend/ev-document.c b/backend/ev-document.c
index 9bccc4c..3395bf7 100644
--- a/backend/ev-document.c
+++ b/backend/ev-document.c
@@ -203,9 +203,8 @@ ev_document_get_links (EvDocument *document,
GdkPixbuf *
-ev_document_render_pixbuf (EvDocument *document,
- int page,
- double scale)
+ev_document_render_pixbuf (EvDocument *document,
+ EvRenderContext *rc)
{
EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
GdkPixbuf *retval;
@@ -213,7 +212,7 @@ ev_document_render_pixbuf (EvDocument *document,
LOG ("ev_document_render_pixbuf");
g_assert (iface->render_pixbuf);
- retval = iface->render_pixbuf (document, page, scale);
+ retval = iface->render_pixbuf (document, rc);
return retval;
}
@@ -250,3 +249,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));
+}