packages: xournal/xournal.spec, xournal/xournal-poppler-api.patch (NEW) - r...
arekm
arekm at pld-linux.org
Sun Nov 13 14:30:05 CET 2011
Author: arekm Date: Sun Nov 13 13:30:05 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 4; fix build with poppler >= 0.17 (from fc)
---- Files affected:
packages/xournal:
xournal.spec (1.17 -> 1.18) , xournal-poppler-api.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/xournal/xournal.spec
diff -u packages/xournal/xournal.spec:1.17 packages/xournal/xournal.spec:1.18
--- packages/xournal/xournal.spec:1.17 Sun Nov 13 11:57:49 2011
+++ packages/xournal/xournal.spec Sun Nov 13 14:30:00 2011
@@ -3,12 +3,13 @@
Summary(pl.UTF-8): Xournal - aplikacja do tworzenia notatek, szkicowania i prowadzenia dziennika pisakiem
Name: xournal
Version: 0.4.5
-Release: 3
+Release: 4
License: GPL
Group: X11/Applications
Source0: http://downloads.sourceforge.net/xournal/%{name}-%{version}.tar.gz
# Source0-md5: 795e4396ded2b67766eb2926be1fb4a9
Patch0: %{name}-zlib.patch
+Patch1: %{name}-poppler-api.patch
URL: http://xournal.sourceforge.net/
BuildRequires: autoconf
BuildRequires: automake
@@ -33,6 +34,7 @@
%prep
%setup -q
%patch0 -p0
+%patch1 -p0
%build
%{__aclocal}
@@ -70,6 +72,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.18 2011/11/13 13:30:00 arekm
+- rel 4; fix build with poppler >= 0.17 (from fc)
+
Revision 1.17 2011/11/13 10:57:49 arekm
- release 3
================================================================
Index: packages/xournal/xournal-poppler-api.patch
diff -u /dev/null packages/xournal/xournal-poppler-api.patch:1.1
--- /dev/null Sun Nov 13 14:30:05 2011
+++ packages/xournal/xournal-poppler-api.patch Sun Nov 13 14:30:00 2011
@@ -0,0 +1,156 @@
+--- src/xo-file.c.org 2009-09-28 17:36:05.000000000 -0600
++++ src/xo-file.c 2011-07-19 09:56:00.264352741 -0600
+@@ -975,6 +975,140 @@
+ g_free(req);
+ }
+
++/*
++ * Copied from http://cgit.freedesktop.org/poppler/poppler/tree/glib/poppler-page.cc?h=poppler-0.16#n617
++ * as a temporary workaround to poppler removing depreciated functions while we wait for
++ * upstream to rewrite against cairo
++ */
++static void
++copy_cairo_surface_to_pixbuf (cairo_surface_t *surface, GdkPixbuf *pixbuf)
++{
++ int cairo_width, cairo_height, cairo_rowstride;
++ unsigned char *pixbuf_data, *dst, *cairo_data;
++ int pixbuf_rowstride, pixbuf_n_channels;
++ unsigned int *src;
++ int x, y;
++
++ cairo_width = cairo_image_surface_get_width (surface);
++ cairo_height = cairo_image_surface_get_height (surface);
++ cairo_rowstride = cairo_image_surface_get_stride (surface);
++ cairo_data = cairo_image_surface_get_data (surface);
++
++ pixbuf_data = gdk_pixbuf_get_pixels (pixbuf);
++ pixbuf_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
++ pixbuf_n_channels = gdk_pixbuf_get_n_channels (pixbuf);
++
++ if (cairo_width > gdk_pixbuf_get_width (pixbuf))
++ cairo_width = gdk_pixbuf_get_width (pixbuf);
++ if (cairo_height > gdk_pixbuf_get_height (pixbuf))
++ cairo_height = gdk_pixbuf_get_height (pixbuf);
++ for (y = 0; y < cairo_height; y++)
++ {
++ src = (unsigned int *) (cairo_data + y * cairo_rowstride);
++ dst = pixbuf_data + y * pixbuf_rowstride;
++ for (x = 0; x < cairo_width; x++)
++ {
++ dst[0] = (*src >> 16) & 0xff;
++ dst[1] = (*src >> 8) & 0xff;
++ dst[2] = (*src >> 0) & 0xff;
++ if (pixbuf_n_channels == 4)
++ dst[3] = (*src >> 24) & 0xff;
++ dst += pixbuf_n_channels;
++ src++;
++ }
++ }
++}
++
++static void
++_poppler_page_render_to_pixbuf (PopplerPage *page,
++ int src_x, int src_y,
++ int src_width, int src_height,
++ double scale,
++ int rotation,
++ gboolean printing,
++ GdkPixbuf *pixbuf)
++{
++ cairo_t *cr;
++ cairo_surface_t *surface;
++
++ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
++ src_width, src_height);
++ cr = cairo_create (surface);
++ cairo_save (cr);
++ switch (rotation) {
++ case 90:
++ cairo_translate (cr, src_x + src_width, -src_y);
++ break;
++ case 180:
++ cairo_translate (cr, src_x + src_width, src_y + src_height);
++ break;
++ case 270:
++ cairo_translate (cr, -src_x, src_y + src_height);
++ break;
++ default:
++ cairo_translate (cr, -src_x, -src_y);
++ }
++
++ if (scale != 1.0)
++ cairo_scale (cr, scale, scale);
++
++ if (rotation != 0)
++ cairo_rotate (cr, rotation * G_PI / 180.0);
++
++ if (printing)
++ poppler_page_render_for_printing (page, cr);
++ else
++ poppler_page_render (page, cr);
++ cairo_restore (cr);
++
++ cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER);
++ cairo_set_source_rgb (cr, 1., 1., 1.);
++ cairo_paint (cr);
++
++ cairo_destroy (cr);
++
++ copy_cairo_surface_to_pixbuf (surface, pixbuf);
++ cairo_surface_destroy (surface);
++}
++
++/**
++ * poppler_page_render_to_pixbuf:
++ * @page: the page to render from
++ * @src_x: x coordinate of upper left corner
++ * @src_y: y coordinate of upper left corner
++ * @src_width: width of rectangle to render
++ * @src_height: height of rectangle to render
++ * @scale: scale specified as pixels per point
++ * @rotation: rotate the document by the specified degree
++ * @pixbuf: pixbuf to render into
++ *
++ * First scale the document to match the specified pixels per point,
++ * then render the rectangle given by the upper left corner at
++ * (src_x, src_y) and src_width and src_height.
++ * This function is for rendering a page that will be displayed.
++ * If you want to render a page that will be printed use
++ * poppler_page_render_to_pixbuf_for_printing() instead
++ *
++ * Deprecated: 0.16
++ **/
++void
++poppler_page_render_to_pixbuf (PopplerPage *page,
++ int src_x, int src_y,
++ int src_width, int src_height,
++ double scale,
++ int rotation,
++ GdkPixbuf *pixbuf)
++{
++ g_return_if_fail (POPPLER_IS_PAGE (page));
++ g_return_if_fail (scale > 0.0);
++ g_return_if_fail (pixbuf != NULL);
++
++ _poppler_page_render_to_pixbuf (page, src_x, src_y,
++ src_width, src_height,
++ scale, rotation,
++ FALSE,
++ pixbuf);
++}
+ /* process a bg PDF request from the queue, and recurse */
+
+ gboolean bgpdf_scheduler_callback(gpointer data)
+--- src/xo-file.h.org 2009-09-27 16:45:53.000000000 -0600
++++ src/xo-file.h 2011-07-19 09:54:00.557465100 -0600
+@@ -36,3 +36,10 @@
+ void init_config_default(void);
+ void load_config_from_file(void);
+ void save_config_to_file(void);
++
++void poppler_page_render_to_pixbuf (PopplerPage *page,
++ int src_x, int src_y,
++ int src_width, int src_height,
++ double scale,
++ int rotation,
++ GdkPixbuf *pixbuf);
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/xournal/xournal.spec?r1=1.17&r2=1.18&f=u
More information about the pld-cvs-commit
mailing list