wok-4.x rev 11491

epdfview: fix build (thank godane)
author Antoine Bodin <gokhlayeh@slitaz.org>
date Mon Dec 19 02:49:30 2011 +0100 (2011-12-19)
parents 2afb3b834baa
children 018bf95ddb55
files epdfview/receipt epdfview/stuff/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch
line diff
     1.1 --- a/epdfview/receipt	Sun Dec 18 13:03:38 2011 +0100
     1.2 +++ b/epdfview/receipt	Mon Dec 19 02:49:30 2011 +0100
     1.3 @@ -17,6 +17,7 @@
     1.4  compile_rules()
     1.5  {
     1.6  	cd $src
     1.7 +	patch -Np1 -i $stuff/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch
     1.8  	./configure \
     1.9  		--without-cups \
    1.10  		$CONFIGURE_ARGS &&
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/epdfview/stuff/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch	Mon Dec 19 02:49:30 2011 +0100
     2.3 @@ -0,0 +1,59 @@
     2.4 +From d30496f52b85f82947bd07b9bd60f8482843ece8 Mon Sep 17 00:00:00 2001
     2.5 +From: jordi <jordi@cb4bfb15-1111-0410-82e2-95233c8f1c7e>
     2.6 +Date: Tue, 5 Jul 2011 09:23:38 +0000
     2.7 +Subject: [PATCH 1/2] When using Poppler 0.17.0, I needed to swap the blue and
     2.8 + red channels, otherwise the colors (other than black
     2.9 + and white) looked wierd.
    2.10 +
    2.11 +git-svn-id: svn://svn.emma-soft.com/epdfview/trunk@367 cb4bfb15-1111-0410-82e2-95233c8f1c7e
    2.12 +---
    2.13 + src/PDFDocument.cxx |   20 ++++++++++++++++++++
    2.14 + 1 files changed, 20 insertions(+), 0 deletions(-)
    2.15 +
    2.16 +diff --git a/src/PDFDocument.cxx b/src/PDFDocument.cxx
    2.17 +index df5d75f..63b3513 100644
    2.18 +--- a/src/PDFDocument.cxx
    2.19 ++++ b/src/PDFDocument.cxx
    2.20 +@@ -20,6 +20,7 @@
    2.21 + #include <time.h>
    2.22 + #include <poppler.h>
    2.23 + #include <unistd.h>
    2.24 ++#include <algorithm>
    2.25 + #include "epdfview.h"
    2.26 +
    2.27 + using namespace ePDFView;
    2.28 +@@ -33,6 +34,24 @@ static PageLayout convertPageLayout (gint pageLayout);
    2.29 + static PageMode convertPageMode (gint pageMode);
    2.30 + static gchar *getAbsoluteFileName (const gchar *fileName);
    2.31 +
    2.32 ++namespace
    2.33 ++{
    2.34 ++    void
    2.35 ++    convert_bgra_to_rgba (guint8 *data, int width, int height)
    2.36 ++    {
    2.37 ++        using std::swap;
    2.38 ++
    2.39 ++        for (int y = 0; y < height; y++)
    2.40 ++        {
    2.41 ++            for (int x = 0; x < width; x++)
    2.42 ++            {
    2.43 ++                swap(data[0], data[2]);
    2.44 ++                data += 4;
    2.45 ++            }
    2.46 ++        }
    2.47 ++    }
    2.48 ++}
    2.49 ++
    2.50 + ///
    2.51 + /// @brief Constructs a new PDFDocument object.
    2.52 + ///
    2.53 +@@ -650,6 +669,7 @@ PDFDocument::renderPage (gint pageNum)
    2.54 +         poppler_page_render (page, context);
    2.55 +         cairo_destroy(context);
    2.56 +         cairo_surface_destroy (surface);
    2.57 ++        convert_bgra_to_rgba(renderedPage->getData (), width, height);
    2.58 + #else // !HAVE_POPPLER_0_17_0
    2.59 +         // Create the pixbuf from the data and render to it.
    2.60 +         GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (renderedPage->getData (),
    2.61 +--
    2.62 +1.7.7