]> www.fi.muni.cz Git - evince.git/commitdiff
implement get_dimensions
authorJeff Muizelaar <jeff@nit.ca>
Thu, 13 Jan 2005 16:19:22 +0000 (16:19 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Thu, 13 Jan 2005 16:19:22 +0000 (16:19 +0000)
2005-01-13  Jeff Muizelaar  <jeff@nit.ca>

        * pixbuf/pixbuf-document.c:
        (pixbuf_document_thumbnails_get_dimensions),
        (pixbuf_document_document_thumbnails_iface_init):

        implement get_dimensions

ChangeLog
pixbuf/pixbuf-document.c

index d838f2527985645e770ca24180d11ad303f7dcbf..4b8dfac876e776e8d34befd1bea1c486eaa5f12c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-01-13  Jeff Muizelaar  <jeff@nit.ca>
+
+       * pixbuf/pixbuf-document.c:
+       (pixbuf_document_thumbnails_get_dimensions),
+       (pixbuf_document_document_thumbnails_iface_init):
+
+       implement get_dimensions
+
 2005-01-13  Marco Pesenti Gritti  <marco@gnome.org>
 
        * ps/ps-document.c: (ps_document_goto_page):
index f0c39976d72e9b902e7d048bfe58a77d808cc643..492a7db43ec3285d935d396bfa562d96730bf390 100644 (file)
@@ -268,11 +268,27 @@ pixbuf_document_thumbnails_get_thumbnail (EvDocumentThumbnails   *document,
        return pixbuf;
 }
 
+static void
+pixbuf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document,
+                                          gint                  page,
+                                          gint                  suggested_width,
+                                          gint                  *width,
+                                          gint                  *height)
+{
+       PixbufDocument *pixbuf_document = PIXBUF_DOCUMENT (document);
+       gdouble page_ratio;
+
+       page_ratio = gdk_pixbuf_get_height (pixbuf_document->pixbuf) /
+                    gdk_pixbuf_get_width (pixbuf_document->pixbuf);
+       *width = suggested_width;
+       *height = (gint) (suggested_width * page_ratio);
+}
 
 static void
 pixbuf_document_document_thumbnails_iface_init (EvDocumentThumbnailsIface *iface)
 {
        iface->get_thumbnail = pixbuf_document_thumbnails_get_thumbnail;
+       iface->get_dimensions = pixbuf_document_thumbnails_get_dimensions;
 }