summaryrefslogtreecommitdiff
path: root/src/Thumbnail.c
blob: c42e9ce3fac178a6204efade1df4055fa0509225 (plain)
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
/* Thumbnail.c generated by valac 0.34.4, the Vala compiler
 * generated from Thumbnail.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <cairo.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gio/gio.h>
#include <gee.h>
#include <pango/pango.h>
#include <time.h>


#define TYPE_DATA_OBJECT (data_object_get_type ())
#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject))
#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass))
#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT))
#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT))
#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass))

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;
typedef struct _DataObjectPrivate DataObjectPrivate;

#define TYPE_ALTERATION (alteration_get_type ())
#define ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALTERATION, Alteration))
#define ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALTERATION, AlterationClass))
#define IS_ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALTERATION))
#define IS_ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALTERATION))
#define ALTERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALTERATION, AlterationClass))

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;

#define TYPE_DATA_COLLECTION (data_collection_get_type ())
#define DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_COLLECTION, DataCollection))
#define DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_COLLECTION, DataCollectionClass))
#define IS_DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_COLLECTION))
#define IS_DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_COLLECTION))
#define DATA_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_COLLECTION, DataCollectionClass))

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

#define TYPE_DATA_VIEW (data_view_get_type ())
#define DATA_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_VIEW, DataView))
#define DATA_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_VIEW, DataViewClass))
#define IS_DATA_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_VIEW))
#define IS_DATA_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_VIEW))
#define DATA_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_VIEW, DataViewClass))

typedef struct _DataView DataView;
typedef struct _DataViewClass DataViewClass;
typedef struct _DataViewPrivate DataViewPrivate;

#define TYPE_DATA_SOURCE (data_source_get_type ())
#define DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SOURCE, DataSource))
#define DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SOURCE, DataSourceClass))
#define IS_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SOURCE))
#define IS_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SOURCE))
#define DATA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SOURCE, DataSourceClass))

typedef struct _DataSource DataSource;
typedef struct _DataSourceClass DataSourceClass;

#define TYPE_THUMBNAIL_VIEW (thumbnail_view_get_type ())
#define THUMBNAIL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_VIEW, ThumbnailView))
#define THUMBNAIL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_VIEW, ThumbnailViewClass))
#define IS_THUMBNAIL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_VIEW))
#define IS_THUMBNAIL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_VIEW))
#define THUMBNAIL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_VIEW, ThumbnailViewClass))

typedef struct _ThumbnailView ThumbnailView;
typedef struct _ThumbnailViewClass ThumbnailViewClass;
typedef struct _ThumbnailViewPrivate ThumbnailViewPrivate;

#define TYPE_CHECKERBOARD_ITEM (checkerboard_item_get_type ())
#define CHECKERBOARD_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CHECKERBOARD_ITEM, CheckerboardItem))
#define CHECKERBOARD_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CHECKERBOARD_ITEM, CheckerboardItemClass))
#define IS_CHECKERBOARD_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CHECKERBOARD_ITEM))
#define IS_CHECKERBOARD_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CHECKERBOARD_ITEM))
#define CHECKERBOARD_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CHECKERBOARD_ITEM, CheckerboardItemClass))

typedef struct _CheckerboardItem CheckerboardItem;
typedef struct _CheckerboardItemClass CheckerboardItemClass;
typedef struct _CheckerboardItemPrivate CheckerboardItemPrivate;

#define TYPE_DIMENSIONS (dimensions_get_type ())
typedef struct _Dimensions Dimensions;

#define TYPE_MEDIA_SOURCE_ITEM (media_source_item_get_type ())
#define MEDIA_SOURCE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem))
#define MEDIA_SOURCE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE_ITEM, MediaSourceItemClass))
#define IS_MEDIA_SOURCE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE_ITEM))
#define IS_MEDIA_SOURCE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE_ITEM))
#define MEDIA_SOURCE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE_ITEM, MediaSourceItemClass))

typedef struct _MediaSourceItem MediaSourceItem;
typedef struct _MediaSourceItemClass MediaSourceItemClass;
typedef struct _MediaSourceItemPrivate MediaSourceItemPrivate;

#define TYPE_THUMBNAIL (thumbnail_get_type ())
#define THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL, Thumbnail))
#define THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL, ThumbnailClass))
#define IS_THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL))
#define IS_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL))
#define THUMBNAIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL, ThumbnailClass))

typedef struct _Thumbnail Thumbnail;
typedef struct _ThumbnailClass ThumbnailClass;
typedef struct _ThumbnailPrivate ThumbnailPrivate;

#define TYPE_THUMBNAIL_SOURCE (thumbnail_source_get_type ())
#define THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSource))
#define THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))
#define IS_THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_SOURCE))
#define IS_THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_SOURCE))
#define THUMBNAIL_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))

typedef struct _ThumbnailSource ThumbnailSource;
typedef struct _ThumbnailSourceClass ThumbnailSourceClass;

#define TYPE_MEDIA_SOURCE (media_source_get_type ())
#define MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE, MediaSource))
#define MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE, MediaSourceClass))
#define IS_MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE))
#define IS_MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE))
#define MEDIA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE, MediaSourceClass))

typedef struct _MediaSource MediaSource;
typedef struct _MediaSourceClass MediaSourceClass;

#define TYPE_SOURCE_COLLECTION (source_collection_get_type ())
#define SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_COLLECTION, SourceCollection))
#define SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_COLLECTION, SourceCollectionClass))
#define IS_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_COLLECTION))
#define IS_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_COLLECTION))
#define SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_COLLECTION, SourceCollectionClass))

typedef struct _SourceCollection SourceCollection;
typedef struct _SourceCollectionClass SourceCollectionClass;

#define TYPE_DATABASE_SOURCE_COLLECTION (database_source_collection_get_type ())
#define DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollection))
#define DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))
#define IS_DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_SOURCE_COLLECTION))
#define IS_DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_SOURCE_COLLECTION))
#define DATABASE_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))

typedef struct _DatabaseSourceCollection DatabaseSourceCollection;
typedef struct _DatabaseSourceCollectionClass DatabaseSourceCollectionClass;

#define TYPE_CONTAINER_SOURCE_COLLECTION (container_source_collection_get_type ())
#define CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection))
#define CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))
#define IS_CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONTAINER_SOURCE_COLLECTION))
#define IS_CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONTAINER_SOURCE_COLLECTION))
#define CONTAINER_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))

typedef struct _ContainerSourceCollection ContainerSourceCollection;
typedef struct _ContainerSourceCollectionClass ContainerSourceCollectionClass;

#define TYPE_TAG_SOURCE_COLLECTION (tag_source_collection_get_type ())
#define TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollection))
#define TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))
#define IS_TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_SOURCE_COLLECTION))
#define IS_TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_SOURCE_COLLECTION))
#define TAG_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))

typedef struct _TagSourceCollection TagSourceCollection;
typedef struct _TagSourceCollectionClass TagSourceCollectionClass;

#define TYPE_CONTAINER_SOURCE (container_source_get_type ())
#define CONTAINER_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONTAINER_SOURCE, ContainerSource))
#define IS_CONTAINER_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONTAINER_SOURCE))
#define CONTAINER_SOURCE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_CONTAINER_SOURCE, ContainerSourceIface))

typedef struct _ContainerSource ContainerSource;
typedef struct _ContainerSourceIface ContainerSourceIface;

#define TYPE_SOURCE_BACKLINK (source_backlink_get_type ())
#define SOURCE_BACKLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_BACKLINK, SourceBacklink))
#define SOURCE_BACKLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_BACKLINK, SourceBacklinkClass))
#define IS_SOURCE_BACKLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_BACKLINK))
#define IS_SOURCE_BACKLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_BACKLINK))
#define SOURCE_BACKLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_BACKLINK, SourceBacklinkClass))

typedef struct _SourceBacklink SourceBacklink;
typedef struct _SourceBacklinkClass SourceBacklinkClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PHOTO_TYPE_EXCEPTION (photo_exception_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_PHOTO_SOURCE (photo_source_get_type ())
#define PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_SOURCE, PhotoSource))
#define PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_SOURCE, PhotoSourceClass))
#define IS_PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_SOURCE))
#define IS_PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_SOURCE))
#define PHOTO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_SOURCE, PhotoSourceClass))

typedef struct _PhotoSource PhotoSource;
typedef struct _PhotoSourceClass PhotoSourceClass;

#define TYPE_PHOTO (photo_get_type ())
#define PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO, Photo))
#define PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO, PhotoClass))
#define IS_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO))
#define IS_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO))
#define PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO, PhotoClass))

typedef struct _Photo Photo;
typedef struct _PhotoClass PhotoClass;

#define TYPE_LIBRARY_PHOTO (library_photo_get_type ())
#define LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO, LibraryPhoto))
#define LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))
#define IS_LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO))
#define IS_LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO))
#define LIBRARY_PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))

typedef struct _LibraryPhoto LibraryPhoto;
typedef struct _LibraryPhotoClass LibraryPhotoClass;

#define TYPE_VIDEO_SOURCE (video_source_get_type ())
#define VIDEO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO_SOURCE, VideoSource))
#define VIDEO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO_SOURCE, VideoSourceClass))
#define IS_VIDEO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO_SOURCE))
#define IS_VIDEO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO_SOURCE))
#define VIDEO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO_SOURCE, VideoSourceClass))

typedef struct _VideoSource VideoSource;
typedef struct _VideoSourceClass VideoSourceClass;

#define TYPE_VIDEO (video_get_type ())
#define VIDEO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO, Video))
#define VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO, VideoClass))
#define IS_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO))
#define IS_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO))
#define VIDEO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO, VideoClass))

typedef struct _Video Video;
typedef struct _VideoClass VideoClass;

#define TYPE_TAG (tag_get_type ())
#define TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG, Tag))
#define TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG, TagClass))
#define IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG))
#define IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG))
#define TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG, TagClass))

typedef struct _Tag Tag;
typedef struct _TagClass TagClass;

#define TYPE_RATING (rating_get_type ())

#define THUMBNAIL_CACHE_TYPE_SIZE (thumbnail_cache_size_get_type ())

#define TYPE_FLAGGABLE (flaggable_get_type ())
#define FLAGGABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FLAGGABLE, Flaggable))
#define IS_FLAGGABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FLAGGABLE))
#define FLAGGABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FLAGGABLE, FlaggableIface))

typedef struct _Flaggable Flaggable;
typedef struct _FlaggableIface FlaggableIface;
#define __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _DataObject {
	GObject parent_instance;
	DataObjectPrivate * priv;
};

struct _DataObjectClass {
	GObjectClass parent_class;
	void (*notify_altered) (DataObject* self, Alteration* alteration);
	void (*notify_membership_changed) (DataObject* self, DataCollection* collection);
	void (*notify_collection_property_set) (DataObject* self, const gchar* name, GValue* old, GValue* val);
	void (*notify_collection_property_cleared) (DataObject* self, const gchar* name);
	gchar* (*get_name) (DataObject* self);
	gchar* (*to_string) (DataObject* self);
};

struct _DataView {
	DataObject parent_instance;
	DataViewPrivate * priv;
};

struct _DataViewClass {
	DataObjectClass parent_class;
	void (*notify_view_altered) (DataView* self);
	void (*notify_geometry_altered) (DataView* self);
	void (*notify_unsubscribed) (DataView* self, DataSource* source);
	void (*state_changed) (DataView* self, gboolean selected);
	void (*visibility_changed) (DataView* self, gboolean visible);
	void (*view_altered) (DataView* self);
	void (*geometry_altered) (DataView* self);
	void (*unsubscribed) (DataView* self, DataSource* source);
};

struct _ThumbnailView {
	DataView parent_instance;
	ThumbnailViewPrivate * priv;
};

struct _ThumbnailViewClass {
	DataViewClass parent_class;
	void (*notify_thumbnail_altered) (ThumbnailView* self);
	void (*thumbnail_altered) (ThumbnailView* self);
};

struct _Dimensions {
	gint width;
	gint height;
};

struct _CheckerboardItem {
	ThumbnailView parent_instance;
	CheckerboardItemPrivate * priv;
	Dimensions requisition;
	GdkRectangle allocation;
};

struct _CheckerboardItemClass {
	ThumbnailViewClass parent_class;
	void (*exposed) (CheckerboardItem* self);
	void (*unexposed) (CheckerboardItem* self);
	gboolean (*is_exposed) (CheckerboardItem* self);
	void (*paint_shadow) (CheckerboardItem* self, cairo_t* ctx, Dimensions* dimensions, GdkPoint* origin, gint radius, gfloat initial_alpha);
	void (*paint_border) (CheckerboardItem* self, cairo_t* ctx, Dimensions* object_dimensions, GdkPoint* object_origin, gint border_width);
	void (*paint_image) (CheckerboardItem* self, cairo_t* ctx, GdkPixbuf* pixbuf, GdkPoint* origin);
	GdkPixbuf* (*get_top_left_trinket) (CheckerboardItem* self, gint scale);
	GdkPixbuf* (*get_top_right_trinket) (CheckerboardItem* self, gint scale);
	GdkPixbuf* (*get_bottom_left_trinket) (CheckerboardItem* self, gint scale);
	GdkPixbuf* (*get_bottom_right_trinket) (CheckerboardItem* self, gint scale);
};

struct _MediaSourceItem {
	CheckerboardItem parent_instance;
	MediaSourceItemPrivate * priv;
};

struct _MediaSourceItemClass {
	CheckerboardItemClass parent_class;
};

struct _Thumbnail {
	MediaSourceItem parent_instance;
	ThumbnailPrivate * priv;
};

struct _ThumbnailClass {
	MediaSourceItemClass parent_class;
};

struct _ThumbnailPrivate {
	MediaSource* media;
	gint scale;
	Dimensions original_dim;
	Dimensions dim;
	GdkPixbuf* unscaled_pixbuf;
	GCancellable* cancellable;
	gboolean hq_scheduled;
	gboolean hq_reschedule;
	gboolean exposure;
};

struct _ContainerSourceIface {
	GTypeInterface parent_iface;
	gboolean (*has_links) (ContainerSource* self);
	SourceBacklink* (*get_backlink) (ContainerSource* self);
	void (*break_link) (ContainerSource* self, DataSource* source);
	void (*break_link_many) (ContainerSource* self, GeeCollection* sources);
	void (*establish_link) (ContainerSource* self, DataSource* source);
	void (*establish_link_many) (ContainerSource* self, GeeCollection* sources);
};

typedef enum  {
	PHOTO_EXCEPTION_NONE = 0,
	PHOTO_EXCEPTION_ORIENTATION = 1 << 0,
	PHOTO_EXCEPTION_CROP = 1 << 1,
	PHOTO_EXCEPTION_REDEYE = 1 << 2,
	PHOTO_EXCEPTION_ADJUST = 1 << 3,
	PHOTO_EXCEPTION_STRAIGHTEN = 1 << 4,
	PHOTO_EXCEPTION_ALL = 0xFFFFFFFFLL
} PhotoException;

typedef enum  {
	RATING_REJECTED = -1,
	RATING_UNRATED = 0,
	RATING_ONE = 1,
	RATING_TWO = 2,
	RATING_THREE = 3,
	RATING_FOUR = 4,
	RATING_FIVE = 5
} Rating;

typedef void (*ThumbnailCacheAsyncFetchCallback) (GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err, void* user_data);
typedef enum  {
	THUMBNAIL_CACHE_SIZE_LARGEST = 360,
	THUMBNAIL_CACHE_SIZE_BIG = 360,
	THUMBNAIL_CACHE_SIZE_MEDIUM = 128,
	THUMBNAIL_CACHE_SIZE_SMALLEST = 128
} ThumbnailCacheSize;

struct _FlaggableIface {
	GTypeInterface parent_iface;
	gboolean (*is_flagged) (Flaggable* self);
	void (*mark_flagged) (Flaggable* self);
	void (*mark_unflagged) (Flaggable* self);
};


static gpointer thumbnail_parent_class = NULL;
extern TagSourceCollection* tag_global;

GType data_object_get_type (void) G_GNUC_CONST;
gpointer alteration_ref (gpointer instance);
void alteration_unref (gpointer instance);
GParamSpec* param_spec_alteration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_alteration (GValue* value, gpointer v_object);
void value_take_alteration (GValue* value, gpointer v_object);
gpointer value_get_alteration (const GValue* value);
GType alteration_get_type (void) G_GNUC_CONST;
gpointer data_collection_ref (gpointer instance);
void data_collection_unref (gpointer instance);
GParamSpec* param_spec_data_collection (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_data_collection (GValue* value, gpointer v_object);
void value_take_data_collection (GValue* value, gpointer v_object);
gpointer value_get_data_collection (const GValue* value);
GType data_collection_get_type (void) G_GNUC_CONST;
GType data_view_get_type (void) G_GNUC_CONST;
GType data_source_get_type (void) G_GNUC_CONST;
GType thumbnail_view_get_type (void) G_GNUC_CONST;
GType checkerboard_item_get_type (void) G_GNUC_CONST;
GType dimensions_get_type (void) G_GNUC_CONST;
Dimensions* dimensions_dup (const Dimensions* self);
void dimensions_free (Dimensions* self);
GType media_source_item_get_type (void) G_GNUC_CONST;
GType thumbnail_get_type (void) G_GNUC_CONST;
GType thumbnail_source_get_type (void) G_GNUC_CONST;
GType media_source_get_type (void) G_GNUC_CONST;
#define THUMBNAIL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_THUMBNAIL, ThumbnailPrivate))
enum  {
	THUMBNAIL_DUMMY_PROPERTY
};
GType source_collection_get_type (void) G_GNUC_CONST;
GType database_source_collection_get_type (void) G_GNUC_CONST;
GType container_source_collection_get_type (void) G_GNUC_CONST;
GType tag_source_collection_get_type (void) G_GNUC_CONST;
gpointer source_backlink_ref (gpointer instance);
void source_backlink_unref (gpointer instance);
GParamSpec* param_spec_source_backlink (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_source_backlink (GValue* value, gpointer v_object);
void value_take_source_backlink (GValue* value, gpointer v_object);
gpointer value_get_source_backlink (const GValue* value);
GType source_backlink_get_type (void) G_GNUC_CONST;
GType container_source_get_type (void) G_GNUC_CONST;
static void thumbnail_on_tag_contents_altered (Thumbnail* self, ContainerSource* container, GeeCollection* added, gboolean relinking, GeeCollection* removed, gboolean unlinking);
static void _thumbnail_on_tag_contents_altered_container_source_collection_container_contents_altered (ContainerSourceCollection* _sender, ContainerSource* container, GeeCollection* added, gboolean relinked, GeeCollection* removed, gboolean unlinked, gpointer self);
static void thumbnail_on_tags_altered (Thumbnail* self, GeeMap* altered);
static void _thumbnail_on_tags_altered_data_collection_items_altered (DataCollection* _sender, GeeMap* items, gpointer self);
#define CHECKERBOARD_ITEM_PROP_SHOW_SUBTITLES "show-subtitles"
#define THUMBNAIL_PROP_SHOW_TAGS CHECKERBOARD_ITEM_PROP_SHOW_SUBTITLES
#define THUMBNAIL_PROP_SIZE "thumbnail-size"
#define THUMBNAIL_PROP_SHOW_RATINGS "show-ratings"
#define THUMBNAIL_LOW_QUALITY_INTERP GDK_INTERP_NEAREST
#define THUMBNAIL_HIGH_QUALITY_INTERP GDK_INTERP_BILINEAR
#define THUMBNAIL_HQ_IMPROVEMENT_MSEC 100
Thumbnail* thumbnail_new (MediaSource* media, gint scale);
Thumbnail* thumbnail_construct (GType object_type, MediaSource* media, gint scale);
GType photo_exception_get_type (void) G_GNUC_CONST;
void media_source_get_dimensions (MediaSource* self, PhotoException disallowed_steps, Dimensions* result);
void dimensions_get_scaled (Dimensions *self, gint scale, gboolean scale_up, Dimensions* result);
gchar* data_object_get_name (DataObject* self);
gchar* media_source_get_comment (MediaSource* self);
MediaSourceItem* media_source_item_new (ThumbnailSource* source, Dimensions* initial_pixbuf_dim, const gchar* title, const gchar* comment, gboolean marked_up, PangoAlignment alignment);
MediaSourceItem* media_source_item_construct (GType object_type, ThumbnailSource* source, Dimensions* initial_pixbuf_dim, const gchar* title, const gchar* comment, gboolean marked_up, PangoAlignment alignment);
GType photo_source_get_type (void) G_GNUC_CONST;
GType photo_get_type (void) G_GNUC_CONST;
GType library_photo_get_type (void) G_GNUC_CONST;
GType video_source_get_type (void) G_GNUC_CONST;
GType video_get_type (void) G_GNUC_CONST;
void media_source_item_set_enable_sprockets (MediaSourceItem* self, gboolean enable_sprockets);
static void thumbnail_update_title (Thumbnail* self, gboolean init);
static void thumbnail_update_comment (Thumbnail* self, gboolean init);
static void thumbnail_update_tags (Thumbnail* self, gboolean init);
GType tag_get_type (void) G_GNUC_CONST;
GeeSortedSet* tag_source_collection_fetch_sorted_for_source (TagSourceCollection* self, MediaSource* photo);
void checkerboard_item_clear_tags (CheckerboardItem* self);
void checkerboard_item_set_tags (CheckerboardItem* self, GeeCollection* tags, PangoAlignment alignment);
gboolean tag_contains (Tag* self, MediaSource* source);
gboolean is_string_empty (const gchar* s);
void checkerboard_item_clear_title (CheckerboardItem* self);
void media_source_item_set_title (MediaSourceItem* self, const gchar* text, gboolean marked_up, PangoAlignment alignment);
void checkerboard_item_clear_comment (CheckerboardItem* self);
void checkerboard_item_set_comment (CheckerboardItem* self, const gchar* text, gboolean marked_up, PangoAlignment alignment);
static void thumbnail_real_notify_altered (DataObject* base, Alteration* alteration);
gboolean alteration_has_detail (Alteration* self, const gchar* subject, const gchar* detail);
void data_object_notify_altered (DataObject* self, Alteration* alteration);
MediaSource* thumbnail_get_media_source (Thumbnail* self);
gint64 thumbnail_photo_id_ascending_comparator (void* a, void* b);
gint64 data_source_get_instance_id (DataSource* self);
gint64 thumbnail_photo_id_descending_comparator (void* a, void* b);
gint64 thumbnail_title_ascending_comparator (void* a, void* b);
gchar* media_source_item_get_natural_collation_key (MediaSourceItem* self);
gint64 thumbnail_title_descending_comparator (void* a, void* b);
gboolean thumbnail_title_comparator_predicate (DataObject* object, Alteration* alteration);
gint64 thumbnail_exposure_time_ascending_comparator (void* a, void* b);
time_t media_source_get_exposure_time (MediaSource* self);
gint64 thumbnail_filename_ascending_comparator (void* a, void* b);
gint64 thumbnail_exposure_time_desending_comparator (void* a, void* b);
gint64 thumbnail_filename_descending_comparator (void* a, void* b);
gboolean thumbnail_exposure_time_comparator_predicate (DataObject* object, Alteration* alteration);
gboolean thumbnail_filename_comparator_predicate (DataObject* object, Alteration* alteration);
GFile* media_source_get_file (MediaSource* self);
gchar* g_utf8_collate_key_for_filename (const gchar* str, gssize len);
gint64 thumbnail_rating_ascending_comparator (void* a, void* b);
GType rating_get_type (void) G_GNUC_CONST;
Rating media_source_get_rating (MediaSource* self);
gint64 thumbnail_rating_descending_comparator (void* a, void* b);
gboolean thumbnail_rating_comparator_predicate (DataObject* object, Alteration* alteration);
static void thumbnail_real_thumbnail_altered (ThumbnailView* base);
static void thumbnail_delayed_high_quality_fetch (Thumbnail* self);
static void thumbnail_paint_empty (Thumbnail* self);
static void thumbnail_real_notify_collection_property_set (DataObject* base, const gchar* name, GValue* old, GValue* val);
static void thumbnail_resize (Thumbnail* self, gint new_scale);
void data_view_notify_view_altered (DataView* self);
void data_object_notify_collection_property_set (DataObject* self, const gchar* name, GValue* old, GValue* val);
gint thumbnail_get_MIN_SCALE (void);
gint thumbnail_get_MAX_SCALE (void);
static void thumbnail_cancel_async_fetch (Thumbnail* self);
gboolean checkerboard_item_has_image (CheckerboardItem* self);
GdkPixbuf* checkerboard_item_get_image (CheckerboardItem* self);
void checkerboard_item_set_image (CheckerboardItem* self, GdkPixbuf* pixbuf);
GdkPixbuf* resize_pixbuf (GdkPixbuf* pixbuf, Dimensions* resized, GdkInterpType interp);
void checkerboard_item_clear_image (CheckerboardItem* self, Dimensions* dim);
static void thumbnail_schedule_low_quality_fetch (Thumbnail* self);
void thumbnail_cache_fetch_async_scaled (ThumbnailSource* source, gint scale, Dimensions* dim, GdkInterpType interp, ThumbnailCacheAsyncFetchCallback callback, void* callback_target, GCancellable* cancellable);
GType thumbnail_cache_size_get_type (void) G_GNUC_CONST;
static void thumbnail_on_low_quality_fetched (Thumbnail* self, GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err);
static void _thumbnail_on_low_quality_fetched_thumbnail_cache_async_fetch_callback (GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err, gpointer self);
static gboolean thumbnail_on_schedule_high_quality (Thumbnail* self);
static gboolean _thumbnail_on_schedule_high_quality_gsource_func (gpointer self);
static void thumbnail_on_high_quality_fetched (Thumbnail* self, GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err);
static void _thumbnail_on_high_quality_fetched_thumbnail_cache_async_fetch_callback (GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err, gpointer self);
gchar* data_object_to_string (DataObject* self);
static void thumbnail_real_exposed (CheckerboardItem* base);
void checkerboard_item_exposed (CheckerboardItem* self);
static void thumbnail_real_unexposed (CheckerboardItem* base);
void checkerboard_item_unexposed (CheckerboardItem* self);
static GdkPixbuf* thumbnail_real_get_top_right_trinket (CheckerboardItem* base, gint scale);
GType flaggable_get_type (void) G_GNUC_CONST;
gboolean flaggable_is_flagged (Flaggable* self);
GdkPixbuf* resources_get_icon (const gchar* name, gint scale);
#define RESOURCES_ICON_FLAGGED_TRINKET "flag-trinket.png"
#define RESOURCES_DEFAULT_ICON_SCALE 24
static GdkPixbuf* thumbnail_real_get_bottom_left_trinket (CheckerboardItem* base, gint scale);
void data_object_get_collection_property (DataObject* self, const gchar* name, GValue* def, GValue* result);
static void _vala_GValue_free (GValue* self);
GdkPixbuf* resources_get_rating_trinket (Rating rating, gint scale);
gint thumbnail_cache_size_get_scale (ThumbnailCacheSize self);
gint thumbnail_get_DEFAULT_SCALE (void);
static void thumbnail_finalize (GObject* obj);
static void _vala_thumbnail_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


static void _thumbnail_on_tag_contents_altered_container_source_collection_container_contents_altered (ContainerSourceCollection* _sender, ContainerSource* container, GeeCollection* added, gboolean relinked, GeeCollection* removed, gboolean unlinked, gpointer self) {
#line 76 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_on_tag_contents_altered ((Thumbnail*) self, container, added, relinked, removed, unlinked);
#line 586 "Thumbnail.c"
}


static void _thumbnail_on_tags_altered_data_collection_items_altered (DataCollection* _sender, GeeMap* items, gpointer self) {
#line 77 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_on_tags_altered ((Thumbnail*) self, items);
#line 593 "Thumbnail.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 53 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return self ? g_object_ref (self) : NULL;
#line 600 "Thumbnail.c"
}


Thumbnail* thumbnail_construct (GType object_type, MediaSource* media, gint scale) {
	Thumbnail * self = NULL;
	MediaSource* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
	Dimensions _tmp2_ = {0};
	gint _tmp3_ = 0;
	Dimensions _tmp4_ = {0};
	MediaSource* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	MediaSource* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	MediaSource* _tmp11_ = NULL;
	MediaSource* _tmp12_ = NULL;
	gint _tmp13_ = 0;
	TagSourceCollection* _tmp14_ = NULL;
	TagSourceCollection* _tmp15_ = NULL;
	gboolean _tmp16_ = FALSE;
	MediaSource* _tmp17_ = NULL;
	MediaSource* _tmp19_ = NULL;
	MediaSource* _tmp20_ = NULL;
	Dimensions _tmp21_ = {0};
	gint _tmp22_ = 0;
	Dimensions _tmp23_ = {0};
#line 49 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_MEDIA_SOURCE (media), NULL);
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = media;
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = media;
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	media_source_get_dimensions (_tmp1_, PHOTO_EXCEPTION_NONE, &_tmp2_);
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = scale;
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	dimensions_get_scaled (&_tmp2_, _tmp3_, TRUE, &_tmp4_);
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = media;
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp6_ = data_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_DATA_OBJECT, DataObject));
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = _tmp6_;
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp8_ = media;
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp9_ = media_source_get_comment (_tmp8_);
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp10_ = _tmp9_;
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = (Thumbnail*) media_source_item_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), &_tmp4_, _tmp7_, _tmp10_, FALSE, PANGO_ALIGN_LEFT);
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (_tmp10_);
#line 50 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (_tmp7_);
#line 53 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp11_ = media;
#line 53 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp12_ = _g_object_ref0 (_tmp11_);
#line 53 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (self->priv->media);
#line 53 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->media = _tmp12_;
#line 54 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp13_ = scale;
#line 54 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->scale = _tmp13_;
#line 56 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp14_ = tag_global;
#line 56 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection), "container-contents-altered", (GCallback) _thumbnail_on_tag_contents_altered_container_source_collection_container_contents_altered, self, 0);
#line 57 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp15_ = tag_global;
#line 57 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_DATA_COLLECTION, DataCollection), "items-altered", (GCallback) _thumbnail_on_tags_altered_data_collection_items_altered, self, 0);
#line 59 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp17_ = media;
#line 59 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, TYPE_LIBRARY_PHOTO)) {
#line 59 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp16_ = TRUE;
#line 685 "Thumbnail.c"
	} else {
		MediaSource* _tmp18_ = NULL;
#line 59 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp18_ = media;
#line 59 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp16_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, TYPE_VIDEO);
#line 692 "Thumbnail.c"
	}
#line 59 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_vala_assert (_tmp16_, "(media is LibraryPhoto) || (media is Video)");
#line 60 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp19_ = media;
#line 60 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	media_source_item_set_enable_sprockets (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem), G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, TYPE_VIDEO));
#line 62 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp20_ = media;
#line 62 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	media_source_get_dimensions (_tmp20_, PHOTO_EXCEPTION_NONE, &_tmp21_);
#line 62 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->original_dim = _tmp21_;
#line 63 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp22_ = scale;
#line 63 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	dimensions_get_scaled (&self->priv->original_dim, _tmp22_, TRUE, &_tmp23_);
#line 63 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->dim = _tmp23_;
#line 67 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_update_title (self, TRUE);
#line 68 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_update_comment (self, TRUE);
#line 69 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_update_tags (self, TRUE);
#line 49 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return self;
#line 720 "Thumbnail.c"
}


Thumbnail* thumbnail_new (MediaSource* media, gint scale) {
#line 49 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return thumbnail_construct (TYPE_THUMBNAIL, media, scale);
#line 727 "Thumbnail.c"
}


static void thumbnail_update_tags (Thumbnail* self, gboolean init) {
	GeeCollection* tags = NULL;
	TagSourceCollection* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
	GeeSortedSet* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	GeeCollection* _tmp4_ = NULL;
#line 80 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 81 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = tag_global;
#line 81 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = self->priv->media;
#line 81 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = tag_source_collection_fetch_sorted_for_source (_tmp0_, _tmp1_);
#line 81 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	tags = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection);
#line 82 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = tags;
#line 82 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp4_ == NULL) {
#line 82 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = TRUE;
#line 754 "Thumbnail.c"
	} else {
		GeeCollection* _tmp5_ = NULL;
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
#line 82 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = tags;
#line 82 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = gee_collection_get_size (_tmp5_);
#line 82 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = _tmp6_;
#line 82 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp7_ == 0;
#line 767 "Thumbnail.c"
	}
#line 82 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp3_) {
#line 83 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		checkerboard_item_clear_tags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
#line 773 "Thumbnail.c"
	} else {
		GeeCollection* _tmp8_ = NULL;
#line 85 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = tags;
#line 85 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		checkerboard_item_set_tags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), _tmp8_, PANGO_ALIGN_LEFT);
#line 780 "Thumbnail.c"
	}
#line 80 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (tags);
#line 784 "Thumbnail.c"
}


static void thumbnail_on_tag_contents_altered (Thumbnail* self, ContainerSource* container, GeeCollection* added, gboolean relinking, GeeCollection* removed, gboolean unlinking) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GeeCollection* _tmp2_ = NULL;
	gboolean tag_added = FALSE;
	gboolean _tmp6_ = FALSE;
	GeeCollection* _tmp7_ = NULL;
	gboolean tag_removed = FALSE;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_ = FALSE;
#line 88 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 88 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_CONTAINER_SOURCE (container));
#line 88 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_COLLECTION (added));
#line 88 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_COLLECTION (removed));
#line 90 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->exposure;
#line 90 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (!_tmp0_) {
#line 91 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		return;
#line 812 "Thumbnail.c"
	}
#line 93 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = added;
#line 93 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp2_ != NULL) {
#line 818 "Thumbnail.c"
		GeeCollection* _tmp3_ = NULL;
		MediaSource* _tmp4_ = NULL;
		gboolean _tmp5_ = FALSE;
#line 93 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = added;
#line 93 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = self->priv->media;
#line 93 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = gee_collection_contains (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DATA_SOURCE, DataSource));
#line 93 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp1_ = _tmp5_;
#line 830 "Thumbnail.c"
	} else {
#line 93 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp1_ = FALSE;
#line 834 "Thumbnail.c"
	}
#line 93 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	tag_added = _tmp1_;
#line 94 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = removed;
#line 94 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp7_ != NULL) {
#line 842 "Thumbnail.c"
		GeeCollection* _tmp8_ = NULL;
		MediaSource* _tmp9_ = NULL;
		gboolean _tmp10_ = FALSE;
#line 94 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = removed;
#line 94 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp9_ = self->priv->media;
#line 94 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp10_ = gee_collection_contains (_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_DATA_SOURCE, DataSource));
#line 94 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = _tmp10_;
#line 854 "Thumbnail.c"
	} else {
#line 94 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = FALSE;
#line 858 "Thumbnail.c"
	}
#line 94 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	tag_removed = _tmp6_;
#line 97 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp12_ = tag_added;
#line 97 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp12_) {
#line 97 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp11_ = TRUE;
#line 868 "Thumbnail.c"
	} else {
		gboolean _tmp13_ = FALSE;
#line 97 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp13_ = tag_removed;
#line 97 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp11_ = _tmp13_;
#line 875 "Thumbnail.c"
	}
#line 97 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp11_) {
#line 98 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		thumbnail_update_tags (self, FALSE);
#line 881 "Thumbnail.c"
	}
}


static void thumbnail_on_tags_altered (Thumbnail* self, GeeMap* altered) {
	gboolean _tmp0_ = FALSE;
#line 101 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 101 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (GEE_IS_MAP (altered));
#line 102 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->exposure;
#line 102 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (!_tmp0_) {
#line 103 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		return;
#line 898 "Thumbnail.c"
	}
	{
		GeeIterator* _object_it = NULL;
		GeeMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp1_ = altered;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp2_ = gee_map_get_keys (_tmp1_);
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp2_;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = _tmp3_;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable));
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = _tmp5_;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (_tmp4_);
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_object_it = _tmp6_;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		while (TRUE) {
#line 926 "Thumbnail.c"
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			DataObject* object = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			Tag* tag = NULL;
			DataObject* _tmp11_ = NULL;
			Tag* _tmp12_ = NULL;
			Tag* _tmp13_ = NULL;
			MediaSource* _tmp14_ = NULL;
			gboolean _tmp15_ = FALSE;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp7_ = _object_it;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp8_ = gee_iterator_next (_tmp7_);
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			if (!_tmp8_) {
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				break;
#line 946 "Thumbnail.c"
			}
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp9_ = _object_it;
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp10_ = gee_iterator_get (_tmp9_);
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			object = (DataObject*) _tmp10_;
#line 106 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp11_ = object;
#line 106 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_TAG, Tag));
#line 106 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			tag = _tmp12_;
#line 108 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp13_ = tag;
#line 108 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp14_ = self->priv->media;
#line 108 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp15_ = tag_contains (_tmp13_, _tmp14_);
#line 108 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			if (_tmp15_) {
#line 109 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				thumbnail_update_tags (self, FALSE);
#line 111 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				_g_object_unref0 (tag);
#line 111 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				_g_object_unref0 (object);
#line 111 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				break;
#line 976 "Thumbnail.c"
			}
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_g_object_unref0 (tag);
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_g_object_unref0 (object);
#line 982 "Thumbnail.c"
		}
#line 105 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (_object_it);
#line 986 "Thumbnail.c"
	}
}


static void thumbnail_update_title (Thumbnail* self, gboolean init) {
	gchar* title = NULL;
	MediaSource* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
#line 116 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 117 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->media;
#line 117 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = data_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DATA_OBJECT, DataObject));
#line 117 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	title = _tmp1_;
#line 118 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = title;
#line 118 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = is_string_empty (_tmp2_);
#line 118 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp3_) {
#line 119 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		checkerboard_item_clear_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
#line 1013 "Thumbnail.c"
	} else {
		gboolean _tmp4_ = FALSE;
#line 120 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = init;
#line 120 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		if (!_tmp4_) {
#line 1020 "Thumbnail.c"
			const gchar* _tmp5_ = NULL;
#line 121 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp5_ = title;
#line 121 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			media_source_item_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem), _tmp5_, FALSE, PANGO_ALIGN_LEFT);
#line 1026 "Thumbnail.c"
		} else {
#line 123 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			media_source_item_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem), "", FALSE, PANGO_ALIGN_LEFT);
#line 1030 "Thumbnail.c"
		}
	}
#line 116 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (title);
#line 1035 "Thumbnail.c"
}


static void thumbnail_update_comment (Thumbnail* self, gboolean init) {
	gchar* comment = NULL;
	MediaSource* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
#line 126 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 127 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->media;
#line 127 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = media_source_get_comment (_tmp0_);
#line 127 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	comment = _tmp1_;
#line 128 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = comment;
#line 128 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = is_string_empty (_tmp2_);
#line 128 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp3_) {
#line 129 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		checkerboard_item_clear_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
#line 1061 "Thumbnail.c"
	} else {
		gboolean _tmp4_ = FALSE;
#line 130 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = init;
#line 130 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		if (!_tmp4_) {
#line 1068 "Thumbnail.c"
			const gchar* _tmp5_ = NULL;
#line 131 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp5_ = comment;
#line 131 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			checkerboard_item_set_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), _tmp5_, FALSE, PANGO_ALIGN_LEFT);
#line 1074 "Thumbnail.c"
		} else {
#line 133 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			checkerboard_item_set_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), "", FALSE, PANGO_ALIGN_LEFT);
#line 1078 "Thumbnail.c"
		}
	}
#line 126 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (comment);
#line 1083 "Thumbnail.c"
}


static void thumbnail_real_notify_altered (DataObject* base, Alteration* alteration) {
	Thumbnail * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	Alteration* _tmp8_ = NULL;
#line 136 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_THUMBNAIL, Thumbnail);
#line 136 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_ALTERATION (alteration));
#line 137 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = self->priv->exposure;
#line 137 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp1_) {
#line 1102 "Thumbnail.c"
		Alteration* _tmp2_ = NULL;
		gboolean _tmp3_ = FALSE;
#line 137 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp2_ = alteration;
#line 137 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = alteration_has_detail (_tmp2_, "metadata", "name");
#line 137 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp0_ = _tmp3_;
#line 1111 "Thumbnail.c"
	} else {
#line 137 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp0_ = FALSE;
#line 1115 "Thumbnail.c"
	}
#line 137 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp0_) {
#line 138 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		thumbnail_update_title (self, FALSE);
#line 1121 "Thumbnail.c"
	}
#line 139 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = self->priv->exposure;
#line 139 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp5_) {
#line 1127 "Thumbnail.c"
		Alteration* _tmp6_ = NULL;
		gboolean _tmp7_ = FALSE;
#line 139 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = alteration;
#line 139 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = alteration_has_detail (_tmp6_, "metadata", "comment");
#line 139 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = _tmp7_;
#line 1136 "Thumbnail.c"
	} else {
#line 139 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = FALSE;
#line 1140 "Thumbnail.c"
	}
#line 139 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp4_) {
#line 140 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		thumbnail_update_comment (self, FALSE);
#line 1146 "Thumbnail.c"
	}
#line 142 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp8_ = alteration;
#line 142 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	DATA_OBJECT_CLASS (thumbnail_parent_class)->notify_altered (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem), TYPE_DATA_OBJECT, DataObject), _tmp8_);
#line 1152 "Thumbnail.c"
}


MediaSource* thumbnail_get_media_source (Thumbnail* self) {
	MediaSource* result = NULL;
	MediaSource* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
#line 145 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_THUMBNAIL (self), NULL);
#line 146 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->media;
#line 146 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 146 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp1_;
#line 146 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1170 "Thumbnail.c"
}


gint64 thumbnail_photo_id_ascending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	void* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
	gint64 _tmp2_ = 0LL;
	void* _tmp3_ = NULL;
	MediaSource* _tmp4_ = NULL;
	gint64 _tmp5_ = 0LL;
#line 154 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = a;
#line 154 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp0_, TYPE_THUMBNAIL, Thumbnail)->priv->media;
#line 154 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = data_source_get_instance_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_SOURCE, DataSource));
#line 154 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = b;
#line 154 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp3_, TYPE_THUMBNAIL, Thumbnail)->priv->media;
#line 154 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = data_source_get_instance_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DATA_SOURCE, DataSource));
#line 154 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp2_ - _tmp5_;
#line 154 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1198 "Thumbnail.c"
}


gint64 thumbnail_photo_id_descending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	void* _tmp0_ = NULL;
	void* _tmp1_ = NULL;
	gint64 _tmp2_ = 0LL;
#line 158 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = b;
#line 158 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = a;
#line 158 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = thumbnail_photo_id_ascending_comparator (_tmp0_, _tmp1_);
#line 158 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp2_;
#line 158 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1217 "Thumbnail.c"
}


gint64 thumbnail_title_ascending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	gint64 _result_ = 0LL;
	GCompareFunc _tmp0_ = NULL;
	void* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	void* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gint64 _tmp8_ = 0LL;
	gint64 _tmp9_ = 0LL;
	gint64 _tmp10_ = 0LL;
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = g_strcmp0;
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = a;
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = media_source_item_get_natural_collation_key (G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp1_, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem));
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = _tmp2_;
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = b;
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = media_source_item_get_natural_collation_key (G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp4_, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem));
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp6_ = _tmp5_;
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = _tmp0_ (_tmp3_, _tmp6_);
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp8_ = (gint64) _tmp7_;
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (_tmp6_);
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (_tmp3_);
#line 162 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_result_ = _tmp8_;
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp10_ = _result_;
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp10_ != ((gint64) 0)) {
#line 1263 "Thumbnail.c"
		gint64 _tmp11_ = 0LL;
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp11_ = _result_;
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp9_ = _tmp11_;
#line 1269 "Thumbnail.c"
	} else {
		void* _tmp12_ = NULL;
		void* _tmp13_ = NULL;
		gint64 _tmp14_ = 0LL;
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp12_ = a;
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp13_ = b;
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp14_ = thumbnail_photo_id_ascending_comparator (_tmp12_, _tmp13_);
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp9_ = _tmp14_;
#line 1282 "Thumbnail.c"
	}
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp9_;
#line 163 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1288 "Thumbnail.c"
}


gint64 thumbnail_title_descending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	gint64 _result_ = 0LL;
	void* _tmp0_ = NULL;
	void* _tmp1_ = NULL;
	gint64 _tmp2_ = 0LL;
	gint64 _tmp3_ = 0LL;
	gint64 _tmp4_ = 0LL;
#line 167 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = b;
#line 167 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = a;
#line 167 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = thumbnail_title_ascending_comparator (_tmp0_, _tmp1_);
#line 167 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_result_ = _tmp2_;
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = _result_;
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp4_ != ((gint64) 0)) {
#line 1312 "Thumbnail.c"
		gint64 _tmp5_ = 0LL;
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = _result_;
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp5_;
#line 1318 "Thumbnail.c"
	} else {
		void* _tmp6_ = NULL;
		void* _tmp7_ = NULL;
		gint64 _tmp8_ = 0LL;
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = a;
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = b;
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = thumbnail_photo_id_descending_comparator (_tmp6_, _tmp7_);
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp8_;
#line 1331 "Thumbnail.c"
	}
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp3_;
#line 169 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1337 "Thumbnail.c"
}


gboolean thumbnail_title_comparator_predicate (DataObject* object, Alteration* alteration) {
	gboolean result = FALSE;
	Alteration* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
#line 172 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 172 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
#line 173 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = alteration;
#line 173 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = alteration_has_detail (_tmp0_, "metadata", "title");
#line 173 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp1_;
#line 173 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1357 "Thumbnail.c"
}


gint64 thumbnail_exposure_time_ascending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	gint64 time_a = 0LL;
	void* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
	time_t _tmp2_ = 0;
	gint64 time_b = 0LL;
	void* _tmp3_ = NULL;
	MediaSource* _tmp4_ = NULL;
	time_t _tmp5_ = 0;
	gint64 _result_ = 0LL;
	gint64 _tmp6_ = 0LL;
	gint64 _tmp7_ = 0LL;
	gint64 _tmp8_ = 0LL;
	gint64 _tmp9_ = 0LL;
#line 177 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = a;
#line 177 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp0_, TYPE_THUMBNAIL, Thumbnail)->priv->media;
#line 177 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = media_source_get_exposure_time (_tmp1_);
#line 177 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	time_a = (gint64) _tmp2_;
#line 178 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = b;
#line 178 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp3_, TYPE_THUMBNAIL, Thumbnail)->priv->media;
#line 178 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = media_source_get_exposure_time (_tmp4_);
#line 178 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	time_b = (gint64) _tmp5_;
#line 179 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp6_ = time_a;
#line 179 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = time_b;
#line 179 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_result_ = _tmp6_ - _tmp7_;
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp9_ = _result_;
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp9_ != ((gint64) 0)) {
#line 1402 "Thumbnail.c"
		gint64 _tmp10_ = 0LL;
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp10_ = _result_;
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = _tmp10_;
#line 1408 "Thumbnail.c"
	} else {
		void* _tmp11_ = NULL;
		void* _tmp12_ = NULL;
		gint64 _tmp13_ = 0LL;
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp11_ = a;
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp12_ = b;
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp13_ = thumbnail_filename_ascending_comparator (_tmp11_, _tmp12_);
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = _tmp13_;
#line 1421 "Thumbnail.c"
	}
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp8_;
#line 181 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1427 "Thumbnail.c"
}


gint64 thumbnail_exposure_time_desending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	gint64 _result_ = 0LL;
	void* _tmp0_ = NULL;
	void* _tmp1_ = NULL;
	gint64 _tmp2_ = 0LL;
	gint64 _tmp3_ = 0LL;
	gint64 _tmp4_ = 0LL;
#line 185 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = b;
#line 185 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = a;
#line 185 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = thumbnail_exposure_time_ascending_comparator (_tmp0_, _tmp1_);
#line 185 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_result_ = _tmp2_;
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = _result_;
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp4_ != ((gint64) 0)) {
#line 1451 "Thumbnail.c"
		gint64 _tmp5_ = 0LL;
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = _result_;
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp5_;
#line 1457 "Thumbnail.c"
	} else {
		void* _tmp6_ = NULL;
		void* _tmp7_ = NULL;
		gint64 _tmp8_ = 0LL;
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = a;
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = b;
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = thumbnail_filename_descending_comparator (_tmp6_, _tmp7_);
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp8_;
#line 1470 "Thumbnail.c"
	}
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp3_;
#line 187 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1476 "Thumbnail.c"
}


gboolean thumbnail_exposure_time_comparator_predicate (DataObject* object, Alteration* alteration) {
	gboolean result = FALSE;
	Alteration* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
#line 190 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 190 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
#line 191 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = alteration;
#line 191 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = alteration_has_detail (_tmp0_, "metadata", "exposure-time");
#line 191 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp1_;
#line 191 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1496 "Thumbnail.c"
}


gboolean thumbnail_filename_comparator_predicate (DataObject* object, Alteration* alteration) {
	gboolean result = FALSE;
	Alteration* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
#line 194 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 194 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
#line 195 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = alteration;
#line 195 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = alteration_has_detail (_tmp0_, "metadata", "filename");
#line 195 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp1_;
#line 195 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1516 "Thumbnail.c"
}


gint64 thumbnail_filename_ascending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	gchar* path_a = NULL;
	void* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* path_b = NULL;
	void* _tmp8_ = NULL;
	MediaSource* _tmp9_ = NULL;
	GFile* _tmp10_ = NULL;
	GFile* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gint64 _result_ = 0LL;
	GCompareFunc _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	gchar* _tmp21_ = NULL;
	gchar* _tmp22_ = NULL;
	gint _tmp23_ = 0;
	gint64 _tmp24_ = 0LL;
	gint64 _tmp25_ = 0LL;
	gint64 _tmp26_ = 0LL;
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = a;
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp0_, TYPE_THUMBNAIL, Thumbnail)->priv->media;
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = media_source_get_file (_tmp1_);
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = _tmp2_;
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = g_file_get_basename (_tmp3_);
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = _tmp4_;
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp6_ = g_utf8_strdown (_tmp5_, (gssize) -1);
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = _tmp6_;
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (_tmp5_);
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (_tmp3_);
#line 199 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	path_a = _tmp7_;
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp8_ = b;
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp9_ = G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp8_, TYPE_THUMBNAIL, Thumbnail)->priv->media;
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp10_ = media_source_get_file (_tmp9_);
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp11_ = _tmp10_;
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp12_ = g_file_get_basename (_tmp11_);
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp13_ = _tmp12_;
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp14_ = g_utf8_strdown (_tmp13_, (gssize) -1);
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp15_ = _tmp14_;
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (_tmp13_);
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (_tmp11_);
#line 200 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	path_b = _tmp15_;
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp16_ = g_strcmp0;
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp17_ = path_a;
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp18_ = g_utf8_collate_key_for_filename (_tmp17_, (gssize) -1);
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp19_ = _tmp18_;
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp20_ = path_b;
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp21_ = g_utf8_collate_key_for_filename (_tmp20_, (gssize) -1);
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp22_ = _tmp21_;
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp23_ = _tmp16_ (_tmp19_, _tmp22_);
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp24_ = (gint64) _tmp23_;
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (_tmp22_);
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (_tmp19_);
#line 202 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_result_ = _tmp24_;
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp26_ = _result_;
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp26_ != ((gint64) 0)) {
#line 1624 "Thumbnail.c"
		gint64 _tmp27_ = 0LL;
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp27_ = _result_;
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp25_ = _tmp27_;
#line 1630 "Thumbnail.c"
	} else {
		void* _tmp28_ = NULL;
		void* _tmp29_ = NULL;
		gint64 _tmp30_ = 0LL;
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp28_ = a;
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp29_ = b;
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp30_ = thumbnail_photo_id_ascending_comparator (_tmp28_, _tmp29_);
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp25_ = _tmp30_;
#line 1643 "Thumbnail.c"
	}
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp25_;
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (path_b);
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_free0 (path_a);
#line 204 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1653 "Thumbnail.c"
}


gint64 thumbnail_filename_descending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	gint64 _result_ = 0LL;
	void* _tmp0_ = NULL;
	void* _tmp1_ = NULL;
	gint64 _tmp2_ = 0LL;
	gint64 _tmp3_ = 0LL;
	gint64 _tmp4_ = 0LL;
#line 208 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = b;
#line 208 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = a;
#line 208 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = thumbnail_filename_ascending_comparator (_tmp0_, _tmp1_);
#line 208 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_result_ = _tmp2_;
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = _result_;
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp4_ != ((gint64) 0)) {
#line 1677 "Thumbnail.c"
		gint64 _tmp5_ = 0LL;
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = _result_;
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp5_;
#line 1683 "Thumbnail.c"
	} else {
		void* _tmp6_ = NULL;
		void* _tmp7_ = NULL;
		gint64 _tmp8_ = 0LL;
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = a;
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = b;
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = thumbnail_photo_id_descending_comparator (_tmp6_, _tmp7_);
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp8_;
#line 1696 "Thumbnail.c"
	}
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp3_;
#line 210 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1702 "Thumbnail.c"
}


gint64 thumbnail_rating_ascending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	gint64 _result_ = 0LL;
	void* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
	Rating _tmp2_ = 0;
	void* _tmp3_ = NULL;
	MediaSource* _tmp4_ = NULL;
	Rating _tmp5_ = 0;
	gint64 _tmp6_ = 0LL;
	gint64 _tmp7_ = 0LL;
#line 214 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = a;
#line 214 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp0_, TYPE_THUMBNAIL, Thumbnail)->priv->media;
#line 214 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = media_source_get_rating (_tmp1_);
#line 214 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = b;
#line 214 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST ((Thumbnail*) _tmp3_, TYPE_THUMBNAIL, Thumbnail)->priv->media;
#line 214 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = media_source_get_rating (_tmp4_);
#line 214 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_result_ = (gint64) (_tmp2_ - _tmp5_);
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = _result_;
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp7_ != ((gint64) 0)) {
#line 1735 "Thumbnail.c"
		gint64 _tmp8_ = 0LL;
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = _result_;
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = _tmp8_;
#line 1741 "Thumbnail.c"
	} else {
		void* _tmp9_ = NULL;
		void* _tmp10_ = NULL;
		gint64 _tmp11_ = 0LL;
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp9_ = a;
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp10_ = b;
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp11_ = thumbnail_photo_id_ascending_comparator (_tmp9_, _tmp10_);
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = _tmp11_;
#line 1754 "Thumbnail.c"
	}
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp6_;
#line 216 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1760 "Thumbnail.c"
}


gint64 thumbnail_rating_descending_comparator (void* a, void* b) {
	gint64 result = 0LL;
	gint64 _result_ = 0LL;
	void* _tmp0_ = NULL;
	void* _tmp1_ = NULL;
	gint64 _tmp2_ = 0LL;
	gint64 _tmp3_ = 0LL;
	gint64 _tmp4_ = 0LL;
#line 220 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = b;
#line 220 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = a;
#line 220 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = thumbnail_rating_ascending_comparator (_tmp0_, _tmp1_);
#line 220 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_result_ = _tmp2_;
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = _result_;
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp4_ != ((gint64) 0)) {
#line 1784 "Thumbnail.c"
		gint64 _tmp5_ = 0LL;
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = _result_;
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp5_;
#line 1790 "Thumbnail.c"
	} else {
		void* _tmp6_ = NULL;
		void* _tmp7_ = NULL;
		gint64 _tmp8_ = 0LL;
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = a;
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = b;
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = thumbnail_photo_id_descending_comparator (_tmp6_, _tmp7_);
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp8_;
#line 1803 "Thumbnail.c"
	}
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp3_;
#line 222 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1809 "Thumbnail.c"
}


gboolean thumbnail_rating_comparator_predicate (DataObject* object, Alteration* alteration) {
	gboolean result = FALSE;
	Alteration* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
#line 225 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 225 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
#line 226 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = alteration;
#line 226 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = alteration_has_detail (_tmp0_, "metadata", "rating");
#line 226 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp1_;
#line 226 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 1829 "Thumbnail.c"
}


static void thumbnail_real_thumbnail_altered (ThumbnailView* base) {
	Thumbnail * self;
	MediaSource* _tmp0_ = NULL;
	Dimensions _tmp1_ = {0};
	gint _tmp2_ = 0;
	Dimensions _tmp3_ = {0};
	gboolean _tmp4_ = FALSE;
#line 229 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_THUMBNAIL, Thumbnail);
#line 230 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->media;
#line 230 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	media_source_get_dimensions (_tmp0_, PHOTO_EXCEPTION_NONE, &_tmp1_);
#line 230 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->original_dim = _tmp1_;
#line 231 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = self->priv->scale;
#line 231 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	dimensions_get_scaled (&self->priv->original_dim, _tmp2_, TRUE, &_tmp3_);
#line 231 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->dim = _tmp3_;
#line 233 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = self->priv->exposure;
#line 233 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp4_) {
#line 234 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		thumbnail_delayed_high_quality_fetch (self);
#line 1860 "Thumbnail.c"
	} else {
#line 236 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		thumbnail_paint_empty (self);
#line 1864 "Thumbnail.c"
	}
#line 238 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	THUMBNAIL_VIEW_CLASS (thumbnail_parent_class)->thumbnail_altered (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem), TYPE_THUMBNAIL_VIEW, ThumbnailView));
#line 1868 "Thumbnail.c"
}


static void thumbnail_real_notify_collection_property_set (DataObject* base, const gchar* name, GValue* old, GValue* val) {
	Thumbnail * self;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GQuark _tmp3_ = 0U;
	const gchar* _tmp5_ = NULL;
	GValue* _tmp6_ = NULL;
	GValue _tmp7_ = {0};
#line 241 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_THUMBNAIL, Thumbnail);
#line 241 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (name != NULL);
#line 241 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (val != NULL);
#line 242 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = name;
#line 242 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = _tmp0_;
#line 242 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
#line 242 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp3_ == g_quark_from_string (THUMBNAIL_PROP_SIZE)) {
#line 242 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		switch (0) {
#line 1896 "Thumbnail.c"
			default:
			{
				GValue _tmp4_ = {0};
#line 244 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				_tmp4_ = *val;
#line 244 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				thumbnail_resize (self, g_value_get_int (&_tmp4_));
#line 245 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				break;
#line 1906 "Thumbnail.c"
			}
		}
	} else if (_tmp3_ == g_quark_from_string (THUMBNAIL_PROP_SHOW_RATINGS)) {
#line 242 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		switch (0) {
#line 1912 "Thumbnail.c"
			default:
			{
#line 248 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				data_view_notify_view_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_VIEW, DataView));
#line 249 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				break;
#line 1919 "Thumbnail.c"
			}
		}
	}
#line 252 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = name;
#line 252 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp6_ = old;
#line 252 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = *val;
#line 252 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	DATA_OBJECT_CLASS (thumbnail_parent_class)->notify_collection_property_set (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem), TYPE_DATA_OBJECT, DataObject), _tmp5_, _tmp6_, &_tmp7_);
#line 1931 "Thumbnail.c"
}


static void thumbnail_resize (Thumbnail* self, gint new_scale) {
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	Dimensions _tmp10_ = {0};
	gboolean _tmp11_ = FALSE;
#line 255 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 256 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = new_scale;
#line 256 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = thumbnail_get_MIN_SCALE ();
#line 256 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = _tmp1_;
#line 256 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_vala_assert (_tmp0_ >= _tmp2_, "new_scale >= MIN_SCALE");
#line 257 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = new_scale;
#line 257 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = thumbnail_get_MAX_SCALE ();
#line 257 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp5_ = _tmp4_;
#line 257 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_vala_assert (_tmp3_ <= _tmp5_, "new_scale <= MAX_SCALE");
#line 259 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp6_ = self->priv->scale;
#line 259 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = new_scale;
#line 259 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp6_ == _tmp7_) {
#line 260 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		return;
#line 1974 "Thumbnail.c"
	}
#line 262 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp8_ = new_scale;
#line 262 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->scale = _tmp8_;
#line 263 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp9_ = self->priv->scale;
#line 263 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	dimensions_get_scaled (&self->priv->original_dim, _tmp9_, TRUE, &_tmp10_);
#line 263 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->dim = _tmp10_;
#line 265 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_cancel_async_fetch (self);
#line 267 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp11_ = self->priv->exposure;
#line 267 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp11_) {
#line 1992 "Thumbnail.c"
		GdkPixbuf* resizable = NULL;
		GdkPixbuf* _tmp12_ = NULL;
		GdkPixbuf* _tmp17_ = NULL;
#line 272 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		resizable = NULL;
#line 273 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp12_ = self->priv->unscaled_pixbuf;
#line 273 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		if (_tmp12_ != NULL) {
#line 2002 "Thumbnail.c"
			GdkPixbuf* _tmp13_ = NULL;
			GdkPixbuf* _tmp14_ = NULL;
#line 274 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp13_ = self->priv->unscaled_pixbuf;
#line 274 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp14_ = _g_object_ref0 (_tmp13_);
#line 274 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_g_object_unref0 (resizable);
#line 274 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			resizable = _tmp14_;
#line 2013 "Thumbnail.c"
		} else {
			gboolean _tmp15_ = FALSE;
#line 275 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp15_ = checkerboard_item_has_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
#line 275 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			if (_tmp15_) {
#line 2020 "Thumbnail.c"
				GdkPixbuf* _tmp16_ = NULL;
#line 276 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				_tmp16_ = checkerboard_item_get_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
#line 276 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				_g_object_unref0 (resizable);
#line 276 "/home/jens/Source/shotwell/src/Thumbnail.vala"
				resizable = _tmp16_;
#line 2028 "Thumbnail.c"
			}
		}
#line 278 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp17_ = resizable;
#line 278 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		if (_tmp17_ != NULL) {
#line 2035 "Thumbnail.c"
			GdkPixbuf* _tmp18_ = NULL;
			Dimensions _tmp19_ = {0};
			GdkPixbuf* _tmp20_ = NULL;
			GdkPixbuf* _tmp21_ = NULL;
#line 279 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp18_ = resizable;
#line 279 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp19_ = self->priv->dim;
#line 279 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp20_ = resize_pixbuf (_tmp18_, &_tmp19_, THUMBNAIL_LOW_QUALITY_INTERP);
#line 279 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_tmp21_ = _tmp20_;
#line 279 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			checkerboard_item_set_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), _tmp21_);
#line 279 "/home/jens/Source/shotwell/src/Thumbnail.vala"
			_g_object_unref0 (_tmp21_);
#line 2052 "Thumbnail.c"
		}
#line 281 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		thumbnail_delayed_high_quality_fetch (self);
#line 267 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (resizable);
#line 2058 "Thumbnail.c"
	} else {
		Dimensions _tmp22_ = {0};
#line 283 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp22_ = self->priv->dim;
#line 283 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		checkerboard_item_clear_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), &_tmp22_);
#line 2065 "Thumbnail.c"
	}
}


static void thumbnail_paint_empty (Thumbnail* self) {
	Dimensions _tmp0_ = {0};
#line 287 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 288 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_cancel_async_fetch (self);
#line 289 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->dim;
#line 289 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	checkerboard_item_clear_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), &_tmp0_);
#line 290 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (self->priv->unscaled_pixbuf);
#line 290 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->unscaled_pixbuf = NULL;
#line 2084 "Thumbnail.c"
}


static void _thumbnail_on_low_quality_fetched_thumbnail_cache_async_fetch_callback (GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err, gpointer self) {
#line 297 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_on_low_quality_fetched ((Thumbnail*) self, pixbuf, unscaled, dim, interp, err);
#line 2091 "Thumbnail.c"
}


static void thumbnail_schedule_low_quality_fetch (Thumbnail* self) {
	GCancellable* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
	Dimensions _tmp2_ = {0};
	GCancellable* _tmp3_ = NULL;
#line 293 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 294 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_cancel_async_fetch (self);
#line 295 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = g_cancellable_new ();
#line 295 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (self->priv->cancellable);
#line 295 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->cancellable = _tmp0_;
#line 297 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = self->priv->media;
#line 297 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = self->priv->dim;
#line 297 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp3_ = self->priv->cancellable;
#line 297 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_cache_fetch_async_scaled (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), (gint) THUMBNAIL_CACHE_SIZE_SMALLEST, &_tmp2_, THUMBNAIL_LOW_QUALITY_INTERP, _thumbnail_on_low_quality_fetched_thumbnail_cache_async_fetch_callback, self, _tmp3_);
#line 2118 "Thumbnail.c"
}


static gboolean _thumbnail_on_schedule_high_quality_gsource_func (gpointer self) {
	gboolean result;
	result = thumbnail_on_schedule_high_quality ((Thumbnail*) self);
#line 308 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 2127 "Thumbnail.c"
}


static void thumbnail_delayed_high_quality_fetch (Thumbnail* self) {
	gboolean _tmp0_ = FALSE;
#line 301 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 302 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->hq_scheduled;
#line 302 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp0_) {
#line 303 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		self->priv->hq_reschedule = TRUE;
#line 305 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		return;
#line 2143 "Thumbnail.c"
	}
#line 308 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) THUMBNAIL_HQ_IMPROVEMENT_MSEC, _thumbnail_on_schedule_high_quality_gsource_func, g_object_ref (self), g_object_unref);
#line 309 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->hq_scheduled = TRUE;
#line 2149 "Thumbnail.c"
}


static void _thumbnail_on_high_quality_fetched_thumbnail_cache_async_fetch_callback (GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err, gpointer self) {
#line 323 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_on_high_quality_fetched ((Thumbnail*) self, pixbuf, unscaled, dim, interp, err);
#line 2156 "Thumbnail.c"
}


static gboolean thumbnail_on_schedule_high_quality (Thumbnail* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GCancellable* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
#line 312 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_val_if_fail (IS_THUMBNAIL (self), FALSE);
#line 313 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->hq_reschedule;
#line 313 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp0_) {
#line 314 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		self->priv->hq_reschedule = FALSE;
#line 316 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		result = TRUE;
#line 316 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		return result;
#line 2177 "Thumbnail.c"
	}
#line 319 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_cancel_async_fetch (self);
#line 320 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = g_cancellable_new ();
#line 320 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (self->priv->cancellable);
#line 320 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->cancellable = _tmp1_;
#line 322 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = self->priv->exposure;
#line 322 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp2_) {
#line 2191 "Thumbnail.c"
		MediaSource* _tmp3_ = NULL;
		gint _tmp4_ = 0;
		Dimensions _tmp5_ = {0};
		GCancellable* _tmp6_ = NULL;
#line 323 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = self->priv->media;
#line 323 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = self->priv->scale;
#line 323 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = self->priv->dim;
#line 323 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = self->priv->cancellable;
#line 323 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		thumbnail_cache_fetch_async_scaled (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), _tmp4_, &_tmp5_, THUMBNAIL_HIGH_QUALITY_INTERP, _thumbnail_on_high_quality_fetched_thumbnail_cache_async_fetch_callback, self, _tmp6_);
#line 2206 "Thumbnail.c"
	}
#line 327 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->hq_scheduled = FALSE;
#line 329 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = FALSE;
#line 329 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 2214 "Thumbnail.c"
}


static void thumbnail_cancel_async_fetch (Thumbnail* self) {
	GCancellable* _tmp0_ = NULL;
#line 332 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 334 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->cancellable;
#line 334 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp0_ != NULL) {
#line 2226 "Thumbnail.c"
		GCancellable* _tmp1_ = NULL;
#line 335 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp1_ = self->priv->cancellable;
#line 335 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		g_cancellable_cancel (_tmp1_);
#line 2232 "Thumbnail.c"
	}
}


static void thumbnail_on_low_quality_fetched (Thumbnail* self, GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err) {
	GError* _tmp0_ = NULL;
	GdkPixbuf* _tmp6_ = NULL;
	GdkPixbuf* _tmp8_ = NULL;
#line 338 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 338 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail ((pixbuf == NULL) || GDK_IS_PIXBUF (pixbuf));
#line 338 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail ((unscaled == NULL) || GDK_IS_PIXBUF (unscaled));
#line 338 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (dim != NULL);
#line 340 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = err;
#line 340 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp0_ != NULL) {
#line 2253 "Thumbnail.c"
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
#line 341 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp1_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 341 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp2_ = _tmp1_;
#line 341 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = self->priv->scale;
#line 341 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = err;
#line 341 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = _tmp4_->message;
#line 341 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		g_critical ("Thumbnail.vala:341: Unable to fetch low-quality thumbnail for %s (scal" \
"e: %d): %s", _tmp2_, _tmp3_, _tmp5_);
#line 341 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_free0 (_tmp2_);
#line 2273 "Thumbnail.c"
	}
#line 344 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp6_ = pixbuf;
#line 344 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp6_ != NULL) {
#line 2279 "Thumbnail.c"
		GdkPixbuf* _tmp7_ = NULL;
#line 345 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = pixbuf;
#line 345 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		checkerboard_item_set_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), _tmp7_);
#line 2285 "Thumbnail.c"
	}
#line 347 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp8_ = unscaled;
#line 347 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp8_ != NULL) {
#line 2291 "Thumbnail.c"
		GdkPixbuf* _tmp9_ = NULL;
		GdkPixbuf* _tmp10_ = NULL;
#line 348 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp9_ = unscaled;
#line 348 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp10_ = _g_object_ref0 (_tmp9_);
#line 348 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (self->priv->unscaled_pixbuf);
#line 348 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		self->priv->unscaled_pixbuf = _tmp10_;
#line 2302 "Thumbnail.c"
	}
#line 350 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_delayed_high_quality_fetch (self);
#line 2306 "Thumbnail.c"
}


static void thumbnail_on_high_quality_fetched (Thumbnail* self, GdkPixbuf* pixbuf, GdkPixbuf* unscaled, Dimensions* dim, GdkInterpType interp, GError* err) {
	GError* _tmp0_ = NULL;
	GdkPixbuf* _tmp6_ = NULL;
	GdkPixbuf* _tmp8_ = NULL;
#line 353 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (IS_THUMBNAIL (self));
#line 353 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail ((pixbuf == NULL) || GDK_IS_PIXBUF (pixbuf));
#line 353 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail ((unscaled == NULL) || GDK_IS_PIXBUF (unscaled));
#line 353 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_return_if_fail (dim != NULL);
#line 355 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = err;
#line 355 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp0_ != NULL) {
#line 2326 "Thumbnail.c"
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
#line 356 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp1_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 356 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp2_ = _tmp1_;
#line 356 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = self->priv->scale;
#line 356 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp4_ = err;
#line 356 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = _tmp4_->message;
#line 356 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		g_critical ("Thumbnail.vala:356: Unable to fetch high-quality thumbnail for %s (sca" \
"le: %d): %s", _tmp2_, _tmp3_, _tmp5_);
#line 356 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_free0 (_tmp2_);
#line 2346 "Thumbnail.c"
	}
#line 359 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp6_ = pixbuf;
#line 359 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp6_ != NULL) {
#line 2352 "Thumbnail.c"
		GdkPixbuf* _tmp7_ = NULL;
#line 360 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = pixbuf;
#line 360 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		checkerboard_item_set_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), _tmp7_);
#line 2358 "Thumbnail.c"
	}
#line 362 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp8_ = unscaled;
#line 362 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp8_ != NULL) {
#line 2364 "Thumbnail.c"
		GdkPixbuf* _tmp9_ = NULL;
		GdkPixbuf* _tmp10_ = NULL;
#line 363 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp9_ = unscaled;
#line 363 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp10_ = _g_object_ref0 (_tmp9_);
#line 363 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (self->priv->unscaled_pixbuf);
#line 363 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		self->priv->unscaled_pixbuf = _tmp10_;
#line 2375 "Thumbnail.c"
	}
}


static void thumbnail_real_exposed (CheckerboardItem* base) {
	Thumbnail * self;
	gboolean _tmp0_ = FALSE;
#line 366 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_THUMBNAIL, Thumbnail);
#line 367 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->exposure = TRUE;
#line 369 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = checkerboard_item_has_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
#line 369 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (!_tmp0_) {
#line 370 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		thumbnail_schedule_low_quality_fetch (self);
#line 2393 "Thumbnail.c"
	}
#line 372 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_update_title (self, FALSE);
#line 373 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_update_comment (self, FALSE);
#line 374 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_update_tags (self, FALSE);
#line 376 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	CHECKERBOARD_ITEM_CLASS (thumbnail_parent_class)->exposed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem), TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
#line 2403 "Thumbnail.c"
}


static void thumbnail_real_unexposed (CheckerboardItem* base) {
	Thumbnail * self;
#line 379 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_THUMBNAIL, Thumbnail);
#line 380 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->exposure = FALSE;
#line 382 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_paint_empty (self);
#line 384 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	CHECKERBOARD_ITEM_CLASS (thumbnail_parent_class)->unexposed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem), TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
#line 2417 "Thumbnail.c"
}


static GdkPixbuf* thumbnail_real_get_top_right_trinket (CheckerboardItem* base, gint scale) {
	Thumbnail * self;
	GdkPixbuf* result = NULL;
	Flaggable* flaggable = NULL;
	MediaSource* _tmp0_ = NULL;
	Flaggable* _tmp1_ = NULL;
	GdkPixbuf* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	Flaggable* _tmp4_ = NULL;
#line 387 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_THUMBNAIL, Thumbnail);
#line 388 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->media;
#line 388 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_FLAGGABLE) ? ((Flaggable*) _tmp0_) : NULL);
#line 388 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	flaggable = _tmp1_;
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = flaggable;
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp4_ != NULL) {
#line 2442 "Thumbnail.c"
		Flaggable* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = flaggable;
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = flaggable_is_flagged (_tmp5_);
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = _tmp6_;
#line 2451 "Thumbnail.c"
	} else {
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp3_ = FALSE;
#line 2455 "Thumbnail.c"
	}
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp3_) {
#line 2459 "Thumbnail.c"
		GdkPixbuf* _tmp7_ = NULL;
#line 391 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp7_ = resources_get_icon (RESOURCES_ICON_FLAGGED_TRINKET, RESOURCES_DEFAULT_ICON_SCALE);
#line 391 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (_tmp2_);
#line 391 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp2_ = _tmp7_;
#line 2467 "Thumbnail.c"
	} else {
#line 391 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (_tmp2_);
#line 391 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp2_ = NULL;
#line 2473 "Thumbnail.c"
	}
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp2_;
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (flaggable);
#line 390 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 2481 "Thumbnail.c"
}


static void _vala_GValue_free (GValue* self) {
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_value_unset (self);
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_free (self);
#line 2490 "Thumbnail.c"
}


static GdkPixbuf* thumbnail_real_get_bottom_left_trinket (CheckerboardItem* base, gint scale) {
	Thumbnail * self;
	GdkPixbuf* result = NULL;
	Rating rating = 0;
	MediaSource* _tmp0_ = NULL;
	Rating _tmp1_ = 0;
	gboolean show_ratings = FALSE;
	GValue* _tmp2_ = NULL;
	GValue _tmp3_ = {0};
	gboolean _tmp4_ = FALSE;
	GdkPixbuf* _tmp5_ = NULL;
	gboolean _tmp6_ = FALSE;
	Rating _tmp7_ = 0;
#line 394 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_THUMBNAIL, Thumbnail);
#line 395 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->media;
#line 395 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp1_ = media_source_get_rating (_tmp0_);
#line 395 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	rating = _tmp1_;
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = g_new0 (GValue, 1);
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_value_init (_tmp2_, G_TYPE_BOOLEAN);
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_value_set_boolean (_tmp2_, FALSE);
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	data_object_get_collection_property (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), THUMBNAIL_PROP_SHOW_RATINGS, _tmp2_, &_tmp3_);
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = g_value_get_boolean (&_tmp3_);
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	__vala_GValue_free0 (_tmp2_);
#line 396 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	show_ratings = _tmp4_;
#line 398 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp7_ = rating;
#line 398 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp7_ != RATING_UNRATED) {
#line 2533 "Thumbnail.c"
		gboolean _tmp8_ = FALSE;
#line 398 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp8_ = show_ratings;
#line 398 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = _tmp8_;
#line 2539 "Thumbnail.c"
	} else {
#line 398 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp6_ = FALSE;
#line 2543 "Thumbnail.c"
	}
#line 398 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp6_) {
#line 2547 "Thumbnail.c"
		Rating _tmp9_ = 0;
		gint _tmp10_ = 0;
		GdkPixbuf* _tmp11_ = NULL;
#line 399 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp9_ = rating;
#line 399 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp10_ = scale;
#line 399 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp11_ = resources_get_rating_trinket (_tmp9_, _tmp10_);
#line 399 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (_tmp5_);
#line 399 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = _tmp11_;
#line 2561 "Thumbnail.c"
	} else {
#line 399 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_g_object_unref0 (_tmp5_);
#line 399 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp5_ = NULL;
#line 2567 "Thumbnail.c"
	}
#line 398 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp5_;
#line 398 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 2573 "Thumbnail.c"
}


gint thumbnail_get_MIN_SCALE (void) {
	gint result;
#line 18 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = 72;
#line 18 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 2583 "Thumbnail.c"
}


gint thumbnail_get_MAX_SCALE (void) {
	gint result;
	gint _tmp0_ = 0;
#line 23 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = thumbnail_cache_size_get_scale (THUMBNAIL_CACHE_SIZE_LARGEST);
#line 23 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp0_;
#line 23 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 2596 "Thumbnail.c"
}


gint thumbnail_get_DEFAULT_SCALE (void) {
	gint result;
	gint _tmp0_ = 0;
#line 28 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = thumbnail_cache_size_get_scale (THUMBNAIL_CACHE_SIZE_MEDIUM);
#line 28 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	result = _tmp0_;
#line 28 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	return result;
#line 2609 "Thumbnail.c"
}


static void thumbnail_class_init (ThumbnailClass * klass) {
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	thumbnail_parent_class = g_type_class_peek_parent (klass);
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_type_class_add_private (klass, sizeof (ThumbnailPrivate));
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	((DataObjectClass *) klass)->notify_altered = thumbnail_real_notify_altered;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	((ThumbnailViewClass *) klass)->thumbnail_altered = thumbnail_real_thumbnail_altered;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	((DataObjectClass *) klass)->notify_collection_property_set = thumbnail_real_notify_collection_property_set;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	((CheckerboardItemClass *) klass)->exposed = thumbnail_real_exposed;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	((CheckerboardItemClass *) klass)->unexposed = thumbnail_real_unexposed;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	((CheckerboardItemClass *) klass)->get_top_right_trinket = thumbnail_real_get_top_right_trinket;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	((CheckerboardItemClass *) klass)->get_bottom_left_trinket = thumbnail_real_get_bottom_left_trinket;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_thumbnail_get_property;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	G_OBJECT_CLASS (klass)->finalize = thumbnail_finalize;
#line 2636 "Thumbnail.c"
}


static void thumbnail_instance_init (Thumbnail * self) {
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv = THUMBNAIL_GET_PRIVATE (self);
#line 41 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->unscaled_pixbuf = NULL;
#line 42 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->cancellable = NULL;
#line 43 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->hq_scheduled = FALSE;
#line 44 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->hq_reschedule = FALSE;
#line 47 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self->priv->exposure = FALSE;
#line 2653 "Thumbnail.c"
}


static void thumbnail_finalize (GObject* obj) {
	Thumbnail * self;
	GCancellable* _tmp0_ = NULL;
	TagSourceCollection* _tmp2_ = NULL;
	guint _tmp3_ = 0U;
	TagSourceCollection* _tmp4_ = NULL;
	guint _tmp5_ = 0U;
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_THUMBNAIL, Thumbnail);
#line 73 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp0_ = self->priv->cancellable;
#line 73 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	if (_tmp0_ != NULL) {
#line 2670 "Thumbnail.c"
		GCancellable* _tmp1_ = NULL;
#line 74 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		_tmp1_ = self->priv->cancellable;
#line 74 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		g_cancellable_cancel (_tmp1_);
#line 2676 "Thumbnail.c"
	}
#line 76 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp2_ = tag_global;
#line 76 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_signal_parse_name ("container-contents-altered", TYPE_CONTAINER_SOURCE_COLLECTION, &_tmp3_, NULL, FALSE);
#line 76 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _thumbnail_on_tag_contents_altered_container_source_collection_container_contents_altered, self);
#line 77 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_tmp4_ = tag_global;
#line 77 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_signal_parse_name ("items-altered", TYPE_DATA_COLLECTION, &_tmp5_, NULL, FALSE);
#line 77 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _thumbnail_on_tags_altered_data_collection_items_altered, self);
#line 37 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (self->priv->media);
#line 41 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (self->priv->unscaled_pixbuf);
#line 42 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	_g_object_unref0 (self->priv->cancellable);
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	G_OBJECT_CLASS (thumbnail_parent_class)->finalize (obj);
#line 2698 "Thumbnail.c"
}


GType thumbnail_get_type (void) {
	static volatile gsize thumbnail_type_id__volatile = 0;
	if (g_once_init_enter (&thumbnail_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ThumbnailClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) thumbnail_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Thumbnail), 0, (GInstanceInitFunc) thumbnail_instance_init, NULL };
		GType thumbnail_type_id;
		thumbnail_type_id = g_type_register_static (TYPE_MEDIA_SOURCE_ITEM, "Thumbnail", &g_define_type_info, 0);
		g_once_init_leave (&thumbnail_type_id__volatile, thumbnail_type_id);
	}
	return thumbnail_type_id__volatile;
}


static void _vala_thumbnail_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	Thumbnail * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_THUMBNAIL, Thumbnail);
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
	switch (property_id) {
#line 2719 "Thumbnail.c"
		default:
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 7 "/home/jens/Source/shotwell/src/Thumbnail.vala"
		break;
#line 2725 "Thumbnail.c"
	}
}