1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
|
/* misc.c generated by valac 0.34.2, the Vala compiler
* generated from misc.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 <time.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gee.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <gobject/gvaluecollector.h>
#define _g_checksum_free0(var) ((var == NULL) ? NULL : (var = (g_checksum_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#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;
#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_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_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_PHOTO_ID (photo_id_get_type ())
typedef struct _PhotoID PhotoID;
#define TYPE_MEDIA_COLLECTION_REGISTRY (media_collection_registry_get_type ())
#define MEDIA_COLLECTION_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistry))
#define MEDIA_COLLECTION_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistryClass))
#define IS_MEDIA_COLLECTION_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_COLLECTION_REGISTRY))
#define IS_MEDIA_COLLECTION_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_COLLECTION_REGISTRY))
#define MEDIA_COLLECTION_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistryClass))
typedef struct _MediaCollectionRegistry MediaCollectionRegistry;
typedef struct _MediaCollectionRegistryClass MediaCollectionRegistryClass;
#define _media_collection_registry_unref0(var) ((var == NULL) ? NULL : (var = (media_collection_registry_unref (var), NULL)))
#define TYPE_ONE_SHOT_SCHEDULER (one_shot_scheduler_get_type ())
#define ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotScheduler))
#define ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass))
#define IS_ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ONE_SHOT_SCHEDULER))
#define IS_ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ONE_SHOT_SCHEDULER))
#define ONE_SHOT_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass))
typedef struct _OneShotScheduler OneShotScheduler;
typedef struct _OneShotSchedulerClass OneShotSchedulerClass;
typedef struct _OneShotSchedulerPrivate OneShotSchedulerPrivate;
typedef struct _ParamSpecOneShotScheduler ParamSpecOneShotScheduler;
#define TYPE_OP_TIMER (op_timer_get_type ())
#define OP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_OP_TIMER, OpTimer))
#define OP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_OP_TIMER, OpTimerClass))
#define IS_OP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_OP_TIMER))
#define IS_OP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_OP_TIMER))
#define OP_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_OP_TIMER, OpTimerClass))
typedef struct _OpTimer OpTimer;
typedef struct _OpTimerClass OpTimerClass;
typedef struct _OpTimerPrivate OpTimerPrivate;
#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
typedef struct _ParamSpecOpTimer ParamSpecOpTimer;
#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);
typedef gboolean (*ValueEqualFunc) (GValue* a, GValue* b, void* user_data);
struct _PhotoID {
gint64 id;
};
typedef void (*OneShotCallback) (void* user_data);
struct _OneShotScheduler {
GTypeInstance parent_instance;
volatile int ref_count;
OneShotSchedulerPrivate * priv;
};
struct _OneShotSchedulerClass {
GTypeClass parent_class;
void (*finalize) (OneShotScheduler *self);
};
struct _OneShotSchedulerPrivate {
gchar* name;
OneShotCallback callback;
gpointer callback_target;
guint scheduled;
};
struct _ParamSpecOneShotScheduler {
GParamSpec parent_instance;
};
struct _OpTimer {
GTypeInstance parent_instance;
volatile int ref_count;
OpTimerPrivate * priv;
};
struct _OpTimerClass {
GTypeClass parent_class;
void (*finalize) (OpTimer *self);
};
struct _OpTimerPrivate {
gchar* name;
GTimer* timer;
glong count;
gdouble elapsed;
gdouble shortest;
gdouble longest;
};
struct _ParamSpecOpTimer {
GParamSpec parent_instance;
};
static gpointer one_shot_scheduler_parent_class = NULL;
static gpointer op_timer_parent_class = NULL;
guint int64_hash (gint64* n);
gboolean int64_equal (gint64* a, gint64* b);
gint int64_compare (gint64* a, gint64* b);
gint uint64_compare (guint64* a, guint64* b);
gboolean bool_value_equals (GValue* a, GValue* b);
gboolean int_value_equals (GValue* a, GValue* b);
gulong timeval_to_ms (GTimeVal* time_val);
gulong now_ms (void);
gulong now_sec (void);
time_t now_time_t (void);
gchar* md5_binary (guint8* buffer, gsize length);
gchar* md5_file (GFile* file, GError** error);
gboolean equal_sets (GeeSet* a, GeeSet* b);
GeeSet* intersection_of_sets (GeeSet* a, GeeSet* b, GeeSet* excluded);
GType data_object_get_type (void) G_GNUC_CONST;
GType data_source_get_type (void) G_GNUC_CONST;
GType thumbnail_source_get_type (void) G_GNUC_CONST;
GType media_source_get_type (void) G_GNUC_CONST;
GType photo_source_get_type (void) G_GNUC_CONST;
GType photo_get_type (void) G_GNUC_CONST;
guchar* serialize_photo_ids (GeeCollection* photos, int* result_length1);
GType photo_id_get_type (void) G_GNUC_CONST;
PhotoID* photo_id_dup (const PhotoID* self);
void photo_id_free (PhotoID* self);
void photo_get_photo_id (Photo* self, PhotoID* result);
GeeList* unserialize_photo_ids (guchar* serialized, gint size);
void photo_id_init (PhotoID *self, gint64 id);
guchar* serialize_media_sources (GeeCollection* media, int* result_length1);
gchar* data_source_get_source_id (DataSource* self);
GeeList* unserialize_media_sources (guchar* serialized, gint size);
gpointer media_collection_registry_ref (gpointer instance);
void media_collection_registry_unref (gpointer instance);
GParamSpec* param_spec_media_collection_registry (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_media_collection_registry (GValue* value, gpointer v_object);
void value_take_media_collection_registry (GValue* value, gpointer v_object);
gpointer value_get_media_collection_registry (const GValue* value);
GType media_collection_registry_get_type (void) G_GNUC_CONST;
MediaCollectionRegistry* media_collection_registry_get_instance (void);
MediaSource* media_collection_registry_fetch_media (MediaCollectionRegistry* self, const gchar* source_id);
gchar* format_local_datespan (struct tm* from_date, struct tm* to_date);
gchar* resources_get_start_multiday_span_format_string (void);
gchar* resources_get_end_multiday_span_format_string (void);
gchar* resources_get_start_multimonth_span_format_string (void);
gchar* resources_get_end_multimonth_span_format_string (void);
gchar* resources_get_long_date_format_string (void);
gchar* string_strip_leading_zeroes (const gchar* str);
gchar* format_local_date (struct tm* date);
gpointer one_shot_scheduler_ref (gpointer instance);
void one_shot_scheduler_unref (gpointer instance);
GParamSpec* param_spec_one_shot_scheduler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_one_shot_scheduler (GValue* value, gpointer v_object);
void value_take_one_shot_scheduler (GValue* value, gpointer v_object);
gpointer value_get_one_shot_scheduler (const GValue* value);
GType one_shot_scheduler_get_type (void) G_GNUC_CONST;
#define ONE_SHOT_SCHEDULER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerPrivate))
enum {
ONE_SHOT_SCHEDULER_DUMMY_PROPERTY
};
void one_shot_scheduler_cancel (OneShotScheduler* self);
OneShotScheduler* one_shot_scheduler_new (const gchar* name, OneShotCallback callback, void* callback_target);
OneShotScheduler* one_shot_scheduler_construct (GType object_type, const gchar* name, OneShotCallback callback, void* callback_target);
gboolean one_shot_scheduler_is_scheduled (OneShotScheduler* self);
void one_shot_scheduler_at_idle (OneShotScheduler* self);
void one_shot_scheduler_at_priority_idle (OneShotScheduler* self, gint priority);
static gboolean one_shot_scheduler_callback_wrapper (OneShotScheduler* self);
static gboolean _one_shot_scheduler_callback_wrapper_gsource_func (gpointer self);
void one_shot_scheduler_after_timeout (OneShotScheduler* self, guint msec, gboolean reschedule);
void one_shot_scheduler_priority_after_timeout (OneShotScheduler* self, gint priority, guint msec, gboolean reschedule);
static void one_shot_scheduler_finalize (OneShotScheduler* obj);
gpointer op_timer_ref (gpointer instance);
void op_timer_unref (gpointer instance);
GParamSpec* param_spec_op_timer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_op_timer (GValue* value, gpointer v_object);
void value_take_op_timer (GValue* value, gpointer v_object);
gpointer value_get_op_timer (const GValue* value);
GType op_timer_get_type (void) G_GNUC_CONST;
#define OP_TIMER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_OP_TIMER, OpTimerPrivate))
enum {
OP_TIMER_DUMMY_PROPERTY
};
OpTimer* op_timer_new (const gchar* name);
OpTimer* op_timer_construct (GType object_type, const gchar* name);
void op_timer_start (OpTimer* self);
void op_timer_stop (OpTimer* self);
gchar* op_timer_to_string (OpTimer* self);
static void op_timer_finalize (OpTimer* obj);
void suppress_warnings (const gchar* log_domain, GLogLevelFlags log_levels, const gchar* message);
gboolean is_twentyfour_hr_time_system (void);
gboolean is_string_empty (const gchar* s);
guint int64_hash (gint64* n) {
guint result = 0U;
guint8* u8 = NULL;
gint64* _tmp0_ = NULL;
guint hash = 0U;
#line 9 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = n;
#line 9 "/home/jens/Source/shotwell/src/util/misc.vala"
u8 = (guint8*) _tmp0_;
#line 10 "/home/jens/Source/shotwell/src/util/misc.vala"
hash = (guint) 0;
#line 289 "misc.c"
{
gint ctr = 0;
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
ctr = 0;
#line 294 "misc.c"
{
gboolean _tmp1_ = FALSE;
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = TRUE;
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
while (TRUE) {
#line 301 "misc.c"
gint _tmp3_ = 0;
guint _tmp4_ = 0U;
guint _tmp5_ = 0U;
guint8* _tmp6_ = NULL;
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!_tmp1_) {
#line 308 "misc.c"
gint _tmp2_ = 0;
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = ctr;
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
ctr = _tmp2_ + 1;
#line 314 "misc.c"
}
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = FALSE;
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = ctr;
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!(((gulong) _tmp3_) < (sizeof (gint64) / sizeof (guint8)))) {
#line 11 "/home/jens/Source/shotwell/src/util/misc.vala"
break;
#line 324 "misc.c"
}
#line 12 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = hash;
#line 12 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = hash;
#line 12 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = u8;
#line 12 "/home/jens/Source/shotwell/src/util/misc.vala"
u8 = _tmp6_ + 1;
#line 12 "/home/jens/Source/shotwell/src/util/misc.vala"
hash = ((_tmp4_ << 4) ^ (_tmp5_ >> 28)) ^ (*_tmp6_);
#line 336 "misc.c"
}
}
}
#line 15 "/home/jens/Source/shotwell/src/util/misc.vala"
result = hash;
#line 15 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 344 "misc.c"
}
gboolean int64_equal (gint64* a, gint64* b) {
gboolean result = FALSE;
gint64* bia = NULL;
gint64* _tmp0_ = NULL;
gint64* bib = NULL;
gint64* _tmp1_ = NULL;
#line 19 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = a;
#line 19 "/home/jens/Source/shotwell/src/util/misc.vala"
bia = (gint64*) _tmp0_;
#line 20 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = b;
#line 20 "/home/jens/Source/shotwell/src/util/misc.vala"
bib = (gint64*) _tmp1_;
#line 22 "/home/jens/Source/shotwell/src/util/misc.vala"
result = (*bia) == (*bib);
#line 22 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 366 "misc.c"
}
gint int64_compare (gint64* a, gint64* b) {
gint result = 0;
gint64 diff = 0LL;
gint64* _tmp0_ = NULL;
gint64* _tmp1_ = NULL;
gint64 _tmp2_ = 0LL;
#line 26 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = a;
#line 26 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = b;
#line 26 "/home/jens/Source/shotwell/src/util/misc.vala"
diff = (*((gint64*) _tmp0_)) - (*((gint64*) _tmp1_));
#line 27 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = diff;
#line 27 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp2_ < ((gint64) 0)) {
#line 28 "/home/jens/Source/shotwell/src/util/misc.vala"
result = -1;
#line 28 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 390 "misc.c"
} else {
gint64 _tmp3_ = 0LL;
#line 29 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = diff;
#line 29 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp3_ > ((gint64) 0)) {
#line 30 "/home/jens/Source/shotwell/src/util/misc.vala"
result = 1;
#line 30 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 401 "misc.c"
} else {
#line 32 "/home/jens/Source/shotwell/src/util/misc.vala"
result = 0;
#line 32 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 407 "misc.c"
}
}
}
gint uint64_compare (guint64* a, guint64* b) {
gint result = 0;
guint64 a64 = 0ULL;
guint64* _tmp0_ = NULL;
guint64 b64 = 0ULL;
guint64* _tmp1_ = NULL;
guint64 _tmp2_ = 0ULL;
guint64 _tmp3_ = 0ULL;
#line 36 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = a;
#line 36 "/home/jens/Source/shotwell/src/util/misc.vala"
a64 = *((guint64*) _tmp0_);
#line 37 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = b;
#line 37 "/home/jens/Source/shotwell/src/util/misc.vala"
b64 = *((guint64*) _tmp1_);
#line 39 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = a64;
#line 39 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = b64;
#line 39 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp2_ < _tmp3_) {
#line 40 "/home/jens/Source/shotwell/src/util/misc.vala"
result = -1;
#line 40 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 439 "misc.c"
} else {
guint64 _tmp4_ = 0ULL;
guint64 _tmp5_ = 0ULL;
#line 41 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = a64;
#line 41 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = b64;
#line 41 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp4_ > _tmp5_) {
#line 42 "/home/jens/Source/shotwell/src/util/misc.vala"
result = 1;
#line 42 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 453 "misc.c"
} else {
#line 44 "/home/jens/Source/shotwell/src/util/misc.vala"
result = 0;
#line 44 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 459 "misc.c"
}
}
}
gboolean bool_value_equals (GValue* a, GValue* b) {
gboolean result = FALSE;
GValue _tmp0_ = {0};
GValue _tmp1_ = {0};
#line 49 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (a != NULL, FALSE);
#line 49 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (b != NULL, FALSE);
#line 50 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = *a;
#line 50 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = *b;
#line 50 "/home/jens/Source/shotwell/src/util/misc.vala"
result = g_value_get_boolean (&_tmp0_) == g_value_get_boolean (&_tmp1_);
#line 50 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 481 "misc.c"
}
gboolean int_value_equals (GValue* a, GValue* b) {
gboolean result = FALSE;
GValue _tmp0_ = {0};
GValue _tmp1_ = {0};
#line 53 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (a != NULL, FALSE);
#line 53 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (b != NULL, FALSE);
#line 54 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = *a;
#line 54 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = *b;
#line 54 "/home/jens/Source/shotwell/src/util/misc.vala"
result = g_value_get_int (&_tmp0_) == g_value_get_int (&_tmp1_);
#line 54 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 501 "misc.c"
}
gulong timeval_to_ms (GTimeVal* time_val) {
gulong result = 0UL;
GTimeVal _tmp0_ = {0};
glong _tmp1_ = 0L;
GTimeVal _tmp2_ = {0};
glong _tmp3_ = 0L;
#line 57 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (time_val != NULL, 0UL);
#line 58 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = *time_val;
#line 58 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = _tmp0_.tv_sec;
#line 58 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = *time_val;
#line 58 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = _tmp2_.tv_usec;
#line 58 "/home/jens/Source/shotwell/src/util/misc.vala"
result = (((gulong) _tmp1_) * 1000) + (((gulong) _tmp3_) / 1000);
#line 58 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 525 "misc.c"
}
gulong now_ms (void) {
gulong result = 0UL;
GTimeVal _tmp0_ = {0};
gulong _tmp1_ = 0UL;
#line 62 "/home/jens/Source/shotwell/src/util/misc.vala"
g_get_current_time (&_tmp0_);
#line 62 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = timeval_to_ms (&_tmp0_);
#line 62 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp1_;
#line 62 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 541 "misc.c"
}
gulong now_sec (void) {
gulong result = 0UL;
GTimeVal time_val = {0};
GTimeVal _tmp0_ = {0};
glong _tmp1_ = 0L;
#line 66 "/home/jens/Source/shotwell/src/util/misc.vala"
g_get_current_time (&time_val);
#line 68 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = time_val;
#line 68 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = _tmp0_.tv_sec;
#line 68 "/home/jens/Source/shotwell/src/util/misc.vala"
result = (gulong) _tmp1_;
#line 68 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 560 "misc.c"
}
inline time_t now_time_t (void) {
time_t result = 0;
gulong _tmp0_ = 0UL;
#line 72 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = now_sec ();
#line 72 "/home/jens/Source/shotwell/src/util/misc.vala"
result = (time_t) _tmp0_;
#line 72 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 573 "misc.c"
}
gchar* md5_binary (guint8* buffer, gsize length) {
gchar* result = NULL;
gsize _tmp0_ = 0UL;
GChecksum* md5 = NULL;
GChecksum* _tmp1_ = NULL;
guint8* _tmp2_ = NULL;
gsize _tmp3_ = 0UL;
const gchar* _tmp4_ = NULL;
gchar* _tmp5_ = NULL;
#line 76 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = length;
#line 76 "/home/jens/Source/shotwell/src/util/misc.vala"
_vala_assert (_tmp0_ != ((gsize) 0), "length != 0");
#line 78 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = g_checksum_new (G_CHECKSUM_MD5);
#line 78 "/home/jens/Source/shotwell/src/util/misc.vala"
md5 = _tmp1_;
#line 79 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = buffer;
#line 79 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = length;
#line 79 "/home/jens/Source/shotwell/src/util/misc.vala"
g_checksum_update (md5, (guchar*) _tmp2_, _tmp3_);
#line 81 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = g_checksum_get_string (md5);
#line 81 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = g_strdup (_tmp4_);
#line 81 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp5_;
#line 81 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_checksum_free0 (md5);
#line 81 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 610 "misc.c"
}
gchar* md5_file (GFile* file, GError** error) {
gchar* result = NULL;
GChecksum* md5 = NULL;
GChecksum* _tmp0_ = NULL;
guint8* buffer = NULL;
guint8* _tmp1_ = NULL;
gint buffer_length1 = 0;
gint _buffer_size_ = 0;
GFileInputStream* fins = NULL;
GFile* _tmp2_ = NULL;
GFileInputStream* _tmp3_ = NULL;
GChecksum* _tmp18_ = NULL;
const gchar* _tmp19_ = NULL;
gchar* _tmp20_ = NULL;
GError * _inner_error_ = NULL;
#line 84 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 85 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = g_checksum_new (G_CHECKSUM_MD5);
#line 85 "/home/jens/Source/shotwell/src/util/misc.vala"
md5 = _tmp0_;
#line 86 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = g_new0 (guint8, 64 * 1024);
#line 86 "/home/jens/Source/shotwell/src/util/misc.vala"
buffer = _tmp1_;
#line 86 "/home/jens/Source/shotwell/src/util/misc.vala"
buffer_length1 = 64 * 1024;
#line 86 "/home/jens/Source/shotwell/src/util/misc.vala"
_buffer_size_ = buffer_length1;
#line 88 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = file;
#line 88 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = g_file_read (_tmp2_, NULL, &_inner_error_);
#line 88 "/home/jens/Source/shotwell/src/util/misc.vala"
fins = _tmp3_;
#line 88 "/home/jens/Source/shotwell/src/util/misc.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 88 "/home/jens/Source/shotwell/src/util/misc.vala"
g_propagate_error (error, _inner_error_);
#line 88 "/home/jens/Source/shotwell/src/util/misc.vala"
buffer = (g_free (buffer), NULL);
#line 88 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_checksum_free0 (md5);
#line 88 "/home/jens/Source/shotwell/src/util/misc.vala"
return NULL;
#line 659 "misc.c"
}
{
gboolean _tmp4_ = FALSE;
#line 89 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = TRUE;
#line 89 "/home/jens/Source/shotwell/src/util/misc.vala"
while (TRUE) {
#line 667 "misc.c"
gsize bytes_read = 0UL;
GFileInputStream* _tmp5_ = NULL;
guint8* _tmp6_ = NULL;
gint _tmp6__length1 = 0;
gssize _tmp7_ = 0L;
gsize _tmp8_ = 0UL;
GChecksum* _tmp9_ = NULL;
guint8* _tmp10_ = NULL;
gint _tmp10__length1 = 0;
gsize _tmp11_ = 0UL;
#line 89 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!_tmp4_) {
#line 680 "misc.c"
}
#line 89 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = FALSE;
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = fins;
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = buffer;
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6__length1 = buffer_length1;
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = g_input_stream_read (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, g_input_stream_get_type (), GInputStream), _tmp6_, (gsize) _tmp6__length1, NULL, &_inner_error_);
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
bytes_read = (gsize) _tmp7_;
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
g_propagate_error (error, _inner_error_);
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (fins);
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
buffer = (g_free (buffer), NULL);
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_checksum_free0 (md5);
#line 90 "/home/jens/Source/shotwell/src/util/misc.vala"
return NULL;
#line 706 "misc.c"
}
#line 91 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = bytes_read;
#line 91 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp8_ <= ((gsize) 0)) {
#line 92 "/home/jens/Source/shotwell/src/util/misc.vala"
break;
#line 714 "misc.c"
}
#line 94 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = md5;
#line 94 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = buffer;
#line 94 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10__length1 = buffer_length1;
#line 94 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp11_ = bytes_read;
#line 94 "/home/jens/Source/shotwell/src/util/misc.vala"
g_checksum_update (_tmp9_, (guchar*) _tmp10_, _tmp11_);
#line 726 "misc.c"
}
}
{
GFileInputStream* _tmp12_ = NULL;
#line 98 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp12_ = fins;
#line 98 "/home/jens/Source/shotwell/src/util/misc.vala"
g_input_stream_close (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, g_input_stream_get_type (), GInputStream), NULL, &_inner_error_);
#line 98 "/home/jens/Source/shotwell/src/util/misc.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 737 "misc.c"
goto __catch5_g_error;
}
}
goto __finally5;
__catch5_g_error:
{
GError* err = NULL;
GFile* _tmp13_ = NULL;
gchar* _tmp14_ = NULL;
gchar* _tmp15_ = NULL;
GError* _tmp16_ = NULL;
const gchar* _tmp17_ = NULL;
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
err = _inner_error_;
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
_inner_error_ = NULL;
#line 100 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp13_ = file;
#line 100 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp14_ = g_file_get_path (_tmp13_);
#line 100 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp15_ = _tmp14_;
#line 100 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp16_ = err;
#line 100 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp17_ = _tmp16_->message;
#line 100 "/home/jens/Source/shotwell/src/util/misc.vala"
g_warning ("misc.vala:100: Unable to close MD5 input stream for %s: %s", _tmp15_, _tmp17_);
#line 100 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp15_);
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_error_free0 (err);
#line 770 "misc.c"
}
__finally5:
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
g_propagate_error (error, _inner_error_);
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (fins);
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
buffer = (g_free (buffer), NULL);
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_checksum_free0 (md5);
#line 97 "/home/jens/Source/shotwell/src/util/misc.vala"
return NULL;
#line 785 "misc.c"
}
#line 103 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp18_ = md5;
#line 103 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp19_ = g_checksum_get_string (_tmp18_);
#line 103 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp20_ = g_strdup (_tmp19_);
#line 103 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp20_;
#line 103 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (fins);
#line 103 "/home/jens/Source/shotwell/src/util/misc.vala"
buffer = (g_free (buffer), NULL);
#line 103 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_checksum_free0 (md5);
#line 103 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 803 "misc.c"
}
gboolean equal_sets (GeeSet* a, GeeSet* b) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
GeeSet* _tmp2_ = NULL;
gboolean _tmp7_ = FALSE;
GeeSet* _tmp8_ = NULL;
gboolean _tmp14_ = FALSE;
gboolean _tmp15_ = FALSE;
GeeSet* _tmp16_ = NULL;
gboolean _tmp21_ = FALSE;
GeeSet* _tmp22_ = NULL;
GeeSet* _tmp24_ = NULL;
gint _tmp25_ = 0;
gint _tmp26_ = 0;
GeeSet* _tmp27_ = NULL;
gint _tmp28_ = 0;
gint _tmp29_ = 0;
#line 107 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail ((a == NULL) || GEE_IS_SET (a), FALSE);
#line 107 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail ((b == NULL) || GEE_IS_SET (b), FALSE);
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = a;
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp2_ != NULL) {
#line 833 "misc.c"
GeeSet* _tmp3_ = NULL;
gint _tmp4_ = 0;
gint _tmp5_ = 0;
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = a;
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection));
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = _tmp4_;
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = _tmp5_ == 0;
#line 845 "misc.c"
} else {
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = FALSE;
#line 849 "misc.c"
}
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp1_) {
#line 853 "misc.c"
GeeSet* _tmp6_ = NULL;
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = b;
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = _tmp6_ == NULL;
#line 859 "misc.c"
} else {
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = FALSE;
#line 863 "misc.c"
}
#line 108 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp0_) {
#line 109 "/home/jens/Source/shotwell/src/util/misc.vala"
result = TRUE;
#line 109 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 871 "misc.c"
}
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = a;
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp8_ == NULL) {
#line 877 "misc.c"
gboolean _tmp9_ = FALSE;
GeeSet* _tmp10_ = NULL;
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = b;
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp10_ != NULL) {
#line 884 "misc.c"
GeeSet* _tmp11_ = NULL;
gint _tmp12_ = 0;
gint _tmp13_ = 0;
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp11_ = b;
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp12_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_COLLECTION, GeeCollection));
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp13_ = _tmp12_;
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = _tmp13_ == 0;
#line 896 "misc.c"
} else {
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = FALSE;
#line 900 "misc.c"
}
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = _tmp9_;
#line 904 "misc.c"
} else {
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = FALSE;
#line 908 "misc.c"
}
#line 111 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp7_) {
#line 112 "/home/jens/Source/shotwell/src/util/misc.vala"
result = TRUE;
#line 112 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 916 "misc.c"
}
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp16_ = a;
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp16_ == NULL) {
#line 922 "misc.c"
GeeSet* _tmp17_ = NULL;
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp17_ = b;
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp15_ = _tmp17_ != NULL;
#line 928 "misc.c"
} else {
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp15_ = FALSE;
#line 932 "misc.c"
}
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp15_) {
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp14_ = TRUE;
#line 938 "misc.c"
} else {
gboolean _tmp18_ = FALSE;
GeeSet* _tmp19_ = NULL;
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp19_ = a;
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp19_ != NULL) {
#line 946 "misc.c"
GeeSet* _tmp20_ = NULL;
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp20_ = b;
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp18_ = _tmp20_ == NULL;
#line 952 "misc.c"
} else {
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp18_ = FALSE;
#line 956 "misc.c"
}
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp14_ = _tmp18_;
#line 960 "misc.c"
}
#line 114 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp14_) {
#line 115 "/home/jens/Source/shotwell/src/util/misc.vala"
result = FALSE;
#line 115 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 968 "misc.c"
}
#line 117 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp22_ = a;
#line 117 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp22_ == NULL) {
#line 974 "misc.c"
GeeSet* _tmp23_ = NULL;
#line 117 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp23_ = b;
#line 117 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp21_ = _tmp23_ == NULL;
#line 980 "misc.c"
} else {
#line 117 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp21_ = FALSE;
#line 984 "misc.c"
}
#line 117 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp21_) {
#line 118 "/home/jens/Source/shotwell/src/util/misc.vala"
result = TRUE;
#line 118 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 992 "misc.c"
}
#line 120 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp24_ = a;
#line 120 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp25_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, GEE_TYPE_COLLECTION, GeeCollection));
#line 120 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp26_ = _tmp25_;
#line 120 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp27_ = b;
#line 120 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp28_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, GEE_TYPE_COLLECTION, GeeCollection));
#line 120 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp29_ = _tmp28_;
#line 120 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp26_ != _tmp29_) {
#line 121 "/home/jens/Source/shotwell/src/util/misc.vala"
result = FALSE;
#line 121 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1012 "misc.c"
}
{
GeeIterator* _element_it = NULL;
GeeSet* _tmp30_ = NULL;
GeeIterator* _tmp31_ = NULL;
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp30_ = a;
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp31_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, GEE_TYPE_ITERABLE, GeeIterable));
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_element_it = _tmp31_;
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
while (TRUE) {
#line 1026 "misc.c"
GeeIterator* _tmp32_ = NULL;
gboolean _tmp33_ = FALSE;
gchar* element = NULL;
GeeIterator* _tmp34_ = NULL;
gpointer _tmp35_ = NULL;
GeeSet* _tmp36_ = NULL;
const gchar* _tmp37_ = NULL;
gboolean _tmp38_ = FALSE;
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp32_ = _element_it;
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp33_ = gee_iterator_next (_tmp32_);
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!_tmp33_) {
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
break;
#line 1043 "misc.c"
}
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp34_ = _element_it;
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp35_ = gee_iterator_get (_tmp34_);
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
element = (gchar*) _tmp35_;
#line 126 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp36_ = b;
#line 126 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp37_ = element;
#line 126 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp38_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEE_TYPE_COLLECTION, GeeCollection), _tmp37_);
#line 126 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!_tmp38_) {
#line 127 "/home/jens/Source/shotwell/src/util/misc.vala"
result = FALSE;
#line 127 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (element);
#line 127 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (_element_it);
#line 127 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1067 "misc.c"
}
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (element);
#line 1071 "misc.c"
}
#line 125 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (_element_it);
#line 1075 "misc.c"
}
#line 130 "/home/jens/Source/shotwell/src/util/misc.vala"
result = TRUE;
#line 130 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1081 "misc.c"
}
static gpointer _g_object_ref0 (gpointer self) {
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
return self ? g_object_ref (self) : NULL;
#line 1088 "misc.c"
}
GeeSet* intersection_of_sets (GeeSet* a, GeeSet* b, GeeSet* excluded) {
GeeSet* result = NULL;
gboolean _tmp0_ = FALSE;
GeeSet* _tmp1_ = NULL;
gboolean _tmp6_ = FALSE;
GeeSet* _tmp7_ = NULL;
GeeSet* intersection = NULL;
GeeHashSet* _tmp12_ = NULL;
GeeSet* _tmp41_ = NULL;
GeeSet* _tmp42_ = NULL;
gint _tmp43_ = 0;
gint _tmp44_ = 0;
GeeSet* _tmp46_ = NULL;
#line 134 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail ((a == NULL) || GEE_IS_SET (a), NULL);
#line 134 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail ((b == NULL) || GEE_IS_SET (b), NULL);
#line 134 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail ((excluded == NULL) || GEE_IS_SET (excluded), NULL);
#line 136 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = a;
#line 136 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp1_ != NULL) {
#line 1115 "misc.c"
GeeSet* _tmp2_ = NULL;
#line 136 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = b;
#line 136 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = _tmp2_ == NULL;
#line 1121 "misc.c"
} else {
#line 136 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = FALSE;
#line 1125 "misc.c"
}
#line 136 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp0_) {
#line 1129 "misc.c"
GeeSet* _tmp3_ = NULL;
#line 137 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = excluded;
#line 137 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp3_ != NULL) {
#line 1135 "misc.c"
GeeSet* _tmp4_ = NULL;
GeeSet* _tmp5_ = NULL;
#line 138 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = excluded;
#line 138 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = a;
#line 138 "/home/jens/Source/shotwell/src/util/misc.vala"
gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_COLLECTION, GeeCollection));
#line 1144 "misc.c"
}
#line 140 "/home/jens/Source/shotwell/src/util/misc.vala"
result = NULL;
#line 140 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1150 "misc.c"
}
#line 143 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = a;
#line 143 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp7_ == NULL) {
#line 1156 "misc.c"
GeeSet* _tmp8_ = NULL;
#line 143 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = b;
#line 143 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = _tmp8_ != NULL;
#line 1162 "misc.c"
} else {
#line 143 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = FALSE;
#line 1166 "misc.c"
}
#line 143 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp6_) {
#line 1170 "misc.c"
GeeSet* _tmp9_ = NULL;
#line 144 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = excluded;
#line 144 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp9_ != NULL) {
#line 1176 "misc.c"
GeeSet* _tmp10_ = NULL;
GeeSet* _tmp11_ = NULL;
#line 145 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = excluded;
#line 145 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp11_ = b;
#line 145 "/home/jens/Source/shotwell/src/util/misc.vala"
gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_COLLECTION, GeeCollection));
#line 1185 "misc.c"
}
#line 147 "/home/jens/Source/shotwell/src/util/misc.vala"
result = NULL;
#line 147 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1191 "misc.c"
}
#line 150 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp12_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
#line 150 "/home/jens/Source/shotwell/src/util/misc.vala"
intersection = G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_SET, GeeSet);
#line 1197 "misc.c"
{
GeeIterator* _element_it = NULL;
GeeSet* _tmp13_ = NULL;
GeeIterator* _tmp14_ = NULL;
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp13_ = a;
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp14_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_ITERABLE, GeeIterable));
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_element_it = _tmp14_;
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
while (TRUE) {
#line 1210 "misc.c"
GeeIterator* _tmp15_ = NULL;
gboolean _tmp16_ = FALSE;
gchar* element = NULL;
GeeIterator* _tmp17_ = NULL;
gpointer _tmp18_ = NULL;
GeeSet* _tmp19_ = NULL;
const gchar* _tmp20_ = NULL;
gboolean _tmp21_ = FALSE;
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp15_ = _element_it;
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp16_ = gee_iterator_next (_tmp15_);
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!_tmp16_) {
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
break;
#line 1227 "misc.c"
}
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp17_ = _element_it;
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp18_ = gee_iterator_get (_tmp17_);
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
element = (gchar*) _tmp18_;
#line 153 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp19_ = b;
#line 153 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp20_ = element;
#line 153 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp21_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection), _tmp20_);
#line 153 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp21_) {
#line 1243 "misc.c"
GeeSet* _tmp22_ = NULL;
const gchar* _tmp23_ = NULL;
#line 154 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp22_ = intersection;
#line 154 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp23_ = element;
#line 154 "/home/jens/Source/shotwell/src/util/misc.vala"
gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GEE_TYPE_COLLECTION, GeeCollection), _tmp23_);
#line 1252 "misc.c"
} else {
GeeSet* _tmp24_ = NULL;
#line 155 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp24_ = excluded;
#line 155 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp24_ != NULL) {
#line 1259 "misc.c"
GeeSet* _tmp25_ = NULL;
const gchar* _tmp26_ = NULL;
#line 156 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp25_ = excluded;
#line 156 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp26_ = element;
#line 156 "/home/jens/Source/shotwell/src/util/misc.vala"
gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GEE_TYPE_COLLECTION, GeeCollection), _tmp26_);
#line 1268 "misc.c"
}
}
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (element);
#line 1273 "misc.c"
}
#line 152 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (_element_it);
#line 1277 "misc.c"
}
{
GeeIterator* _element_it = NULL;
GeeSet* _tmp27_ = NULL;
GeeIterator* _tmp28_ = NULL;
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp27_ = b;
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp28_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, GEE_TYPE_ITERABLE, GeeIterable));
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_element_it = _tmp28_;
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
while (TRUE) {
#line 1291 "misc.c"
GeeIterator* _tmp29_ = NULL;
gboolean _tmp30_ = FALSE;
gchar* element = NULL;
GeeIterator* _tmp31_ = NULL;
gpointer _tmp32_ = NULL;
GeeSet* _tmp33_ = NULL;
const gchar* _tmp34_ = NULL;
gboolean _tmp35_ = FALSE;
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp29_ = _element_it;
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp30_ = gee_iterator_next (_tmp29_);
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!_tmp30_) {
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
break;
#line 1308 "misc.c"
}
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp31_ = _element_it;
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp32_ = gee_iterator_get (_tmp31_);
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
element = (gchar*) _tmp32_;
#line 160 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp33_ = a;
#line 160 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp34_ = element;
#line 160 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp35_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, GEE_TYPE_COLLECTION, GeeCollection), _tmp34_);
#line 160 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp35_) {
#line 1324 "misc.c"
GeeSet* _tmp36_ = NULL;
const gchar* _tmp37_ = NULL;
#line 161 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp36_ = intersection;
#line 161 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp37_ = element;
#line 161 "/home/jens/Source/shotwell/src/util/misc.vala"
gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEE_TYPE_COLLECTION, GeeCollection), _tmp37_);
#line 1333 "misc.c"
} else {
GeeSet* _tmp38_ = NULL;
#line 162 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp38_ = excluded;
#line 162 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp38_ != NULL) {
#line 1340 "misc.c"
GeeSet* _tmp39_ = NULL;
const gchar* _tmp40_ = NULL;
#line 163 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp39_ = excluded;
#line 163 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp40_ = element;
#line 163 "/home/jens/Source/shotwell/src/util/misc.vala"
gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, GEE_TYPE_COLLECTION, GeeCollection), _tmp40_);
#line 1349 "misc.c"
}
}
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (element);
#line 1354 "misc.c"
}
#line 159 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (_element_it);
#line 1358 "misc.c"
}
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp42_ = intersection;
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp43_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, GEE_TYPE_COLLECTION, GeeCollection));
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp44_ = _tmp43_;
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp44_ > 0) {
#line 1368 "misc.c"
GeeSet* _tmp45_ = NULL;
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp45_ = intersection;
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp41_ = _tmp45_;
#line 1374 "misc.c"
} else {
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp41_ = NULL;
#line 1378 "misc.c"
}
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp46_ = _g_object_ref0 (_tmp41_);
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp46_;
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (intersection);
#line 166 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1388 "misc.c"
}
guchar* serialize_photo_ids (GeeCollection* photos, int* result_length1) {
guchar* result = NULL;
gint64* ids = NULL;
GeeCollection* _tmp0_ = NULL;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
gint64* _tmp3_ = NULL;
gint ids_length1 = 0;
gint _ids_size_ = 0;
gint ctr = 0;
gsize bytes = 0UL;
GeeCollection* _tmp16_ = NULL;
gint _tmp17_ = 0;
gint _tmp18_ = 0;
guchar* serialized = NULL;
guchar* _tmp19_ = NULL;
gint serialized_length1 = 0;
gint _serialized_size_ = 0;
gint64* _tmp20_ = NULL;
gint _tmp20__length1 = 0;
guchar* _tmp21_ = NULL;
gint _tmp21__length1 = 0;
#line 169 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (GEE_IS_COLLECTION (photos), NULL);
#line 170 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = photos;
#line 170 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = gee_collection_get_size (_tmp0_);
#line 170 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = _tmp1_;
#line 170 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = g_new0 (gint64, _tmp2_);
#line 170 "/home/jens/Source/shotwell/src/util/misc.vala"
ids = _tmp3_;
#line 170 "/home/jens/Source/shotwell/src/util/misc.vala"
ids_length1 = _tmp2_;
#line 170 "/home/jens/Source/shotwell/src/util/misc.vala"
_ids_size_ = ids_length1;
#line 171 "/home/jens/Source/shotwell/src/util/misc.vala"
ctr = 0;
#line 1432 "misc.c"
{
GeeIterator* _photo_it = NULL;
GeeCollection* _tmp4_ = NULL;
GeeIterator* _tmp5_ = NULL;
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = photos;
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable));
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_photo_it = _tmp5_;
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
while (TRUE) {
#line 1445 "misc.c"
GeeIterator* _tmp6_ = NULL;
gboolean _tmp7_ = FALSE;
Photo* photo = NULL;
GeeIterator* _tmp8_ = NULL;
gpointer _tmp9_ = NULL;
gint64* _tmp10_ = NULL;
gint _tmp10__length1 = 0;
gint _tmp11_ = 0;
Photo* _tmp12_ = NULL;
PhotoID _tmp13_ = {0};
gint64 _tmp14_ = 0LL;
gint64 _tmp15_ = 0LL;
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = _photo_it;
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = gee_iterator_next (_tmp6_);
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!_tmp7_) {
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
break;
#line 1466 "misc.c"
}
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = _photo_it;
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = gee_iterator_get (_tmp8_);
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
photo = (Photo*) _tmp9_;
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = ids;
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10__length1 = ids_length1;
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp11_ = ctr;
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
ctr = _tmp11_ + 1;
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp12_ = photo;
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
photo_get_photo_id (_tmp12_, &_tmp13_);
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp14_ = _tmp13_.id;
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_[_tmp11_] = _tmp14_;
#line 173 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp15_ = _tmp10_[_tmp11_];
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (photo);
#line 1494 "misc.c"
}
#line 172 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (_photo_it);
#line 1498 "misc.c"
}
#line 175 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp16_ = photos;
#line 175 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp17_ = gee_collection_get_size (_tmp16_);
#line 175 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp18_ = _tmp17_;
#line 175 "/home/jens/Source/shotwell/src/util/misc.vala"
bytes = (gsize) (_tmp18_ * sizeof (gint64));
#line 176 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp19_ = g_new0 (guchar, bytes);
#line 176 "/home/jens/Source/shotwell/src/util/misc.vala"
serialized = _tmp19_;
#line 176 "/home/jens/Source/shotwell/src/util/misc.vala"
serialized_length1 = bytes;
#line 176 "/home/jens/Source/shotwell/src/util/misc.vala"
_serialized_size_ = serialized_length1;
#line 177 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp20_ = ids;
#line 177 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp20__length1 = ids_length1;
#line 177 "/home/jens/Source/shotwell/src/util/misc.vala"
memcpy (serialized, _tmp20_, bytes);
#line 179 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp21_ = serialized;
#line 179 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp21__length1 = serialized_length1;
#line 179 "/home/jens/Source/shotwell/src/util/misc.vala"
if (result_length1) {
#line 179 "/home/jens/Source/shotwell/src/util/misc.vala"
*result_length1 = _tmp21__length1;
#line 1530 "misc.c"
}
#line 179 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp21_;
#line 179 "/home/jens/Source/shotwell/src/util/misc.vala"
ids = (g_free (ids), NULL);
#line 179 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1538 "misc.c"
}
GeeList* unserialize_photo_ids (guchar* serialized, gint size) {
GeeList* result = NULL;
gsize count = 0UL;
gint _tmp0_ = 0;
gboolean _tmp1_ = FALSE;
gsize _tmp2_ = 0UL;
gint64* ids = NULL;
gsize _tmp4_ = 0UL;
gint64* _tmp5_ = NULL;
gint ids_length1 = 0;
gint _ids_size_ = 0;
gint64* _tmp6_ = NULL;
gint _tmp6__length1 = 0;
guchar* _tmp7_ = NULL;
gint _tmp8_ = 0;
GeeArrayList* list = NULL;
GeeArrayList* _tmp9_ = NULL;
gint64* _tmp10_ = NULL;
gint _tmp10__length1 = 0;
#line 183 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = size;
#line 183 "/home/jens/Source/shotwell/src/util/misc.vala"
count = (gsize) (_tmp0_ / sizeof (gint64));
#line 184 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = count;
#line 184 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp2_ <= ((gsize) 0)) {
#line 184 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = TRUE;
#line 1571 "misc.c"
} else {
guchar* _tmp3_ = NULL;
#line 184 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = serialized;
#line 184 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = _tmp3_ == NULL;
#line 1578 "misc.c"
}
#line 184 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp1_) {
#line 185 "/home/jens/Source/shotwell/src/util/misc.vala"
result = NULL;
#line 185 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1586 "misc.c"
}
#line 187 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = count;
#line 187 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = g_new0 (gint64, _tmp4_);
#line 187 "/home/jens/Source/shotwell/src/util/misc.vala"
ids = _tmp5_;
#line 187 "/home/jens/Source/shotwell/src/util/misc.vala"
ids_length1 = _tmp4_;
#line 187 "/home/jens/Source/shotwell/src/util/misc.vala"
_ids_size_ = ids_length1;
#line 188 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = ids;
#line 188 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6__length1 = ids_length1;
#line 188 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = serialized;
#line 188 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = size;
#line 188 "/home/jens/Source/shotwell/src/util/misc.vala"
memcpy (_tmp6_, _tmp7_, (gsize) _tmp8_);
#line 190 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = gee_array_list_new (TYPE_PHOTO_ID, (GBoxedCopyFunc) photo_id_dup, photo_id_free, NULL, NULL, NULL);
#line 190 "/home/jens/Source/shotwell/src/util/misc.vala"
list = _tmp9_;
#line 191 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = ids;
#line 191 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10__length1 = ids_length1;
#line 1616 "misc.c"
{
gint64* id_collection = NULL;
gint id_collection_length1 = 0;
gint _id_collection_size_ = 0;
gint id_it = 0;
#line 191 "/home/jens/Source/shotwell/src/util/misc.vala"
id_collection = _tmp10_;
#line 191 "/home/jens/Source/shotwell/src/util/misc.vala"
id_collection_length1 = _tmp10__length1;
#line 191 "/home/jens/Source/shotwell/src/util/misc.vala"
for (id_it = 0; id_it < _tmp10__length1; id_it = id_it + 1) {
#line 1628 "misc.c"
gint64 id = 0LL;
#line 191 "/home/jens/Source/shotwell/src/util/misc.vala"
id = id_collection[id_it];
#line 1632 "misc.c"
{
GeeArrayList* _tmp11_ = NULL;
gint64 _tmp12_ = 0LL;
PhotoID _tmp13_ = {0};
#line 192 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp11_ = list;
#line 192 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp12_ = id;
#line 192 "/home/jens/Source/shotwell/src/util/misc.vala"
photo_id_init (&_tmp13_, _tmp12_);
#line 192 "/home/jens/Source/shotwell/src/util/misc.vala"
gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), &_tmp13_);
#line 1645 "misc.c"
}
}
}
#line 194 "/home/jens/Source/shotwell/src/util/misc.vala"
result = G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_LIST, GeeList);
#line 194 "/home/jens/Source/shotwell/src/util/misc.vala"
ids = (g_free (ids), NULL);
#line 194 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1655 "misc.c"
}
guchar* serialize_media_sources (GeeCollection* media, int* result_length1) {
guchar* result = NULL;
GdkAtom* atoms = NULL;
GeeCollection* _tmp0_ = NULL;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
GdkAtom* _tmp3_ = NULL;
gint atoms_length1 = 0;
gint _atoms_size_ = 0;
gint ctr = 0;
gsize bytes = 0UL;
GeeCollection* _tmp17_ = NULL;
gint _tmp18_ = 0;
gint _tmp19_ = 0;
guchar* serialized = NULL;
guchar* _tmp20_ = NULL;
gint serialized_length1 = 0;
gint _serialized_size_ = 0;
GdkAtom* _tmp21_ = NULL;
gint _tmp21__length1 = 0;
guchar* _tmp22_ = NULL;
gint _tmp22__length1 = 0;
#line 197 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (GEE_IS_COLLECTION (media), NULL);
#line 198 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = media;
#line 198 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = gee_collection_get_size (_tmp0_);
#line 198 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = _tmp1_;
#line 198 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = g_new0 (GdkAtom, _tmp2_);
#line 198 "/home/jens/Source/shotwell/src/util/misc.vala"
atoms = _tmp3_;
#line 198 "/home/jens/Source/shotwell/src/util/misc.vala"
atoms_length1 = _tmp2_;
#line 198 "/home/jens/Source/shotwell/src/util/misc.vala"
_atoms_size_ = atoms_length1;
#line 199 "/home/jens/Source/shotwell/src/util/misc.vala"
ctr = 0;
#line 1699 "misc.c"
{
GeeIterator* _current_media_it = NULL;
GeeCollection* _tmp4_ = NULL;
GeeIterator* _tmp5_ = NULL;
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = media;
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable));
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_current_media_it = _tmp5_;
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
while (TRUE) {
#line 1712 "misc.c"
GeeIterator* _tmp6_ = NULL;
gboolean _tmp7_ = FALSE;
MediaSource* current_media = NULL;
GeeIterator* _tmp8_ = NULL;
gpointer _tmp9_ = NULL;
GdkAtom* _tmp10_ = NULL;
gint _tmp10__length1 = 0;
gint _tmp11_ = 0;
MediaSource* _tmp12_ = NULL;
gchar* _tmp13_ = NULL;
gchar* _tmp14_ = NULL;
GdkAtom _tmp15_ = 0U;
GdkAtom _tmp16_ = 0U;
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = _current_media_it;
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = gee_iterator_next (_tmp6_);
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!_tmp7_) {
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
break;
#line 1734 "misc.c"
}
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = _current_media_it;
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = gee_iterator_get (_tmp8_);
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
current_media = (MediaSource*) _tmp9_;
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = atoms;
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10__length1 = atoms_length1;
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp11_ = ctr;
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
ctr = _tmp11_ + 1;
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp12_ = current_media;
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp13_ = data_source_get_source_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_DATA_SOURCE, DataSource));
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp14_ = _tmp13_;
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp15_ = gdk_atom_intern (_tmp14_, FALSE);
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_[_tmp11_] = _tmp15_;
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp16_ = _tmp10_[_tmp11_];
#line 201 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp14_);
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (current_media);
#line 1766 "misc.c"
}
#line 200 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (_current_media_it);
#line 1770 "misc.c"
}
#line 203 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp17_ = media;
#line 203 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp18_ = gee_collection_get_size (_tmp17_);
#line 203 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp19_ = _tmp18_;
#line 203 "/home/jens/Source/shotwell/src/util/misc.vala"
bytes = (gsize) (_tmp19_ * sizeof (GdkAtom));
#line 204 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp20_ = g_new0 (guchar, bytes);
#line 204 "/home/jens/Source/shotwell/src/util/misc.vala"
serialized = _tmp20_;
#line 204 "/home/jens/Source/shotwell/src/util/misc.vala"
serialized_length1 = bytes;
#line 204 "/home/jens/Source/shotwell/src/util/misc.vala"
_serialized_size_ = serialized_length1;
#line 205 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp21_ = atoms;
#line 205 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp21__length1 = atoms_length1;
#line 205 "/home/jens/Source/shotwell/src/util/misc.vala"
memcpy (serialized, _tmp21_, bytes);
#line 207 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp22_ = serialized;
#line 207 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp22__length1 = serialized_length1;
#line 207 "/home/jens/Source/shotwell/src/util/misc.vala"
if (result_length1) {
#line 207 "/home/jens/Source/shotwell/src/util/misc.vala"
*result_length1 = _tmp22__length1;
#line 1802 "misc.c"
}
#line 207 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp22_;
#line 207 "/home/jens/Source/shotwell/src/util/misc.vala"
atoms = (g_free (atoms), NULL);
#line 207 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1810 "misc.c"
}
GeeList* unserialize_media_sources (guchar* serialized, gint size) {
GeeList* result = NULL;
gsize count = 0UL;
gint _tmp0_ = 0;
gboolean _tmp1_ = FALSE;
gsize _tmp2_ = 0UL;
GdkAtom* atoms = NULL;
gsize _tmp4_ = 0UL;
GdkAtom* _tmp5_ = NULL;
gint atoms_length1 = 0;
gint _atoms_size_ = 0;
GdkAtom* _tmp6_ = NULL;
gint _tmp6__length1 = 0;
guchar* _tmp7_ = NULL;
gint _tmp8_ = 0;
GeeArrayList* list = NULL;
GeeArrayList* _tmp9_ = NULL;
GdkAtom* _tmp10_ = NULL;
gint _tmp10__length1 = 0;
#line 211 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = size;
#line 211 "/home/jens/Source/shotwell/src/util/misc.vala"
count = (gsize) (_tmp0_ / sizeof (GdkAtom));
#line 212 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = count;
#line 212 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp2_ <= ((gsize) 0)) {
#line 212 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = TRUE;
#line 1843 "misc.c"
} else {
guchar* _tmp3_ = NULL;
#line 212 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = serialized;
#line 212 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = _tmp3_ == NULL;
#line 1850 "misc.c"
}
#line 212 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp1_) {
#line 213 "/home/jens/Source/shotwell/src/util/misc.vala"
result = NULL;
#line 213 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1858 "misc.c"
}
#line 215 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = count;
#line 215 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = g_new0 (GdkAtom, _tmp4_);
#line 215 "/home/jens/Source/shotwell/src/util/misc.vala"
atoms = _tmp5_;
#line 215 "/home/jens/Source/shotwell/src/util/misc.vala"
atoms_length1 = _tmp4_;
#line 215 "/home/jens/Source/shotwell/src/util/misc.vala"
_atoms_size_ = atoms_length1;
#line 216 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = atoms;
#line 216 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6__length1 = atoms_length1;
#line 216 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = serialized;
#line 216 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = size;
#line 216 "/home/jens/Source/shotwell/src/util/misc.vala"
memcpy (_tmp6_, _tmp7_, (gsize) _tmp8_);
#line 218 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = gee_array_list_new (TYPE_MEDIA_SOURCE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
#line 218 "/home/jens/Source/shotwell/src/util/misc.vala"
list = _tmp9_;
#line 219 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = atoms;
#line 219 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10__length1 = atoms_length1;
#line 1888 "misc.c"
{
GdkAtom* current_atom_collection = NULL;
gint current_atom_collection_length1 = 0;
gint _current_atom_collection_size_ = 0;
gint current_atom_it = 0;
#line 219 "/home/jens/Source/shotwell/src/util/misc.vala"
current_atom_collection = _tmp10_;
#line 219 "/home/jens/Source/shotwell/src/util/misc.vala"
current_atom_collection_length1 = _tmp10__length1;
#line 219 "/home/jens/Source/shotwell/src/util/misc.vala"
for (current_atom_it = 0; current_atom_it < _tmp10__length1; current_atom_it = current_atom_it + 1) {
#line 1900 "misc.c"
GdkAtom current_atom = 0U;
#line 219 "/home/jens/Source/shotwell/src/util/misc.vala"
current_atom = current_atom_collection[current_atom_it];
#line 1904 "misc.c"
{
MediaSource* media = NULL;
MediaCollectionRegistry* _tmp11_ = NULL;
MediaCollectionRegistry* _tmp12_ = NULL;
GdkAtom _tmp13_ = 0U;
gchar* _tmp14_ = NULL;
gchar* _tmp15_ = NULL;
MediaSource* _tmp16_ = NULL;
MediaSource* _tmp17_ = NULL;
MediaSource* _tmp18_ = NULL;
GeeArrayList* _tmp19_ = NULL;
MediaSource* _tmp20_ = NULL;
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp11_ = media_collection_registry_get_instance ();
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp12_ = _tmp11_;
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp13_ = current_atom;
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp14_ = gdk_atom_name (_tmp13_);
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp15_ = _tmp14_;
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp16_ = media_collection_registry_fetch_media (_tmp12_, _tmp15_);
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp17_ = _tmp16_;
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp15_);
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
_media_collection_registry_unref0 (_tmp12_);
#line 220 "/home/jens/Source/shotwell/src/util/misc.vala"
media = _tmp17_;
#line 221 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp18_ = media;
#line 221 "/home/jens/Source/shotwell/src/util/misc.vala"
_vala_assert (_tmp18_ != NULL, "media != null");
#line 222 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp19_ = list;
#line 222 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp20_ = media;
#line 222 "/home/jens/Source/shotwell/src/util/misc.vala"
gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp20_);
#line 219 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_object_unref0 (media);
#line 1949 "misc.c"
}
}
}
#line 225 "/home/jens/Source/shotwell/src/util/misc.vala"
result = G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_LIST, GeeList);
#line 225 "/home/jens/Source/shotwell/src/util/misc.vala"
atoms = (g_free (atoms), NULL);
#line 225 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 1959 "misc.c"
}
static gchar* g_time_format (struct tm *self, const gchar* format) {
gchar* result = NULL;
gchar* buffer = NULL;
gchar* _tmp0_ = NULL;
gint buffer_length1 = 0;
gint _buffer_size_ = 0;
gchar* _tmp1_ = NULL;
gint _tmp1__length1 = 0;
const gchar* _tmp2_ = NULL;
gchar* _tmp3_ = NULL;
gint _tmp3__length1 = 0;
gchar* _tmp4_ = NULL;
#line 2758 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_return_val_if_fail (format != NULL, NULL);
#line 2759 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp0_ = g_new0 (gchar, 64);
#line 2759 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
buffer = _tmp0_;
#line 2759 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
buffer_length1 = 64;
#line 2759 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_buffer_size_ = buffer_length1;
#line 2760 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp1_ = buffer;
#line 2760 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp1__length1 = buffer_length1;
#line 2760 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp2_ = format;
#line 2760 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
strftime (_tmp1_, _tmp1__length1, _tmp2_, &(*self));
#line 2761 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp3_ = buffer;
#line 2761 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp3__length1 = buffer_length1;
#line 2761 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp4_ = g_strdup ((const gchar*) _tmp3_);
#line 2761 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
result = _tmp4_;
#line 2761 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
buffer = (g_free (buffer), NULL);
#line 2761 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
return result;
#line 2005 "misc.c"
}
gchar* format_local_datespan (struct tm* from_date, struct tm* to_date) {
gchar* result = NULL;
gchar* from_format = NULL;
gchar* to_format = NULL;
struct tm _tmp0_ = {0};
gint _tmp1_ = 0;
struct tm _tmp2_ = {0};
gint _tmp3_ = 0;
const gchar* _tmp19_ = NULL;
gchar* _tmp20_ = NULL;
gchar* _tmp21_ = NULL;
const gchar* _tmp22_ = NULL;
gchar* _tmp23_ = NULL;
gchar* _tmp24_ = NULL;
gchar* _tmp25_ = NULL;
gchar* _tmp26_ = NULL;
gchar* _tmp27_ = NULL;
gchar* _tmp28_ = NULL;
#line 228 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (from_date != NULL, NULL);
#line 228 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (to_date != NULL, NULL);
#line 233 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = *from_date;
#line 233 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = _tmp0_.tm_year;
#line 233 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = *to_date;
#line 233 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = _tmp2_.tm_year;
#line 233 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp1_ == _tmp3_) {
#line 2041 "misc.c"
gboolean _tmp4_ = FALSE;
struct tm _tmp5_ = {0};
gint _tmp6_ = 0;
struct tm _tmp7_ = {0};
gint _tmp8_ = 0;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = *from_date;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = _tmp5_.tm_mon;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = *to_date;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = _tmp7_.tm_mon;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp6_ == _tmp8_) {
#line 2057 "misc.c"
struct tm _tmp9_ = {0};
gint _tmp10_ = 0;
struct tm _tmp11_ = {0};
gint _tmp12_ = 0;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = *from_date;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = _tmp9_.tm_mday;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp11_ = *to_date;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp12_ = _tmp11_.tm_mday;
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = _tmp10_ == (_tmp12_ - 1);
#line 2072 "misc.c"
} else {
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = FALSE;
#line 2076 "misc.c"
}
#line 235 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp4_) {
#line 2080 "misc.c"
gchar* _tmp13_ = NULL;
gchar* _tmp14_ = NULL;
#line 237 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp13_ = resources_get_start_multiday_span_format_string ();
#line 237 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (from_format);
#line 237 "/home/jens/Source/shotwell/src/util/misc.vala"
from_format = _tmp13_;
#line 238 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp14_ = resources_get_end_multiday_span_format_string ();
#line 238 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (to_format);
#line 238 "/home/jens/Source/shotwell/src/util/misc.vala"
to_format = _tmp14_;
#line 2095 "misc.c"
} else {
gchar* _tmp15_ = NULL;
gchar* _tmp16_ = NULL;
#line 242 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp15_ = resources_get_start_multimonth_span_format_string ();
#line 242 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (from_format);
#line 242 "/home/jens/Source/shotwell/src/util/misc.vala"
from_format = _tmp15_;
#line 243 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp16_ = resources_get_end_multimonth_span_format_string ();
#line 243 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (to_format);
#line 243 "/home/jens/Source/shotwell/src/util/misc.vala"
to_format = _tmp16_;
#line 2111 "misc.c"
}
} else {
gchar* _tmp17_ = NULL;
gchar* _tmp18_ = NULL;
#line 248 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp17_ = resources_get_long_date_format_string ();
#line 248 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (from_format);
#line 248 "/home/jens/Source/shotwell/src/util/misc.vala"
from_format = _tmp17_;
#line 249 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp18_ = resources_get_long_date_format_string ();
#line 249 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (to_format);
#line 249 "/home/jens/Source/shotwell/src/util/misc.vala"
to_format = _tmp18_;
#line 2128 "misc.c"
}
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp19_ = from_format;
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp20_ = g_time_format (from_date, _tmp19_);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp21_ = _tmp20_;
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp22_ = to_format;
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp23_ = g_time_format (to_date, _tmp22_);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp24_ = _tmp23_;
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp25_ = g_strdup_printf ("%s - %s", _tmp21_, _tmp24_);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp26_ = _tmp25_;
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp27_ = string_strip_leading_zeroes (_tmp26_);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp28_ = _tmp27_;
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp26_);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp24_);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp21_);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp28_;
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (to_format);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (from_format);
#line 252 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 2164 "misc.c"
}
gchar* format_local_date (struct tm* date) {
gchar* result = NULL;
gchar* _tmp0_ = NULL;
gchar* _tmp1_ = NULL;
gchar* _tmp2_ = NULL;
gchar* _tmp3_ = NULL;
gchar* _tmp4_ = NULL;
gchar* _tmp5_ = NULL;
#line 256 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (date != NULL, NULL);
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = resources_get_long_date_format_string ();
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = _tmp0_;
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = g_time_format (date, _tmp1_);
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = _tmp2_;
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = string_strip_leading_zeroes (_tmp3_);
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = _tmp4_;
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp3_);
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp1_);
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp5_;
#line 257 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 2198 "misc.c"
}
OneShotScheduler* one_shot_scheduler_construct (GType object_type, const gchar* name, OneShotCallback callback, void* callback_target) {
OneShotScheduler* self = NULL;
const gchar* _tmp0_ = NULL;
gchar* _tmp1_ = NULL;
OneShotCallback _tmp2_ = NULL;
void* _tmp2__target = NULL;
#line 267 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (name != NULL, NULL);
#line 267 "/home/jens/Source/shotwell/src/util/misc.vala"
self = (OneShotScheduler*) g_type_create_instance (object_type);
#line 268 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = name;
#line 268 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = g_strdup (_tmp0_);
#line 268 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (self->priv->name);
#line 268 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->name = _tmp1_;
#line 269 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = callback;
#line 269 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2__target = callback_target;
#line 269 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->callback = _tmp2_;
#line 269 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->callback_target = _tmp2__target;
#line 267 "/home/jens/Source/shotwell/src/util/misc.vala"
return self;
#line 2230 "misc.c"
}
OneShotScheduler* one_shot_scheduler_new (const gchar* name, OneShotCallback callback, void* callback_target) {
#line 267 "/home/jens/Source/shotwell/src/util/misc.vala"
return one_shot_scheduler_construct (TYPE_ONE_SHOT_SCHEDULER, name, callback, callback_target);
#line 2237 "misc.c"
}
gboolean one_shot_scheduler_is_scheduled (OneShotScheduler* self) {
gboolean result = FALSE;
guint _tmp0_ = 0U;
#line 280 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (IS_ONE_SHOT_SCHEDULER (self), FALSE);
#line 281 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = self->priv->scheduled;
#line 281 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp0_ != ((guint) 0);
#line 281 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 2252 "misc.c"
}
void one_shot_scheduler_at_idle (OneShotScheduler* self) {
#line 284 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self));
#line 285 "/home/jens/Source/shotwell/src/util/misc.vala"
one_shot_scheduler_at_priority_idle (self, G_PRIORITY_DEFAULT_IDLE);
#line 2261 "misc.c"
}
static gboolean _one_shot_scheduler_callback_wrapper_gsource_func (gpointer self) {
gboolean result;
result = one_shot_scheduler_callback_wrapper ((OneShotScheduler*) self);
#line 290 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 2270 "misc.c"
}
void one_shot_scheduler_at_priority_idle (OneShotScheduler* self, gint priority) {
guint _tmp0_ = 0U;
#line 288 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self));
#line 289 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = self->priv->scheduled;
#line 289 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp0_ == ((guint) 0)) {
#line 2282 "misc.c"
gint _tmp1_ = 0;
guint _tmp2_ = 0U;
#line 290 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = priority;
#line 290 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = g_idle_add_full (_tmp1_, _one_shot_scheduler_callback_wrapper_gsource_func, one_shot_scheduler_ref (self), one_shot_scheduler_unref);
#line 290 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->scheduled = _tmp2_;
#line 2291 "misc.c"
}
}
void one_shot_scheduler_after_timeout (OneShotScheduler* self, guint msec, gboolean reschedule) {
guint _tmp0_ = 0U;
gboolean _tmp1_ = FALSE;
#line 293 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self));
#line 294 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = msec;
#line 294 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = reschedule;
#line 294 "/home/jens/Source/shotwell/src/util/misc.vala"
one_shot_scheduler_priority_after_timeout (self, G_PRIORITY_DEFAULT, _tmp0_, _tmp1_);
#line 2307 "misc.c"
}
void one_shot_scheduler_priority_after_timeout (OneShotScheduler* self, gint priority, guint msec, gboolean reschedule) {
gboolean _tmp0_ = FALSE;
guint _tmp1_ = 0U;
guint _tmp3_ = 0U;
gint _tmp5_ = 0;
guint _tmp6_ = 0U;
guint _tmp7_ = 0U;
#line 297 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self));
#line 298 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = self->priv->scheduled;
#line 298 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp1_ != ((guint) 0)) {
#line 2324 "misc.c"
gboolean _tmp2_ = FALSE;
#line 298 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = reschedule;
#line 298 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = !_tmp2_;
#line 2330 "misc.c"
} else {
#line 298 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = FALSE;
#line 2334 "misc.c"
}
#line 298 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp0_) {
#line 299 "/home/jens/Source/shotwell/src/util/misc.vala"
return;
#line 2340 "misc.c"
}
#line 301 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = self->priv->scheduled;
#line 301 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp3_ != ((guint) 0)) {
#line 2346 "misc.c"
guint _tmp4_ = 0U;
#line 302 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = self->priv->scheduled;
#line 302 "/home/jens/Source/shotwell/src/util/misc.vala"
g_source_remove (_tmp4_);
#line 2352 "misc.c"
}
#line 304 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = priority;
#line 304 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = msec;
#line 304 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = g_timeout_add_full (_tmp5_, _tmp6_, _one_shot_scheduler_callback_wrapper_gsource_func, one_shot_scheduler_ref (self), one_shot_scheduler_unref);
#line 304 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->scheduled = _tmp7_;
#line 2362 "misc.c"
}
void one_shot_scheduler_cancel (OneShotScheduler* self) {
guint _tmp0_ = 0U;
guint _tmp1_ = 0U;
#line 307 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self));
#line 308 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = self->priv->scheduled;
#line 308 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp0_ == ((guint) 0)) {
#line 309 "/home/jens/Source/shotwell/src/util/misc.vala"
return;
#line 2377 "misc.c"
}
#line 311 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = self->priv->scheduled;
#line 311 "/home/jens/Source/shotwell/src/util/misc.vala"
g_source_remove (_tmp1_);
#line 312 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->scheduled = (guint) 0;
#line 2385 "misc.c"
}
static gboolean one_shot_scheduler_callback_wrapper (OneShotScheduler* self) {
gboolean result = FALSE;
OneShotCallback _tmp0_ = NULL;
void* _tmp0__target = NULL;
#line 315 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (IS_ONE_SHOT_SCHEDULER (self), FALSE);
#line 316 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->scheduled = (guint) 0;
#line 317 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = self->priv->callback;
#line 317 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0__target = self->priv->callback_target;
#line 317 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ (_tmp0__target);
#line 319 "/home/jens/Source/shotwell/src/util/misc.vala"
result = FALSE;
#line 319 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 2407 "misc.c"
}
static void value_one_shot_scheduler_init (GValue* value) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = NULL;
#line 2414 "misc.c"
}
static void value_one_shot_scheduler_free_value (GValue* value) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (value->data[0].v_pointer) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
one_shot_scheduler_unref (value->data[0].v_pointer);
#line 2423 "misc.c"
}
}
static void value_one_shot_scheduler_copy_value (const GValue* src_value, GValue* dest_value) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (src_value->data[0].v_pointer) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
dest_value->data[0].v_pointer = one_shot_scheduler_ref (src_value->data[0].v_pointer);
#line 2433 "misc.c"
} else {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
dest_value->data[0].v_pointer = NULL;
#line 2437 "misc.c"
}
}
static gpointer value_one_shot_scheduler_peek_pointer (const GValue* value) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return value->data[0].v_pointer;
#line 2445 "misc.c"
}
static gchar* value_one_shot_scheduler_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (collect_values[0].v_pointer) {
#line 2452 "misc.c"
OneShotScheduler* object;
object = collect_values[0].v_pointer;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (object->parent_instance.g_class == NULL) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 2459 "misc.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 2463 "misc.c"
}
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = one_shot_scheduler_ref (object);
#line 2467 "misc.c"
} else {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = NULL;
#line 2471 "misc.c"
}
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return NULL;
#line 2475 "misc.c"
}
static gchar* value_one_shot_scheduler_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
OneShotScheduler** object_p;
object_p = collect_values[0].v_pointer;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!object_p) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 2486 "misc.c"
}
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!value->data[0].v_pointer) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
*object_p = NULL;
#line 2492 "misc.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
*object_p = value->data[0].v_pointer;
#line 2496 "misc.c"
} else {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
*object_p = one_shot_scheduler_ref (value->data[0].v_pointer);
#line 2500 "misc.c"
}
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return NULL;
#line 2504 "misc.c"
}
GParamSpec* param_spec_one_shot_scheduler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecOneShotScheduler* spec;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_ONE_SHOT_SCHEDULER), NULL);
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return G_PARAM_SPEC (spec);
#line 2518 "misc.c"
}
gpointer value_get_one_shot_scheduler (const GValue* value) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_ONE_SHOT_SCHEDULER), NULL);
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return value->data[0].v_pointer;
#line 2527 "misc.c"
}
void value_set_one_shot_scheduler (GValue* value, gpointer v_object) {
OneShotScheduler* old;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_ONE_SHOT_SCHEDULER));
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
old = value->data[0].v_pointer;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (v_object) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_ONE_SHOT_SCHEDULER));
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = v_object;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
one_shot_scheduler_ref (value->data[0].v_pointer);
#line 2547 "misc.c"
} else {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = NULL;
#line 2551 "misc.c"
}
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (old) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
one_shot_scheduler_unref (old);
#line 2557 "misc.c"
}
}
void value_take_one_shot_scheduler (GValue* value, gpointer v_object) {
OneShotScheduler* old;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_ONE_SHOT_SCHEDULER));
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
old = value->data[0].v_pointer;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (v_object) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_ONE_SHOT_SCHEDULER));
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = v_object;
#line 2576 "misc.c"
} else {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = NULL;
#line 2580 "misc.c"
}
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (old) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
one_shot_scheduler_unref (old);
#line 2586 "misc.c"
}
}
static void one_shot_scheduler_class_init (OneShotSchedulerClass * klass) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
one_shot_scheduler_parent_class = g_type_class_peek_parent (klass);
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
((OneShotSchedulerClass *) klass)->finalize = one_shot_scheduler_finalize;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_type_class_add_private (klass, sizeof (OneShotSchedulerPrivate));
#line 2598 "misc.c"
}
static void one_shot_scheduler_instance_init (OneShotScheduler * self) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv = ONE_SHOT_SCHEDULER_GET_PRIVATE (self);
#line 265 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->scheduled = (guint) 0;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
self->ref_count = 1;
#line 2609 "misc.c"
}
static void one_shot_scheduler_finalize (OneShotScheduler* obj) {
OneShotScheduler * self;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ONE_SHOT_SCHEDULER, OneShotScheduler);
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_signal_handlers_destroy (self);
#line 277 "/home/jens/Source/shotwell/src/util/misc.vala"
one_shot_scheduler_cancel (self);
#line 263 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (self->priv->name);
#line 2623 "misc.c"
}
GType one_shot_scheduler_get_type (void) {
static volatile gsize one_shot_scheduler_type_id__volatile = 0;
if (g_once_init_enter (&one_shot_scheduler_type_id__volatile)) {
static const GTypeValueTable g_define_type_value_table = { value_one_shot_scheduler_init, value_one_shot_scheduler_free_value, value_one_shot_scheduler_copy_value, value_one_shot_scheduler_peek_pointer, "p", value_one_shot_scheduler_collect_value, "p", value_one_shot_scheduler_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (OneShotSchedulerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) one_shot_scheduler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OneShotScheduler), 0, (GInstanceInitFunc) one_shot_scheduler_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType one_shot_scheduler_type_id;
one_shot_scheduler_type_id = g_type_register_fundamental (g_type_fundamental_next (), "OneShotScheduler", &g_define_type_info, &g_define_type_fundamental_info, 0);
g_once_init_leave (&one_shot_scheduler_type_id__volatile, one_shot_scheduler_type_id);
}
return one_shot_scheduler_type_id__volatile;
}
gpointer one_shot_scheduler_ref (gpointer instance) {
OneShotScheduler* self;
self = instance;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_atomic_int_inc (&self->ref_count);
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
return instance;
#line 2648 "misc.c"
}
void one_shot_scheduler_unref (gpointer instance) {
OneShotScheduler* self;
self = instance;
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
ONE_SHOT_SCHEDULER_GET_CLASS (self)->finalize (self);
#line 262 "/home/jens/Source/shotwell/src/util/misc.vala"
g_type_free_instance ((GTypeInstance *) self);
#line 2661 "misc.c"
}
}
OpTimer* op_timer_construct (GType object_type, const gchar* name) {
OpTimer* self = NULL;
const gchar* _tmp0_ = NULL;
gchar* _tmp1_ = NULL;
#line 331 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (name != NULL, NULL);
#line 331 "/home/jens/Source/shotwell/src/util/misc.vala"
self = (OpTimer*) g_type_create_instance (object_type);
#line 332 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = name;
#line 332 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = g_strdup (_tmp0_);
#line 332 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (self->priv->name);
#line 332 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->name = _tmp1_;
#line 331 "/home/jens/Source/shotwell/src/util/misc.vala"
return self;
#line 2684 "misc.c"
}
OpTimer* op_timer_new (const gchar* name) {
#line 331 "/home/jens/Source/shotwell/src/util/misc.vala"
return op_timer_construct (TYPE_OP_TIMER, name);
#line 2691 "misc.c"
}
void op_timer_start (OpTimer* self) {
GTimer* _tmp0_ = NULL;
#line 335 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (IS_OP_TIMER (self));
#line 336 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = self->priv->timer;
#line 336 "/home/jens/Source/shotwell/src/util/misc.vala"
g_timer_start (_tmp0_);
#line 2703 "misc.c"
}
void op_timer_stop (OpTimer* self) {
gdouble time = 0.0;
GTimer* _tmp0_ = NULL;
gdouble _tmp1_ = 0.0;
gdouble _tmp2_ = 0.0;
gdouble _tmp3_ = 0.0;
gdouble _tmp4_ = 0.0;
gdouble _tmp5_ = 0.0;
gdouble _tmp7_ = 0.0;
gdouble _tmp8_ = 0.0;
glong _tmp10_ = 0L;
#line 339 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (IS_OP_TIMER (self));
#line 340 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = self->priv->timer;
#line 340 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = g_timer_elapsed (_tmp0_, NULL);
#line 340 "/home/jens/Source/shotwell/src/util/misc.vala"
time = _tmp1_;
#line 342 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = self->priv->elapsed;
#line 342 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = time;
#line 342 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->elapsed = _tmp2_ + _tmp3_;
#line 344 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = time;
#line 344 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = self->priv->shortest;
#line 344 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp4_ < _tmp5_) {
#line 2738 "misc.c"
gdouble _tmp6_ = 0.0;
#line 345 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = time;
#line 345 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->shortest = _tmp6_;
#line 2744 "misc.c"
}
#line 347 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = time;
#line 347 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = self->priv->longest;
#line 347 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp7_ > _tmp8_) {
#line 2752 "misc.c"
gdouble _tmp9_ = 0.0;
#line 348 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = time;
#line 348 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->longest = _tmp9_;
#line 2758 "misc.c"
}
#line 350 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = self->priv->count;
#line 350 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->count = _tmp10_ + 1;
#line 2764 "misc.c"
}
gchar* op_timer_to_string (OpTimer* self) {
gchar* result = NULL;
glong _tmp0_ = 0L;
#line 353 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (IS_OP_TIMER (self), NULL);
#line 354 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = self->priv->count;
#line 354 "/home/jens/Source/shotwell/src/util/misc.vala"
if (_tmp0_ > ((glong) 0)) {
#line 2777 "misc.c"
const gchar* _tmp1_ = NULL;
glong _tmp2_ = 0L;
gdouble _tmp3_ = 0.0;
gdouble _tmp4_ = 0.0;
gdouble _tmp5_ = 0.0;
glong _tmp6_ = 0L;
gdouble _tmp7_ = 0.0;
gchar* _tmp8_ = NULL;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = self->priv->name;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = self->priv->count;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = self->priv->elapsed;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = self->priv->shortest;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp5_ = self->priv->elapsed;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp6_ = self->priv->count;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp7_ = self->priv->longest;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp8_ = g_strdup_printf ("%s: count=%ld elapsed=%.03lfs min/avg/max=%.03lf/%.03lf/%.03lf", _tmp1_, _tmp2_, _tmp3_, _tmp4_, _tmp5_ / ((gdouble) _tmp6_), _tmp7_);
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp8_;
#line 355 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 2806 "misc.c"
} else {
const gchar* _tmp9_ = NULL;
gchar* _tmp10_ = NULL;
#line 358 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp9_ = self->priv->name;
#line 358 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp10_ = g_strdup_printf ("%s: no operations", _tmp9_);
#line 358 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp10_;
#line 358 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 2818 "misc.c"
}
}
static void value_op_timer_init (GValue* value) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = NULL;
#line 2826 "misc.c"
}
static void value_op_timer_free_value (GValue* value) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (value->data[0].v_pointer) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
op_timer_unref (value->data[0].v_pointer);
#line 2835 "misc.c"
}
}
static void value_op_timer_copy_value (const GValue* src_value, GValue* dest_value) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (src_value->data[0].v_pointer) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
dest_value->data[0].v_pointer = op_timer_ref (src_value->data[0].v_pointer);
#line 2845 "misc.c"
} else {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
dest_value->data[0].v_pointer = NULL;
#line 2849 "misc.c"
}
}
static gpointer value_op_timer_peek_pointer (const GValue* value) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return value->data[0].v_pointer;
#line 2857 "misc.c"
}
static gchar* value_op_timer_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (collect_values[0].v_pointer) {
#line 2864 "misc.c"
OpTimer* object;
object = collect_values[0].v_pointer;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (object->parent_instance.g_class == NULL) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 2871 "misc.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 2875 "misc.c"
}
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = op_timer_ref (object);
#line 2879 "misc.c"
} else {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = NULL;
#line 2883 "misc.c"
}
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return NULL;
#line 2887 "misc.c"
}
static gchar* value_op_timer_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
OpTimer** object_p;
object_p = collect_values[0].v_pointer;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!object_p) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 2898 "misc.c"
}
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (!value->data[0].v_pointer) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
*object_p = NULL;
#line 2904 "misc.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
*object_p = value->data[0].v_pointer;
#line 2908 "misc.c"
} else {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
*object_p = op_timer_ref (value->data[0].v_pointer);
#line 2912 "misc.c"
}
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return NULL;
#line 2916 "misc.c"
}
GParamSpec* param_spec_op_timer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecOpTimer* spec;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_OP_TIMER), NULL);
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return G_PARAM_SPEC (spec);
#line 2930 "misc.c"
}
gpointer value_get_op_timer (const GValue* value) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_OP_TIMER), NULL);
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return value->data[0].v_pointer;
#line 2939 "misc.c"
}
void value_set_op_timer (GValue* value, gpointer v_object) {
OpTimer* old;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_OP_TIMER));
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
old = value->data[0].v_pointer;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (v_object) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_OP_TIMER));
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = v_object;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
op_timer_ref (value->data[0].v_pointer);
#line 2959 "misc.c"
} else {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = NULL;
#line 2963 "misc.c"
}
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (old) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
op_timer_unref (old);
#line 2969 "misc.c"
}
}
void value_take_op_timer (GValue* value, gpointer v_object) {
OpTimer* old;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_OP_TIMER));
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
old = value->data[0].v_pointer;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (v_object) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_OP_TIMER));
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = v_object;
#line 2988 "misc.c"
} else {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
value->data[0].v_pointer = NULL;
#line 2992 "misc.c"
}
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (old) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
op_timer_unref (old);
#line 2998 "misc.c"
}
}
static void op_timer_class_init (OpTimerClass * klass) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
op_timer_parent_class = g_type_class_peek_parent (klass);
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
((OpTimerClass *) klass)->finalize = op_timer_finalize;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_type_class_add_private (klass, sizeof (OpTimerPrivate));
#line 3010 "misc.c"
}
static void op_timer_instance_init (OpTimer * self) {
GTimer* _tmp0_ = NULL;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv = OP_TIMER_GET_PRIVATE (self);
#line 325 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp0_ = g_timer_new ();
#line 325 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->timer = _tmp0_;
#line 326 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->count = (glong) 0;
#line 327 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->elapsed = (gdouble) 0;
#line 328 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->shortest = DBL_MAX;
#line 329 "/home/jens/Source/shotwell/src/util/misc.vala"
self->priv->longest = DBL_MIN;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
self->ref_count = 1;
#line 3032 "misc.c"
}
static void op_timer_finalize (OpTimer* obj) {
OpTimer * self;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_OP_TIMER, OpTimer);
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_signal_handlers_destroy (self);
#line 324 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (self->priv->name);
#line 325 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_timer_destroy0 (self->priv->timer);
#line 3046 "misc.c"
}
GType op_timer_get_type (void) {
static volatile gsize op_timer_type_id__volatile = 0;
if (g_once_init_enter (&op_timer_type_id__volatile)) {
static const GTypeValueTable g_define_type_value_table = { value_op_timer_init, value_op_timer_free_value, value_op_timer_copy_value, value_op_timer_peek_pointer, "p", value_op_timer_collect_value, "p", value_op_timer_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (OpTimerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) op_timer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OpTimer), 0, (GInstanceInitFunc) op_timer_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType op_timer_type_id;
op_timer_type_id = g_type_register_fundamental (g_type_fundamental_next (), "OpTimer", &g_define_type_info, &g_define_type_fundamental_info, 0);
g_once_init_leave (&op_timer_type_id__volatile, op_timer_type_id);
}
return op_timer_type_id__volatile;
}
gpointer op_timer_ref (gpointer instance) {
OpTimer* self;
self = instance;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_atomic_int_inc (&self->ref_count);
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
return instance;
#line 3071 "misc.c"
}
void op_timer_unref (gpointer instance) {
OpTimer* self;
self = instance;
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
OP_TIMER_GET_CLASS (self)->finalize (self);
#line 323 "/home/jens/Source/shotwell/src/util/misc.vala"
g_type_free_instance ((GTypeInstance *) self);
#line 3084 "misc.c"
}
}
void suppress_warnings (const gchar* log_domain, GLogLevelFlags log_levels, const gchar* message) {
#line 369 "/home/jens/Source/shotwell/src/util/misc.vala"
g_return_if_fail (message != NULL);
#line 3092 "misc.c"
}
static void g_time_local (time_t time, struct tm* result) {
struct tm _result_ = {0};
struct tm _tmp0_ = {0};
#line 2750 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
localtime_r (&time, &_tmp0_);
#line 2750 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_result_ = _tmp0_;
#line 2751 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
*result = _result_;
#line 2751 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
return;
#line 3107 "misc.c"
}
gboolean is_twentyfour_hr_time_system (void) {
gboolean result = FALSE;
struct tm _tmp0_ = {0};
gchar* _tmp1_ = NULL;
gchar* _tmp2_ = NULL;
gboolean _tmp3_ = FALSE;
gboolean _tmp4_ = FALSE;
#line 375 "/home/jens/Source/shotwell/src/util/misc.vala"
g_time_local ((time_t) 0, &_tmp0_);
#line 375 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp1_ = g_time_format (&_tmp0_, "%p");
#line 375 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp2_ = _tmp1_;
#line 375 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp3_ = is_string_empty (_tmp2_);
#line 375 "/home/jens/Source/shotwell/src/util/misc.vala"
_tmp4_ = _tmp3_;
#line 375 "/home/jens/Source/shotwell/src/util/misc.vala"
_g_free0 (_tmp2_);
#line 375 "/home/jens/Source/shotwell/src/util/misc.vala"
result = _tmp4_;
#line 375 "/home/jens/Source/shotwell/src/util/misc.vala"
return result;
#line 3134 "misc.c"
}
|