1 |
voyageur 07/09/11 09:44:25 |
2 |
|
3 |
Added: popplerkit-0.2-poppler6_support.patch |
4 |
Log: |
5 |
Add poppler 0.6 support |
6 |
(Portage version: 2.1.3.9) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 gnustep-libs/popplerkit/files/popplerkit-0.2-poppler6_support.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnustep-libs/popplerkit/files/popplerkit-0.2-poppler6_support.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnustep-libs/popplerkit/files/popplerkit-0.2-poppler6_support.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: popplerkit-0.2-poppler6_support.patch |
15 |
=================================================================== |
16 |
Index: Etoile/Frameworks/PopplerKit/bindings/poppler_page.cc |
17 |
=================================================================== |
18 |
--- Etoile/Frameworks/PopplerKit/bindings/poppler_page.cc (révision 2341) |
19 |
+++ Etoile/Frameworks/PopplerKit/bindings/poppler_page.cc (révision 2342) |
20 |
@@ -33,7 +33,8 @@ |
21 |
return NULL; |
22 |
} |
23 |
|
24 |
- if ((pageIndex <= 0) || (pageIndex > PDF_DOC(poppler_document)->getNumPages())) |
25 |
+ if ((pageIndex <= 0) || |
26 |
+ ((int)pageIndex > PDF_DOC(poppler_document)->getNumPages())) |
27 |
{ |
28 |
return NULL; |
29 |
} |
30 |
@@ -69,8 +70,7 @@ |
31 |
|
32 |
#ifdef POPPLER_0_4 |
33 |
return PAGE(poppler_page)->getWidth(); |
34 |
-#endif |
35 |
-#ifdef POPPLER_0_5 |
36 |
+#else |
37 |
return PAGE(poppler_page)->getMediaWidth(); |
38 |
#endif |
39 |
|
40 |
@@ -85,9 +85,7 @@ |
41 |
|
42 |
#ifdef POPPLER_0_4 |
43 |
return PAGE(poppler_page)->getHeight(); |
44 |
-#endif |
45 |
-#ifdef POPPLER_0_5 |
46 |
+#else |
47 |
return PAGE(poppler_page)->getMediaHeight(); |
48 |
#endif |
49 |
- |
50 |
} |
51 |
Index: Etoile/Frameworks/PopplerKit/bindings/poppler.cc |
52 |
=================================================================== |
53 |
--- Etoile/Frameworks/PopplerKit/bindings/poppler.cc (révision 2341) |
54 |
+++ Etoile/Frameworks/PopplerKit/bindings/poppler.cc (révision 2342) |
55 |
@@ -110,7 +110,7 @@ |
56 |
} |
57 |
|
58 |
// tell fontconfig about application fonts |
59 |
- for (int i = 0; i < nappFonts; i++) |
60 |
+ for (unsigned int i = 0; i < nappFonts; i++) |
61 |
{ |
62 |
if (FcConfigAppFontAddFile(FcConfigGetCurrent(), appFonts[i])) |
63 |
{ |
64 |
@@ -118,12 +118,16 @@ |
65 |
} |
66 |
else |
67 |
{ |
68 |
- fprintf(stderr, "failed to register application font %s\n"); |
69 |
+ fprintf(stderr, "failed to register application font %s\n", appFonts[i]); |
70 |
} |
71 |
fflush(stderr); |
72 |
} |
73 |
|
74 |
+#ifdef POPPLER_0_6 |
75 |
+ globalParams = new GlobalParams(); |
76 |
+#else |
77 |
globalParams = new GlobalParams(NULL); |
78 |
+#endif |
79 |
#ifdef POPPLER_0_4 |
80 |
globalParams->setupBaseFontsFc(NULL); |
81 |
#endif |
82 |
Index: Etoile/Frameworks/PopplerKit/bindings/poppler_splash_renderer.cc |
83 |
=================================================================== |
84 |
--- Etoile/Frameworks/PopplerKit/bindings/poppler_splash_renderer.cc (révision 2341) |
85 |
+++ Etoile/Frameworks/PopplerKit/bindings/poppler_splash_renderer.cc (révision 2342) |
86 |
@@ -38,8 +38,7 @@ |
87 |
#ifdef POPPLER_0_4 |
88 |
white.rgb8 = splashMakeRGB8(bg_red, bg_green, bg_blue); |
89 |
void* splashDevice = new SplashOutputDev(splashModeRGB8, gFalse, white); |
90 |
-#endif |
91 |
-#ifdef POPPLER_0_5 |
92 |
+#else // 0.5, 0.6 |
93 |
white[0] = bg_red; |
94 |
white[1] = bg_green; |
95 |
white[2] = bg_blue; |
96 |
@@ -86,13 +85,17 @@ |
97 |
SYNCHRONIZED(PAGE(poppler_page)->displaySlice(SPLASH_DEV(output_dev), |
98 |
(double)hDPI, (double)vDPI, |
99 |
rotate, |
100 |
-#ifdef POPPLER_0_5 |
101 |
+#ifndef POPPLER_0_4 // 0.5, 0.6 |
102 |
gTrue, // useMediaBox |
103 |
#endif |
104 |
gTrue, // Crop |
105 |
(int)sliceX, (int)sliceY, |
106 |
(int)sliceW, (int)sliceH, |
107 |
+#ifdef POPPLER_0_6 |
108 |
+ gFalse, // printing |
109 |
+#else |
110 |
NULL, // Links |
111 |
+#endif |
112 |
PDF_DOC(poppler_document)->getCatalog())); |
113 |
|
114 |
return 1; |
115 |
@@ -123,16 +126,14 @@ |
116 |
|
117 |
#ifdef POPPLER_0_4 |
118 |
SplashRGB8* rgb8; |
119 |
-#endif |
120 |
-#ifdef POPPLER_0_5 |
121 |
+#else // 0.5, 0.6 |
122 |
SplashColorPtr color; |
123 |
#endif |
124 |
unsigned char* dataPtr; |
125 |
|
126 |
#ifdef POPPLER_0_4 |
127 |
rgb8 = SPLASH_BITMAP(bitmap)->getDataPtr().rgb8; |
128 |
-#endif |
129 |
-#ifdef POPPLER_0_5 |
130 |
+#else // 0.5, 0.6 |
131 |
color = SPLASH_BITMAP(bitmap)->getDataPtr(); |
132 |
#endif |
133 |
|
134 |
@@ -146,8 +147,7 @@ |
135 |
*dataPtr++ = splashRGB8G(*rgb8); |
136 |
*dataPtr++ = splashRGB8B(*rgb8); |
137 |
++rgb8; |
138 |
-#endif |
139 |
-#ifdef POPPLER_0_5 |
140 |
+#else // 0.5, 0.6 |
141 |
*dataPtr++ = splashRGB8R(color); |
142 |
*dataPtr++ = splashRGB8G(color); |
143 |
*dataPtr++ = splashRGB8B(color); |
144 |
Index: Etoile/Frameworks/PopplerKit/bindings/GNUmakefile |
145 |
=================================================================== |
146 |
--- Etoile/Frameworks/PopplerKit/bindings/GNUmakefile (révision 2341) |
147 |
+++ Etoile/Frameworks/PopplerKit/bindings/GNUmakefile (révision 2342) |
148 |
@@ -55,4 +55,8 @@ |
149 |
bindings_CFLAGS += -DPOPPLER_0_5 |
150 |
endif |
151 |
|
152 |
+ifeq ($(POPPLER_0_6), YES) |
153 |
+ bindings_CFLAGS += -DPOPPLER_0_6 |
154 |
+endif |
155 |
+ |
156 |
include $(GNUSTEP_MAKEFILES)/subproject.make |
157 |
Index: Etoile/Frameworks/PopplerKit/bindings/poppler_text.cc |
158 |
=================================================================== |
159 |
--- Etoile/Frameworks/PopplerKit/bindings/poppler_text.cc (révision 2341) |
160 |
+++ Etoile/Frameworks/PopplerKit/bindings/poppler_text.cc (révision 2342) |
161 |
@@ -51,10 +51,16 @@ |
162 |
|
163 |
SYNCHRONIZED(PAGE(poppler_page)->display(TEXT_DEV(text_device), |
164 |
hDPI, vDPI, rotate, |
165 |
-#ifdef POPPLER_0_5 |
166 |
+#ifndef POPPLER_0_4 |
167 |
gTrue, // useMediaBox |
168 |
#endif |
169 |
- crop, NULL, PDF_DOC(poppler_document)->getCatalog())); |
170 |
+ crop, |
171 |
+#ifdef POPPLER_0_6 |
172 |
+ gFalse, // printing |
173 |
+#else |
174 |
+ NULL, // links |
175 |
+#endif |
176 |
+ PDF_DOC(poppler_document)->getCatalog())); |
177 |
return 1; |
178 |
} |
179 |
|
180 |
@@ -70,7 +76,7 @@ |
181 |
int result = TEXT_DEV(text_device)->findText(text_utf32, text_len, |
182 |
start_at_top, stop_at_bottom, |
183 |
start_at_last, stop_at_last, |
184 |
-#ifdef POPPLER_0_5 |
185 |
+#ifndef POPPLER_0_4 // 0.5, 0.6 |
186 |
gTrue, gFalse, |
187 |
#endif |
188 |
x_min, y_min, x_max, y_max); |
189 |
Index: Etoile/Frameworks/PopplerKit/config.sh |
190 |
=================================================================== |
191 |
--- Etoile/Frameworks/PopplerKit/config.sh (révision 2341) |
192 |
+++ Etoile/Frameworks/PopplerKit/config.sh (révision 2342) |
193 |
@@ -60,6 +60,13 @@ |
194 |
POPPLER_VERSION="POPPLER_0_5" |
195 |
fi |
196 |
|
197 |
+${PKG_CONFIG} --atleast-version=0.5.9 poppler |
198 |
+if [ $? -eq 0 ]; then |
199 |
+ POPPLER_VERSION="POPPLER_0_6" |
200 |
+fi |
201 |
+ |
202 |
+echo $POPPLER_VERSION |
203 |
+ |
204 |
# include freetype, just to be sure |
205 |
${PKG_CONFIG} --exists freetype2 |
206 |
if [ $? -eq 0 ]; then |
207 |
|
208 |
|
209 |
|
210 |
-- |
211 |
gentoo-commits@g.o mailing list |