From df1b45e49e809c90e5f79e36c2da95b342d063d6 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 30 Jun 2005 22:01:33 +0000 Subject: Adjust to poppler API changes; use a sub-GdkPixbuf instead of passing 2005-06-30 Kristian Høgsberg * pdf/ev-poppler.cc: Adjust to poppler API changes; use a sub-GdkPixbuf instead of passing dest_x and dest_y. * shell/ev-view.c: (view_point_to_doc_point), (view_rect_to_doc_rect), (ev_view_button_press_event), (ev_view_motion_notify_event), (compute_new_selection_rect), (gdk_rectangle_point_in), (compute_new_selection_text), (compute_selections): Update selection code to keep the selection around as two points and not as a normalized rectangle, and fix page level selection in two-column mode. --- (limited to 'pdf') diff --git a/pdf/ev-poppler.cc b/pdf/ev-poppler.cc index 92f89a6..aa2ac90 100644 --- a/pdf/ev-poppler.cc +++ b/pdf/ev-poppler.cc @@ -83,6 +83,7 @@ static void pdf_document_thumbnails_get_dimensions (EvDocumentThumbnails static int pdf_document_get_n_pages (EvDocument *document); static EvLink * ev_link_from_action (PopplerAction *action); +static void pdf_document_search_free (PdfDocumentSearch *search); G_DEFINE_TYPE_WITH_CODE (PdfDocument, pdf_document, G_TYPE_OBJECT, @@ -358,8 +359,7 @@ pdf_document_render_pixbuf (EvDocument *document, 0, 0, width, height, rc->scale, - pixbuf, - 0, 0); + pixbuf); g_object_unref (poppler_page); @@ -821,7 +821,7 @@ make_thumbnail_for_size (PdfDocument *pdf_document, gboolean border) { PopplerPage *poppler_page; - GdkPixbuf *pixbuf; + GdkPixbuf *pixbuf, *sub_pixbuf; int width, height; int x_offset, y_offset; double scale; @@ -837,20 +837,24 @@ make_thumbnail_for_size (PdfDocument *pdf_document, if (border) { pixbuf = ev_document_misc_get_thumbnail_frame (width, height, NULL); - x_offset = 1; - y_offset = 1; + + sub_pixbuf = gdk_pixbuf_new_subpixbuf (pixbuf, + 1, 1, + width - 1, height - 1); } else { pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height); gdk_pixbuf_fill (pixbuf, 0xffffffff); - x_offset = 0; - y_offset = 0; + sub_pixbuf = gdk_pixbuf_new_subpixbuf (pixbuf, + 0, 0, + width, height); } poppler_page_render_to_pixbuf (poppler_page, 0, 0, width, height, - scale, pixbuf, - x_offset, y_offset); + scale, sub_pixbuf); + + g_object_unref (G_OBJECT (sub_pixbuf)); g_object_unref (poppler_page); return pixbuf; -- cgit v0.9.1