1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
|
/* book.c generated by valac 0.22.1, the Vala compiler
* generated from book.vala, do not modify */
/*
* Copyright (C) 2009-2011 Canonical Ltd.
* Author: Robert Ancell <robert.ancell@canonical.com>
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version. See http://www.gnu.org/copyleft/gpl.html the full text of the
* license.
*/
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <cairo-ps.h>
#include <zlib.h>
#include <gobject/gvaluecollector.h>
#define TYPE_BOOK (book_get_type ())
#define BOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BOOK, Book))
#define BOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BOOK, BookClass))
#define IS_BOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BOOK))
#define IS_BOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BOOK))
#define BOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BOOK, BookClass))
typedef struct _Book Book;
typedef struct _BookClass BookClass;
typedef struct _BookPrivate BookPrivate;
#define TYPE_PAGE (page_get_type ())
#define PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE, Page))
#define PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE, PageClass))
#define IS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE))
#define IS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE))
#define PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE, PageClass))
typedef struct _Page Page;
typedef struct _PageClass PageClass;
#define _page_unref0(var) ((var == NULL) ? NULL : (var = (page_unref (var), NULL)))
#define __g_list_free__page_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__page_unref0_ (var), NULL)))
#define _g_byte_array_unref0(var) ((var == NULL) ? NULL : (var = (g_byte_array_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define TYPE_PS_WRITER (ps_writer_get_type ())
#define PS_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PS_WRITER, PsWriter))
#define PS_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PS_WRITER, PsWriterClass))
#define IS_PS_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PS_WRITER))
#define IS_PS_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PS_WRITER))
#define PS_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PS_WRITER, PsWriterClass))
typedef struct _PsWriter PsWriter;
typedef struct _PsWriterClass PsWriterClass;
typedef struct _PsWriterPrivate PsWriterPrivate;
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
#define _ps_writer_unref0(var) ((var == NULL) ? NULL : (var = (ps_writer_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define TYPE_PDF_WRITER (pdf_writer_get_type ())
#define PDF_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PDF_WRITER, PDFWriter))
#define PDF_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PDF_WRITER, PDFWriterClass))
#define IS_PDF_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PDF_WRITER))
#define IS_PDF_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PDF_WRITER))
#define PDF_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PDF_WRITER, PDFWriterClass))
typedef struct _PDFWriter PDFWriter;
typedef struct _PDFWriterClass PDFWriterClass;
typedef struct _PDFWriterPrivate PDFWriterPrivate;
#define _pdf_writer_unref0(var) ((var == NULL) ? NULL : (var = (pdf_writer_unref (var), NULL)))
typedef struct _ParamSpecBook ParamSpecBook;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _ParamSpecPDFWriter ParamSpecPDFWriter;
typedef struct _ParamSpecPsWriter ParamSpecPsWriter;
struct _Book {
GTypeInstance parent_instance;
volatile int ref_count;
BookPrivate * priv;
};
struct _BookClass {
GTypeClass parent_class;
void (*finalize) (Book *self);
};
struct _BookPrivate {
GList* pages;
gboolean needs_saving_;
GByteArray* jpeg_data;
};
struct _PsWriter {
GTypeInstance parent_instance;
volatile int ref_count;
PsWriterPrivate * priv;
cairo_surface_t* surface;
GFileOutputStream* stream;
};
struct _PsWriterClass {
GTypeClass parent_class;
void (*finalize) (PsWriter *self);
};
struct _PDFWriter {
GTypeInstance parent_instance;
volatile int ref_count;
PDFWriterPrivate * priv;
gsize offset;
GList* object_offsets;
};
struct _PDFWriterClass {
GTypeClass parent_class;
void (*finalize) (PDFWriter *self);
};
struct _ParamSpecBook {
GParamSpec parent_instance;
};
struct _PDFWriterPrivate {
GFileOutputStream* stream;
};
struct _ParamSpecPDFWriter {
GParamSpec parent_instance;
};
struct _ParamSpecPsWriter {
GParamSpec parent_instance;
};
static gpointer book_parent_class = NULL;
static gpointer pdf_writer_parent_class = NULL;
static gpointer ps_writer_parent_class = NULL;
gpointer book_ref (gpointer instance);
void book_unref (gpointer instance);
GParamSpec* param_spec_book (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_book (GValue* value, gpointer v_object);
void value_take_book (GValue* value, gpointer v_object);
gpointer value_get_book (const GValue* value);
GType book_get_type (void) G_GNUC_CONST;
gpointer page_ref (gpointer instance);
void page_unref (gpointer instance);
GParamSpec* param_spec_page (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_page (GValue* value, gpointer v_object);
void value_take_page (GValue* value, gpointer v_object);
gpointer value_get_page (const GValue* value);
GType page_get_type (void) G_GNUC_CONST;
#define BOOK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_BOOK, BookPrivate))
enum {
BOOK_DUMMY_PROPERTY
};
static void book_page_changed_cb (Book* self, Page* page);
static void _book_page_changed_cb_page_pixels_changed (Page* _sender, gpointer self);
static void _book_page_changed_cb_page_crop_changed (Page* _sender, gpointer self);
static void _page_unref0_ (gpointer var);
static void _g_list_free__page_unref0_ (GList* self);
Book* book_new (void);
Book* book_construct (GType object_type);
void book_clear (Book* self);
void book_set_needs_saving (Book* self, gboolean value);
void book_append_page (Book* self, Page* page);
void book_move_page (Book* self, Page* page, guint location);
void book_delete_page (Book* self, Page* page);
Page* book_get_page (Book* self, gint page_number);
guint book_get_page_index (Book* self, Page* page);
static GFile* book_make_indexed_file (Book* self, const gchar* uri, gint i);
guint book_get_n_pages (Book* self);
static void book_save_multi_file (Book* self, const gchar* type, gint quality, GFile* file, GError** error);
void page_save (Page* self, const gchar* type, gint quality, GFile* file, GError** error);
static void book_save_ps_pdf_surface (Book* self, cairo_surface_t* surface, GdkPixbuf* image, gdouble dpi);
static void book_save_ps (Book* self, GFile* file, GError** error);
gpointer ps_writer_ref (gpointer instance);
void ps_writer_unref (gpointer instance);
GParamSpec* param_spec_ps_writer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_ps_writer (GValue* value, gpointer v_object);
void value_take_ps_writer (GValue* value, gpointer v_object);
gpointer value_get_ps_writer (const GValue* value);
GType ps_writer_get_type (void) G_GNUC_CONST;
PsWriter* ps_writer_new (GFileOutputStream* stream);
PsWriter* ps_writer_construct (GType object_type, GFileOutputStream* stream);
GdkPixbuf* page_get_image (Page* self, gboolean apply_crop);
gint page_get_dpi (Page* self);
static guint8* book_compress_zlib (Book* self, guint8* data, int data_length1, int* result_length1);
static guint8* book_compress_jpeg (Book* self, GdkPixbuf* image, gint quality, gint dpi, int* result_length1);
static gboolean book_write_pixbuf_data (Book* self, guint8* buf, int buf_length1, GError** error);
static gboolean _book_write_pixbuf_data_gdk_pixbuf_save_func (guint8* buf, gsize buf_length1, GError** error, gpointer self);
static void book_save_pdf (Book* self, GFile* file, gint quality, GError** error);
gpointer pdf_writer_ref (gpointer instance);
void pdf_writer_unref (gpointer instance);
GParamSpec* param_spec_pdf_writer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_pdf_writer (GValue* value, gpointer v_object);
void value_take_pdf_writer (GValue* value, gpointer v_object);
gpointer value_get_pdf_writer (const GValue* value);
GType pdf_writer_get_type (void) G_GNUC_CONST;
PDFWriter* pdf_writer_new (GFileOutputStream* stream);
PDFWriter* pdf_writer_construct (GType object_type, GFileOutputStream* stream);
void pdf_writer_write_string (PDFWriter* self, const gchar* text);
guint pdf_writer_start_object (PDFWriter* self);
gboolean page_get_is_color (Page* self);
gint page_get_depth (Page* self);
static guint8* _vala_array_dup1 (guint8* self, int length);
static guint8* _vala_array_dup2 (guint8* self, int length);
void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1);
void book_save (Book* self, const gchar* type, gint quality, GFile* file, GError** error);
gboolean book_get_needs_saving (Book* self);
static void g_cclosure_user_marshal_VOID__PAGE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void book_finalize (Book* obj);
#define PDF_WRITER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PDF_WRITER, PDFWriterPrivate))
enum {
PDF_WRITER_DUMMY_PROPERTY
};
static void pdf_writer_finalize (PDFWriter* obj);
enum {
PS_WRITER_DUMMY_PROPERTY
};
static cairo_status_t ps_writer_write_cairo_data (PsWriter* self, guint8* data, int data_length1);
static cairo_status_t _ps_writer_write_cairo_data_cairo_write_func_t (gpointer self, guchar* data, int data_length1);
static void ps_writer_finalize (PsWriter* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gpointer _page_ref0 (gpointer self) {
#line 45 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self ? page_ref (self) : NULL;
#line 244 "book.c"
}
static void _book_page_changed_cb_page_pixels_changed (Page* _sender, gpointer self) {
#line 47 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_page_changed_cb (self, _sender);
#line 251 "book.c"
}
static void _book_page_changed_cb_page_crop_changed (Page* _sender, gpointer self) {
#line 48 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_page_changed_cb (self, _sender);
#line 258 "book.c"
}
static void _page_unref0_ (gpointer var) {
#line 14 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
(var == NULL) ? NULL : (var = (page_unref (var), NULL));
#line 265 "book.c"
}
static void _g_list_free__page_unref0_ (GList* self) {
#line 14 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_list_foreach (self, (GFunc) _page_unref0_, NULL);
#line 14 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_list_free (self);
#line 274 "book.c"
}
Book* book_construct (GType object_type) {
Book* self = NULL;
#line 38 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = (Book*) g_type_create_instance (object_type);
#line 40 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
__g_list_free__page_unref0_0 (self->priv->pages);
#line 40 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = NULL;
#line 38 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self;
#line 288 "book.c"
}
Book* book_new (void) {
#line 38 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return book_construct (TYPE_BOOK);
#line 295 "book.c"
}
void book_clear (Book* self) {
GList* _tmp0_ = NULL;
#line 52 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 54 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->pages;
#line 305 "book.c"
{
GList* page_collection = NULL;
GList* page_it = NULL;
#line 54 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_collection = _tmp0_;
#line 54 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
for (page_it = page_collection; page_it != NULL; page_it = page_it->next) {
#line 313 "book.c"
Page* _tmp1_ = NULL;
Page* page = NULL;
#line 54 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _page_ref0 ((Page*) page_it->data);
#line 54 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp1_;
#line 320 "book.c"
{
Page* _tmp2_ = NULL;
guint _tmp3_ = 0U;
Page* _tmp4_ = NULL;
guint _tmp5_ = 0U;
#line 56 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = page;
#line 56 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("pixels-changed", TYPE_PAGE, &_tmp3_, NULL, FALSE);
#line 56 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _book_page_changed_cb_page_pixels_changed, self);
#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = page;
#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp5_, NULL, FALSE);
#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self);
#line 54 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
#line 340 "book.c"
}
}
}
#line 59 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
__g_list_free__page_unref0_0 (self->priv->pages);
#line 59 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = NULL;
#line 60 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "cleared");
#line 350 "book.c"
}
static void book_page_changed_cb (Book* self, Page* page) {
#line 63 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 63 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (page != NULL);
#line 65 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_set_needs_saving (self, TRUE);
#line 361 "book.c"
}
void book_append_page (Book* self, Page* page) {
Page* _tmp0_ = NULL;
Page* _tmp1_ = NULL;
Page* _tmp2_ = NULL;
Page* _tmp3_ = NULL;
Page* _tmp4_ = NULL;
#line 68 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 68 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (page != NULL);
#line 70 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = page;
#line 70 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_connect (_tmp0_, "pixels-changed", (GCallback) _book_page_changed_cb_page_pixels_changed, self);
#line 71 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = page;
#line 71 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_connect (_tmp1_, "crop-changed", (GCallback) _book_page_changed_cb_page_crop_changed, self);
#line 73 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = page;
#line 73 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = _page_ref0 (_tmp2_);
#line 73 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = g_list_append (self->priv->pages, _tmp3_);
#line 74 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = page;
#line 74 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "page-added", _tmp4_);
#line 75 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_set_needs_saving (self, TRUE);
#line 395 "book.c"
}
void book_move_page (Book* self, Page* page, guint location) {
Page* _tmp0_ = NULL;
Page* _tmp1_ = NULL;
Page* _tmp2_ = NULL;
guint _tmp3_ = 0U;
#line 78 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 78 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (page != NULL);
#line 80 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = page;
#line 80 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = g_list_remove (self->priv->pages, _tmp0_);
#line 81 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = page;
#line 81 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = _page_ref0 (_tmp1_);
#line 81 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = location;
#line 81 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = g_list_insert (self->priv->pages, _tmp2_, (gint) _tmp3_);
#line 82 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "reordered");
#line 83 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_set_needs_saving (self, TRUE);
#line 424 "book.c"
}
void book_delete_page (Book* self, Page* page) {
Page* _tmp0_ = NULL;
guint _tmp1_ = 0U;
Page* _tmp2_ = NULL;
guint _tmp3_ = 0U;
Page* _tmp4_ = NULL;
Page* _tmp5_ = NULL;
#line 86 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 86 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (page != NULL);
#line 88 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = page;
#line 88 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("pixels-changed", TYPE_PAGE, &_tmp1_, NULL, FALSE);
#line 88 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _book_page_changed_cb_page_pixels_changed, self);
#line 89 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = page;
#line 89 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp3_, NULL, FALSE);
#line 89 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self);
#line 90 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = page;
#line 90 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "page-removed", _tmp4_);
#line 91 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = page;
#line 91 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = g_list_remove (self->priv->pages, _tmp5_);
#line 92 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_set_needs_saving (self, TRUE);
#line 461 "book.c"
}
Page* book_get_page (Book* self, gint page_number) {
Page* result = NULL;
gint _tmp0_ = 0;
GList* _tmp4_ = NULL;
gint _tmp5_ = 0;
gconstpointer _tmp6_ = NULL;
Page* _tmp7_ = NULL;
#line 95 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
#line 97 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = page_number;
#line 97 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp0_ < 0) {
#line 478 "book.c"
GList* _tmp1_ = NULL;
guint _tmp2_ = 0U;
gint _tmp3_ = 0;
#line 98 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = self->priv->pages;
#line 98 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = g_list_length (_tmp1_);
#line 98 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = page_number;
#line 98 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_number = ((gint) _tmp2_) + _tmp3_;
#line 490 "book.c"
}
#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = self->priv->pages;
#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = page_number;
#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = g_list_nth_data (_tmp4_, (guint) _tmp5_);
#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = _page_ref0 ((Page*) _tmp6_);
#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp7_;
#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 504 "book.c"
}
guint book_get_page_index (Book* self, Page* page) {
guint result = 0U;
GList* _tmp0_ = NULL;
Page* _tmp1_ = NULL;
gint _tmp2_ = 0;
#line 102 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, 0U);
#line 102 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (page != NULL, 0U);
#line 104 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->pages;
#line 104 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = page;
#line 104 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = g_list_index (_tmp0_, _tmp1_);
#line 104 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = (guint) _tmp2_;
#line 104 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 527 "book.c"
}
static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) {
gint result = 0;
gchar* _result_ = NULL;
gint _tmp0_ = 0;
gunichar _tmp1_ = 0U;
gchar* _tmp2_ = NULL;
gchar* _tmp3_ = NULL;
#line 928 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
g_return_val_if_fail (self != NULL, 0);
#line 929 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp0_ = start_index;
#line 929 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp1_ = c;
#line 929 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) (-1), _tmp1_);
#line 929 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_result_ = _tmp2_;
#line 931 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp3_ = _result_;
#line 931 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
if (_tmp3_ != NULL) {
#line 552 "book.c"
gchar* _tmp4_ = NULL;
#line 932 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp4_ = _result_;
#line 932 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
result = (gint) (_tmp4_ - ((gchar*) self));
#line 932 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
return result;
#line 560 "book.c"
} else {
#line 934 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
result = -1;
#line 934 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
return result;
#line 566 "book.c"
}
}
static gchar* string_slice (const gchar* self, glong start, glong end) {
gchar* result = NULL;
glong string_length = 0L;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
glong _tmp2_ = 0L;
glong _tmp5_ = 0L;
gboolean _tmp8_ = FALSE;
glong _tmp9_ = 0L;
gboolean _tmp12_ = FALSE;
gboolean _tmp13_ = FALSE;
glong _tmp14_ = 0L;
gboolean _tmp17_ = FALSE;
glong _tmp18_ = 0L;
glong _tmp19_ = 0L;
glong _tmp20_ = 0L;
glong _tmp21_ = 0L;
glong _tmp22_ = 0L;
gchar* _tmp23_ = NULL;
#line 1189 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
g_return_val_if_fail (self != NULL, NULL);
#line 1190 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp0_ = strlen (self);
#line 1190 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp1_ = _tmp0_;
#line 1190 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
string_length = (glong) _tmp1_;
#line 1191 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp2_ = start;
#line 1191 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
if (_tmp2_ < ((glong) 0)) {
#line 602 "book.c"
glong _tmp3_ = 0L;
glong _tmp4_ = 0L;
#line 1192 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp3_ = string_length;
#line 1192 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp4_ = start;
#line 1192 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
start = _tmp3_ + _tmp4_;
#line 611 "book.c"
}
#line 1194 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp5_ = end;
#line 1194 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
if (_tmp5_ < ((glong) 0)) {
#line 617 "book.c"
glong _tmp6_ = 0L;
glong _tmp7_ = 0L;
#line 1195 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp6_ = string_length;
#line 1195 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp7_ = end;
#line 1195 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
end = _tmp6_ + _tmp7_;
#line 626 "book.c"
}
#line 1197 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp9_ = start;
#line 1197 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
if (_tmp9_ >= ((glong) 0)) {
#line 632 "book.c"
glong _tmp10_ = 0L;
glong _tmp11_ = 0L;
#line 1197 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp10_ = start;
#line 1197 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp11_ = string_length;
#line 1197 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp8_ = _tmp10_ <= _tmp11_;
#line 641 "book.c"
} else {
#line 1197 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp8_ = FALSE;
#line 645 "book.c"
}
#line 1197 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp12_ = _tmp8_;
#line 1197 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
g_return_val_if_fail (_tmp12_, NULL);
#line 1198 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp14_ = end;
#line 1198 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
if (_tmp14_ >= ((glong) 0)) {
#line 655 "book.c"
glong _tmp15_ = 0L;
glong _tmp16_ = 0L;
#line 1198 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp15_ = end;
#line 1198 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp16_ = string_length;
#line 1198 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp13_ = _tmp15_ <= _tmp16_;
#line 664 "book.c"
} else {
#line 1198 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp13_ = FALSE;
#line 668 "book.c"
}
#line 1198 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp17_ = _tmp13_;
#line 1198 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
g_return_val_if_fail (_tmp17_, NULL);
#line 1199 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp18_ = start;
#line 1199 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp19_ = end;
#line 1199 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL);
#line 1200 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp20_ = start;
#line 1200 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp21_ = end;
#line 1200 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp22_ = start;
#line 1200 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_));
#line 1200 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
result = _tmp23_;
#line 1200 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
return result;
#line 692 "book.c"
}
static GFile* book_make_indexed_file (Book* self, const gchar* uri, gint i) {
GFile* result = NULL;
guint _tmp0_ = 0U;
guint _tmp1_ = 0U;
gchar* basename = NULL;
const gchar* _tmp4_ = NULL;
gchar* _tmp5_ = NULL;
gchar* prefix = NULL;
const gchar* _tmp6_ = NULL;
gchar* _tmp7_ = NULL;
gchar* suffix = NULL;
gchar* _tmp8_ = NULL;
gint extension_index = 0;
const gchar* _tmp9_ = NULL;
gint _tmp10_ = 0;
gint _tmp11_ = 0;
gint width = 0;
guint _tmp26_ = 0U;
guint _tmp27_ = 0U;
gchar* _tmp28_ = NULL;
gchar* _tmp29_ = NULL;
gint _tmp30_ = 0;
gint _tmp31_ = 0;
gint _tmp32_ = 0;
gchar* number_format = NULL;
gint _tmp33_ = 0;
gchar* _tmp34_ = NULL;
gchar* filename = NULL;
const gchar* _tmp35_ = NULL;
gchar* _tmp36_ = NULL;
gchar* _tmp37_ = NULL;
const gchar* _tmp38_ = NULL;
gint _tmp39_ = 0;
gchar* _tmp40_ = NULL;
gchar* _tmp41_ = NULL;
gchar* _tmp42_ = NULL;
gchar* _tmp43_ = NULL;
const gchar* _tmp44_ = NULL;
gchar* _tmp45_ = NULL;
gchar* _tmp46_ = NULL;
const gchar* _tmp47_ = NULL;
GFile* _tmp48_ = NULL;
#line 107 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
#line 107 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (uri != NULL, NULL);
#line 109 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = book_get_n_pages (self);
#line 109 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _tmp0_;
#line 109 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp1_ == ((guint) 1)) {
#line 748 "book.c"
const gchar* _tmp2_ = NULL;
GFile* _tmp3_ = NULL;
#line 110 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = uri;
#line 110 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = g_file_new_for_uri (_tmp2_);
#line 110 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp3_;
#line 110 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 759 "book.c"
}
#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = uri;
#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = g_path_get_basename (_tmp4_);
#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
basename = _tmp5_;
#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = uri;
#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = g_strdup (_tmp6_);
#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
prefix = _tmp7_;
#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = g_strdup ("");
#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
suffix = _tmp8_;
#line 115 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = basename;
#line 115 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = string_last_index_of_char (_tmp9_, (gunichar) '.', 0);
#line 115 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
extension_index = _tmp10_;
#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = extension_index;
#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp11_ >= 0) {
#line 787 "book.c"
const gchar* _tmp12_ = NULL;
gint _tmp13_ = 0;
const gchar* _tmp14_ = NULL;
gint _tmp15_ = 0;
gint _tmp16_ = 0;
gchar* _tmp17_ = NULL;
const gchar* _tmp18_ = NULL;
const gchar* _tmp19_ = NULL;
gint _tmp20_ = 0;
gint _tmp21_ = 0;
const gchar* _tmp22_ = NULL;
gint _tmp23_ = 0;
gint _tmp24_ = 0;
gchar* _tmp25_ = NULL;
#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = basename;
#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = extension_index;
#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = basename;
#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = strlen (_tmp14_);
#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16_ = _tmp15_;
#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17_ = string_slice (_tmp12_, (glong) _tmp13_, (glong) _tmp16_);
#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (suffix);
#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
suffix = _tmp17_;
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp18_ = uri;
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp19_ = uri;
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp20_ = strlen (_tmp19_);
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp21_ = _tmp20_;
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp22_ = suffix;
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp23_ = strlen (_tmp22_);
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp24_ = _tmp23_;
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp25_ = string_slice (_tmp18_, (glong) 0, (glong) (_tmp21_ - _tmp24_));
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (prefix);
#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
prefix = _tmp25_;
#line 838 "book.c"
}
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp26_ = book_get_n_pages (self);
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp27_ = _tmp26_;
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp28_ = g_strdup_printf ("%u", _tmp27_);
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp29_ = _tmp28_;
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp30_ = strlen (_tmp29_);
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp31_ = _tmp30_;
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp32_ = _tmp31_;
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp29_);
#line 121 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width = _tmp32_;
#line 122 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp33_ = width;
#line 122 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp34_ = g_strdup_printf ("%%0%dd", _tmp33_);
#line 122 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
number_format = _tmp34_;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp35_ = prefix;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp36_ = g_strconcat (_tmp35_, "-", NULL);
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp37_ = _tmp36_;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp38_ = number_format;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp39_ = i;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp40_ = g_strdup_printf (_tmp38_, _tmp39_ + 1);
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp41_ = _tmp40_;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp42_ = g_strconcat (_tmp37_, _tmp41_, NULL);
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp43_ = _tmp42_;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp44_ = suffix;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp45_ = g_strconcat (_tmp43_, _tmp44_, NULL);
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp46_ = _tmp45_;
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp43_);
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp41_);
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp37_);
#line 123 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
filename = _tmp46_;
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp47_ = filename;
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp48_ = g_file_new_for_uri (_tmp47_);
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp48_;
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (filename);
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (number_format);
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (suffix);
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (prefix);
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (basename);
#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 914 "book.c"
}
static void book_save_multi_file (Book* self, const gchar* type, gint quality, GFile* file, GError** error) {
GError * _inner_error_ = NULL;
#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (type != NULL);
#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (file != NULL);
#line 926 "book.c"
{
gint i = 0;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = 0;
#line 931 "book.c"
{
gboolean _tmp0_ = FALSE;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = TRUE;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 938 "book.c"
gboolean _tmp1_ = FALSE;
gint _tmp3_ = 0;
guint _tmp4_ = 0U;
guint _tmp5_ = 0U;
Page* page = NULL;
gint _tmp6_ = 0;
Page* _tmp7_ = NULL;
Page* _tmp8_ = NULL;
const gchar* _tmp9_ = NULL;
gint _tmp10_ = 0;
GFile* _tmp11_ = NULL;
gchar* _tmp12_ = NULL;
gchar* _tmp13_ = NULL;
gint _tmp14_ = 0;
GFile* _tmp15_ = NULL;
GFile* _tmp16_ = NULL;
gint _tmp17_ = 0;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _tmp0_;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp1_) {
#line 960 "book.c"
gint _tmp2_ = 0;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = i;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = _tmp2_ + 1;
#line 966 "book.c"
}
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = FALSE;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = i;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = book_get_n_pages (self);
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = _tmp4_;
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(((guint) _tmp3_) < _tmp5_)) {
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 980 "book.c"
}
#line 131 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = i;
#line 131 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = book_get_page (self, _tmp6_);
#line 131 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp7_;
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = page;
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = type;
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = quality;
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = file;
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = g_file_get_uri (_tmp11_);
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = _tmp12_;
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = i;
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = book_make_indexed_file (self, _tmp13_, _tmp14_);
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16_ = _tmp15_;
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_save (_tmp8_, _tmp9_, _tmp10_, _tmp16_, &_inner_error_);
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (_tmp16_);
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp13_);
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
#line 1020 "book.c"
}
#line 133 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17_ = i;
#line 133 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "saving", _tmp17_);
#line 129 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
#line 1028 "book.c"
}
}
}
}
static void book_save_ps_pdf_surface (Book* self, cairo_surface_t* surface, GdkPixbuf* image, gdouble dpi) {
cairo_t* context = NULL;
cairo_surface_t* _tmp0_ = NULL;
cairo_t* _tmp1_ = NULL;
gdouble _tmp2_ = 0.0;
gdouble _tmp3_ = 0.0;
GdkPixbuf* _tmp4_ = NULL;
cairo_pattern_t* _tmp5_ = NULL;
#line 137 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 137 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (surface != NULL);
#line 137 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (image != NULL);
#line 139 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = surface;
#line 139 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = cairo_create (_tmp0_);
#line 139 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
context = _tmp1_;
#line 140 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = dpi;
#line 140 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = dpi;
#line 140 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_scale (context, 72.0 / _tmp2_, 72.0 / _tmp3_);
#line 141 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = image;
#line 141 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
gdk_cairo_set_source_pixbuf (context, _tmp4_, (gdouble) 0, (gdouble) 0);
#line 142 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = cairo_get_source (context);
#line 142 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_pattern_set_filter (_tmp5_, CAIRO_FILTER_BEST);
#line 143 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_paint (context);
#line 137 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_cairo_destroy0 (context);
#line 1073 "book.c"
}
static gpointer _cairo_surface_reference0 (gpointer self) {
#line 150 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self ? cairo_surface_reference (self) : NULL;
#line 1080 "book.c"
}
static void book_save_ps (Book* self, GFile* file, GError** error) {
GFileOutputStream* stream = NULL;
GFile* _tmp0_ = NULL;
GFileOutputStream* _tmp1_ = NULL;
PsWriter* writer = NULL;
PsWriter* _tmp2_ = NULL;
cairo_surface_t* surface = NULL;
PsWriter* _tmp3_ = NULL;
cairo_surface_t* _tmp4_ = NULL;
cairo_surface_t* _tmp5_ = NULL;
GError * _inner_error_ = NULL;
#line 146 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 146 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (file != NULL);
#line 148 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = file;
#line 148 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_);
#line 148 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream = _tmp1_;
#line 148 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 148 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
#line 148 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
#line 1111 "book.c"
}
#line 149 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = ps_writer_new (stream);
#line 149 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
writer = _tmp2_;
#line 150 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = writer;
#line 150 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = _tmp3_->surface;
#line 150 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = _cairo_surface_reference0 (_tmp4_);
#line 150 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
surface = _tmp5_;
#line 1125 "book.c"
{
gint i = 0;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = 0;
#line 1130 "book.c"
{
gboolean _tmp6_ = FALSE;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = TRUE;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 1137 "book.c"
gboolean _tmp7_ = FALSE;
gint _tmp9_ = 0;
guint _tmp10_ = 0U;
guint _tmp11_ = 0U;
Page* page = NULL;
gint _tmp12_ = 0;
Page* _tmp13_ = NULL;
GdkPixbuf* image = NULL;
Page* _tmp14_ = NULL;
GdkPixbuf* _tmp15_ = NULL;
gdouble width = 0.0;
GdkPixbuf* _tmp16_ = NULL;
gint _tmp17_ = 0;
Page* _tmp18_ = NULL;
gint _tmp19_ = 0;
gint _tmp20_ = 0;
gdouble height = 0.0;
GdkPixbuf* _tmp21_ = NULL;
gint _tmp22_ = 0;
Page* _tmp23_ = NULL;
gint _tmp24_ = 0;
gint _tmp25_ = 0;
cairo_surface_t* _tmp26_ = NULL;
gdouble _tmp27_ = 0.0;
gdouble _tmp28_ = 0.0;
cairo_surface_t* _tmp29_ = NULL;
GdkPixbuf* _tmp30_ = NULL;
Page* _tmp31_ = NULL;
gint _tmp32_ = 0;
gint _tmp33_ = 0;
cairo_surface_t* _tmp34_ = NULL;
gint _tmp35_ = 0;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = _tmp6_;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp7_) {
#line 1174 "book.c"
gint _tmp8_ = 0;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = i;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = _tmp8_ + 1;
#line 1180 "book.c"
}
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = FALSE;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = i;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = book_get_n_pages (self);
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = _tmp10_;
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(((guint) _tmp9_) < _tmp11_)) {
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 1194 "book.c"
}
#line 154 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = i;
#line 154 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = book_get_page (self, _tmp12_);
#line 154 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp13_;
#line 155 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = page;
#line 155 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = page_get_image (_tmp14_, TRUE);
#line 155 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
image = _tmp15_;
#line 156 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16_ = image;
#line 156 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17_ = gdk_pixbuf_get_width (_tmp16_);
#line 156 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp18_ = page;
#line 156 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp19_ = page_get_dpi (_tmp18_);
#line 156 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp20_ = _tmp19_;
#line 156 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width = (_tmp17_ * 72.0) / _tmp20_;
#line 157 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp21_ = image;
#line 157 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp22_ = gdk_pixbuf_get_height (_tmp21_);
#line 157 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp23_ = page;
#line 157 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp24_ = page_get_dpi (_tmp23_);
#line 157 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp25_ = _tmp24_;
#line 157 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height = (_tmp22_ * 72.0) / _tmp25_;
#line 158 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp26_ = surface;
#line 158 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp27_ = width;
#line 158 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp28_ = height;
#line 158 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_ps_surface_set_size (_tmp26_, _tmp27_, _tmp28_);
#line 159 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp29_ = surface;
#line 159 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp30_ = image;
#line 159 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp31_ = page;
#line 159 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp32_ = page_get_dpi (_tmp31_);
#line 159 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp33_ = _tmp32_;
#line 159 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_save_ps_pdf_surface (self, _tmp29_, _tmp30_, (gdouble) _tmp33_);
#line 160 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp34_ = surface;
#line 160 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_surface_show_page (_tmp34_);
#line 161 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp35_ = i;
#line 161 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "saving", _tmp35_);
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (image);
#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
#line 1264 "book.c"
}
}
}
#line 146 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_cairo_surface_destroy0 (surface);
#line 146 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_ps_writer_unref0 (writer);
#line 146 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (stream);
#line 1274 "book.c"
}
static guint8* book_compress_zlib (Book* self, guint8* data, int data_length1, int* result_length1) {
guint8* result = NULL;
z_stream stream = {0};
guint8* out_data = NULL;
guint8* _tmp0_ = NULL;
gint _tmp0__length1 = 0;
guint8* _tmp1_ = NULL;
gint out_data_length1 = 0;
gint _out_data_size_ = 0;
guint8* _tmp2_ = NULL;
gint _tmp2__length1 = 0;
guint8* _tmp3_ = NULL;
gint _tmp3__length1 = 0;
z_stream _tmp7_ = {0};
guint _tmp8_ = 0U;
guint n_written = 0U;
guint8* _tmp10_ = NULL;
gint _tmp10__length1 = 0;
z_stream _tmp11_ = {0};
guint _tmp12_ = 0U;
guint _tmp13_ = 0U;
gint _tmp14_ = 0;
guint8* _tmp15_ = NULL;
gint _tmp15__length1 = 0;
#line 165 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
#line 167 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
deflateInit (&stream, (gint) Z_BEST_COMPRESSION);
#line 168 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = data;
#line 168 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0__length1 = data_length1;
#line 168 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_new0 (guint8, _tmp0__length1);
#line 168 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data = _tmp1_;
#line 168 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data_length1 = _tmp0__length1;
#line 168 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_out_data_size_ = out_data_length1;
#line 170 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = data;
#line 170 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2__length1 = data_length1;
#line 170 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream.next_in = _tmp2_;
#line 170 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream.avail_in = _tmp2__length1;
#line 171 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = out_data;
#line 171 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3__length1 = out_data_length1;
#line 171 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream.next_out = _tmp3_;
#line 171 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream.avail_out = _tmp3__length1;
#line 172 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 1336 "book.c"
z_stream _tmp4_ = {0};
guint _tmp5_ = 0U;
gint _tmp6_ = 0;
#line 172 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = stream;
#line 172 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = _tmp4_.avail_in;
#line 172 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp5_ > ((guint) 0))) {
#line 172 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 1348 "book.c"
}
#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = deflate (&stream, (gint) Z_FINISH);
#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp6_ == ((gint) Z_STREAM_ERROR)) {
#line 175 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 1356 "book.c"
}
}
#line 178 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = stream;
#line 178 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = _tmp7_.avail_in;
#line 178 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp8_ > ((guint) 0)) {
#line 1365 "book.c"
guint8* _tmp9_ = NULL;
gint _tmp9__length1 = 0;
#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = NULL;
#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9__length1 = 0;
#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (result_length1) {
#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*result_length1 = _tmp9__length1;
#line 1376 "book.c"
}
#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp9_;
#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data = (g_free (out_data), NULL);
#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
deflateEnd (&stream);
#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 1386 "book.c"
}
#line 181 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = data;
#line 181 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10__length1 = data_length1;
#line 181 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = stream;
#line 181 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = _tmp11_.avail_out;
#line 181 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
n_written = _tmp10__length1 - _tmp12_;
#line 182 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = n_written;
#line 182 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = (gint) _tmp13_;
#line 182 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data = g_renew (guint8, out_data, (gint) _tmp13_);
#line 182 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
(_tmp14_ > out_data_length1) ? memset (out_data + out_data_length1, 0, sizeof (guint8) * (_tmp14_ - out_data_length1)) : NULL;
#line 182 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data_length1 = _tmp14_;
#line 182 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_out_data_size_ = _tmp14_;
#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = out_data;
#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15__length1 = out_data_length1;
#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (result_length1) {
#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*result_length1 = _tmp15__length1;
#line 1418 "book.c"
}
#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp15_;
#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
deflateEnd (&stream);
#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 1426 "book.c"
}
static gboolean _book_write_pixbuf_data_gdk_pixbuf_save_func (guint8* buf, gsize buf_length1, GError** error, gpointer self) {
gboolean result;
result = book_write_pixbuf_data (self, buf, buf_length1, error);
#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 1435 "book.c"
}
static guint8* book_compress_jpeg (Book* self, GdkPixbuf* image, gint quality, gint dpi, int* result_length1) {
guint8* result = NULL;
GByteArray* _tmp0_ = NULL;
gchar** keys = NULL;
gchar* _tmp1_ = NULL;
gchar* _tmp2_ = NULL;
gchar* _tmp3_ = NULL;
gchar* _tmp4_ = NULL;
gchar** _tmp5_ = NULL;
gint keys_length1 = 0;
gint _keys_size_ = 0;
gchar** values = NULL;
gint _tmp6_ = 0;
gchar* _tmp7_ = NULL;
gchar* _tmp8_ = NULL;
gint _tmp9_ = 0;
gchar* _tmp10_ = NULL;
gint _tmp11_ = 0;
gchar* _tmp12_ = NULL;
gchar** _tmp13_ = NULL;
gint values_length1 = 0;
gint _values_size_ = 0;
guint8* data = NULL;
GByteArray* _tmp15_ = NULL;
guint8* _tmp16_ = NULL;
gint _tmp16__length1 = 0;
gint data_length1 = 0;
gint _data_size_ = 0;
guint8* _tmp17_ = NULL;
gint _tmp17__length1 = 0;
GError * _inner_error_ = NULL;
#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (image != NULL, NULL);
#line 191 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = g_byte_array_new ();
#line 191 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_byte_array_unref0 (self->priv->jpeg_data);
#line 191 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->jpeg_data = _tmp0_;
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_strdup ("quality");
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = g_strdup ("density-unit");
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = g_strdup ("x-density");
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = g_strdup ("y-density");
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = g_new0 (gchar*, 5 + 1);
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_[0] = _tmp1_;
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_[1] = _tmp2_;
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_[2] = _tmp3_;
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_[3] = _tmp4_;
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_[4] = NULL;
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
keys = _tmp5_;
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
keys_length1 = 5;
#line 192 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_keys_size_ = keys_length1;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = quality;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = g_strdup_printf ("%d", _tmp6_);
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = g_strdup ("dots-per-inch");
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = dpi;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = g_strdup_printf ("%d", _tmp9_);
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = dpi;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = g_strdup_printf ("%d", _tmp11_);
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = g_new0 (gchar*, 5 + 1);
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_[0] = _tmp7_;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_[1] = _tmp8_;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_[2] = _tmp10_;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_[3] = _tmp12_;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_[4] = NULL;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
values = _tmp13_;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
values_length1 = 5;
#line 193 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_values_size_ = values_length1;
#line 1538 "book.c"
{
GdkPixbuf* _tmp14_ = NULL;
#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = image;
#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
gdk_pixbuf_save_to_callbackv (_tmp14_, _book_write_pixbuf_data_gdk_pixbuf_save_func, self, "jpeg", keys, values, &_inner_error_);
#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 1547 "book.c"
goto __catch0_g_error;
}
}
goto __finally0;
__catch0_g_error:
{
GError* e = NULL;
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
e = _inner_error_;
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_inner_error_ = NULL;
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_error_free0 (e);
#line 1561 "book.c"
}
__finally0:
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_clear_error (&_inner_error_);
#line 194 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
#line 1576 "book.c"
}
#line 201 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = self->priv->jpeg_data;
#line 201 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16_ = _tmp15_->data;
#line 201 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16__length1 = _tmp15_->len;
#line 201 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_->data = NULL;
#line 201 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp16_;
#line 201 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp16__length1;
#line 201 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
#line 202 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_byte_array_unref0 (self->priv->jpeg_data);
#line 202 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->jpeg_data = NULL;
#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17_ = data;
#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17__length1 = data_length1;
#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (result_length1) {
#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*result_length1 = _tmp17__length1;
#line 1604 "book.c"
}
#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp17_;
#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 1614 "book.c"
}
static gboolean book_write_pixbuf_data (Book* self, guint8* buf, int buf_length1, GError** error) {
gboolean result = FALSE;
GByteArray* _tmp0_ = NULL;
guint8* _tmp1_ = NULL;
gint _tmp1__length1 = 0;
#line 207 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, FALSE);
#line 209 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->jpeg_data;
#line 209 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = buf;
#line 209 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1__length1 = buf_length1;
#line 209 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_byte_array_append (_tmp0_, _tmp1_, _tmp1__length1);
#line 210 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = TRUE;
#line 210 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 1637 "book.c"
}
static guint8* _vala_array_dup1 (guint8* self, int length) {
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_memdup (self, length * sizeof (guint8));
#line 1644 "book.c"
}
static guint8* _vala_array_dup2 (guint8* self, int length) {
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_memdup (self, length * sizeof (guint8));
#line 1651 "book.c"
}
static void book_save_pdf (Book* self, GFile* file, gint quality, GError** error) {
GFileOutputStream* stream = NULL;
GFile* _tmp0_ = NULL;
GFileOutputStream* _tmp1_ = NULL;
PDFWriter* writer = NULL;
PDFWriter* _tmp2_ = NULL;
PDFWriter* _tmp3_ = NULL;
PDFWriter* _tmp4_ = NULL;
guint catalog_number = 0U;
PDFWriter* _tmp5_ = NULL;
guint _tmp6_ = 0U;
PDFWriter* _tmp7_ = NULL;
guint _tmp8_ = 0U;
gchar* _tmp9_ = NULL;
gchar* _tmp10_ = NULL;
PDFWriter* _tmp11_ = NULL;
PDFWriter* _tmp12_ = NULL;
PDFWriter* _tmp13_ = NULL;
guint _tmp14_ = 0U;
gchar* _tmp15_ = NULL;
gchar* _tmp16_ = NULL;
PDFWriter* _tmp17_ = NULL;
PDFWriter* _tmp18_ = NULL;
PDFWriter* _tmp19_ = NULL;
guint pages_number = 0U;
PDFWriter* _tmp20_ = NULL;
guint _tmp21_ = 0U;
PDFWriter* _tmp22_ = NULL;
guint _tmp23_ = 0U;
gchar* _tmp24_ = NULL;
gchar* _tmp25_ = NULL;
PDFWriter* _tmp26_ = NULL;
PDFWriter* _tmp27_ = NULL;
PDFWriter* _tmp28_ = NULL;
PDFWriter* _tmp40_ = NULL;
PDFWriter* _tmp41_ = NULL;
guint _tmp42_ = 0U;
guint _tmp43_ = 0U;
gchar* _tmp44_ = NULL;
gchar* _tmp45_ = NULL;
PDFWriter* _tmp46_ = NULL;
PDFWriter* _tmp47_ = NULL;
PDFWriter* _tmp361_ = NULL;
guint info_number = 0U;
PDFWriter* _tmp362_ = NULL;
guint _tmp363_ = 0U;
PDFWriter* _tmp364_ = NULL;
guint _tmp365_ = 0U;
gchar* _tmp366_ = NULL;
gchar* _tmp367_ = NULL;
PDFWriter* _tmp368_ = NULL;
PDFWriter* _tmp369_ = NULL;
gchar* _tmp370_ = NULL;
gchar* _tmp371_ = NULL;
PDFWriter* _tmp372_ = NULL;
PDFWriter* _tmp373_ = NULL;
gsize xref_offset = 0UL;
PDFWriter* _tmp374_ = NULL;
gsize _tmp375_ = 0UL;
PDFWriter* _tmp376_ = NULL;
PDFWriter* _tmp377_ = NULL;
PDFWriter* _tmp378_ = NULL;
GList* _tmp379_ = NULL;
guint _tmp380_ = 0U;
gchar* _tmp381_ = NULL;
gchar* _tmp382_ = NULL;
PDFWriter* _tmp383_ = NULL;
GList* _tmp384_ = NULL;
PDFWriter* _tmp389_ = NULL;
PDFWriter* _tmp390_ = NULL;
PDFWriter* _tmp391_ = NULL;
PDFWriter* _tmp392_ = NULL;
GList* _tmp393_ = NULL;
guint _tmp394_ = 0U;
gchar* _tmp395_ = NULL;
gchar* _tmp396_ = NULL;
PDFWriter* _tmp397_ = NULL;
guint _tmp398_ = 0U;
gchar* _tmp399_ = NULL;
gchar* _tmp400_ = NULL;
PDFWriter* _tmp401_ = NULL;
guint _tmp402_ = 0U;
gchar* _tmp403_ = NULL;
gchar* _tmp404_ = NULL;
PDFWriter* _tmp405_ = NULL;
PDFWriter* _tmp406_ = NULL;
PDFWriter* _tmp407_ = NULL;
gsize _tmp408_ = 0UL;
gchar* _tmp409_ = NULL;
gchar* _tmp410_ = NULL;
PDFWriter* _tmp411_ = NULL;
GError * _inner_error_ = NULL;
#line 213 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 213 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (file != NULL);
#line 215 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = file;
#line 215 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_);
#line 215 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream = _tmp1_;
#line 215 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 215 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
#line 215 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
#line 1763 "book.c"
}
#line 216 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = pdf_writer_new (stream);
#line 216 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
writer = _tmp2_;
#line 219 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = writer;
#line 219 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp3_, "%PDF-1.3\n");
#line 222 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = writer;
#line 222 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp4_, "%\xe2\xe3\xcf\xd3\n");
#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = writer;
#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = pdf_writer_start_object (_tmp5_);
#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
catalog_number = _tmp6_;
#line 226 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = writer;
#line 226 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = catalog_number;
#line 226 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = g_strdup_printf ("%u 0 obj\n", _tmp8_);
#line 226 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = _tmp9_;
#line 226 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp7_, _tmp10_);
#line 226 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp10_);
#line 227 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = writer;
#line 227 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp11_, "<<\n");
#line 228 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = writer;
#line 228 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp12_, "/Type /Catalog\n");
#line 230 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = writer;
#line 230 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = catalog_number;
#line 230 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = g_strdup_printf ("/Pages %u 0 R\n", _tmp14_ + 1);
#line 230 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16_ = _tmp15_;
#line 230 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp13_, _tmp16_);
#line 230 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp16_);
#line 231 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17_ = writer;
#line 231 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp17_, ">>\n");
#line 232 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp18_ = writer;
#line 232 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp18_, "endobj\n");
#line 250 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp19_ = writer;
#line 250 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp19_, "\n");
#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp20_ = writer;
#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp21_ = pdf_writer_start_object (_tmp20_);
#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pages_number = _tmp21_;
#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp22_ = writer;
#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp23_ = pages_number;
#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp24_ = g_strdup_printf ("%u 0 obj\n", _tmp23_);
#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp25_ = _tmp24_;
#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp22_, _tmp25_);
#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp25_);
#line 253 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp26_ = writer;
#line 253 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp26_, "<<\n");
#line 254 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp27_ = writer;
#line 254 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp27_, "/Type /Pages\n");
#line 255 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp28_ = writer;
#line 255 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp28_, "/Kids [");
#line 1857 "book.c"
{
gint i = 0;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = 0;
#line 1862 "book.c"
{
gboolean _tmp29_ = FALSE;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp29_ = TRUE;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 1869 "book.c"
gboolean _tmp30_ = FALSE;
gint _tmp32_ = 0;
guint _tmp33_ = 0U;
guint _tmp34_ = 0U;
PDFWriter* _tmp35_ = NULL;
guint _tmp36_ = 0U;
gint _tmp37_ = 0;
gchar* _tmp38_ = NULL;
gchar* _tmp39_ = NULL;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp30_ = _tmp29_;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp30_) {
#line 1883 "book.c"
gint _tmp31_ = 0;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp31_ = i;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = _tmp31_ + 1;
#line 1889 "book.c"
}
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp29_ = FALSE;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp32_ = i;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp33_ = book_get_n_pages (self);
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp34_ = _tmp33_;
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(((guint) _tmp32_) < _tmp34_)) {
#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 1903 "book.c"
}
#line 257 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp35_ = writer;
#line 257 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp36_ = pages_number;
#line 257 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp37_ = i;
#line 257 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp38_ = g_strdup_printf (" %u 0 R", (_tmp36_ + 1) + (_tmp37_ * 3));
#line 257 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp39_ = _tmp38_;
#line 257 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp35_, _tmp39_);
#line 257 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp39_);
#line 1919 "book.c"
}
}
}
#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp40_ = writer;
#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp40_, " ]\n");
#line 259 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp41_ = writer;
#line 259 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp42_ = book_get_n_pages (self);
#line 259 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp43_ = _tmp42_;
#line 259 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp44_ = g_strdup_printf ("/Count %u\n", _tmp43_);
#line 259 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp45_ = _tmp44_;
#line 259 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp41_, _tmp45_);
#line 259 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp45_);
#line 260 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp46_ = writer;
#line 260 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp46_, ">>\n");
#line 261 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp47_ = writer;
#line 261 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp47_, "endobj\n");
#line 1949 "book.c"
{
gint i = 0;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = 0;
#line 1954 "book.c"
{
gboolean _tmp48_ = FALSE;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp48_ = TRUE;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 1961 "book.c"
gboolean _tmp49_ = FALSE;
gint _tmp51_ = 0;
guint _tmp52_ = 0U;
guint _tmp53_ = 0U;
Page* page = NULL;
gint _tmp54_ = 0;
Page* _tmp55_ = NULL;
GdkPixbuf* image = NULL;
Page* _tmp56_ = NULL;
GdkPixbuf* _tmp57_ = NULL;
gint width = 0;
GdkPixbuf* _tmp58_ = NULL;
gint _tmp59_ = 0;
gint height = 0;
GdkPixbuf* _tmp60_ = NULL;
gint _tmp61_ = 0;
guint8* pixels = NULL;
GdkPixbuf* _tmp62_ = NULL;
guint8* _tmp63_ = NULL;
gint pixels_length1 = 0;
gint _pixels_size_ = 0;
gdouble page_width = 0.0;
gint _tmp64_ = 0;
Page* _tmp65_ = NULL;
gint _tmp66_ = 0;
gint _tmp67_ = 0;
gdouble page_height = 0.0;
gint _tmp68_ = 0;
Page* _tmp69_ = NULL;
gint _tmp70_ = 0;
gint _tmp71_ = 0;
gint depth = 0;
gchar* color_space = NULL;
gchar* _tmp72_ = NULL;
gchar* filter = NULL;
gchar* width_buffer = NULL;
gchar* _tmp73_ = NULL;
gint width_buffer_length1 = 0;
gint _width_buffer_size_ = 0;
gchar* height_buffer = NULL;
gchar* _tmp74_ = NULL;
gint height_buffer_length1 = 0;
gint _height_buffer_size_ = 0;
guint8* data = NULL;
gint data_length1 = 0;
gint _data_size_ = 0;
Page* _tmp75_ = NULL;
gboolean _tmp76_ = FALSE;
gboolean _tmp77_ = FALSE;
guint8* compressed_data = NULL;
guint8* _tmp235_ = NULL;
gint _tmp235__length1 = 0;
gint _tmp236_ = 0;
guint8* _tmp237_ = NULL;
gint compressed_data_length1 = 0;
gint _compressed_data_size_ = 0;
guint8* _tmp238_ = NULL;
gint _tmp238__length1 = 0;
PDFWriter* _tmp256_ = NULL;
guint number = 0U;
PDFWriter* _tmp257_ = NULL;
guint _tmp258_ = 0U;
PDFWriter* _tmp259_ = NULL;
guint _tmp260_ = 0U;
gchar* _tmp261_ = NULL;
gchar* _tmp262_ = NULL;
PDFWriter* _tmp263_ = NULL;
PDFWriter* _tmp264_ = NULL;
PDFWriter* _tmp265_ = NULL;
guint _tmp266_ = 0U;
gchar* _tmp267_ = NULL;
gchar* _tmp268_ = NULL;
PDFWriter* _tmp269_ = NULL;
gint _tmp270_ = 0;
guint _tmp271_ = 0U;
gchar* _tmp272_ = NULL;
gchar* _tmp273_ = NULL;
PDFWriter* _tmp274_ = NULL;
gdouble _tmp275_ = 0.0;
gchar* _tmp276_ = NULL;
gint _tmp276__length1 = 0;
const gchar* _tmp277_ = NULL;
gdouble _tmp278_ = 0.0;
gchar* _tmp279_ = NULL;
gint _tmp279__length1 = 0;
const gchar* _tmp280_ = NULL;
gchar* _tmp281_ = NULL;
gchar* _tmp282_ = NULL;
PDFWriter* _tmp283_ = NULL;
guint _tmp284_ = 0U;
gchar* _tmp285_ = NULL;
gchar* _tmp286_ = NULL;
PDFWriter* _tmp287_ = NULL;
PDFWriter* _tmp288_ = NULL;
PDFWriter* _tmp289_ = NULL;
PDFWriter* _tmp290_ = NULL;
guint _tmp291_ = 0U;
PDFWriter* _tmp292_ = NULL;
guint _tmp293_ = 0U;
gchar* _tmp294_ = NULL;
gchar* _tmp295_ = NULL;
PDFWriter* _tmp296_ = NULL;
PDFWriter* _tmp297_ = NULL;
PDFWriter* _tmp298_ = NULL;
PDFWriter* _tmp299_ = NULL;
gint _tmp300_ = 0;
gchar* _tmp301_ = NULL;
gchar* _tmp302_ = NULL;
PDFWriter* _tmp303_ = NULL;
gint _tmp304_ = 0;
gchar* _tmp305_ = NULL;
gchar* _tmp306_ = NULL;
PDFWriter* _tmp307_ = NULL;
const gchar* _tmp308_ = NULL;
gchar* _tmp309_ = NULL;
gchar* _tmp310_ = NULL;
PDFWriter* _tmp311_ = NULL;
gint _tmp312_ = 0;
gchar* _tmp313_ = NULL;
gchar* _tmp314_ = NULL;
PDFWriter* _tmp315_ = NULL;
guint8* _tmp316_ = NULL;
gint _tmp316__length1 = 0;
gchar* _tmp317_ = NULL;
gchar* _tmp318_ = NULL;
const gchar* _tmp319_ = NULL;
PDFWriter* _tmp324_ = NULL;
PDFWriter* _tmp325_ = NULL;
PDFWriter* _tmp326_ = NULL;
guint8* _tmp327_ = NULL;
gint _tmp327__length1 = 0;
PDFWriter* _tmp328_ = NULL;
PDFWriter* _tmp329_ = NULL;
PDFWriter* _tmp330_ = NULL;
gchar* command = NULL;
gdouble _tmp331_ = 0.0;
gchar* _tmp332_ = NULL;
gint _tmp332__length1 = 0;
const gchar* _tmp333_ = NULL;
gdouble _tmp334_ = 0.0;
gchar* _tmp335_ = NULL;
gint _tmp335__length1 = 0;
const gchar* _tmp336_ = NULL;
gint _tmp337_ = 0;
gchar* _tmp338_ = NULL;
PDFWriter* _tmp339_ = NULL;
PDFWriter* _tmp340_ = NULL;
guint _tmp341_ = 0U;
PDFWriter* _tmp342_ = NULL;
guint _tmp343_ = 0U;
gchar* _tmp344_ = NULL;
gchar* _tmp345_ = NULL;
PDFWriter* _tmp346_ = NULL;
PDFWriter* _tmp347_ = NULL;
const gchar* _tmp348_ = NULL;
gint _tmp349_ = 0;
gint _tmp350_ = 0;
gchar* _tmp351_ = NULL;
gchar* _tmp352_ = NULL;
PDFWriter* _tmp353_ = NULL;
PDFWriter* _tmp354_ = NULL;
PDFWriter* _tmp355_ = NULL;
const gchar* _tmp356_ = NULL;
PDFWriter* _tmp357_ = NULL;
PDFWriter* _tmp358_ = NULL;
PDFWriter* _tmp359_ = NULL;
gint _tmp360_ = 0;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp49_ = _tmp48_;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp49_) {
#line 2133 "book.c"
gint _tmp50_ = 0;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp50_ = i;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = _tmp50_ + 1;
#line 2139 "book.c"
}
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp48_ = FALSE;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp51_ = i;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp52_ = book_get_n_pages (self);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp53_ = _tmp52_;
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(((guint) _tmp51_) < _tmp53_)) {
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 2153 "book.c"
}
#line 265 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp54_ = i;
#line 265 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp55_ = book_get_page (self, _tmp54_);
#line 265 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp55_;
#line 266 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp56_ = page;
#line 266 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp57_ = page_get_image (_tmp56_, TRUE);
#line 266 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
image = _tmp57_;
#line 267 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp58_ = image;
#line 267 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp59_ = gdk_pixbuf_get_width (_tmp58_);
#line 267 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width = _tmp59_;
#line 268 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp60_ = image;
#line 268 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp61_ = gdk_pixbuf_get_height (_tmp60_);
#line 268 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height = _tmp61_;
#line 269 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp62_ = image;
#line 269 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp63_ = gdk_pixbuf_get_pixels (_tmp62_);
#line 269 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pixels = _tmp63_;
#line 269 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pixels_length1 = -1;
#line 269 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_pixels_size_ = pixels_length1;
#line 270 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp64_ = width;
#line 270 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp65_ = page;
#line 270 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp66_ = page_get_dpi (_tmp65_);
#line 270 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp67_ = _tmp66_;
#line 270 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_width = (_tmp64_ * 72.0) / _tmp67_;
#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp68_ = height;
#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp69_ = page;
#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp70_ = page_get_dpi (_tmp69_);
#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp71_ = _tmp70_;
#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_height = (_tmp68_ * 72.0) / _tmp71_;
#line 273 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 8;
#line 274 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp72_ = g_strdup ("DeviceRGB");
#line 274 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp72_;
#line 275 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
filter = NULL;
#line 276 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp73_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
#line 276 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width_buffer = _tmp73_;
#line 276 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width_buffer_length1 = G_ASCII_DTOSTR_BUF_SIZE;
#line 276 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_width_buffer_size_ = width_buffer_length1;
#line 277 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp74_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
#line 277 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height_buffer = _tmp74_;
#line 277 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height_buffer_length1 = G_ASCII_DTOSTR_BUF_SIZE;
#line 277 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_height_buffer_size_ = height_buffer_length1;
#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp75_ = page;
#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp76_ = page_get_is_color (_tmp75_);
#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp77_ = _tmp76_;
#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp77_) {
#line 2241 "book.c"
gchar* _tmp78_ = NULL;
gint data_length = 0;
gint _tmp79_ = 0;
gint _tmp80_ = 0;
gint _tmp81_ = 0;
guint8* _tmp82_ = NULL;
#line 281 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 8;
#line 282 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp78_ = g_strdup ("DeviceRGB");
#line 282 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
#line 282 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp78_;
#line 283 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp79_ = height;
#line 283 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp80_ = width;
#line 283 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length = (_tmp79_ * _tmp80_) * 3;
#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp81_ = data_length;
#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp82_ = g_new0 (guint8, _tmp81_);
#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp82_;
#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp81_;
#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
#line 2274 "book.c"
{
gint row = 0;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = 0;
#line 2279 "book.c"
{
gboolean _tmp83_ = FALSE;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp83_ = TRUE;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 2286 "book.c"
gboolean _tmp84_ = FALSE;
gint _tmp86_ = 0;
gint _tmp87_ = 0;
gint in_offset = 0;
gint _tmp88_ = 0;
GdkPixbuf* _tmp89_ = NULL;
gint _tmp90_ = 0;
gint out_offset = 0;
gint _tmp91_ = 0;
gint _tmp92_ = 0;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp84_ = _tmp83_;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp84_) {
#line 2301 "book.c"
gint _tmp85_ = 0;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp85_ = row;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = _tmp85_ + 1;
#line 2307 "book.c"
}
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp83_ = FALSE;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp86_ = row;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp87_ = height;
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp86_ < _tmp87_)) {
#line 285 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 2319 "book.c"
}
#line 287 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp88_ = row;
#line 287 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp89_ = image;
#line 287 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp90_ = gdk_pixbuf_get_rowstride (_tmp89_);
#line 287 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_offset = _tmp88_ * _tmp90_;
#line 288 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp91_ = row;
#line 288 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp92_ = width;
#line 288 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_offset = (_tmp91_ * _tmp92_) * 3;
#line 2335 "book.c"
{
gint x = 0;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = 0;
#line 2340 "book.c"
{
gboolean _tmp93_ = FALSE;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp93_ = TRUE;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 2347 "book.c"
gboolean _tmp94_ = FALSE;
gint _tmp96_ = 0;
gint _tmp97_ = 0;
gint in_o = 0;
gint _tmp98_ = 0;
gint _tmp99_ = 0;
gint out_o = 0;
gint _tmp100_ = 0;
gint _tmp101_ = 0;
guint8* _tmp102_ = NULL;
gint _tmp102__length1 = 0;
gint _tmp103_ = 0;
guint8* _tmp104_ = NULL;
gint _tmp104__length1 = 0;
gint _tmp105_ = 0;
guint8 _tmp106_ = 0U;
guint8 _tmp107_ = 0U;
guint8* _tmp108_ = NULL;
gint _tmp108__length1 = 0;
gint _tmp109_ = 0;
guint8* _tmp110_ = NULL;
gint _tmp110__length1 = 0;
gint _tmp111_ = 0;
guint8 _tmp112_ = 0U;
guint8 _tmp113_ = 0U;
guint8* _tmp114_ = NULL;
gint _tmp114__length1 = 0;
gint _tmp115_ = 0;
guint8* _tmp116_ = NULL;
gint _tmp116__length1 = 0;
gint _tmp117_ = 0;
guint8 _tmp118_ = 0U;
guint8 _tmp119_ = 0U;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp94_ = _tmp93_;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp94_) {
#line 2385 "book.c"
gint _tmp95_ = 0;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp95_ = x;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = _tmp95_ + 1;
#line 2391 "book.c"
}
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp93_ = FALSE;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp96_ = x;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp97_ = width;
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp96_ < _tmp97_)) {
#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 2403 "book.c"
}
#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp98_ = in_offset;
#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp99_ = x;
#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_o = _tmp98_ + (_tmp99_ * 3);
#line 292 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp100_ = out_offset;
#line 292 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp101_ = x;
#line 292 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_o = _tmp100_ + (_tmp101_ * 3);
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp102_ = data;
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp102__length1 = data_length1;
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp103_ = out_o;
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp104_ = pixels;
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp104__length1 = pixels_length1;
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp105_ = in_o;
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp106_ = _tmp104_[_tmp105_];
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp102_[_tmp103_] = _tmp106_;
#line 294 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp107_ = _tmp102_[_tmp103_];
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp108_ = data;
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp108__length1 = data_length1;
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp109_ = out_o;
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp110_ = pixels;
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp110__length1 = pixels_length1;
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp111_ = in_o;
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp112_ = _tmp110_[_tmp111_ + 1];
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp108_[_tmp109_ + 1] = _tmp112_;
#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp113_ = _tmp108_[_tmp109_ + 1];
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp114_ = data;
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp114__length1 = data_length1;
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp115_ = out_o;
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp116_ = pixels;
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp116__length1 = pixels_length1;
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp117_ = in_o;
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp118_ = _tmp116_[_tmp117_ + 2];
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp114_[_tmp115_ + 2] = _tmp118_;
#line 296 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp119_ = _tmp114_[_tmp115_ + 2];
#line 2471 "book.c"
}
}
}
}
}
}
} else {
Page* _tmp120_ = NULL;
gint _tmp121_ = 0;
gint _tmp122_ = 0;
#line 300 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp120_ = page;
#line 300 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp121_ = page_get_depth (_tmp120_);
#line 300 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp122_ = _tmp121_;
#line 300 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp122_ == 2) {
#line 2490 "book.c"
gint shift_count = 0;
gchar* _tmp123_ = NULL;
gint data_length = 0;
gint _tmp124_ = 0;
gint _tmp125_ = 0;
gint _tmp126_ = 0;
guint8* _tmp127_ = NULL;
gint offset = 0;
#line 302 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
shift_count = 6;
#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 2;
#line 304 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp123_ = g_strdup ("DeviceGray");
#line 304 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
#line 304 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp123_;
#line 305 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp124_ = height;
#line 305 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp125_ = width;
#line 305 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length = _tmp124_ * (((_tmp125_ * 2) + 7) / 8);
#line 306 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp126_ = data_length;
#line 306 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp127_ = g_new0 (guint8, _tmp126_);
#line 306 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
#line 306 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp127_;
#line 306 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp126_;
#line 306 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
#line 307 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = 0;
#line 2529 "book.c"
{
gint row = 0;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = 0;
#line 2534 "book.c"
{
gboolean _tmp128_ = FALSE;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp128_ = TRUE;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 2541 "book.c"
gboolean _tmp129_ = FALSE;
gint _tmp131_ = 0;
gint _tmp132_ = 0;
gint _tmp133_ = 0;
gint in_offset = 0;
gint _tmp135_ = 0;
GdkPixbuf* _tmp136_ = NULL;
gint _tmp137_ = 0;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp129_ = _tmp128_;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp129_) {
#line 2554 "book.c"
gint _tmp130_ = 0;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp130_ = row;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = _tmp130_ + 1;
#line 2560 "book.c"
}
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp128_ = FALSE;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp131_ = row;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp132_ = height;
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp131_ < _tmp132_)) {
#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 2572 "book.c"
}
#line 311 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp133_ = shift_count;
#line 311 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp133_ != 6) {
#line 2578 "book.c"
gint _tmp134_ = 0;
#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp134_ = offset;
#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = _tmp134_ + 1;
#line 314 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
shift_count = 6;
#line 2586 "book.c"
}
#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp135_ = row;
#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp136_ = image;
#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp137_ = gdk_pixbuf_get_rowstride (_tmp136_);
#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_offset = _tmp135_ * _tmp137_;
#line 2596 "book.c"
{
gint x = 0;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = 0;
#line 2601 "book.c"
{
gboolean _tmp138_ = FALSE;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp138_ = TRUE;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 2608 "book.c"
gboolean _tmp139_ = FALSE;
gint _tmp141_ = 0;
gint _tmp142_ = 0;
gint _tmp143_ = 0;
guint8 p = 0U;
guint8* _tmp147_ = NULL;
gint _tmp147__length1 = 0;
gint _tmp148_ = 0;
gint _tmp149_ = 0;
guint8 _tmp150_ = 0U;
guint8 _tmp151_ = 0U;
gint _tmp166_ = 0;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp139_ = _tmp138_;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp139_) {
#line 2625 "book.c"
gint _tmp140_ = 0;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp140_ = x;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = _tmp140_ + 1;
#line 2631 "book.c"
}
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp138_ = FALSE;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp141_ = x;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp142_ = width;
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp141_ < _tmp142_)) {
#line 318 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 2643 "book.c"
}
#line 321 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp143_ = shift_count;
#line 321 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp143_ == 6) {
#line 2649 "book.c"
guint8* _tmp144_ = NULL;
gint _tmp144__length1 = 0;
gint _tmp145_ = 0;
guint8 _tmp146_ = 0U;
#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp144_ = data;
#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp144__length1 = data_length1;
#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp145_ = offset;
#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp144_[_tmp145_] = (guint8) 0;
#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp146_ = _tmp144_[_tmp145_];
#line 2664 "book.c"
}
#line 325 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp147_ = pixels;
#line 325 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp147__length1 = pixels_length1;
#line 325 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp148_ = in_offset;
#line 325 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp149_ = x;
#line 325 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp150_ = _tmp147_[_tmp148_ + (_tmp149_ * 3)];
#line 325 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
p = _tmp150_;
#line 326 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp151_ = p;
#line 326 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((gint) _tmp151_) >= 192) {
#line 2682 "book.c"
guint8* _tmp152_ = NULL;
gint _tmp152__length1 = 0;
gint _tmp153_ = 0;
gint _tmp154_ = 0;
guint8 _tmp155_ = 0U;
#line 327 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp152_ = data;
#line 327 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp152__length1 = data_length1;
#line 327 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp153_ = offset;
#line 327 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp154_ = shift_count;
#line 327 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp152_[_tmp153_] |= (guint8) (3 << _tmp154_);
#line 327 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp155_ = _tmp152_[_tmp153_];
#line 2700 "book.c"
} else {
guint8 _tmp156_ = 0U;
#line 328 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp156_ = p;
#line 328 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((gint) _tmp156_) >= 128) {
#line 2707 "book.c"
guint8* _tmp157_ = NULL;
gint _tmp157__length1 = 0;
gint _tmp158_ = 0;
gint _tmp159_ = 0;
guint8 _tmp160_ = 0U;
#line 329 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp157_ = data;
#line 329 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp157__length1 = data_length1;
#line 329 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp158_ = offset;
#line 329 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp159_ = shift_count;
#line 329 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp157_[_tmp158_] |= (guint8) (2 << _tmp159_);
#line 329 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp160_ = _tmp157_[_tmp158_];
#line 2725 "book.c"
} else {
guint8 _tmp161_ = 0U;
#line 330 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp161_ = p;
#line 330 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((gint) _tmp161_) >= 64) {
#line 2732 "book.c"
guint8* _tmp162_ = NULL;
gint _tmp162__length1 = 0;
gint _tmp163_ = 0;
gint _tmp164_ = 0;
guint8 _tmp165_ = 0U;
#line 331 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp162_ = data;
#line 331 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp162__length1 = data_length1;
#line 331 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp163_ = offset;
#line 331 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp164_ = shift_count;
#line 331 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp162_[_tmp163_] |= (guint8) (1 << _tmp164_);
#line 331 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp165_ = _tmp162_[_tmp163_];
#line 2750 "book.c"
}
}
}
#line 334 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp166_ = shift_count;
#line 334 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp166_ == 0) {
#line 2758 "book.c"
gint _tmp167_ = 0;
#line 336 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp167_ = offset;
#line 336 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = _tmp167_ + 1;
#line 337 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
shift_count = 6;
#line 2766 "book.c"
} else {
gint _tmp168_ = 0;
#line 340 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp168_ = shift_count;
#line 340 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
shift_count = _tmp168_ - 2;
#line 2773 "book.c"
}
}
}
}
}
}
}
} else {
Page* _tmp169_ = NULL;
gint _tmp170_ = 0;
gint _tmp171_ = 0;
#line 344 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp169_ = page;
#line 344 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp170_ = page_get_depth (_tmp169_);
#line 344 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp171_ = _tmp170_;
#line 344 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp171_ == 1) {
#line 2793 "book.c"
gint mask = 0;
gchar* _tmp172_ = NULL;
gint data_length = 0;
gint _tmp173_ = 0;
gint _tmp174_ = 0;
gint _tmp175_ = 0;
guint8* _tmp176_ = NULL;
gint offset = 0;
#line 346 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
mask = 0x80;
#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 1;
#line 349 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp172_ = g_strdup ("DeviceGray");
#line 349 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
#line 349 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp172_;
#line 350 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp173_ = height;
#line 350 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp174_ = width;
#line 350 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length = _tmp173_ * ((_tmp174_ + 7) / 8);
#line 351 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp175_ = data_length;
#line 351 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp176_ = g_new0 (guint8, _tmp175_);
#line 351 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
#line 351 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp176_;
#line 351 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp175_;
#line 351 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
#line 352 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = 0;
#line 2832 "book.c"
{
gint row = 0;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = 0;
#line 2837 "book.c"
{
gboolean _tmp177_ = FALSE;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp177_ = TRUE;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 2844 "book.c"
gboolean _tmp178_ = FALSE;
gint _tmp180_ = 0;
gint _tmp181_ = 0;
gint _tmp182_ = 0;
gint in_offset = 0;
gint _tmp184_ = 0;
GdkPixbuf* _tmp185_ = NULL;
gint _tmp186_ = 0;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp178_ = _tmp177_;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp178_) {
#line 2857 "book.c"
gint _tmp179_ = 0;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp179_ = row;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = _tmp179_ + 1;
#line 2863 "book.c"
}
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp177_ = FALSE;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp180_ = row;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp181_ = height;
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp180_ < _tmp181_)) {
#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 2875 "book.c"
}
#line 356 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp182_ = mask;
#line 356 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp182_ != 0x80) {
#line 2881 "book.c"
gint _tmp183_ = 0;
#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp183_ = offset;
#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = _tmp183_ + 1;
#line 359 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
mask = 0x80;
#line 2889 "book.c"
}
#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp184_ = row;
#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp185_ = image;
#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp186_ = gdk_pixbuf_get_rowstride (_tmp185_);
#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_offset = _tmp184_ * _tmp186_;
#line 2899 "book.c"
{
gint x = 0;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = 0;
#line 2904 "book.c"
{
gboolean _tmp187_ = FALSE;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp187_ = TRUE;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 2911 "book.c"
gboolean _tmp188_ = FALSE;
gint _tmp190_ = 0;
gint _tmp191_ = 0;
gint _tmp192_ = 0;
guint8* _tmp196_ = NULL;
gint _tmp196__length1 = 0;
gint _tmp197_ = 0;
gint _tmp198_ = 0;
guint8 _tmp199_ = 0U;
gint _tmp204_ = 0;
gint _tmp205_ = 0;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp188_ = _tmp187_;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp188_) {
#line 2927 "book.c"
gint _tmp189_ = 0;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp189_ = x;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = _tmp189_ + 1;
#line 2933 "book.c"
}
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp187_ = FALSE;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp190_ = x;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp191_ = width;
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp190_ < _tmp191_)) {
#line 363 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 2945 "book.c"
}
#line 366 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp192_ = mask;
#line 366 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp192_ == 0x80) {
#line 2951 "book.c"
guint8* _tmp193_ = NULL;
gint _tmp193__length1 = 0;
gint _tmp194_ = 0;
guint8 _tmp195_ = 0U;
#line 367 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp193_ = data;
#line 367 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp193__length1 = data_length1;
#line 367 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp194_ = offset;
#line 367 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp193_[_tmp194_] = (guint8) 0;
#line 367 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp195_ = _tmp193_[_tmp194_];
#line 2966 "book.c"
}
#line 370 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp196_ = pixels;
#line 370 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp196__length1 = pixels_length1;
#line 370 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp197_ = in_offset;
#line 370 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp198_ = x;
#line 370 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp199_ = _tmp196_[_tmp197_ + (_tmp198_ * 3)];
#line 370 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((gint) _tmp199_) != 0) {
#line 2980 "book.c"
guint8* _tmp200_ = NULL;
gint _tmp200__length1 = 0;
gint _tmp201_ = 0;
gint _tmp202_ = 0;
guint8 _tmp203_ = 0U;
#line 371 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp200_ = data;
#line 371 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp200__length1 = data_length1;
#line 371 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp201_ = offset;
#line 371 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp202_ = mask;
#line 371 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp200_[_tmp201_] |= (guint8) _tmp202_;
#line 371 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp203_ = _tmp200_[_tmp201_];
#line 2998 "book.c"
}
#line 374 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp204_ = mask;
#line 374 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
mask = _tmp204_ >> 1;
#line 375 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp205_ = mask;
#line 375 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp205_ == 0) {
#line 3008 "book.c"
gint _tmp206_ = 0;
#line 377 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp206_ = offset;
#line 377 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = _tmp206_ + 1;
#line 378 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
mask = 0x80;
#line 3016 "book.c"
}
}
}
}
}
}
}
} else {
gchar* _tmp207_ = NULL;
gint data_length = 0;
gint _tmp208_ = 0;
gint _tmp209_ = 0;
gint _tmp210_ = 0;
guint8* _tmp211_ = NULL;
#line 385 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 8;
#line 386 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp207_ = g_strdup ("DeviceGray");
#line 386 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
#line 386 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp207_;
#line 387 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp208_ = height;
#line 387 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp209_ = width;
#line 387 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length = _tmp208_ * _tmp209_;
#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp210_ = data_length;
#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp211_ = g_new0 (guint8, _tmp210_);
#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp211_;
#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp210_;
#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
#line 3057 "book.c"
{
gint row = 0;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = 0;
#line 3062 "book.c"
{
gboolean _tmp212_ = FALSE;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp212_ = TRUE;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 3069 "book.c"
gboolean _tmp213_ = FALSE;
gint _tmp215_ = 0;
gint _tmp216_ = 0;
gint in_offset = 0;
gint _tmp217_ = 0;
GdkPixbuf* _tmp218_ = NULL;
gint _tmp219_ = 0;
gint out_offset = 0;
gint _tmp220_ = 0;
gint _tmp221_ = 0;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp213_ = _tmp212_;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp213_) {
#line 3084 "book.c"
gint _tmp214_ = 0;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp214_ = row;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = _tmp214_ + 1;
#line 3090 "book.c"
}
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp212_ = FALSE;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp215_ = row;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp216_ = height;
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp215_ < _tmp216_)) {
#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 3102 "book.c"
}
#line 391 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp217_ = row;
#line 391 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp218_ = image;
#line 391 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp219_ = gdk_pixbuf_get_rowstride (_tmp218_);
#line 391 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_offset = _tmp217_ * _tmp219_;
#line 392 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp220_ = row;
#line 392 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp221_ = width;
#line 392 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_offset = _tmp220_ * _tmp221_;
#line 3118 "book.c"
{
gint x = 0;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = 0;
#line 3123 "book.c"
{
gboolean _tmp222_ = FALSE;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp222_ = TRUE;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
#line 3130 "book.c"
gboolean _tmp223_ = FALSE;
gint _tmp225_ = 0;
gint _tmp226_ = 0;
guint8* _tmp227_ = NULL;
gint _tmp227__length1 = 0;
gint _tmp228_ = 0;
gint _tmp229_ = 0;
guint8* _tmp230_ = NULL;
gint _tmp230__length1 = 0;
gint _tmp231_ = 0;
gint _tmp232_ = 0;
guint8 _tmp233_ = 0U;
guint8 _tmp234_ = 0U;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp223_ = _tmp222_;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp223_) {
#line 3148 "book.c"
gint _tmp224_ = 0;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp224_ = x;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = _tmp224_ + 1;
#line 3154 "book.c"
}
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp222_ = FALSE;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp225_ = x;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp226_ = width;
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp225_ < _tmp226_)) {
#line 393 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 3166 "book.c"
}
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp227_ = data;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp227__length1 = data_length1;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp228_ = out_offset;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp229_ = x;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp230_ = pixels;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp230__length1 = pixels_length1;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp231_ = in_offset;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp232_ = x;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp233_ = _tmp230_[_tmp231_ + (_tmp232_ * 3)];
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp227_[_tmp228_ + _tmp229_] = _tmp233_;
#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp234_ = _tmp227_[_tmp228_ + _tmp229_];
#line 3190 "book.c"
}
}
}
}
}
}
}
}
}
#line 399 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp235_ = data;
#line 399 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp235__length1 = data_length1;
#line 399 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp237_ = book_compress_zlib (self, _tmp235_, _tmp235__length1, &_tmp236_);
#line 399 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
compressed_data = _tmp237_;
#line 399 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
compressed_data_length1 = _tmp236_;
#line 399 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_compressed_data_size_ = compressed_data_length1;
#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp238_ = compressed_data;
#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp238__length1 = compressed_data_length1;
#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp238_ != NULL) {
#line 3218 "book.c"
gint _tmp239_ = 0;
const gchar* _tmp252_ = NULL;
#line 403 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp239_ = depth;
#line 403 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp239_ > 1) {
#line 3225 "book.c"
guint8* jpeg_data = NULL;
GdkPixbuf* _tmp240_ = NULL;
gint _tmp241_ = 0;
Page* _tmp242_ = NULL;
gint _tmp243_ = 0;
gint _tmp244_ = 0;
gint _tmp245_ = 0;
guint8* _tmp246_ = NULL;
gint jpeg_data_length1 = 0;
gint _jpeg_data_size_ = 0;
guint8* _tmp247_ = NULL;
gint _tmp247__length1 = 0;
guint8* _tmp248_ = NULL;
gint _tmp248__length1 = 0;
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp240_ = image;
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp241_ = quality;
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp242_ = page;
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp243_ = page_get_dpi (_tmp242_);
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp244_ = _tmp243_;
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp246_ = book_compress_jpeg (self, _tmp240_, _tmp241_, _tmp244_, &_tmp245_);
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
jpeg_data = _tmp246_;
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
jpeg_data_length1 = _tmp245_;
#line 405 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_jpeg_data_size_ = jpeg_data_length1;
#line 406 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp247_ = jpeg_data;
#line 406 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp247__length1 = jpeg_data_length1;
#line 406 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp248_ = compressed_data;
#line 406 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp248__length1 = compressed_data_length1;
#line 406 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp247__length1 < _tmp248__length1) {
#line 3268 "book.c"
gchar* _tmp249_ = NULL;
guint8* _tmp250_ = NULL;
gint _tmp250__length1 = 0;
guint8* _tmp251_ = NULL;
gint _tmp251__length1 = 0;
#line 408 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp249_ = g_strdup ("DCTDecode");
#line 408 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (filter);
#line 408 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
filter = _tmp249_;
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp250_ = jpeg_data;
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp250__length1 = jpeg_data_length1;
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp251_ = (_tmp250_ != NULL) ? _vala_array_dup1 (_tmp250_, _tmp250__length1) : ((gpointer) _tmp250_);
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp251__length1 = _tmp250__length1;
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp251_;
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp251__length1;
#line 409 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
#line 3296 "book.c"
}
#line 403 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
jpeg_data = (g_free (jpeg_data), NULL);
#line 3300 "book.c"
}
#line 413 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp252_ = filter;
#line 413 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp252_ == NULL) {
#line 3306 "book.c"
gchar* _tmp253_ = NULL;
guint8* _tmp254_ = NULL;
gint _tmp254__length1 = 0;
guint8* _tmp255_ = NULL;
gint _tmp255__length1 = 0;
#line 415 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp253_ = g_strdup ("FlateDecode");
#line 415 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (filter);
#line 415 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
filter = _tmp253_;
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp254_ = compressed_data;
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp254__length1 = compressed_data_length1;
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp255_ = (_tmp254_ != NULL) ? _vala_array_dup2 (_tmp254_, _tmp254__length1) : ((gpointer) _tmp254_);
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp255__length1 = _tmp254__length1;
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp255_;
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp255__length1;
#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
#line 3334 "book.c"
}
}
#line 421 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp256_ = writer;
#line 421 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp256_, "\n");
#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp257_ = writer;
#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp258_ = pdf_writer_start_object (_tmp257_);
#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
number = _tmp258_;
#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp259_ = writer;
#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp260_ = number;
#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp261_ = g_strdup_printf ("%u 0 obj\n", _tmp260_);
#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp262_ = _tmp261_;
#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp259_, _tmp262_);
#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp262_);
#line 424 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp263_ = writer;
#line 424 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp263_, "<<\n");
#line 425 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp264_ = writer;
#line 425 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp264_, "/Type /Page\n");
#line 426 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp265_ = writer;
#line 426 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp266_ = pages_number;
#line 426 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp267_ = g_strdup_printf ("/Parent %u 0 R\n", _tmp266_);
#line 426 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp268_ = _tmp267_;
#line 426 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp265_, _tmp268_);
#line 426 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp268_);
#line 427 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp269_ = writer;
#line 427 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp270_ = i;
#line 427 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp271_ = number;
#line 427 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp272_ = g_strdup_printf ("/Resources << /XObject << /Im%d %u 0 R >> >>\n", _tmp270_, _tmp271_ + 1);
#line 427 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp273_ = _tmp272_;
#line 427 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp269_, _tmp273_);
#line 427 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp273_);
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp274_ = writer;
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp275_ = page_width;
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp276_ = width_buffer;
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp276__length1 = width_buffer_length1;
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp277_ = g_ascii_formatd (_tmp276_, _tmp276__length1, "%.2f", _tmp275_);
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp278_ = page_height;
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp279_ = height_buffer;
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp279__length1 = height_buffer_length1;
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp280_ = g_ascii_formatd (_tmp279_, _tmp279__length1, "%.2f", _tmp278_);
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp281_ = g_strdup_printf ("/MediaBox [ 0 0 %s %s ]\n", _tmp277_, _tmp280_);
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp282_ = _tmp281_;
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp274_, _tmp282_);
#line 428 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp282_);
#line 429 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp283_ = writer;
#line 429 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp284_ = number;
#line 429 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp285_ = g_strdup_printf ("/Contents %u 0 R\n", _tmp284_ + 2);
#line 429 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp286_ = _tmp285_;
#line 429 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp283_, _tmp286_);
#line 429 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp286_);
#line 430 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp287_ = writer;
#line 430 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp287_, ">>\n");
#line 431 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp288_ = writer;
#line 431 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp288_, "endobj\n");
#line 434 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp289_ = writer;
#line 434 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp289_, "\n");
#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp290_ = writer;
#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp291_ = pdf_writer_start_object (_tmp290_);
#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
number = _tmp291_;
#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp292_ = writer;
#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp293_ = number;
#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp294_ = g_strdup_printf ("%u 0 obj\n", _tmp293_);
#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp295_ = _tmp294_;
#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp292_, _tmp295_);
#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp295_);
#line 437 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp296_ = writer;
#line 437 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp296_, "<<\n");
#line 438 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp297_ = writer;
#line 438 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp297_, "/Type /XObject\n");
#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp298_ = writer;
#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp298_, "/Subtype /Image\n");
#line 440 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp299_ = writer;
#line 440 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp300_ = width;
#line 440 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp301_ = g_strdup_printf ("/Width %d\n", _tmp300_);
#line 440 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp302_ = _tmp301_;
#line 440 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp299_, _tmp302_);
#line 440 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp302_);
#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp303_ = writer;
#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp304_ = height;
#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp305_ = g_strdup_printf ("/Height %d\n", _tmp304_);
#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp306_ = _tmp305_;
#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp303_, _tmp306_);
#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp306_);
#line 442 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp307_ = writer;
#line 442 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp308_ = color_space;
#line 442 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp309_ = g_strdup_printf ("/ColorSpace /%s\n", _tmp308_);
#line 442 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp310_ = _tmp309_;
#line 442 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp307_, _tmp310_);
#line 442 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp310_);
#line 443 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp311_ = writer;
#line 443 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp312_ = depth;
#line 443 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp313_ = g_strdup_printf ("/BitsPerComponent %d\n", _tmp312_);
#line 443 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp314_ = _tmp313_;
#line 443 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp311_, _tmp314_);
#line 443 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp314_);
#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp315_ = writer;
#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp316_ = data;
#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp316__length1 = data_length1;
#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp317_ = g_strdup_printf ("/Length %d\n", _tmp316__length1);
#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp318_ = _tmp317_;
#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp315_, _tmp318_);
#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp318_);
#line 445 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp319_ = filter;
#line 445 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp319_ != NULL) {
#line 3539 "book.c"
PDFWriter* _tmp320_ = NULL;
const gchar* _tmp321_ = NULL;
gchar* _tmp322_ = NULL;
gchar* _tmp323_ = NULL;
#line 446 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp320_ = writer;
#line 446 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp321_ = filter;
#line 446 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp322_ = g_strdup_printf ("/Filter /%s\n", _tmp321_);
#line 446 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp323_ = _tmp322_;
#line 446 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp320_, _tmp323_);
#line 446 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp323_);
#line 3556 "book.c"
}
#line 447 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp324_ = writer;
#line 447 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp324_, ">>\n");
#line 448 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp325_ = writer;
#line 448 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp325_, "stream\n");
#line 449 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp326_ = writer;
#line 449 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp327_ = data;
#line 449 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp327__length1 = data_length1;
#line 449 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write (_tmp326_, _tmp327_, _tmp327__length1);
#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp328_ = writer;
#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp328_, "\n");
#line 451 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp329_ = writer;
#line 451 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp329_, "endstream\n");
#line 452 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp330_ = writer;
#line 452 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp330_, "endobj\n");
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp331_ = page_width;
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp332_ = width_buffer;
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp332__length1 = width_buffer_length1;
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp333_ = g_ascii_formatd (_tmp332_, _tmp332__length1, "%f", _tmp331_);
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp334_ = page_height;
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp335_ = height_buffer;
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp335__length1 = height_buffer_length1;
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp336_ = g_ascii_formatd (_tmp335_, _tmp335__length1, "%f", _tmp334_);
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp337_ = i;
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp338_ = g_strdup_printf ("q\n%s 0 0 %s 0 0 cm\n/Im%d Do\nQ", _tmp333_, _tmp336_, _tmp337_);
#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
command = _tmp338_;
#line 456 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp339_ = writer;
#line 456 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp339_, "\n");
#line 457 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp340_ = writer;
#line 457 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp341_ = pdf_writer_start_object (_tmp340_);
#line 457 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
number = _tmp341_;
#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp342_ = writer;
#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp343_ = number;
#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp344_ = g_strdup_printf ("%u 0 obj\n", _tmp343_);
#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp345_ = _tmp344_;
#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp342_, _tmp345_);
#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp345_);
#line 459 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp346_ = writer;
#line 459 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp346_, "<<\n");
#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp347_ = writer;
#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp348_ = command;
#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp349_ = strlen (_tmp348_);
#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp350_ = _tmp349_;
#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp351_ = g_strdup_printf ("/Length %d\n", _tmp350_ + 1);
#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp352_ = _tmp351_;
#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp347_, _tmp352_);
#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp352_);
#line 461 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp353_ = writer;
#line 461 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp353_, ">>\n");
#line 462 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp354_ = writer;
#line 462 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp354_, "stream\n");
#line 463 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp355_ = writer;
#line 463 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp356_ = command;
#line 463 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp355_, _tmp356_);
#line 464 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp357_ = writer;
#line 464 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp357_, "\n");
#line 465 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp358_ = writer;
#line 465 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp358_, "endstream\n");
#line 466 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp359_ = writer;
#line 466 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp359_, "endobj\n");
#line 468 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp360_ = i;
#line 468 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "saving", _tmp360_);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (command);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
compressed_data = (g_free (compressed_data), NULL);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height_buffer = (g_free (height_buffer), NULL);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width_buffer = (g_free (width_buffer), NULL);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (filter);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (image);
#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
#line 3698 "book.c"
}
}
}
#line 472 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp361_ = writer;
#line 472 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp361_, "\n");
#line 473 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp362_ = writer;
#line 473 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp363_ = pdf_writer_start_object (_tmp362_);
#line 473 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
info_number = _tmp363_;
#line 474 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp364_ = writer;
#line 474 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp365_ = info_number;
#line 474 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp366_ = g_strdup_printf ("%u 0 obj\n", _tmp365_);
#line 474 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp367_ = _tmp366_;
#line 474 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp364_, _tmp367_);
#line 474 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp367_);
#line 475 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp368_ = writer;
#line 475 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp368_, "<<\n");
#line 476 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp369_ = writer;
#line 476 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp370_ = g_strdup_printf ("/Creator (Simple Scan %s)\n", VERSION);
#line 476 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp371_ = _tmp370_;
#line 476 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp369_, _tmp371_);
#line 476 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp371_);
#line 477 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp372_ = writer;
#line 477 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp372_, ">>\n");
#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp373_ = writer;
#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp373_, "endobj\n");
#line 481 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp374_ = writer;
#line 481 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp375_ = _tmp374_->offset;
#line 481 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
xref_offset = _tmp375_;
#line 482 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp376_ = writer;
#line 482 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp376_, "xref\n");
#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp377_ = writer;
#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp378_ = writer;
#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp379_ = _tmp378_->object_offsets;
#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp380_ = g_list_length (_tmp379_);
#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp381_ = g_strdup_printf ("1 %zu\n", (gsize) _tmp380_);
#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp382_ = _tmp381_;
#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp377_, _tmp382_);
#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp382_);
#line 484 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp383_ = writer;
#line 484 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp384_ = _tmp383_->object_offsets;
#line 3776 "book.c"
{
GList* offset_collection = NULL;
GList* offset_it = NULL;
#line 484 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset_collection = _tmp384_;
#line 484 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
for (offset_it = offset_collection; offset_it != NULL; offset_it = offset_it->next) {
#line 3784 "book.c"
guint offset = 0U;
#line 484 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = (guint) ((guintptr) offset_it->data);
#line 3788 "book.c"
{
PDFWriter* _tmp385_ = NULL;
guint _tmp386_ = 0U;
gchar* _tmp387_ = NULL;
gchar* _tmp388_ = NULL;
#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp385_ = writer;
#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp386_ = offset;
#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp387_ = g_strdup_printf ("%010zu 00000 n \n", (gsize) _tmp386_);
#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp388_ = _tmp387_;
#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp385_, _tmp388_);
#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp388_);
#line 3806 "book.c"
}
}
}
#line 488 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp389_ = writer;
#line 488 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp389_, "trailer\n");
#line 489 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp390_ = writer;
#line 489 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp390_, "<<\n");
#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp391_ = writer;
#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp392_ = writer;
#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp393_ = _tmp392_->object_offsets;
#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp394_ = g_list_length (_tmp393_);
#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp395_ = g_strdup_printf ("/Size %zu\n", (gsize) _tmp394_);
#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp396_ = _tmp395_;
#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp391_, _tmp396_);
#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp396_);
#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp397_ = writer;
#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp398_ = info_number;
#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp399_ = g_strdup_printf ("/Info %u 0 R\n", _tmp398_);
#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp400_ = _tmp399_;
#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp397_, _tmp400_);
#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp400_);
#line 492 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp401_ = writer;
#line 492 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp402_ = catalog_number;
#line 492 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp403_ = g_strdup_printf ("/Root %u 0 R\n", _tmp402_);
#line 492 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp404_ = _tmp403_;
#line 492 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp401_, _tmp404_);
#line 492 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp404_);
#line 494 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp405_ = writer;
#line 494 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp405_, ">>\n");
#line 495 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp406_ = writer;
#line 495 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp406_, "startxref\n");
#line 496 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp407_ = writer;
#line 496 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp408_ = xref_offset;
#line 496 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp409_ = g_strdup_printf ("%zu\n", _tmp408_);
#line 496 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp410_ = _tmp409_;
#line 496 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp407_, _tmp410_);
#line 496 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp410_);
#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp411_ = writer;
#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp411_, "%%EOF\n");
#line 213 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_pdf_writer_unref0 (writer);
#line 213 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (stream);
#line 3886 "book.c"
}
void book_save (Book* self, const gchar* type, gint quality, GFile* file, GError** error) {
const gchar* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
GQuark _tmp3_ = 0U;
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label0 = 0;
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label1 = 0;
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label2 = 0;
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label3 = 0;
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label4 = 0;
#line 3904 "book.c"
GError * _inner_error_ = NULL;
#line 500 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 500 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (type != NULL);
#line 500 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (file != NULL);
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = type;
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _tmp0_;
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("jpeg")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("png"))))) || (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("tiff"))))) {
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
switch (0) {
#line 3922 "book.c"
default:
{
const gchar* _tmp4_ = NULL;
gint _tmp5_ = 0;
GFile* _tmp6_ = NULL;
#line 507 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = type;
#line 507 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = quality;
#line 507 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = file;
#line 507 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_save_multi_file (self, _tmp4_, _tmp5_, _tmp6_, &_inner_error_);
#line 507 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 507 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
#line 507 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
#line 3942 "book.c"
}
#line 508 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 3946 "book.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("ps")))) {
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
switch (0) {
#line 3952 "book.c"
default:
{
GFile* _tmp7_ = NULL;
#line 510 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = file;
#line 510 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_save_ps (self, _tmp7_, &_inner_error_);
#line 510 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 510 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
#line 510 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
#line 3966 "book.c"
}
#line 511 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 3970 "book.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("pdf")))) {
#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
switch (0) {
#line 3976 "book.c"
default:
{
GFile* _tmp8_ = NULL;
gint _tmp9_ = 0;
#line 513 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = file;
#line 513 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = quality;
#line 513 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_save_pdf (self, _tmp8_, _tmp9_, &_inner_error_);
#line 513 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 513 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
#line 513 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
#line 3993 "book.c"
}
#line 514 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
#line 3997 "book.c"
}
}
}
}
guint book_get_n_pages (Book* self) {
guint result;
GList* _tmp0_ = NULL;
guint _tmp1_ = 0U;
#line 16 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, 0U);
#line 16 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->pages;
#line 16 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_list_length (_tmp0_);
#line 16 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp1_;
#line 16 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 4018 "book.c"
}
gboolean book_get_needs_saving (Book* self) {
gboolean result;
gboolean _tmp0_ = FALSE;
#line 21 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, FALSE);
#line 21 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->needs_saving_;
#line 21 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp0_;
#line 21 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 4033 "book.c"
}
void book_set_needs_saving (Book* self, gboolean value) {
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
gboolean _tmp2_ = FALSE;
#line 22 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 24 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->needs_saving_;
#line 24 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = value;
#line 24 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp0_ == _tmp1_) {
#line 25 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
#line 4051 "book.c"
}
#line 26 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = value;
#line 26 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->needs_saving_ = _tmp2_;
#line 27 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "needs-saving-changed");
#line 4059 "book.c"
}
static void g_cclosure_user_marshal_VOID__PAGE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
typedef void (*GMarshalFunc_VOID__PAGE) (gpointer data1, gpointer arg_1, gpointer data2);
register GMarshalFunc_VOID__PAGE callback;
register GCClosure * cc;
register gpointer data1;
register gpointer data2;
cc = (GCClosure *) closure;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (n_param_values == 2);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data1 = closure->data;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data2 = param_values->data[0].v_pointer;
#line 4078 "book.c"
} else {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data1 = param_values->data[0].v_pointer;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data2 = closure->data;
#line 4084 "book.c"
}
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
callback = (GMarshalFunc_VOID__PAGE) (marshal_data ? marshal_data : cc->callback);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
callback (data1, value_get_page (param_values + 1), data2);
#line 4090 "book.c"
}
static void value_book_init (GValue* value) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4097 "book.c"
}
static void value_book_free_value (GValue* value) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (value->data[0].v_pointer) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_unref (value->data[0].v_pointer);
#line 4106 "book.c"
}
}
static void value_book_copy_value (const GValue* src_value, GValue* dest_value) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (src_value->data[0].v_pointer) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = book_ref (src_value->data[0].v_pointer);
#line 4116 "book.c"
} else {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = NULL;
#line 4120 "book.c"
}
}
static gpointer value_book_peek_pointer (const GValue* value) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
#line 4128 "book.c"
}
static gchar* value_book_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (collect_values[0].v_pointer) {
#line 4135 "book.c"
Book* object;
object = collect_values[0].v_pointer;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (object->parent_instance.g_class == NULL) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 4142 "book.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 4146 "book.c"
}
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = book_ref (object);
#line 4150 "book.c"
} else {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4154 "book.c"
}
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
#line 4158 "book.c"
}
static gchar* value_book_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
Book** object_p;
object_p = collect_values[0].v_pointer;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!object_p) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 4169 "book.c"
}
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!value->data[0].v_pointer) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = NULL;
#line 4175 "book.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = value->data[0].v_pointer;
#line 4179 "book.c"
} else {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = book_ref (value->data[0].v_pointer);
#line 4183 "book.c"
}
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
#line 4187 "book.c"
}
GParamSpec* param_spec_book (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecBook* spec;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_BOOK), NULL);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return G_PARAM_SPEC (spec);
#line 4201 "book.c"
}
gpointer value_get_book (const GValue* value) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BOOK), NULL);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
#line 4210 "book.c"
}
void value_set_book (GValue* value, gpointer v_object) {
Book* old;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BOOK));
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_BOOK));
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_ref (value->data[0].v_pointer);
#line 4230 "book.c"
} else {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4234 "book.c"
}
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_unref (old);
#line 4240 "book.c"
}
}
void value_take_book (GValue* value, gpointer v_object) {
Book* old;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BOOK));
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_BOOK));
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
#line 4259 "book.c"
} else {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4263 "book.c"
}
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_unref (old);
#line 4269 "book.c"
}
}
static void book_class_init (BookClass * klass) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_parent_class = g_type_class_peek_parent (klass);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
BOOK_CLASS (klass)->finalize = book_finalize;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_class_add_private (klass, sizeof (BookPrivate));
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("page_added", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__PAGE, G_TYPE_NONE, 1, TYPE_PAGE);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("page_removed", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__PAGE, G_TYPE_NONE, 1, TYPE_PAGE);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("reordered", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("cleared", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("needs_saving_changed", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("saving", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
#line 4293 "book.c"
}
static void book_instance_init (Book * self) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv = BOOK_GET_PRIVATE (self);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->ref_count = 1;
#line 4302 "book.c"
}
static void book_finalize (Book* obj) {
Book * self;
GList* _tmp0_ = NULL;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BOOK, Book);
#line 45 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->pages;
#line 4313 "book.c"
{
GList* page_collection = NULL;
GList* page_it = NULL;
#line 45 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_collection = _tmp0_;
#line 45 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
for (page_it = page_collection; page_it != NULL; page_it = page_it->next) {
#line 4321 "book.c"
Page* _tmp1_ = NULL;
Page* page = NULL;
#line 45 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _page_ref0 ((Page*) page_it->data);
#line 45 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp1_;
#line 4328 "book.c"
{
Page* _tmp2_ = NULL;
guint _tmp3_ = 0U;
Page* _tmp4_ = NULL;
guint _tmp5_ = 0U;
#line 47 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = page;
#line 47 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("pixels-changed", TYPE_PAGE, &_tmp3_, NULL, FALSE);
#line 47 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _book_page_changed_cb_page_pixels_changed, self);
#line 48 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = page;
#line 48 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp5_, NULL, FALSE);
#line 48 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self);
#line 45 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
#line 4348 "book.c"
}
}
}
#line 14 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
__g_list_free__page_unref0_0 (self->priv->pages);
#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_byte_array_unref0 (self->priv->jpeg_data);
#line 4356 "book.c"
}
GType book_get_type (void) {
static volatile gsize book_type_id__volatile = 0;
if (g_once_init_enter (&book_type_id__volatile)) {
static const GTypeValueTable g_define_type_value_table = { value_book_init, value_book_free_value, value_book_copy_value, value_book_peek_pointer, "p", value_book_collect_value, "p", value_book_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (BookClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) book_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Book), 0, (GInstanceInitFunc) book_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType book_type_id;
book_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Book", &g_define_type_info, &g_define_type_fundamental_info, 0);
g_once_init_leave (&book_type_id__volatile, book_type_id);
}
return book_type_id__volatile;
}
gpointer book_ref (gpointer instance) {
Book* self;
self = instance;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_atomic_int_inc (&self->ref_count);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return instance;
#line 4381 "book.c"
}
void book_unref (gpointer instance) {
Book* self;
self = instance;
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
BOOK_GET_CLASS (self)->finalize (self);
#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_free_instance ((GTypeInstance *) self);
#line 4394 "book.c"
}
}
static gpointer _g_object_ref0 (gpointer self) {
#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self ? g_object_ref (self) : NULL;
#line 4402 "book.c"
}
PDFWriter* pdf_writer_construct (GType object_type, GFileOutputStream* stream) {
PDFWriter* self = NULL;
GFileOutputStream* _tmp0_ = NULL;
GFileOutputStream* _tmp1_ = NULL;
#line 525 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (stream != NULL, NULL);
#line 525 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = (PDFWriter*) g_type_create_instance (object_type);
#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = stream;
#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _g_object_ref0 (_tmp0_);
#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (self->priv->stream);
#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->stream = _tmp1_;
#line 525 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self;
#line 4424 "book.c"
}
PDFWriter* pdf_writer_new (GFileOutputStream* stream) {
#line 525 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return pdf_writer_construct (TYPE_PDF_WRITER, stream);
#line 4431 "book.c"
}
void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1) {
gsize _tmp4_ = 0UL;
guint8* _tmp5_ = NULL;
gint _tmp5__length1 = 0;
GError * _inner_error_ = NULL;
#line 530 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 4442 "book.c"
{
GFileOutputStream* _tmp0_ = NULL;
guint8* _tmp1_ = NULL;
gint _tmp1__length1 = 0;
#line 534 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->stream;
#line 534 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = data;
#line 534 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1__length1 = data_length1;
#line 534 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_output_stream_write_all ((GOutputStream*) _tmp0_, _tmp1_, (gsize) _tmp1__length1, NULL, NULL, &_inner_error_);
#line 534 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 4457 "book.c"
goto __catch1_g_error;
}
}
goto __finally1;
__catch1_g_error:
{
GError* e = NULL;
GError* _tmp2_ = NULL;
const gchar* _tmp3_ = NULL;
#line 532 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
e = _inner_error_;
#line 532 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_inner_error_ = NULL;
#line 538 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = e;
#line 538 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = _tmp2_->message;
#line 538 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_warning ("book.vala:538: Error writing PDF: %s", _tmp3_);
#line 532 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_error_free0 (e);
#line 4479 "book.c"
}
__finally1:
#line 532 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 532 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 532 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_clear_error (&_inner_error_);
#line 532 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
#line 4490 "book.c"
}
#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = self->offset;
#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = data;
#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5__length1 = data_length1;
#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->offset = _tmp4_ + _tmp5__length1;
#line 4500 "book.c"
}
static gchar* string_to_utf8 (const gchar* self, int* result_length1) {
gchar* result = NULL;
gchar* _result_ = NULL;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
gchar* _tmp2_ = NULL;
gint _result__length1 = 0;
gint __result__size_ = 0;
gint _tmp3_ = 0;
gchar* _tmp4_ = NULL;
gint _tmp4__length1 = 0;
gint _tmp5_ = 0;
gint _tmp6_ = 0;
gchar* _tmp7_ = NULL;
gint _tmp7__length1 = 0;
#line 1266 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
g_return_val_if_fail (self != NULL, NULL);
#line 1267 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp0_ = strlen (self);
#line 1267 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp1_ = _tmp0_;
#line 1267 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp2_ = g_new0 (gchar, _tmp1_ + 1);
#line 1267 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_result_ = _tmp2_;
#line 1267 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_result__length1 = _tmp1_ + 1;
#line 1267 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
__result__size_ = _result__length1;
#line 1268 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp3_ = _result__length1;
#line 1268 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_result__length1 = _tmp3_ - 1;
#line 1269 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp4_ = _result_;
#line 1269 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp4__length1 = _result__length1;
#line 1269 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp5_ = strlen (self);
#line 1269 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp6_ = _tmp5_;
#line 1269 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
memcpy (_tmp4_, self, (gsize) _tmp6_);
#line 1270 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp7_ = _result_;
#line 1270 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
_tmp7__length1 = _result__length1;
#line 1270 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
if (result_length1) {
#line 1270 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
*result_length1 = _tmp7__length1;
#line 4555 "book.c"
}
#line 1270 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
result = _tmp7_;
#line 1270 "/usr/share/vala-0.22/vapi/glib-2.0.vapi"
return result;
#line 4561 "book.c"
}
void pdf_writer_write_string (PDFWriter* self, const gchar* text) {
const gchar* _tmp0_ = NULL;
gint _tmp1_ = 0;
gchar* _tmp2_ = NULL;
guint8* _tmp3_ = NULL;
gint _tmp3__length1 = 0;
#line 543 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
#line 543 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (text != NULL);
#line 545 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = text;
#line 545 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = string_to_utf8 (_tmp0_, &_tmp1_);
#line 545 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = (guint8*) _tmp2_;
#line 545 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3__length1 = (_tmp1_ * sizeof (gchar)) / sizeof (guint8);
#line 545 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write (self, _tmp3_, (_tmp1_ * sizeof (gchar)) / sizeof (guint8));
#line 545 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = (g_free (_tmp3_), NULL);
#line 4587 "book.c"
}
guint pdf_writer_start_object (PDFWriter* self) {
guint result = 0U;
gsize _tmp0_ = 0UL;
GList* _tmp1_ = NULL;
guint _tmp2_ = 0U;
#line 548 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, 0U);
#line 550 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->offset;
#line 550 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->object_offsets = g_list_append (self->object_offsets, (gpointer) ((guintptr) ((guint) _tmp0_)));
#line 551 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = self->object_offsets;
#line 551 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = g_list_length (_tmp1_);
#line 551 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp2_;
#line 551 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 4610 "book.c"
}
static void value_pdf_writer_init (GValue* value) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4617 "book.c"
}
static void value_pdf_writer_free_value (GValue* value) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (value->data[0].v_pointer) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_unref (value->data[0].v_pointer);
#line 4626 "book.c"
}
}
static void value_pdf_writer_copy_value (const GValue* src_value, GValue* dest_value) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (src_value->data[0].v_pointer) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = pdf_writer_ref (src_value->data[0].v_pointer);
#line 4636 "book.c"
} else {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = NULL;
#line 4640 "book.c"
}
}
static gpointer value_pdf_writer_peek_pointer (const GValue* value) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
#line 4648 "book.c"
}
static gchar* value_pdf_writer_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (collect_values[0].v_pointer) {
#line 4655 "book.c"
PDFWriter* object;
object = collect_values[0].v_pointer;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (object->parent_instance.g_class == NULL) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 4662 "book.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 4666 "book.c"
}
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = pdf_writer_ref (object);
#line 4670 "book.c"
} else {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4674 "book.c"
}
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
#line 4678 "book.c"
}
static gchar* value_pdf_writer_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
PDFWriter** object_p;
object_p = collect_values[0].v_pointer;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!object_p) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 4689 "book.c"
}
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!value->data[0].v_pointer) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = NULL;
#line 4695 "book.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = value->data[0].v_pointer;
#line 4699 "book.c"
} else {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = pdf_writer_ref (value->data[0].v_pointer);
#line 4703 "book.c"
}
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
#line 4707 "book.c"
}
GParamSpec* param_spec_pdf_writer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecPDFWriter* spec;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_PDF_WRITER), NULL);
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return G_PARAM_SPEC (spec);
#line 4721 "book.c"
}
gpointer value_get_pdf_writer (const GValue* value) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PDF_WRITER), NULL);
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
#line 4730 "book.c"
}
void value_set_pdf_writer (GValue* value, gpointer v_object) {
PDFWriter* old;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PDF_WRITER));
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PDF_WRITER));
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_ref (value->data[0].v_pointer);
#line 4750 "book.c"
} else {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4754 "book.c"
}
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_unref (old);
#line 4760 "book.c"
}
}
void value_take_pdf_writer (GValue* value, gpointer v_object) {
PDFWriter* old;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PDF_WRITER));
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PDF_WRITER));
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
#line 4779 "book.c"
} else {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4783 "book.c"
}
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_unref (old);
#line 4789 "book.c"
}
}
static void pdf_writer_class_init (PDFWriterClass * klass) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_parent_class = g_type_class_peek_parent (klass);
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
PDF_WRITER_CLASS (klass)->finalize = pdf_writer_finalize;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_class_add_private (klass, sizeof (PDFWriterPrivate));
#line 4801 "book.c"
}
static void pdf_writer_instance_init (PDFWriter * self) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv = PDF_WRITER_GET_PRIVATE (self);
#line 521 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->offset = (gsize) 0;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->ref_count = 1;
#line 4812 "book.c"
}
static void pdf_writer_finalize (PDFWriter* obj) {
PDFWriter * self;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PDF_WRITER, PDFWriter);
#line 522 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_list_free0 (self->object_offsets);
#line 523 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (self->priv->stream);
#line 4824 "book.c"
}
GType pdf_writer_get_type (void) {
static volatile gsize pdf_writer_type_id__volatile = 0;
if (g_once_init_enter (&pdf_writer_type_id__volatile)) {
static const GTypeValueTable g_define_type_value_table = { value_pdf_writer_init, value_pdf_writer_free_value, value_pdf_writer_copy_value, value_pdf_writer_peek_pointer, "p", value_pdf_writer_collect_value, "p", value_pdf_writer_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (PDFWriterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdf_writer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PDFWriter), 0, (GInstanceInitFunc) pdf_writer_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType pdf_writer_type_id;
pdf_writer_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PDFWriter", &g_define_type_info, &g_define_type_fundamental_info, 0);
g_once_init_leave (&pdf_writer_type_id__volatile, pdf_writer_type_id);
}
return pdf_writer_type_id__volatile;
}
gpointer pdf_writer_ref (gpointer instance) {
PDFWriter* self;
self = instance;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_atomic_int_inc (&self->ref_count);
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return instance;
#line 4849 "book.c"
}
void pdf_writer_unref (gpointer instance) {
PDFWriter* self;
self = instance;
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
PDF_WRITER_GET_CLASS (self)->finalize (self);
#line 519 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_free_instance ((GTypeInstance *) self);
#line 4862 "book.c"
}
}
static cairo_status_t _ps_writer_write_cairo_data_cairo_write_func_t (gpointer self, guchar* data, int data_length1) {
cairo_status_t result;
result = ps_writer_write_cairo_data (self, data, data_length1);
#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 4872 "book.c"
}
PsWriter* ps_writer_construct (GType object_type, GFileOutputStream* stream) {
PsWriter* self = NULL;
GFileOutputStream* _tmp0_ = NULL;
GFileOutputStream* _tmp1_ = NULL;
cairo_surface_t* _tmp2_ = NULL;
#line 560 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (stream != NULL, NULL);
#line 560 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = (PsWriter*) g_type_create_instance (object_type);
#line 562 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = stream;
#line 562 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _g_object_ref0 (_tmp0_);
#line 562 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (self->stream);
#line 562 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->stream = _tmp1_;
#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = cairo_ps_surface_create_for_stream (_ps_writer_write_cairo_data_cairo_write_func_t, self, (gdouble) 0, (gdouble) 0);
#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_cairo_surface_destroy0 (self->surface);
#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->surface = _tmp2_;
#line 560 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self;
#line 4901 "book.c"
}
PsWriter* ps_writer_new (GFileOutputStream* stream) {
#line 560 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return ps_writer_construct (TYPE_PS_WRITER, stream);
#line 4908 "book.c"
}
static cairo_status_t ps_writer_write_cairo_data (PsWriter* self, guint8* data, int data_length1) {
cairo_status_t result = 0;
GError * _inner_error_ = NULL;
#line 566 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, 0);
#line 4917 "book.c"
{
GFileOutputStream* _tmp0_ = NULL;
guint8* _tmp1_ = NULL;
gint _tmp1__length1 = 0;
#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->stream;
#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = data;
#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1__length1 = data_length1;
#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_output_stream_write_all ((GOutputStream*) _tmp0_, _tmp1_, (gsize) _tmp1__length1, NULL, NULL, &_inner_error_);
#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 4932 "book.c"
goto __catch2_g_error;
}
}
goto __finally2;
__catch2_g_error:
{
GError* e = NULL;
GError* _tmp2_ = NULL;
const gchar* _tmp3_ = NULL;
#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
e = _inner_error_;
#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_inner_error_ = NULL;
#line 574 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = e;
#line 574 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = _tmp2_->message;
#line 574 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_warning ("book.vala:574: Error writing data: %s", _tmp3_);
#line 575 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = CAIRO_STATUS_WRITE_ERROR;
#line 575 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_error_free0 (e);
#line 575 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 4958 "book.c"
}
__finally2:
#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_clear_error (&_inner_error_);
#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return 0;
#line 4969 "book.c"
}
#line 578 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = CAIRO_STATUS_SUCCESS;
#line 578 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
#line 4975 "book.c"
}
static void value_ps_writer_init (GValue* value) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 4982 "book.c"
}
static void value_ps_writer_free_value (GValue* value) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (value->data[0].v_pointer) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_unref (value->data[0].v_pointer);
#line 4991 "book.c"
}
}
static void value_ps_writer_copy_value (const GValue* src_value, GValue* dest_value) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (src_value->data[0].v_pointer) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = ps_writer_ref (src_value->data[0].v_pointer);
#line 5001 "book.c"
} else {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = NULL;
#line 5005 "book.c"
}
}
static gpointer value_ps_writer_peek_pointer (const GValue* value) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
#line 5013 "book.c"
}
static gchar* value_ps_writer_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (collect_values[0].v_pointer) {
#line 5020 "book.c"
PsWriter* object;
object = collect_values[0].v_pointer;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (object->parent_instance.g_class == NULL) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 5027 "book.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 5031 "book.c"
}
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = ps_writer_ref (object);
#line 5035 "book.c"
} else {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 5039 "book.c"
}
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
#line 5043 "book.c"
}
static gchar* value_ps_writer_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
PsWriter** object_p;
object_p = collect_values[0].v_pointer;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!object_p) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 5054 "book.c"
}
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!value->data[0].v_pointer) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = NULL;
#line 5060 "book.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = value->data[0].v_pointer;
#line 5064 "book.c"
} else {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = ps_writer_ref (value->data[0].v_pointer);
#line 5068 "book.c"
}
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
#line 5072 "book.c"
}
GParamSpec* param_spec_ps_writer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecPsWriter* spec;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_PS_WRITER), NULL);
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return G_PARAM_SPEC (spec);
#line 5086 "book.c"
}
gpointer value_get_ps_writer (const GValue* value) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PS_WRITER), NULL);
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
#line 5095 "book.c"
}
void value_set_ps_writer (GValue* value, gpointer v_object) {
PsWriter* old;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PS_WRITER));
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PS_WRITER));
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_ref (value->data[0].v_pointer);
#line 5115 "book.c"
} else {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 5119 "book.c"
}
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_unref (old);
#line 5125 "book.c"
}
}
void value_take_ps_writer (GValue* value, gpointer v_object) {
PsWriter* old;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PS_WRITER));
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PS_WRITER));
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
#line 5144 "book.c"
} else {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
#line 5148 "book.c"
}
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_unref (old);
#line 5154 "book.c"
}
}
static void ps_writer_class_init (PsWriterClass * klass) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_parent_class = g_type_class_peek_parent (klass);
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
PS_WRITER_CLASS (klass)->finalize = ps_writer_finalize;
#line 5164 "book.c"
}
static void ps_writer_instance_init (PsWriter * self) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->ref_count = 1;
#line 5171 "book.c"
}
static void ps_writer_finalize (PsWriter* obj) {
PsWriter * self;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PS_WRITER, PsWriter);
#line 557 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_cairo_surface_destroy0 (self->surface);
#line 558 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (self->stream);
#line 5183 "book.c"
}
GType ps_writer_get_type (void) {
static volatile gsize ps_writer_type_id__volatile = 0;
if (g_once_init_enter (&ps_writer_type_id__volatile)) {
static const GTypeValueTable g_define_type_value_table = { value_ps_writer_init, value_ps_writer_free_value, value_ps_writer_copy_value, value_ps_writer_peek_pointer, "p", value_ps_writer_collect_value, "p", value_ps_writer_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (PsWriterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ps_writer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PsWriter), 0, (GInstanceInitFunc) ps_writer_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType ps_writer_type_id;
ps_writer_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PsWriter", &g_define_type_info, &g_define_type_fundamental_info, 0);
g_once_init_leave (&ps_writer_type_id__volatile, ps_writer_type_id);
}
return ps_writer_type_id__volatile;
}
gpointer ps_writer_ref (gpointer instance) {
PsWriter* self;
self = instance;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_atomic_int_inc (&self->ref_count);
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return instance;
#line 5208 "book.c"
}
void ps_writer_unref (gpointer instance) {
PsWriter* self;
self = instance;
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
PS_WRITER_GET_CLASS (self)->finalize (self);
#line 555 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_free_instance ((GTypeInstance *) self);
#line 5221 "book.c"
}
}
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
if ((array != NULL) && (destroy_func != NULL)) {
int i;
for (i = 0; i < array_length; i = i + 1) {
if (((gpointer*) array)[i] != NULL) {
destroy_func (((gpointer*) array)[i]);
}
}
}
}
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
_vala_array_destroy (array, array_length, destroy_func);
g_free (array);
}
|