Gentoo Archives: gentoo-commits

From: "Romain Perier (mrpouet)" <mrpouet@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in gnome-extra/gnome-web-photo/files: gnome-web-photo-0.8-libxul-compat.patch
Date: Mon, 08 Feb 2010 17:44:18
Message-Id: E1NeXei-0007vn-PU@stork.gentoo.org
1 mrpouet 10/02/08 17:44:16
2
3 Added: gnome-web-photo-0.8-libxul-compat.patch
4 Log:
5 Fix compatibility with xulrunner-1.9.2, per bug #303897.
6 (Portage version: 2.2_rc62/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 gnome-extra/gnome-web-photo/files/gnome-web-photo-0.8-libxul-compat.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-extra/gnome-web-photo/files/gnome-web-photo-0.8-libxul-compat.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-extra/gnome-web-photo/files/gnome-web-photo-0.8-libxul-compat.patch?rev=1.1&content-type=text/plain
13
14 Index: gnome-web-photo-0.8-libxul-compat.patch
15 ===================================================================
16 From c90a9ed422d683840b59fc50c7d201e63cbd2028 Mon Sep 17 00:00:00 2001
17 From: Romain Perier <mrpouet@g.o>
18 Date: Mon, 8 Feb 2010 18:27:29 +0100
19 Subject: Fix backward compatibility with xulrunner-1.9.2
20
21 1)° xulrunner-1.9.2 no longer installs libxul-unstable
22 2)° Since 1.9.2 nsIPresShell has an API change (RenderDocument),
23 so we've to check LIBXUL_VERSION
24
25 ---
26 m4/libxul.m4 | 9 +++++++--
27 src/Makefile.am | 1 +
28 src/Writer.cpp | 8 ++++++--
29 3 files changed, 14 insertions(+), 4 deletions(-)
30
31 --- a/m4/libxul.m4
32 +++ b/m4/libxul.m4
33 @@ -50,7 +50,7 @@ if test "$libxul_cv_have_libxul" != "yes"; then
34 AC_MSG_ERROR([libxul not found])
35 fi
36
37 -libxul_cv_version="$($PKG_CONFIG --modversion $libxul_cv_libxul_pkg)"
38 +libxul_cv_version="$($PKG_CONFIG --modversion $libxul_cv_libxul_pkg | sed 's:\.::g')"
39 libxul_cv_prefix="$($PKG_CONFIG --variable=prefix $libxul_cv_libxul_pkg)"
40 libxul_cv_include_root="$($PKG_CONFIG --variable=includedir $libxul_cv_libxul_pkg)"
41 libxul_cv_sdkdir="$($PKG_CONFIG --variable=sdkdir $libxul_cv_libxul_pkg)"
42 @@ -59,7 +59,12 @@ libxul_cv_sdkdir="$($PKG_CONFIG --variable=sdkdir $libxul_cv_libxul_pkg)"
43 # I can figure this out, do it like this:
44 libxul_cv_libdir="$($PKG_CONFIG --variable=sdkdir $libxul_cv_libxul_pkg)/bin"
45
46 -libxul_cv_includes="$($PKG_CONFIG --cflags-only-I libxul-unstable libxul)"
47 +libxul_cv_includes="$($PKG_CONFIG --cflags-only-I libxul)"
48 +
49 +# xulrunner-1.9.2 no longer installs libxul-unstable
50 +if $($PKG_CONFIG --exists libxul-unstable); then
51 + libxul_cv_includes+="$($PKG_CONFIG --cflags-only-I libxul-unstable)"
52 +fi
53
54 AC_DEFINE([HAVE_LIBXUL],[1],[Define for libxul])
55
56 --- a/src/Makefile.am
57 +++ b/src/Makefile.am
58 @@ -42,6 +42,7 @@ gnome_web_photo_CPPFLAGS = \
59 -DLOCALEDIR=\"$(datadir)/locale\" \
60 -DGECKO_HOME=\"$(GECKO_HOME)\" \
61 -DGECKO_PREFIX=\"$(GECKO_PREFIX)\" \
62 + -DLIBXUL_VERSION=$(LIBXUL_VERSION) \
63 -DXPCOM_GLUE_USE_NSPR \
64 -DXPCOM_GLUE \
65 $(AM_CPPFLAGS)
66 --- a/src/Writer.cpp
67 +++ b/src/Writer.cpp
68 @@ -196,9 +196,13 @@ Writer::Write()
69
70 width = NSAppUnitsToIntPixels(cutout.width, p2a);
71 height = NSAppUnitsToIntPixels(cutout.height, p2a);
72 -
73 - rv = presShell->RenderDocument(cutout, PR_FALSE, PR_TRUE,
74 +#if LIBXUL_VERSION >= 192
75 + rv = presShell->RenderDocument(cutout, nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING,
76 NS_RGB(255, 255, 255), context);
77 +#else
78 + rv = presShell->RenderDocument(cutout, PR_FALSE, PR_TRUE,
79 + NS_RGB(255, 255, 255), context);
80 +#endif
81 if (NS_SUCCEEDED(rv)) {
82 imgContext->DrawSurface(surface, gfxSize(width, height));
83 }