]> www.fi.muni.cz Git - evince.git/commitdiff
poor man's dropshadow.
authorJonathan Blandford <jrb@redhat.com>
Wed, 5 Jan 2005 03:33:16 +0000 (03:33 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Wed, 5 Jan 2005 03:33:16 +0000 (03:33 +0000)
Tue Jan  4 22:32:32 2005  Jonathan Blandford  <jrb@redhat.com>

        * pdf/xpdf/pdf-document.cc
        (pdf_document_thumbnails_get_page_pixbuf): poor man's dropshadow.

ChangeLog
pdf/xpdf/pdf-document.cc

index 57c0f417d6db8f850863e8a183ed45568ee1415b..72838591dd5d73ab1afc43e2ac12d1bdbaed365e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan  4 22:32:32 2005  Jonathan Blandford  <jrb@redhat.com>
+
+       * pdf/xpdf/pdf-document.cc
+       (pdf_document_thumbnails_get_page_pixbuf): poor man's dropshadow.
+
 Tue Jan  4 21:25:05 2005  Jonathan Blandford  <jrb@redhat.com>
 
        * pdf/xpdf/pdf-document.cc: Do real thumbnailing of PDF files.
index 51ade189877dae2aefd5f1c8a98e62d7e60777cd..4abe9ff32459f21bdd9a9207a8ce68d65cab231f 100644 (file)
@@ -1022,6 +1022,9 @@ pdf_document_thumbnails_get_page_pixbuf (PdfDocument *pdf_document,
        GdkPixmap *pixmap;
        GDKSplashOutputDev *output;
        GdkPixbuf *pixbuf;
+       GdkPixbuf *shadow;
+       gint rowstride;
+       guchar *data;
 
        pixmap = gdk_pixmap_new (pdf_document->target,
                                 width, height, -1);
@@ -1046,7 +1049,33 @@ pdf_document_thumbnails_get_page_pixbuf (PdfDocument *pdf_document,
                                               width, height);
        gdk_drawable_unref (pixmap);
        delete output;
-       return pixbuf;
+
+       shadow = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+                                TRUE, 8,
+                                width + 4,
+                                height + 4);
+       gdk_pixbuf_fill (shadow, 0x000000ff);
+       gdk_pixbuf_copy_area (pixbuf, 0, 0,
+                             width,
+                             height,
+                             shadow,
+                             1, 1);
+       g_object_unref (pixbuf);
+
+       /* Add the corner */
+       data = gdk_pixbuf_get_pixels (shadow);
+       rowstride = gdk_pixbuf_get_rowstride (shadow);
+       data [(width + 2) * 4 + 3] = 0;
+       data [(width + 3) * 4 + 3] = 0;
+       data [(width + 2) * 4 + (rowstride * 1) + 3] = 0;
+       data [(width + 3) * 4 + (rowstride * 1) + 3] = 0;
+
+       data [(height + 2) * rowstride + 3] = 0;
+       data [(height + 3) * rowstride + 3] = 0;
+       data [(height + 2) * rowstride + 4 + 3] = 0;
+       data [(height + 3) * rowstride + 4 + 3] = 0;
+       
+       return shadow;
 }
 
 static GdkPixbuf *