From e93b3a265bbc02546d230204402e3f41e83d6ab5 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Thu, 30 Jun 2005 05:44:28 +0000 Subject: Massive changes. We now support text selection of pdfs, and not just Thu Jun 30 01:43:00 2005 Jonathan Blandford * 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. --- (limited to 'tiff') diff --git a/tiff/tiff-document.c b/tiff/tiff-document.c index a4c8638..f2ed498 100644 --- a/tiff/tiff-document.c +++ b/tiff/tiff-document.c @@ -205,7 +205,8 @@ rotate_pixbuf (EvDocument *document, GdkPixbuf *pixbuf) } static GdkPixbuf * -tiff_document_render_pixbuf (EvDocument *document, int page, double scale) +tiff_document_render_pixbuf (EvDocument *document, + EvRenderContext *rc) { TiffDocument *tiff_document = TIFF_DOCUMENT (document); int width, height; @@ -219,7 +220,7 @@ tiff_document_render_pixbuf (EvDocument *document, int page, double scale) g_return_val_if_fail (tiff_document->tiff != NULL, 0); push_handlers (); - if (TIFFSetDirectory (tiff_document->tiff, page) != 1) + if (TIFFSetDirectory (tiff_document->tiff, rc->page) != 1) { pop_handlers (); return NULL; @@ -266,8 +267,8 @@ tiff_document_render_pixbuf (EvDocument *document, int page, double scale) pop_handlers (); scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, - width * scale, - height * scale, + width * rc->scale, + height * rc->scale, GDK_INTERP_BILINEAR); g_object_unref (pixbuf); @@ -332,6 +333,7 @@ tiff_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document, gint size, gboolean border) { + EvRenderContext *rc; GdkPixbuf *pixbuf; gdouble w, h; @@ -339,9 +341,9 @@ tiff_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document, page, &w, &h); - pixbuf = tiff_document_render_pixbuf (EV_DOCUMENT (document), - page, - size/w); + rc = ev_render_context_new (EV_ORIENTATION_PORTRAIT, page, size/w); + pixbuf = tiff_document_render_pixbuf (EV_DOCUMENT (document), rc); + g_object_unref (G_OBJECT (rc)); if (border) { -- cgit v0.9.1