1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
|
/* Dimensions.c generated by valac 0.34.2, the Vala compiler
* generated from Dimensions.vala, do not modify */
/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU LGPL (version 2.1 or later).
* See the COPYING file in this distribution.
*/
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
#include <cairo.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#define TYPE_SCALE_CONSTRAINT (scale_constraint_get_type ())
#define TYPE_DIMENSIONS (dimensions_get_type ())
typedef struct _Dimensions Dimensions;
#define TYPE_SCALING (scaling_get_type ())
typedef struct _Scaling Scaling;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define TYPE_ZOOM_STATE (zoom_state_get_type ())
typedef struct _ZoomState ZoomState;
#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 enum {
SCALE_CONSTRAINT_ORIGINAL,
SCALE_CONSTRAINT_DIMENSIONS,
SCALE_CONSTRAINT_WIDTH,
SCALE_CONSTRAINT_HEIGHT,
SCALE_CONSTRAINT_FILL_VIEWPORT
} ScaleConstraint;
struct _Dimensions {
gint width;
gint height;
};
struct _Scaling {
ScaleConstraint constraint;
gint scale;
Dimensions viewport;
gboolean scale_up;
};
struct _ZoomState {
Dimensions content_dimensions;
Dimensions viewport_dimensions;
gdouble zoom_factor;
gdouble interpolation_factor;
gdouble min_factor;
gdouble max_factor;
GdkPoint viewport_center;
};
GType scale_constraint_get_type (void) G_GNUC_CONST;
gchar* scale_constraint_to_string (ScaleConstraint self);
GType dimensions_get_type (void) G_GNUC_CONST;
Dimensions* dimensions_dup (const Dimensions* self);
void dimensions_free (Dimensions* self);
void dimensions_init (Dimensions *self, gint width, gint height);
void dimensions_for_pixbuf (GdkPixbuf* pixbuf, Dimensions* result);
void dimensions_for_allocation (GtkAllocation* allocation, Dimensions* result);
void dimensions_for_widget_allocation (GtkWidget* widget, Dimensions* result);
void dimensions_for_rectangle (GdkRectangle* rect, Dimensions* result);
gboolean dimensions_has_area (Dimensions *self);
void dimensions_floor (Dimensions *self, Dimensions* min, Dimensions* result);
gchar* dimensions_to_string (Dimensions *self);
gboolean dimensions_equals (Dimensions *self, Dimensions* dim);
gboolean dimensions_approx_equals (Dimensions *self, Dimensions* dim, gint fudge);
gboolean dimensions_approx_scaled (Dimensions *self, gint scale, gint fudge);
gint dimensions_major_axis (Dimensions *self);
gint dimensions_minor_axis (Dimensions *self);
void dimensions_with_min (Dimensions *self, gint min_width, gint min_height, Dimensions* result);
void dimensions_with_max (Dimensions *self, gint max_width, gint max_height, Dimensions* result);
void dimensions_get_scaled (Dimensions *self, gint scale, gboolean scale_up, Dimensions* result);
void dimensions_get_scaled_by_width (Dimensions *self, gint scale, Dimensions* result);
void dimensions_get_scaled_by_height (Dimensions *self, gint scale, Dimensions* result);
void dimensions_get_scale_ratios (Dimensions *self, Dimensions* scaled, gdouble* width_ratio, gdouble* height_ratio);
gdouble dimensions_get_aspect_ratio (Dimensions *self);
void dimensions_get_scaled_proportional (Dimensions *self, Dimensions* viewport, Dimensions* result);
void dimensions_get_scaled_to_fill_viewport (Dimensions *self, Dimensions* viewport, Dimensions* result);
void dimensions_get_scaled_rectangle (Dimensions *self, Dimensions* scaled, GdkRectangle* rect, GdkRectangle* result);
void dimensions_get_scaled_similar (Dimensions *self, Dimensions* original, Dimensions* scaled, Dimensions* result);
void dimensions_get_scaled_by_constraint (Dimensions *self, gint scale, ScaleConstraint constraint, Dimensions* result);
GType scaling_get_type (void) G_GNUC_CONST;
Scaling* scaling_dup (const Scaling* self);
void scaling_free (Scaling* self);
#define SCALING_NO_SCALE 0
static void scaling_init (Scaling *self, ScaleConstraint constraint, gint scale, Dimensions* viewport, gboolean scale_up);
void scaling_for_original (Scaling* result);
void scaling_for_screen (GtkWindow* window, gboolean scale_up, Scaling* result);
void scaling_for_viewport (Dimensions* viewport, gboolean scale_up, Scaling* result);
static void scaling_get_screen_dimensions (GtkWindow* window, Dimensions* result);
void scaling_for_best_fit (gint pixels, gboolean scale_up, Scaling* result);
void scaling_for_widget (GtkWidget* widget, gboolean scale_up, Scaling* result);
void scaling_to_fill_viewport (Dimensions* viewport, Scaling* result);
void scaling_to_fill_screen (GtkWindow* window, Scaling* result);
void scaling_for_constraint (ScaleConstraint constraint, gint scale, gboolean scale_up, Scaling* result);
static gint scaling_scale_to_pixels (Scaling *self);
gboolean scaling_is_unscaled (Scaling *self);
gboolean scaling_is_best_fit (Scaling *self, Dimensions* original, gint* pixels);
gboolean scaling_is_best_fit_dimensions (Scaling *self, Dimensions* original, Dimensions* scaled);
gboolean scaling_is_for_viewport (Scaling *self, Dimensions* original, Dimensions* scaled);
gboolean scaling_is_fill_viewport (Scaling *self, Dimensions* original, Dimensions* scaled);
void scaling_get_scaled_dimensions (Scaling *self, Dimensions* original, Dimensions* result);
GdkPixbuf* scaling_perform_on_pixbuf (Scaling *self, GdkPixbuf* pixbuf, GdkInterpType interp, gboolean scale_up);
GdkPixbuf* scale_pixbuf (GdkPixbuf* pixbuf, gint scale, GdkInterpType interp, gboolean scale_up);
GdkPixbuf* resize_pixbuf (GdkPixbuf* pixbuf, Dimensions* resized, GdkInterpType interp);
gchar* scaling_to_string (Scaling *self);
gboolean scaling_equals (Scaling *self, Scaling* scaling);
GType zoom_state_get_type (void) G_GNUC_CONST;
ZoomState* zoom_state_dup (const ZoomState* self);
void zoom_state_free (ZoomState* self);
void zoom_state_init (ZoomState *self, Dimensions* content_dimensions, Dimensions* viewport_dimensions, gdouble slider_val, GdkPoint* viewport_center);
static void zoom_state_compute_zoom_factors (ZoomState *self);
static void zoom_state_center_viewport (ZoomState *self);
static void zoom_state_clamp_viewport_center (ZoomState *self);
void zoom_state_init_rescale (ZoomState *self, ZoomState* existing, gdouble new_slider_val);
void zoom_state_init_rescale_to_isomorphic (ZoomState *self, ZoomState* existing);
void zoom_state_init_pan (ZoomState *self, ZoomState* existing, GdkPoint* new_viewport_center);
gint zoom_state_get_zoomed_width (ZoomState *self);
gint zoom_state_get_zoomed_height (ZoomState *self);
gdouble zoom_state_get_interpolation_factor (ZoomState *self);
void zoom_state_get_viewing_rectangle_wrt_content (ZoomState *self, GdkRectangle* result);
void zoom_state_get_viewing_rectangle_wrt_screen (ZoomState *self, GdkRectangle* result);
void zoom_state_get_viewing_rectangle_projection (ZoomState *self, GdkPixbuf* for_pixbuf, GdkRectangle* result);
gdouble zoom_state_get_zoom_factor (ZoomState *self);
void zoom_state_get_viewport_center (ZoomState *self, GdkPoint* result);
gchar* zoom_state_to_string (ZoomState *self);
gboolean zoom_state_is_min (ZoomState *self);
gboolean zoom_state_is_default (ZoomState *self);
gboolean zoom_state_is_isomorphic (ZoomState *self);
gboolean zoom_state_is_max (ZoomState *self);
gboolean zoom_state_equals (ZoomState *self, ZoomState* other);
gchar* scale_constraint_to_string (ScaleConstraint self) {
gchar* result = NULL;
#line 15 "/home/jens/Source/shotwell/src/Dimensions.vala"
switch (self) {
#line 15 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_ORIGINAL:
#line 161 "Dimensions.c"
{
const gchar* _tmp0_ = NULL;
gchar* _tmp1_ = NULL;
#line 17 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _ ("Original size");
#line 17 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = g_strdup (_tmp0_);
#line 17 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp1_;
#line 17 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 173 "Dimensions.c"
}
#line 15 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_DIMENSIONS:
#line 177 "Dimensions.c"
{
const gchar* _tmp2_ = NULL;
gchar* _tmp3_ = NULL;
#line 20 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = _ ("Width or height");
#line 20 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = g_strdup (_tmp2_);
#line 20 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp3_;
#line 20 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 189 "Dimensions.c"
}
#line 15 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_WIDTH:
#line 193 "Dimensions.c"
{
const gchar* _tmp4_ = NULL;
gchar* _tmp5_ = NULL;
#line 23 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _ ("Width");
#line 23 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = g_strdup (_tmp4_);
#line 23 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp5_;
#line 23 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 205 "Dimensions.c"
}
#line 15 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_HEIGHT:
#line 209 "Dimensions.c"
{
const gchar* _tmp6_ = NULL;
gchar* _tmp7_ = NULL;
#line 26 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _ ("Height");
#line 26 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = g_strdup (_tmp6_);
#line 26 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp7_;
#line 26 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 221 "Dimensions.c"
}
#line 15 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_FILL_VIEWPORT:
#line 225 "Dimensions.c"
{
gchar* _tmp8_ = NULL;
#line 30 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = g_strdup ("Fill Viewport");
#line 30 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp8_;
#line 30 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 234 "Dimensions.c"
}
default:
#line 15 "/home/jens/Source/shotwell/src/Dimensions.vala"
break;
#line 239 "Dimensions.c"
}
#line 33 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_warn_if_reached ();
#line 35 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = NULL;
#line 35 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 247 "Dimensions.c"
}
GType scale_constraint_get_type (void) {
static volatile gsize scale_constraint_type_id__volatile = 0;
if (g_once_init_enter (&scale_constraint_type_id__volatile)) {
static const GEnumValue values[] = {{SCALE_CONSTRAINT_ORIGINAL, "SCALE_CONSTRAINT_ORIGINAL", "original"}, {SCALE_CONSTRAINT_DIMENSIONS, "SCALE_CONSTRAINT_DIMENSIONS", "dimensions"}, {SCALE_CONSTRAINT_WIDTH, "SCALE_CONSTRAINT_WIDTH", "width"}, {SCALE_CONSTRAINT_HEIGHT, "SCALE_CONSTRAINT_HEIGHT", "height"}, {SCALE_CONSTRAINT_FILL_VIEWPORT, "SCALE_CONSTRAINT_FILL_VIEWPORT", "fill-viewport"}, {0, NULL, NULL}};
GType scale_constraint_type_id;
scale_constraint_type_id = g_enum_register_static ("ScaleConstraint", values);
g_once_init_leave (&scale_constraint_type_id__volatile, scale_constraint_type_id);
}
return scale_constraint_type_id__volatile;
}
void dimensions_init (Dimensions *self, gint width, gint height) {
gboolean _tmp0_ = FALSE;
gint _tmp1_ = 0;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
gint _tmp5_ = 0;
gint _tmp6_ = 0;
gint _tmp7_ = 0;
gint _tmp8_ = 0;
#line 43 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (self, 0, sizeof (Dimensions));
#line 44 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = width;
#line 44 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_ < 0) {
#line 44 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = TRUE;
#line 280 "Dimensions.c"
} else {
gint _tmp2_ = 0;
#line 44 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = height;
#line 44 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp2_ < 0;
#line 287 "Dimensions.c"
}
#line 44 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_) {
#line 45 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_warning ("Dimensions.vala:45: Tried to construct a Dimensions object with negati" \
"ve width or height - forcing sensible default values.");
#line 293 "Dimensions.c"
}
#line 47 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = width;
#line 47 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = width;
#line 47 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = CLAMP (_tmp3_, 0, _tmp4_);
#line 47 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).width = _tmp5_;
#line 48 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = height;
#line 48 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = height;
#line 48 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = CLAMP (_tmp6_, 0, _tmp7_);
#line 48 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).height = _tmp8_;
#line 311 "Dimensions.c"
}
void dimensions_for_pixbuf (GdkPixbuf* pixbuf, Dimensions* result) {
GdkPixbuf* _tmp0_ = NULL;
gint _tmp1_ = 0;
GdkPixbuf* _tmp2_ = NULL;
gint _tmp3_ = 0;
Dimensions _tmp4_ = {0};
#line 51 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
#line 52 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = pixbuf;
#line 52 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = gdk_pixbuf_get_width (_tmp0_);
#line 52 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = pixbuf;
#line 52 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = gdk_pixbuf_get_height (_tmp2_);
#line 52 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp4_, _tmp1_, _tmp3_);
#line 52 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp4_;
#line 52 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 337 "Dimensions.c"
}
void dimensions_for_allocation (GtkAllocation* allocation, Dimensions* result) {
GtkAllocation _tmp0_ = {0};
gint _tmp1_ = 0;
GtkAllocation _tmp2_ = {0};
gint _tmp3_ = 0;
Dimensions _tmp4_ = {0};
#line 55 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (allocation != NULL);
#line 56 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *allocation;
#line 56 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.width;
#line 56 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *allocation;
#line 56 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.height;
#line 56 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp4_, _tmp1_, _tmp3_);
#line 56 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp4_;
#line 56 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 363 "Dimensions.c"
}
void dimensions_for_widget_allocation (GtkWidget* widget, Dimensions* result) {
GtkAllocation allocation = {0};
GtkWidget* _tmp0_ = NULL;
GtkAllocation _tmp1_ = {0};
GtkAllocation _tmp2_ = {0};
gint _tmp3_ = 0;
GtkAllocation _tmp4_ = {0};
gint _tmp5_ = 0;
Dimensions _tmp6_ = {0};
#line 59 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (GTK_IS_WIDGET (widget));
#line 61 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = widget;
#line 61 "/home/jens/Source/shotwell/src/Dimensions.vala"
gtk_widget_get_allocation (_tmp0_, &_tmp1_);
#line 61 "/home/jens/Source/shotwell/src/Dimensions.vala"
allocation = _tmp1_;
#line 63 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = allocation;
#line 63 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.width;
#line 63 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = allocation;
#line 63 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = _tmp4_.height;
#line 63 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp6_, _tmp3_, _tmp5_);
#line 63 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp6_;
#line 63 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 398 "Dimensions.c"
}
void dimensions_for_rectangle (GdkRectangle* rect, Dimensions* result) {
GdkRectangle _tmp0_ = {0};
gint _tmp1_ = 0;
GdkRectangle _tmp2_ = {0};
gint _tmp3_ = 0;
Dimensions _tmp4_ = {0};
#line 66 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (rect != NULL);
#line 67 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *rect;
#line 67 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.width;
#line 67 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *rect;
#line 67 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.height;
#line 67 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp4_, _tmp1_, _tmp3_);
#line 67 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp4_;
#line 67 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 424 "Dimensions.c"
}
gboolean dimensions_has_area (Dimensions *self) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gint _tmp1_ = 0;
#line 71 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).width;
#line 71 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_ > 0) {
#line 436 "Dimensions.c"
gint _tmp2_ = 0;
#line 71 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).height;
#line 71 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp2_ > 0;
#line 442 "Dimensions.c"
} else {
#line 71 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = FALSE;
#line 446 "Dimensions.c"
}
#line 71 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 71 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 452 "Dimensions.c"
}
void dimensions_floor (Dimensions *self, Dimensions* min, Dimensions* result) {
gint _tmp0_ = 0;
gint _tmp1_ = 0;
Dimensions _tmp2_ = {0};
gint _tmp3_ = 0;
gint _tmp7_ = 0;
gint _tmp8_ = 0;
Dimensions _tmp9_ = {0};
gint _tmp10_ = 0;
Dimensions _tmp14_ = {0};
#line 74 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (min != NULL);
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).width;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *min;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.width;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_ > _tmp3_) {
#line 476 "Dimensions.c"
gint _tmp4_ = 0;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = (*self).width;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp4_;
#line 482 "Dimensions.c"
} else {
Dimensions _tmp5_ = {0};
gint _tmp6_ = 0;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = *min;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp5_.width;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp6_;
#line 492 "Dimensions.c"
}
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = (*self).height;
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = *min;
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = _tmp9_.height;
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp8_ > _tmp10_) {
#line 502 "Dimensions.c"
gint _tmp11_ = 0;
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = (*self).height;
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = _tmp11_;
#line 508 "Dimensions.c"
} else {
Dimensions _tmp12_ = {0};
gint _tmp13_ = 0;
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = *min;
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = _tmp12_.height;
#line 76 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = _tmp13_;
#line 518 "Dimensions.c"
}
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp14_, _tmp0_, _tmp7_);
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp14_;
#line 75 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 526 "Dimensions.c"
}
gchar* dimensions_to_string (Dimensions *self) {
gchar* result = NULL;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
gchar* _tmp2_ = NULL;
#line 80 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).width;
#line 80 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).height;
#line 80 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = g_strdup_printf ("%dx%d", _tmp0_, _tmp1_);
#line 80 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp2_;
#line 80 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 545 "Dimensions.c"
}
gboolean dimensions_equals (Dimensions *self, Dimensions* dim) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gint _tmp1_ = 0;
Dimensions _tmp2_ = {0};
gint _tmp3_ = 0;
#line 83 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (dim != NULL, FALSE);
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).width;
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *dim;
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.width;
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_ == _tmp3_) {
#line 565 "Dimensions.c"
gint _tmp4_ = 0;
Dimensions _tmp5_ = {0};
gint _tmp6_ = 0;
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = (*self).height;
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = *dim;
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp5_.height;
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp4_ == _tmp6_;
#line 577 "Dimensions.c"
} else {
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = FALSE;
#line 581 "Dimensions.c"
}
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 84 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 587 "Dimensions.c"
}
gboolean dimensions_approx_equals (Dimensions *self, Dimensions* dim, gint fudge) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gint _tmp1_ = 0;
Dimensions _tmp2_ = {0};
gint _tmp3_ = 0;
gint _tmp4_ = 0;
gint _tmp5_ = 0;
#line 88 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (dim != NULL, FALSE);
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).width;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *dim;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.width;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = abs (_tmp1_ - _tmp3_);
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = fudge;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp4_ <= _tmp5_) {
#line 613 "Dimensions.c"
gint _tmp6_ = 0;
Dimensions _tmp7_ = {0};
gint _tmp8_ = 0;
gint _tmp9_ = 0;
gint _tmp10_ = 0;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = (*self).height;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = *dim;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = _tmp7_.height;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = abs (_tmp6_ - _tmp8_);
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = fudge;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp9_ <= _tmp10_;
#line 631 "Dimensions.c"
} else {
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = FALSE;
#line 635 "Dimensions.c"
}
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 89 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 641 "Dimensions.c"
}
gboolean dimensions_approx_scaled (Dimensions *self, gint scale, gint fudge) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).width;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = scale;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = fudge;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_ <= (_tmp2_ + _tmp3_)) {
#line 659 "Dimensions.c"
gint _tmp4_ = 0;
gint _tmp5_ = 0;
gint _tmp6_ = 0;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = (*self).height;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = scale;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = fudge;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp4_ <= (_tmp5_ + _tmp6_);
#line 671 "Dimensions.c"
} else {
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = FALSE;
#line 675 "Dimensions.c"
}
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 93 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 681 "Dimensions.c"
}
gint dimensions_major_axis (Dimensions *self) {
gint result = 0;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
#line 97 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).width;
#line 97 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).height;
#line 97 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = MAX (_tmp0_, _tmp1_);
#line 97 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp2_;
#line 97 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 700 "Dimensions.c"
}
gint dimensions_minor_axis (Dimensions *self) {
gint result = 0;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
#line 101 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).width;
#line 101 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).height;
#line 101 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = MIN (_tmp0_, _tmp1_);
#line 101 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp2_;
#line 101 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 719 "Dimensions.c"
}
void dimensions_with_min (Dimensions *self, gint min_width, gint min_height, Dimensions* result) {
gint _tmp0_ = 0;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
gint _tmp5_ = 0;
Dimensions _tmp6_ = {0};
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).width;
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = min_width;
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = MAX (_tmp0_, _tmp1_);
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = (*self).height;
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = min_height;
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = MAX (_tmp3_, _tmp4_);
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp6_, _tmp2_, _tmp5_);
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp6_;
#line 105 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 749 "Dimensions.c"
}
void dimensions_with_max (Dimensions *self, gint max_width, gint max_height, Dimensions* result) {
gint _tmp0_ = 0;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
gint _tmp5_ = 0;
Dimensions _tmp6_ = {0};
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).width;
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = max_width;
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = MIN (_tmp0_, _tmp1_);
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = (*self).height;
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = max_height;
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = MIN (_tmp3_, _tmp4_);
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp6_, _tmp2_, _tmp5_);
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp6_;
#line 109 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 779 "Dimensions.c"
}
void dimensions_get_scaled (Dimensions *self, gint scale, gboolean scale_up, Dimensions* result) {
gint _tmp0_ = 0;
gboolean _tmp1_ = FALSE;
gboolean _tmp2_ = FALSE;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
gboolean _tmp15_ = FALSE;
gboolean _tmp16_ = FALSE;
gint _tmp25_ = 0;
gint _tmp26_ = 0;
gint _tmp27_ = 0;
gint _tmp28_ = 0;
#line 113 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = scale;
#line 113 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp0_ > 0, "scale > 0");
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = (*self).width;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = scale;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp3_ == _tmp4_) {
#line 805 "Dimensions.c"
gint _tmp5_ = 0;
gint _tmp6_ = 0;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = (*self).height;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = scale;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = _tmp5_ < _tmp6_;
#line 814 "Dimensions.c"
} else {
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = FALSE;
#line 818 "Dimensions.c"
}
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp2_) {
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = TRUE;
#line 824 "Dimensions.c"
} else {
gboolean _tmp7_ = FALSE;
gint _tmp8_ = 0;
gint _tmp9_ = 0;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = (*self).height;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = scale;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp8_ == _tmp9_) {
#line 835 "Dimensions.c"
gint _tmp10_ = 0;
gint _tmp11_ = 0;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = (*self).width;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = scale;
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = _tmp10_ < _tmp11_;
#line 844 "Dimensions.c"
} else {
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = FALSE;
#line 848 "Dimensions.c"
}
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp7_;
#line 852 "Dimensions.c"
}
#line 116 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_) {
#line 856 "Dimensions.c"
gint _tmp12_ = 0;
gint _tmp13_ = 0;
Dimensions _tmp14_ = {0};
#line 117 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = (*self).width;
#line 117 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = (*self).height;
#line 117 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp14_, _tmp12_, _tmp13_);
#line 117 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp14_;
#line 117 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 870 "Dimensions.c"
}
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = scale_up;
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (!_tmp16_) {
#line 876 "Dimensions.c"
gboolean _tmp17_ = FALSE;
gint _tmp18_ = 0;
gint _tmp19_ = 0;
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = (*self).width;
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = scale;
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp18_ < _tmp19_) {
#line 886 "Dimensions.c"
gint _tmp20_ = 0;
gint _tmp21_ = 0;
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = (*self).height;
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = scale;
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = _tmp20_ < _tmp21_;
#line 895 "Dimensions.c"
} else {
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = FALSE;
#line 899 "Dimensions.c"
}
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = _tmp17_;
#line 903 "Dimensions.c"
} else {
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = FALSE;
#line 907 "Dimensions.c"
}
#line 120 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp15_) {
#line 911 "Dimensions.c"
gint _tmp22_ = 0;
gint _tmp23_ = 0;
Dimensions _tmp24_ = {0};
#line 121 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = (*self).width;
#line 121 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp23_ = (*self).height;
#line 121 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp24_, _tmp22_, _tmp23_);
#line 121 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp24_;
#line 121 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 925 "Dimensions.c"
}
#line 123 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp25_ = (*self).width;
#line 123 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp26_ = scale;
#line 123 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp27_ = (*self).height;
#line 123 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp28_ = scale;
#line 123 "/home/jens/Source/shotwell/src/Dimensions.vala"
if ((_tmp25_ - _tmp26_) > (_tmp27_ - _tmp28_)) {
#line 937 "Dimensions.c"
gint _tmp29_ = 0;
Dimensions _tmp30_ = {0};
#line 124 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp29_ = scale;
#line 124 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_by_width (&(*self), _tmp29_, &_tmp30_);
#line 124 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp30_;
#line 124 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 948 "Dimensions.c"
} else {
gint _tmp31_ = 0;
Dimensions _tmp32_ = {0};
#line 126 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp31_ = scale;
#line 126 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_by_height (&(*self), _tmp31_, &_tmp32_);
#line 126 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp32_;
#line 126 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 960 "Dimensions.c"
}
}
void dimensions_get_scale_ratios (Dimensions *self, Dimensions* scaled, gdouble* width_ratio, gdouble* height_ratio) {
gdouble _vala_width_ratio = 0.0;
gdouble _vala_height_ratio = 0.0;
Dimensions _tmp0_ = {0};
gint _tmp1_ = 0;
gint _tmp2_ = 0;
Dimensions _tmp3_ = {0};
gint _tmp4_ = 0;
gint _tmp5_ = 0;
#line 129 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (scaled != NULL);
#line 130 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *scaled;
#line 130 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.width;
#line 130 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).width;
#line 130 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_width_ratio = ((gdouble) _tmp1_) / ((gdouble) _tmp2_);
#line 131 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = *scaled;
#line 131 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_.height;
#line 131 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = (*self).height;
#line 131 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_height_ratio = ((gdouble) _tmp4_) / ((gdouble) _tmp5_);
#line 129 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (width_ratio) {
#line 129 "/home/jens/Source/shotwell/src/Dimensions.vala"
*width_ratio = _vala_width_ratio;
#line 996 "Dimensions.c"
}
#line 129 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (height_ratio) {
#line 129 "/home/jens/Source/shotwell/src/Dimensions.vala"
*height_ratio = _vala_height_ratio;
#line 1002 "Dimensions.c"
}
}
gdouble dimensions_get_aspect_ratio (Dimensions *self) {
gdouble result = 0.0;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
#line 135 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).width;
#line 135 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).height;
#line 135 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = ((gdouble) _tmp0_) / _tmp1_;
#line 135 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 1019 "Dimensions.c"
}
void dimensions_get_scaled_proportional (Dimensions *self, Dimensions* viewport, Dimensions* result) {
gdouble width_ratio = 0.0;
gdouble height_ratio = 0.0;
Dimensions _tmp0_ = {0};
gdouble _tmp1_ = 0.0;
gdouble _tmp2_ = 0.0;
gdouble scaled_width = 0.0;
gdouble scaled_height = 0.0;
gdouble _tmp3_ = 0.0;
gdouble _tmp4_ = 0.0;
Dimensions scaled = {0};
gdouble _tmp13_ = 0.0;
gdouble _tmp14_ = 0.0;
gdouble _tmp15_ = 0.0;
gdouble _tmp16_ = 0.0;
Dimensions _tmp17_ = {0};
Dimensions _tmp18_ = {0};
Dimensions _tmp19_ = {0};
Dimensions _tmp20_ = {0};
gint _tmp21_ = 0;
Dimensions _tmp22_ = {0};
gint _tmp23_ = 0;
Dimensions _tmp24_ = {0};
gint _tmp25_ = 0;
Dimensions _tmp26_ = {0};
gint _tmp27_ = 0;
#line 138 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (viewport != NULL);
#line 140 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *viewport;
#line 140 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scale_ratios (&(*self), &_tmp0_, &_tmp1_, &_tmp2_);
#line 140 "/home/jens/Source/shotwell/src/Dimensions.vala"
width_ratio = _tmp1_;
#line 140 "/home/jens/Source/shotwell/src/Dimensions.vala"
height_ratio = _tmp2_;
#line 143 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = width_ratio;
#line 143 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = height_ratio;
#line 143 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp3_ < _tmp4_) {
#line 1065 "Dimensions.c"
Dimensions _tmp5_ = {0};
gint _tmp6_ = 0;
gint _tmp7_ = 0;
gdouble _tmp8_ = 0.0;
#line 144 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = *viewport;
#line 144 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp5_.width;
#line 144 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_width = (gdouble) _tmp6_;
#line 145 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = (*self).height;
#line 145 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = width_ratio;
#line 145 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_height = ((gdouble) _tmp7_) * _tmp8_;
#line 1082 "Dimensions.c"
} else {
gint _tmp9_ = 0;
gdouble _tmp10_ = 0.0;
Dimensions _tmp11_ = {0};
gint _tmp12_ = 0;
#line 147 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = (*self).width;
#line 147 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = height_ratio;
#line 147 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_width = ((gdouble) _tmp9_) * _tmp10_;
#line 148 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = *viewport;
#line 148 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = _tmp11_.height;
#line 148 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_height = (gdouble) _tmp12_;
#line 1100 "Dimensions.c"
}
#line 151 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = scaled_width;
#line 151 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = round (_tmp13_);
#line 151 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = scaled_height;
#line 151 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = round (_tmp15_);
#line 151 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp17_, (gint) _tmp14_, (gint) _tmp16_);
#line 151 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp18_, 1, 1);
#line 151 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_floor (&_tmp17_, &_tmp18_, &_tmp19_);
#line 151 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled = _tmp19_;
#line 153 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = scaled;
#line 153 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = _tmp20_.height;
#line 153 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = *viewport;
#line 153 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp23_ = _tmp22_.height;
#line 153 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp21_ <= _tmp23_, "scaled.height <= viewport.height");
#line 154 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp24_ = scaled;
#line 154 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp25_ = _tmp24_.width;
#line 154 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp26_ = *viewport;
#line 154 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp27_ = _tmp26_.width;
#line 154 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp25_ <= _tmp27_, "scaled.width <= viewport.width");
#line 156 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = scaled;
#line 156 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1142 "Dimensions.c"
}
void dimensions_get_scaled_to_fill_viewport (Dimensions *self, Dimensions* viewport, Dimensions* result) {
gdouble width_ratio = 0.0;
gdouble height_ratio = 0.0;
Dimensions _tmp0_ = {0};
gdouble _tmp1_ = 0.0;
gdouble _tmp2_ = 0.0;
gdouble scaled_width = 0.0;
gdouble scaled_height = 0.0;
gboolean _tmp3_ = FALSE;
gint _tmp4_ = 0;
Dimensions _tmp5_ = {0};
gint _tmp6_ = 0;
gdouble _tmp32_ = 0.0;
gdouble _tmp33_ = 0.0;
gdouble _tmp34_ = 0.0;
gdouble _tmp35_ = 0.0;
Dimensions _tmp36_ = {0};
Dimensions _tmp37_ = {0};
Dimensions _tmp38_ = {0};
#line 159 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (viewport != NULL);
#line 161 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *viewport;
#line 161 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scale_ratios (&(*self), &_tmp0_, &_tmp1_, &_tmp2_);
#line 161 "/home/jens/Source/shotwell/src/Dimensions.vala"
width_ratio = _tmp1_;
#line 161 "/home/jens/Source/shotwell/src/Dimensions.vala"
height_ratio = _tmp2_;
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = (*self).width;
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = *viewport;
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp5_.width;
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp4_ < _tmp6_) {
#line 1183 "Dimensions.c"
gint _tmp7_ = 0;
Dimensions _tmp8_ = {0};
gint _tmp9_ = 0;
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = (*self).height;
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = *viewport;
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = _tmp8_.height;
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp7_ >= _tmp9_;
#line 1195 "Dimensions.c"
} else {
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = FALSE;
#line 1199 "Dimensions.c"
}
#line 164 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp3_) {
#line 1203 "Dimensions.c"
Dimensions _tmp10_ = {0};
gint _tmp11_ = 0;
gint _tmp12_ = 0;
gdouble _tmp13_ = 0.0;
#line 166 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = *viewport;
#line 166 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = _tmp10_.width;
#line 166 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_width = (gdouble) _tmp11_;
#line 167 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = (*self).height;
#line 167 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = width_ratio;
#line 167 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_height = ((gdouble) _tmp12_) * _tmp13_;
#line 1220 "Dimensions.c"
} else {
gboolean _tmp14_ = FALSE;
gint _tmp15_ = 0;
Dimensions _tmp16_ = {0};
gint _tmp17_ = 0;
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = (*self).width;
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = *viewport;
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = _tmp16_.width;
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp15_ >= _tmp17_) {
#line 1234 "Dimensions.c"
gint _tmp18_ = 0;
Dimensions _tmp19_ = {0};
gint _tmp20_ = 0;
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = (*self).height;
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = *viewport;
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = _tmp19_.height;
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = _tmp18_ < _tmp20_;
#line 1246 "Dimensions.c"
} else {
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = FALSE;
#line 1250 "Dimensions.c"
}
#line 168 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp14_) {
#line 1254 "Dimensions.c"
gint _tmp21_ = 0;
gdouble _tmp22_ = 0.0;
Dimensions _tmp23_ = {0};
gint _tmp24_ = 0;
#line 170 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = (*self).width;
#line 170 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = height_ratio;
#line 170 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_width = ((gdouble) _tmp21_) * _tmp22_;
#line 171 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp23_ = *viewport;
#line 171 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp24_ = _tmp23_.height;
#line 171 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_height = (gdouble) _tmp24_;
#line 1271 "Dimensions.c"
} else {
gdouble ratio = 0.0;
gdouble _tmp25_ = 0.0;
gdouble _tmp26_ = 0.0;
gdouble _tmp27_ = 0.0;
gint _tmp28_ = 0;
gdouble _tmp29_ = 0.0;
gint _tmp30_ = 0;
gdouble _tmp31_ = 0.0;
#line 174 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp25_ = width_ratio;
#line 174 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp26_ = height_ratio;
#line 174 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp27_ = MAX (_tmp25_, _tmp26_);
#line 174 "/home/jens/Source/shotwell/src/Dimensions.vala"
ratio = _tmp27_;
#line 176 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp28_ = (*self).width;
#line 176 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp29_ = ratio;
#line 176 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_width = ((gdouble) _tmp28_) * _tmp29_;
#line 177 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp30_ = (*self).height;
#line 177 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp31_ = ratio;
#line 177 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_height = ((gdouble) _tmp30_) * _tmp31_;
#line 1301 "Dimensions.c"
}
}
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp32_ = scaled_width;
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp33_ = round (_tmp32_);
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp34_ = scaled_height;
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp35_ = round (_tmp34_);
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp36_, (gint) _tmp33_, (gint) _tmp35_);
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp37_, 1, 1);
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_floor (&_tmp36_, &_tmp37_, &_tmp38_);
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp38_;
#line 180 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1322 "Dimensions.c"
}
void dimensions_get_scaled_rectangle (Dimensions *self, Dimensions* scaled, GdkRectangle* rect, GdkRectangle* result) {
gdouble x_scale = 0.0;
gdouble y_scale = 0.0;
Dimensions _tmp0_ = {0};
gdouble _tmp1_ = 0.0;
gdouble _tmp2_ = 0.0;
GdkRectangle scaled_rect = {0};
GdkRectangle _tmp3_ = {0};
gint _tmp4_ = 0;
gdouble _tmp5_ = 0.0;
gdouble _tmp6_ = 0.0;
GdkRectangle _tmp7_ = {0};
gint _tmp8_ = 0;
gdouble _tmp9_ = 0.0;
gdouble _tmp10_ = 0.0;
GdkRectangle _tmp11_ = {0};
gint _tmp12_ = 0;
gdouble _tmp13_ = 0.0;
gdouble _tmp14_ = 0.0;
GdkRectangle _tmp15_ = {0};
gint _tmp16_ = 0;
gdouble _tmp17_ = 0.0;
gdouble _tmp18_ = 0.0;
GdkRectangle _tmp19_ = {0};
gint _tmp20_ = 0;
GdkRectangle _tmp21_ = {0};
gint _tmp22_ = 0;
#line 183 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (scaled != NULL);
#line 183 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (rect != NULL);
#line 185 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *scaled;
#line 185 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scale_ratios (&(*self), &_tmp0_, &_tmp1_, &_tmp2_);
#line 185 "/home/jens/Source/shotwell/src/Dimensions.vala"
x_scale = _tmp1_;
#line 185 "/home/jens/Source/shotwell/src/Dimensions.vala"
y_scale = _tmp2_;
#line 187 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (&scaled_rect, 0, sizeof (GdkRectangle));
#line 188 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = *rect;
#line 188 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_.x;
#line 188 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = x_scale;
#line 188 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = round (((gdouble) _tmp4_) * _tmp5_);
#line 188 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_rect.x = (gint) _tmp6_;
#line 189 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = *rect;
#line 189 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = _tmp7_.y;
#line 189 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = y_scale;
#line 189 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = round (((gdouble) _tmp8_) * _tmp9_);
#line 189 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_rect.y = (gint) _tmp10_;
#line 190 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = *rect;
#line 190 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = _tmp11_.width;
#line 190 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = x_scale;
#line 190 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = round (((gdouble) _tmp12_) * _tmp13_);
#line 190 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_rect.width = (gint) _tmp14_;
#line 191 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = *rect;
#line 191 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = _tmp15_.height;
#line 191 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = y_scale;
#line 191 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = round (((gdouble) _tmp16_) * _tmp17_);
#line 191 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_rect.height = (gint) _tmp18_;
#line 193 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = scaled_rect;
#line 193 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = _tmp19_.width;
#line 193 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp20_ <= 0) {
#line 194 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_rect.width = 1;
#line 1415 "Dimensions.c"
}
#line 196 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = scaled_rect;
#line 196 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = _tmp21_.height;
#line 196 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp22_ <= 0) {
#line 197 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled_rect.height = 1;
#line 1425 "Dimensions.c"
}
#line 199 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = scaled_rect;
#line 199 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1431 "Dimensions.c"
}
void dimensions_get_scaled_similar (Dimensions *self, Dimensions* original, Dimensions* scaled, Dimensions* result) {
gdouble x_scale = 0.0;
gdouble y_scale = 0.0;
Dimensions _tmp0_ = {0};
gdouble _tmp1_ = 0.0;
gdouble _tmp2_ = 0.0;
gdouble scale = 0.0;
gdouble _tmp3_ = 0.0;
gint _tmp4_ = 0;
gdouble _tmp5_ = 0.0;
gint _tmp6_ = 0;
gdouble _tmp7_ = 0.0;
Dimensions _tmp8_ = {0};
Dimensions _tmp9_ = {0};
Dimensions _tmp10_ = {0};
#line 203 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (original != NULL);
#line 203 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (scaled != NULL);
#line 205 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *scaled;
#line 205 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scale_ratios (original, &_tmp0_, &_tmp1_, &_tmp2_);
#line 205 "/home/jens/Source/shotwell/src/Dimensions.vala"
x_scale = _tmp1_;
#line 205 "/home/jens/Source/shotwell/src/Dimensions.vala"
y_scale = _tmp2_;
#line 207 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = MIN (x_scale, y_scale);
#line 207 "/home/jens/Source/shotwell/src/Dimensions.vala"
scale = _tmp3_;
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = (*self).width;
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = round (((gdouble) _tmp4_) * scale);
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = (*self).height;
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = round (((gdouble) _tmp6_) * scale);
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp8_, (gint) _tmp5_, (gint) _tmp7_);
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp9_, 1, 1);
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_floor (&_tmp8_, &_tmp9_, &_tmp10_);
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp10_;
#line 209 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1484 "Dimensions.c"
}
void dimensions_get_scaled_by_width (Dimensions *self, gint scale, Dimensions* result) {
gint _tmp0_ = 0;
gdouble ratio = 0.0;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
gdouble _tmp5_ = 0.0;
Dimensions _tmp6_ = {0};
Dimensions _tmp7_ = {0};
Dimensions _tmp8_ = {0};
#line 214 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = scale;
#line 214 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp0_ > 0, "scale > 0");
#line 216 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = scale;
#line 216 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).width;
#line 216 "/home/jens/Source/shotwell/src/Dimensions.vala"
ratio = ((gdouble) _tmp1_) / ((gdouble) _tmp2_);
#line 218 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = scale;
#line 218 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = (*self).height;
#line 218 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = round (((gdouble) _tmp4_) * ratio);
#line 218 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp6_, _tmp3_, (gint) _tmp5_);
#line 218 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp7_, 1, 1);
#line 218 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_floor (&_tmp6_, &_tmp7_, &_tmp8_);
#line 218 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp8_;
#line 218 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1525 "Dimensions.c"
}
void dimensions_get_scaled_by_height (Dimensions *self, gint scale, Dimensions* result) {
gint _tmp0_ = 0;
gdouble ratio = 0.0;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
gdouble _tmp4_ = 0.0;
gint _tmp5_ = 0;
Dimensions _tmp6_ = {0};
Dimensions _tmp7_ = {0};
Dimensions _tmp8_ = {0};
#line 222 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = scale;
#line 222 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp0_ > 0, "scale > 0");
#line 224 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = scale;
#line 224 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).height;
#line 224 "/home/jens/Source/shotwell/src/Dimensions.vala"
ratio = ((gdouble) _tmp1_) / ((gdouble) _tmp2_);
#line 226 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = (*self).width;
#line 226 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = round (((gdouble) _tmp3_) * ratio);
#line 226 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = scale;
#line 226 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp6_, (gint) _tmp4_, _tmp5_);
#line 226 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp7_, 1, 1);
#line 226 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_floor (&_tmp6_, &_tmp7_, &_tmp8_);
#line 226 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp8_;
#line 226 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1566 "Dimensions.c"
}
void dimensions_get_scaled_by_constraint (Dimensions *self, gint scale, ScaleConstraint constraint, Dimensions* result) {
ScaleConstraint _tmp0_ = 0;
#line 230 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = constraint;
#line 230 "/home/jens/Source/shotwell/src/Dimensions.vala"
switch (_tmp0_) {
#line 230 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_ORIGINAL:
#line 1578 "Dimensions.c"
{
gint _tmp1_ = 0;
gint _tmp2_ = 0;
Dimensions _tmp3_ = {0};
#line 232 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).width;
#line 232 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).height;
#line 232 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp3_, _tmp1_, _tmp2_);
#line 232 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp3_;
#line 232 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1593 "Dimensions.c"
}
#line 230 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_DIMENSIONS:
#line 1597 "Dimensions.c"
{
Dimensions _tmp4_ = {0};
gint _tmp5_ = 0;
gint _tmp6_ = 0;
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = (*self).width;
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = (*self).height;
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp5_ >= _tmp6_) {
#line 1608 "Dimensions.c"
gint _tmp7_ = 0;
Dimensions _tmp8_ = {0};
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = scale;
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_by_width (&(*self), _tmp7_, &_tmp8_);
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp8_;
#line 1617 "Dimensions.c"
} else {
gint _tmp9_ = 0;
Dimensions _tmp10_ = {0};
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = scale;
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_by_height (&(*self), _tmp9_, &_tmp10_);
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp10_;
#line 1627 "Dimensions.c"
}
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp4_;
#line 235 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1633 "Dimensions.c"
}
#line 230 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_WIDTH:
#line 1637 "Dimensions.c"
{
gint _tmp11_ = 0;
Dimensions _tmp12_ = {0};
#line 238 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = scale;
#line 238 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_by_width (&(*self), _tmp11_, &_tmp12_);
#line 238 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp12_;
#line 238 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1649 "Dimensions.c"
}
#line 230 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_HEIGHT:
#line 1653 "Dimensions.c"
{
gint _tmp13_ = 0;
Dimensions _tmp14_ = {0};
#line 241 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = scale;
#line 241 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_by_height (&(*self), _tmp13_, &_tmp14_);
#line 241 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp14_;
#line 241 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1665 "Dimensions.c"
}
default:
{
ScaleConstraint _tmp15_ = 0;
#line 244 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = constraint;
#line 244 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_error ("Dimensions.vala:244: Bad constraint: %d", (gint) _tmp15_);
#line 1674 "Dimensions.c"
}
}
}
Dimensions* dimensions_dup (const Dimensions* self) {
Dimensions* dup;
#line 39 "/home/jens/Source/shotwell/src/Dimensions.vala"
dup = g_new0 (Dimensions, 1);
#line 39 "/home/jens/Source/shotwell/src/Dimensions.vala"
memcpy (dup, self, sizeof (Dimensions));
#line 39 "/home/jens/Source/shotwell/src/Dimensions.vala"
return dup;
#line 1688 "Dimensions.c"
}
void dimensions_free (Dimensions* self) {
#line 39 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_free (self);
#line 1695 "Dimensions.c"
}
GType dimensions_get_type (void) {
static volatile gsize dimensions_type_id__volatile = 0;
if (g_once_init_enter (&dimensions_type_id__volatile)) {
GType dimensions_type_id;
dimensions_type_id = g_boxed_type_register_static ("Dimensions", (GBoxedCopyFunc) dimensions_dup, (GBoxedFreeFunc) dimensions_free);
g_once_init_leave (&dimensions_type_id__volatile, dimensions_type_id);
}
return dimensions_type_id__volatile;
}
static void scaling_init (Scaling *self, ScaleConstraint constraint, gint scale, Dimensions* viewport, gboolean scale_up) {
ScaleConstraint _tmp0_ = 0;
gint _tmp1_ = 0;
Dimensions _tmp2_ = {0};
gboolean _tmp3_ = FALSE;
#line 257 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (viewport != NULL);
#line 257 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (self, 0, sizeof (Scaling));
#line 258 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = constraint;
#line 258 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).constraint = _tmp0_;
#line 259 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = scale;
#line 259 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).scale = _tmp1_;
#line 260 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *viewport;
#line 260 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport = _tmp2_;
#line 261 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = scale_up;
#line 261 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).scale_up = _tmp3_;
#line 1735 "Dimensions.c"
}
void scaling_for_original (Scaling* result) {
Dimensions _tmp0_ = {0};
Scaling _tmp1_ = {0};
#line 265 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp0_, 0, 0);
#line 265 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_init (&_tmp1_, SCALE_CONSTRAINT_ORIGINAL, SCALING_NO_SCALE, &_tmp0_, FALSE);
#line 265 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp1_;
#line 265 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1750 "Dimensions.c"
}
void scaling_for_screen (GtkWindow* window, gboolean scale_up, Scaling* result) {
GtkWindow* _tmp0_ = NULL;
Dimensions _tmp1_ = {0};
gboolean _tmp2_ = FALSE;
Scaling _tmp3_ = {0};
#line 268 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (GTK_IS_WINDOW (window));
#line 269 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = window;
#line 269 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_get_screen_dimensions (_tmp0_, &_tmp1_);
#line 269 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = scale_up;
#line 269 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_for_viewport (&_tmp1_, _tmp2_, &_tmp3_);
#line 269 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp3_;
#line 269 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1773 "Dimensions.c"
}
void scaling_for_best_fit (gint pixels, gboolean scale_up, Scaling* result) {
gint _tmp0_ = 0;
gint _tmp1_ = 0;
Dimensions _tmp2_ = {0};
gboolean _tmp3_ = FALSE;
Scaling _tmp4_ = {0};
#line 273 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = pixels;
#line 273 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp0_ > 0, "pixels > 0");
#line 275 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = pixels;
#line 275 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp2_, 0, 0);
#line 275 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = scale_up;
#line 275 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_init (&_tmp4_, SCALE_CONSTRAINT_DIMENSIONS, _tmp1_, &_tmp2_, _tmp3_);
#line 275 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp4_;
#line 275 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1799 "Dimensions.c"
}
void scaling_for_viewport (Dimensions* viewport, gboolean scale_up, Scaling* result) {
gboolean _tmp0_ = FALSE;
Dimensions _tmp1_ = {0};
gboolean _tmp2_ = FALSE;
Scaling _tmp3_ = {0};
#line 278 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (viewport != NULL);
#line 279 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = dimensions_has_area (viewport);
#line 279 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp0_, "viewport.has_area()");
#line 281 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = *viewport;
#line 281 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = scale_up;
#line 281 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_init (&_tmp3_, SCALE_CONSTRAINT_DIMENSIONS, SCALING_NO_SCALE, &_tmp1_, _tmp2_);
#line 281 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp3_;
#line 281 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1824 "Dimensions.c"
}
void scaling_for_widget (GtkWidget* widget, gboolean scale_up, Scaling* result) {
Dimensions viewport = {0};
GtkWidget* _tmp0_ = NULL;
Dimensions _tmp1_ = {0};
gboolean _tmp2_ = FALSE;
Dimensions _tmp3_ = {0};
gint _tmp4_ = 0;
Dimensions _tmp8_ = {0};
gboolean _tmp9_ = FALSE;
Scaling _tmp10_ = {0};
#line 284 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (GTK_IS_WIDGET (widget));
#line 285 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = widget;
#line 285 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_for_widget_allocation (_tmp0_, &_tmp1_);
#line 285 "/home/jens/Source/shotwell/src/Dimensions.vala"
viewport = _tmp1_;
#line 295 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = viewport;
#line 295 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_.width;
#line 295 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp4_ <= 1) {
#line 295 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = TRUE;
#line 1854 "Dimensions.c"
} else {
Dimensions _tmp5_ = {0};
gint _tmp6_ = 0;
#line 295 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = viewport;
#line 295 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp5_.height;
#line 295 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = _tmp6_ <= 1;
#line 1864 "Dimensions.c"
}
#line 295 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp2_) {
#line 1868 "Dimensions.c"
Scaling _tmp7_ = {0};
#line 296 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_for_original (&_tmp7_);
#line 296 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp7_;
#line 296 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1876 "Dimensions.c"
}
#line 298 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = viewport;
#line 298 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = scale_up;
#line 298 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_init (&_tmp10_, SCALE_CONSTRAINT_DIMENSIONS, SCALING_NO_SCALE, &_tmp8_, _tmp9_);
#line 298 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp10_;
#line 298 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1888 "Dimensions.c"
}
void scaling_to_fill_viewport (Dimensions* viewport, Scaling* result) {
gboolean _tmp0_ = FALSE;
Dimensions _tmp1_ = {0};
gint _tmp2_ = 0;
Dimensions _tmp6_ = {0};
Scaling _tmp7_ = {0};
#line 301 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (viewport != NULL);
#line 304 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = *viewport;
#line 304 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = _tmp1_.width;
#line 304 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp2_ <= 1) {
#line 304 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = TRUE;
#line 1908 "Dimensions.c"
} else {
Dimensions _tmp3_ = {0};
gint _tmp4_ = 0;
#line 304 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = *viewport;
#line 304 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_.height;
#line 304 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp4_ <= 1;
#line 1918 "Dimensions.c"
}
#line 304 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_) {
#line 1922 "Dimensions.c"
Scaling _tmp5_ = {0};
#line 305 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_for_original (&_tmp5_);
#line 305 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp5_;
#line 305 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1930 "Dimensions.c"
}
#line 307 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = *viewport;
#line 307 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_init (&_tmp7_, SCALE_CONSTRAINT_FILL_VIEWPORT, SCALING_NO_SCALE, &_tmp6_, TRUE);
#line 307 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp7_;
#line 307 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1940 "Dimensions.c"
}
void scaling_to_fill_screen (GtkWindow* window, Scaling* result) {
GtkWindow* _tmp0_ = NULL;
Dimensions _tmp1_ = {0};
Scaling _tmp2_ = {0};
#line 310 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (GTK_IS_WINDOW (window));
#line 311 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = window;
#line 311 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_get_screen_dimensions (_tmp0_, &_tmp1_);
#line 311 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_to_fill_viewport (&_tmp1_, &_tmp2_);
#line 311 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp2_;
#line 311 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1960 "Dimensions.c"
}
void scaling_for_constraint (ScaleConstraint constraint, gint scale, gboolean scale_up, Scaling* result) {
ScaleConstraint _tmp0_ = 0;
gint _tmp1_ = 0;
Dimensions _tmp2_ = {0};
gboolean _tmp3_ = FALSE;
Scaling _tmp4_ = {0};
#line 315 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = constraint;
#line 315 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = scale;
#line 315 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp2_, 0, 0);
#line 315 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = scale_up;
#line 315 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaling_init (&_tmp4_, _tmp0_, _tmp1_, &_tmp2_, _tmp3_);
#line 315 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp4_;
#line 315 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 1984 "Dimensions.c"
}
static gpointer _g_object_ref0 (gpointer self) {
#line 319 "/home/jens/Source/shotwell/src/Dimensions.vala"
return self ? g_object_ref (self) : NULL;
#line 1991 "Dimensions.c"
}
static void scaling_get_screen_dimensions (GtkWindow* window, Dimensions* result) {
GdkScreen* screen = NULL;
GtkWindow* _tmp0_ = NULL;
GdkScreen* _tmp1_ = NULL;
GdkScreen* _tmp2_ = NULL;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
Dimensions _tmp5_ = {0};
#line 318 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (GTK_IS_WINDOW (window));
#line 319 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = window;
#line 319 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = gtk_window_get_screen (_tmp0_);
#line 319 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = _g_object_ref0 (_tmp1_);
#line 319 "/home/jens/Source/shotwell/src/Dimensions.vala"
screen = _tmp2_;
#line 321 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = gdk_screen_get_width (screen);
#line 321 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = gdk_screen_get_height (screen);
#line 321 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_tmp5_, _tmp3_, _tmp4_);
#line 321 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp5_;
#line 321 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_object_unref0 (screen);
#line 321 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 2025 "Dimensions.c"
}
static gint scaling_scale_to_pixels (Scaling *self) {
gint result = 0;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
#line 325 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).scale;
#line 325 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_ >= 0) {
#line 2037 "Dimensions.c"
gint _tmp2_ = 0;
#line 325 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).scale;
#line 325 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp2_;
#line 2043 "Dimensions.c"
} else {
#line 325 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = 0;
#line 2047 "Dimensions.c"
}
#line 325 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 325 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2053 "Dimensions.c"
}
gboolean scaling_is_unscaled (Scaling *self) {
gboolean result = FALSE;
ScaleConstraint _tmp0_ = 0;
#line 329 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).constraint;
#line 329 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_ == SCALE_CONSTRAINT_ORIGINAL;
#line 329 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2066 "Dimensions.c"
}
gboolean scaling_is_best_fit (Scaling *self, Dimensions* original, gint* pixels) {
gint _vala_pixels = 0;
gboolean result = FALSE;
gint _tmp0_ = 0;
ScaleConstraint _tmp1_ = 0;
#line 332 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (original != NULL, FALSE);
#line 333 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_pixels = 0;
#line 335 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).scale;
#line 335 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_ == SCALING_NO_SCALE) {
#line 336 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 336 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (pixels) {
#line 336 "/home/jens/Source/shotwell/src/Dimensions.vala"
*pixels = _vala_pixels;
#line 2089 "Dimensions.c"
}
#line 336 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2093 "Dimensions.c"
}
#line 338 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).constraint;
#line 338 "/home/jens/Source/shotwell/src/Dimensions.vala"
switch (_tmp1_) {
#line 338 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_ORIGINAL:
#line 338 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_FILL_VIEWPORT:
#line 2103 "Dimensions.c"
{
#line 341 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 341 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (pixels) {
#line 341 "/home/jens/Source/shotwell/src/Dimensions.vala"
*pixels = _vala_pixels;
#line 2111 "Dimensions.c"
}
#line 341 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2115 "Dimensions.c"
}
default:
{
gint _tmp2_ = 0;
gint _tmp3_ = 0;
#line 344 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = scaling_scale_to_pixels (&(*self));
#line 344 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_pixels = _tmp2_;
#line 345 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _vala_pixels;
#line 345 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp3_ > 0, "pixels > 0");
#line 347 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = TRUE;
#line 347 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (pixels) {
#line 347 "/home/jens/Source/shotwell/src/Dimensions.vala"
*pixels = _vala_pixels;
#line 2135 "Dimensions.c"
}
#line 347 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2139 "Dimensions.c"
}
}
#line 332 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (pixels) {
#line 332 "/home/jens/Source/shotwell/src/Dimensions.vala"
*pixels = _vala_pixels;
#line 2146 "Dimensions.c"
}
}
gboolean scaling_is_best_fit_dimensions (Scaling *self, Dimensions* original, Dimensions* scaled) {
Dimensions _vala_scaled = {0};
gboolean result = FALSE;
gint _tmp0_ = 0;
ScaleConstraint _tmp1_ = 0;
#line 351 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (original != NULL, FALSE);
#line 352 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_vala_scaled, 0, 0);
#line 354 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).scale;
#line 354 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_ == SCALING_NO_SCALE) {
#line 355 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 355 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 355 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2170 "Dimensions.c"
}
#line 355 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2174 "Dimensions.c"
}
#line 357 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).constraint;
#line 357 "/home/jens/Source/shotwell/src/Dimensions.vala"
switch (_tmp1_) {
#line 357 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_ORIGINAL:
#line 357 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_FILL_VIEWPORT:
#line 2184 "Dimensions.c"
{
#line 360 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 360 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 360 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2192 "Dimensions.c"
}
#line 360 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2196 "Dimensions.c"
}
default:
{
gint pixels = 0;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
ScaleConstraint _tmp5_ = 0;
Dimensions _tmp6_ = {0};
#line 363 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = scaling_scale_to_pixels (&(*self));
#line 363 "/home/jens/Source/shotwell/src/Dimensions.vala"
pixels = _tmp2_;
#line 364 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = pixels;
#line 364 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp3_ > 0, "pixels > 0");
#line 366 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = pixels;
#line 366 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = (*self).constraint;
#line 366 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_by_constraint (original, _tmp4_, _tmp5_, &_tmp6_);
#line 366 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_scaled = _tmp6_;
#line 368 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = TRUE;
#line 368 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 368 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2228 "Dimensions.c"
}
#line 368 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2232 "Dimensions.c"
}
}
#line 351 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 351 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2239 "Dimensions.c"
}
}
gboolean scaling_is_for_viewport (Scaling *self, Dimensions* original, Dimensions* scaled) {
Dimensions _vala_scaled = {0};
gboolean result = FALSE;
gint _tmp0_ = 0;
ScaleConstraint _tmp1_ = 0;
#line 372 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (original != NULL, FALSE);
#line 373 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_vala_scaled, 0, 0);
#line 375 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).scale;
#line 375 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_ != SCALING_NO_SCALE) {
#line 376 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 376 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 376 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2263 "Dimensions.c"
}
#line 376 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2267 "Dimensions.c"
}
#line 378 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).constraint;
#line 378 "/home/jens/Source/shotwell/src/Dimensions.vala"
switch (_tmp1_) {
#line 378 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_ORIGINAL:
#line 378 "/home/jens/Source/shotwell/src/Dimensions.vala"
case SCALE_CONSTRAINT_FILL_VIEWPORT:
#line 2277 "Dimensions.c"
{
#line 381 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 381 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 381 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2285 "Dimensions.c"
}
#line 381 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2289 "Dimensions.c"
}
default:
{
gboolean _tmp2_ = FALSE;
gboolean _tmp3_ = FALSE;
gboolean _tmp4_ = FALSE;
gboolean _tmp5_ = FALSE;
#line 384 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = dimensions_has_area (&(*self).viewport);
#line 384 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp2_, "viewport.has_area()");
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = (*self).scale_up;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (!_tmp5_) {
#line 2305 "Dimensions.c"
Dimensions _tmp6_ = {0};
gint _tmp7_ = 0;
Dimensions _tmp8_ = {0};
gint _tmp9_ = 0;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = *original;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = _tmp6_.width;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = (*self).viewport;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = _tmp8_.width;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp7_ < _tmp9_;
#line 2320 "Dimensions.c"
} else {
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = FALSE;
#line 2324 "Dimensions.c"
}
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp4_) {
#line 2328 "Dimensions.c"
Dimensions _tmp10_ = {0};
gint _tmp11_ = 0;
Dimensions _tmp12_ = {0};
gint _tmp13_ = 0;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = *original;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = _tmp10_.height;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = (*self).viewport;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = _tmp12_.height;
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp11_ < _tmp13_;
#line 2343 "Dimensions.c"
} else {
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = FALSE;
#line 2347 "Dimensions.c"
}
#line 386 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp3_) {
#line 2351 "Dimensions.c"
Dimensions _tmp14_ = {0};
#line 387 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = *original;
#line 387 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_scaled = _tmp14_;
#line 2357 "Dimensions.c"
} else {
Dimensions _tmp15_ = {0};
Dimensions _tmp16_ = {0};
#line 389 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = (*self).viewport;
#line 389 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_proportional (original, &_tmp15_, &_tmp16_);
#line 389 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_scaled = _tmp16_;
#line 2367 "Dimensions.c"
}
#line 391 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = TRUE;
#line 391 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 391 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2375 "Dimensions.c"
}
#line 391 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2379 "Dimensions.c"
}
}
#line 372 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 372 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2386 "Dimensions.c"
}
}
gboolean scaling_is_fill_viewport (Scaling *self, Dimensions* original, Dimensions* scaled) {
Dimensions _vala_scaled = {0};
gboolean result = FALSE;
ScaleConstraint _tmp0_ = 0;
gboolean _tmp1_ = FALSE;
Dimensions _tmp2_ = {0};
Dimensions _tmp3_ = {0};
#line 395 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (original != NULL, FALSE);
#line 396 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_init (&_vala_scaled, 0, 0);
#line 398 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).constraint;
#line 398 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_ != SCALE_CONSTRAINT_FILL_VIEWPORT) {
#line 399 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 399 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 399 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2412 "Dimensions.c"
}
#line 399 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2416 "Dimensions.c"
}
#line 401 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = dimensions_has_area (&(*self).viewport);
#line 401 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp1_, "viewport.has_area()");
#line 402 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).viewport;
#line 402 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scaled_to_fill_viewport (original, &_tmp2_, &_tmp3_);
#line 402 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_scaled = _tmp3_;
#line 404 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = TRUE;
#line 404 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (scaled) {
#line 404 "/home/jens/Source/shotwell/src/Dimensions.vala"
*scaled = _vala_scaled;
#line 2434 "Dimensions.c"
}
#line 404 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2438 "Dimensions.c"
}
void scaling_get_scaled_dimensions (Scaling *self, Dimensions* original, Dimensions* result) {
gboolean _tmp0_ = FALSE;
Dimensions scaled = {0};
Dimensions _tmp2_ = {0};
Dimensions _tmp3_ = {0};
gboolean _tmp4_ = FALSE;
Dimensions _tmp5_ = {0};
Dimensions _tmp6_ = {0};
gboolean _tmp7_ = FALSE;
gboolean is_viewport = FALSE;
Dimensions _tmp8_ = {0};
Dimensions _tmp9_ = {0};
gboolean _tmp10_ = FALSE;
gboolean _tmp11_ = FALSE;
#line 407 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (original != NULL);
#line 408 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = scaling_is_unscaled (&(*self));
#line 408 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_) {
#line 2462 "Dimensions.c"
Dimensions _tmp1_ = {0};
#line 409 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = *original;
#line 409 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp1_;
#line 409 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 2470 "Dimensions.c"
}
#line 412 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *original;
#line 412 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = scaling_is_fill_viewport (&(*self), &_tmp2_, &_tmp3_);
#line 412 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled = _tmp3_;
#line 412 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp4_) {
#line 413 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = scaled;
#line 413 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 2484 "Dimensions.c"
}
#line 415 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = *original;
#line 415 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = scaling_is_best_fit_dimensions (&(*self), &_tmp5_, &_tmp6_);
#line 415 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled = _tmp6_;
#line 415 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp7_) {
#line 416 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = scaled;
#line 416 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 2498 "Dimensions.c"
}
#line 418 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = *original;
#line 418 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = scaling_is_for_viewport (&(*self), &_tmp8_, &_tmp9_);
#line 418 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled = _tmp9_;
#line 418 "/home/jens/Source/shotwell/src/Dimensions.vala"
is_viewport = _tmp10_;
#line 419 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = is_viewport;
#line 419 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp11_, "is_viewport");
#line 421 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = scaled;
#line 421 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 2516 "Dimensions.c"
}
GdkPixbuf* scaling_perform_on_pixbuf (Scaling *self, GdkPixbuf* pixbuf, GdkInterpType interp, gboolean scale_up) {
GdkPixbuf* result = NULL;
gboolean _tmp0_ = FALSE;
Dimensions pixbuf_dim = {0};
GdkPixbuf* _tmp3_ = NULL;
Dimensions _tmp4_ = {0};
gint pixels = 0;
Dimensions _tmp5_ = {0};
gint _tmp6_ = 0;
gboolean _tmp7_ = FALSE;
Dimensions scaled = {0};
Dimensions _tmp13_ = {0};
Dimensions _tmp14_ = {0};
gboolean _tmp15_ = FALSE;
gboolean is_viewport = FALSE;
Dimensions _tmp20_ = {0};
Dimensions _tmp21_ = {0};
gboolean _tmp22_ = FALSE;
gboolean _tmp23_ = FALSE;
GdkPixbuf* _tmp24_ = NULL;
Dimensions _tmp25_ = {0};
GdkInterpType _tmp26_ = 0;
GdkPixbuf* _tmp27_ = NULL;
#line 424 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
#line 425 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = scaling_is_unscaled (&(*self));
#line 425 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_) {
#line 2549 "Dimensions.c"
GdkPixbuf* _tmp1_ = NULL;
GdkPixbuf* _tmp2_ = NULL;
#line 426 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = pixbuf;
#line 426 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = _g_object_ref0 (_tmp1_);
#line 426 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp2_;
#line 426 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2560 "Dimensions.c"
}
#line 428 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = pixbuf;
#line 428 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_for_pixbuf (_tmp3_, &_tmp4_);
#line 428 "/home/jens/Source/shotwell/src/Dimensions.vala"
pixbuf_dim = _tmp4_;
#line 431 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = pixbuf_dim;
#line 431 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = scaling_is_best_fit (&(*self), &_tmp5_, &_tmp6_);
#line 431 "/home/jens/Source/shotwell/src/Dimensions.vala"
pixels = _tmp6_;
#line 431 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp7_) {
#line 2576 "Dimensions.c"
GdkPixbuf* _tmp8_ = NULL;
gint _tmp9_ = 0;
GdkInterpType _tmp10_ = 0;
gboolean _tmp11_ = FALSE;
GdkPixbuf* _tmp12_ = NULL;
#line 432 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = pixbuf;
#line 432 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = pixels;
#line 432 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = interp;
#line 432 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = scale_up;
#line 432 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = scale_pixbuf (_tmp8_, _tmp9_, _tmp10_, _tmp11_);
#line 432 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp12_;
#line 432 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2596 "Dimensions.c"
}
#line 435 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = pixbuf_dim;
#line 435 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = scaling_is_fill_viewport (&(*self), &_tmp13_, &_tmp14_);
#line 435 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled = _tmp14_;
#line 435 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp15_) {
#line 2606 "Dimensions.c"
GdkPixbuf* _tmp16_ = NULL;
Dimensions _tmp17_ = {0};
GdkInterpType _tmp18_ = 0;
GdkPixbuf* _tmp19_ = NULL;
#line 436 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = pixbuf;
#line 436 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = scaled;
#line 436 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = interp;
#line 436 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = resize_pixbuf (_tmp16_, &_tmp17_, _tmp18_);
#line 436 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp19_;
#line 436 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2623 "Dimensions.c"
}
#line 438 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = pixbuf_dim;
#line 438 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = scaling_is_for_viewport (&(*self), &_tmp20_, &_tmp21_);
#line 438 "/home/jens/Source/shotwell/src/Dimensions.vala"
scaled = _tmp21_;
#line 438 "/home/jens/Source/shotwell/src/Dimensions.vala"
is_viewport = _tmp22_;
#line 439 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp23_ = is_viewport;
#line 439 "/home/jens/Source/shotwell/src/Dimensions.vala"
_vala_assert (_tmp23_, "is_viewport");
#line 441 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp24_ = pixbuf;
#line 441 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp25_ = scaled;
#line 441 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp26_ = interp;
#line 441 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp27_ = resize_pixbuf (_tmp24_, &_tmp25_, _tmp26_);
#line 441 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp27_;
#line 441 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2649 "Dimensions.c"
}
gchar* scaling_to_string (Scaling *self) {
gchar* result = NULL;
ScaleConstraint _tmp0_ = 0;
#line 445 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).constraint;
#line 445 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp0_ == SCALE_CONSTRAINT_ORIGINAL) {
#line 2660 "Dimensions.c"
gchar* _tmp1_ = NULL;
#line 446 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = g_strdup ("scaling: UNSCALED");
#line 446 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp1_;
#line 446 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2668 "Dimensions.c"
} else {
ScaleConstraint _tmp2_ = 0;
#line 447 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).constraint;
#line 447 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp2_ == SCALE_CONSTRAINT_FILL_VIEWPORT) {
#line 2675 "Dimensions.c"
gchar* _tmp3_ = NULL;
gchar* _tmp4_ = NULL;
gchar* _tmp5_ = NULL;
gchar* _tmp6_ = NULL;
#line 448 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = dimensions_to_string (&(*self).viewport);
#line 448 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_;
#line 448 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = g_strdup_printf ("scaling: fill viewport %s", _tmp4_);
#line 448 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp5_;
#line 448 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (_tmp4_);
#line 448 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp6_;
#line 448 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2694 "Dimensions.c"
} else {
gint _tmp7_ = 0;
#line 449 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = (*self).scale;
#line 449 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp7_ != SCALING_NO_SCALE) {
#line 2701 "Dimensions.c"
const gchar* _tmp8_ = NULL;
gboolean _tmp9_ = FALSE;
ScaleConstraint _tmp10_ = 0;
gchar* _tmp11_ = NULL;
gchar* _tmp12_ = NULL;
gint _tmp13_ = 0;
gchar* _tmp14_ = NULL;
gchar* _tmp15_ = NULL;
#line 451 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = (*self).scale_up;
#line 451 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp9_) {
#line 451 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = "scaled up";
#line 2716 "Dimensions.c"
} else {
#line 451 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = "not scaled up";
#line 2720 "Dimensions.c"
}
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = (*self).constraint;
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = scale_constraint_to_string (_tmp10_);
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = _tmp11_;
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = scaling_scale_to_pixels (&(*self));
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = g_strdup_printf ("scaling: best-fit (%s %d pixels %s)", _tmp12_, _tmp13_, _tmp8_);
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = _tmp14_;
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (_tmp12_);
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp15_;
#line 450 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2740 "Dimensions.c"
} else {
const gchar* _tmp16_ = NULL;
gboolean _tmp17_ = FALSE;
gchar* _tmp18_ = NULL;
gchar* _tmp19_ = NULL;
gchar* _tmp20_ = NULL;
gchar* _tmp21_ = NULL;
#line 454 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = (*self).scale_up;
#line 454 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp17_) {
#line 454 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = "scaled up";
#line 2754 "Dimensions.c"
} else {
#line 454 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = "not scaled up";
#line 2758 "Dimensions.c"
}
#line 453 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = dimensions_to_string (&(*self).viewport);
#line 453 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = _tmp18_;
#line 453 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = g_strdup_printf ("scaling: viewport %s (%s)", _tmp19_, _tmp16_);
#line 453 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = _tmp20_;
#line 453 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (_tmp19_);
#line 453 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp21_;
#line 453 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2774 "Dimensions.c"
}
}
}
}
gboolean scaling_equals (Scaling *self, Scaling* scaling) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
ScaleConstraint _tmp2_ = 0;
Scaling _tmp3_ = {0};
ScaleConstraint _tmp4_ = 0;
#line 457 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (scaling != NULL, FALSE);
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).constraint;
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = *scaling;
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_.constraint;
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp2_ == _tmp4_) {
#line 2798 "Dimensions.c"
gint _tmp5_ = 0;
Scaling _tmp6_ = {0};
gint _tmp7_ = 0;
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = (*self).scale;
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = *scaling;
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = _tmp6_.scale;
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp5_ == _tmp7_;
#line 2810 "Dimensions.c"
} else {
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = FALSE;
#line 2814 "Dimensions.c"
}
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_) {
#line 2818 "Dimensions.c"
Scaling _tmp8_ = {0};
Dimensions _tmp9_ = {0};
gboolean _tmp10_ = FALSE;
#line 459 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = *scaling;
#line 459 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = _tmp8_.viewport;
#line 459 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = dimensions_equals (&(*self).viewport, &_tmp9_);
#line 459 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = _tmp10_;
#line 2830 "Dimensions.c"
} else {
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = FALSE;
#line 2834 "Dimensions.c"
}
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 458 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 2840 "Dimensions.c"
}
Scaling* scaling_dup (const Scaling* self) {
Scaling* dup;
#line 249 "/home/jens/Source/shotwell/src/Dimensions.vala"
dup = g_new0 (Scaling, 1);
#line 249 "/home/jens/Source/shotwell/src/Dimensions.vala"
memcpy (dup, self, sizeof (Scaling));
#line 249 "/home/jens/Source/shotwell/src/Dimensions.vala"
return dup;
#line 2852 "Dimensions.c"
}
void scaling_free (Scaling* self) {
#line 249 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_free (self);
#line 2859 "Dimensions.c"
}
GType scaling_get_type (void) {
static volatile gsize scaling_type_id__volatile = 0;
if (g_once_init_enter (&scaling_type_id__volatile)) {
GType scaling_type_id;
scaling_type_id = g_boxed_type_register_static ("Scaling", (GBoxedCopyFunc) scaling_dup, (GBoxedFreeFunc) scaling_free);
g_once_init_leave (&scaling_type_id__volatile, scaling_type_id);
}
return scaling_type_id__volatile;
}
void zoom_state_init (ZoomState *self, Dimensions* content_dimensions, Dimensions* viewport_dimensions, gdouble slider_val, GdkPoint* viewport_center) {
Dimensions _tmp0_ = {0};
Dimensions _tmp1_ = {0};
gdouble _tmp2_ = 0.0;
gboolean _tmp3_ = FALSE;
gboolean _tmp4_ = FALSE;
GdkPoint* _tmp5_ = NULL;
#line 472 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (content_dimensions != NULL);
#line 472 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (viewport_dimensions != NULL);
#line 472 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (self, 0, sizeof (ZoomState));
#line 474 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *content_dimensions;
#line 474 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).content_dimensions = _tmp0_;
#line 475 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = *viewport_dimensions;
#line 475 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_dimensions = _tmp1_;
#line 476 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = slider_val;
#line 476 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).interpolation_factor = _tmp2_;
#line 478 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_compute_zoom_factors (&(*self));
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = viewport_center;
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp5_ == NULL) {
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = TRUE;
#line 2907 "Dimensions.c"
} else {
gboolean _tmp6_ = FALSE;
GdkPoint* _tmp7_ = NULL;
gint _tmp8_ = 0;
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = viewport_center;
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = (*_tmp7_).x;
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp8_ == 0) {
#line 2918 "Dimensions.c"
GdkPoint* _tmp9_ = NULL;
gint _tmp10_ = 0;
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = viewport_center;
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = (*_tmp9_).y;
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp10_ == 0;
#line 2927 "Dimensions.c"
} else {
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = FALSE;
#line 2931 "Dimensions.c"
}
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp6_;
#line 2935 "Dimensions.c"
}
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp4_) {
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = TRUE;
#line 2941 "Dimensions.c"
} else {
gdouble _tmp11_ = 0.0;
#line 481 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = slider_val;
#line 481 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp11_ == 0.0;
#line 2948 "Dimensions.c"
}
#line 480 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp3_) {
#line 482 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_center_viewport (&(*self));
#line 2954 "Dimensions.c"
} else {
GdkPoint* _tmp12_ = NULL;
#line 484 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = viewport_center;
#line 484 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center = *_tmp12_;
#line 485 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_clamp_viewport_center (&(*self));
#line 2963 "Dimensions.c"
}
}
void zoom_state_init_rescale (ZoomState *self, ZoomState* existing, gdouble new_slider_val) {
ZoomState _tmp0_ = {0};
Dimensions _tmp1_ = {0};
ZoomState _tmp2_ = {0};
Dimensions _tmp3_ = {0};
gdouble _tmp4_ = 0.0;
gdouble _tmp5_ = 0.0;
#line 489 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (existing != NULL);
#line 489 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (self, 0, sizeof (ZoomState));
#line 490 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *existing;
#line 490 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.content_dimensions;
#line 490 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).content_dimensions = _tmp1_;
#line 491 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *existing;
#line 491 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.viewport_dimensions;
#line 491 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_dimensions = _tmp3_;
#line 492 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = new_slider_val;
#line 492 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).interpolation_factor = _tmp4_;
#line 494 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_compute_zoom_factors (&(*self));
#line 496 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = new_slider_val;
#line 496 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp5_ == 0.0) {
#line 497 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_center_viewport (&(*self));
#line 3003 "Dimensions.c"
} else {
gdouble _tmp6_ = 0.0;
ZoomState _tmp7_ = {0};
GdkPoint _tmp8_ = {0};
gint _tmp9_ = 0;
ZoomState _tmp10_ = {0};
gdouble _tmp11_ = 0.0;
gdouble _tmp12_ = 0.0;
ZoomState _tmp13_ = {0};
GdkPoint _tmp14_ = {0};
gint _tmp15_ = 0;
ZoomState _tmp16_ = {0};
gdouble _tmp17_ = 0.0;
#line 499 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = (*self).zoom_factor;
#line 499 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = *existing;
#line 499 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = _tmp7_.viewport_center;
#line 499 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = _tmp8_.x;
#line 499 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = *existing;
#line 499 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = _tmp10_.zoom_factor;
#line 499 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center.x = (gint) (_tmp6_ * (_tmp9_ / _tmp11_));
#line 501 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = (*self).zoom_factor;
#line 501 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = *existing;
#line 501 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = _tmp13_.viewport_center;
#line 501 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = _tmp14_.y;
#line 501 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = *existing;
#line 501 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = _tmp16_.zoom_factor;
#line 501 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center.y = (gint) (_tmp12_ * (_tmp15_ / _tmp17_));
#line 503 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_clamp_viewport_center (&(*self));
#line 3047 "Dimensions.c"
}
}
void zoom_state_init_rescale_to_isomorphic (ZoomState *self, ZoomState* existing) {
ZoomState _tmp0_ = {0};
Dimensions _tmp1_ = {0};
ZoomState _tmp2_ = {0};
Dimensions _tmp3_ = {0};
ZoomState _tmp4_ = {0};
gdouble _tmp5_ = 0.0;
gdouble _tmp6_ = 0.0;
ZoomState _tmp7_ = {0};
gdouble _tmp8_ = 0.0;
ZoomState _tmp9_ = {0};
gdouble _tmp10_ = 0.0;
gdouble _tmp11_ = 0.0;
gdouble _tmp12_ = 0.0;
#line 507 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (existing != NULL);
#line 507 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (self, 0, sizeof (ZoomState));
#line 508 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *existing;
#line 508 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.content_dimensions;
#line 508 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).content_dimensions = _tmp1_;
#line 509 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *existing;
#line 509 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.viewport_dimensions;
#line 509 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_dimensions = _tmp3_;
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = *existing;
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = _tmp4_.min_factor;
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = log (1.0 / _tmp5_);
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = *existing;
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = _tmp7_.max_factor;
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = *existing;
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = _tmp9_.min_factor;
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = log (_tmp8_ / _tmp10_);
#line 510 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).interpolation_factor = _tmp6_ / _tmp11_;
#line 513 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_compute_zoom_factors (&(*self));
#line 515 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = (*self).interpolation_factor;
#line 515 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp12_ == 0.0) {
#line 516 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_center_viewport (&(*self));
#line 3108 "Dimensions.c"
} else {
gdouble _tmp13_ = 0.0;
ZoomState _tmp14_ = {0};
GdkPoint _tmp15_ = {0};
gint _tmp16_ = 0;
ZoomState _tmp17_ = {0};
gdouble _tmp18_ = 0.0;
gdouble _tmp19_ = 0.0;
ZoomState _tmp20_ = {0};
GdkPoint _tmp21_ = {0};
gint _tmp22_ = 0;
ZoomState _tmp23_ = {0};
gdouble _tmp24_ = 0.0;
#line 518 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = (*self).zoom_factor;
#line 518 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = *existing;
#line 518 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = _tmp14_.viewport_center;
#line 518 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = _tmp15_.x;
#line 518 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = *existing;
#line 518 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = _tmp17_.zoom_factor;
#line 518 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center.x = (gint) (_tmp13_ * (_tmp16_ / _tmp18_));
#line 520 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = (*self).zoom_factor;
#line 520 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = *existing;
#line 520 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = _tmp20_.viewport_center;
#line 520 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = _tmp21_.y;
#line 520 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp23_ = *existing;
#line 520 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp24_ = _tmp23_.zoom_factor;
#line 520 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center.y = (gint) (_tmp19_ * (_tmp22_ / _tmp24_));
#line 522 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_clamp_viewport_center (&(*self));
#line 3152 "Dimensions.c"
}
}
void zoom_state_init_pan (ZoomState *self, ZoomState* existing, GdkPoint* new_viewport_center) {
ZoomState _tmp0_ = {0};
Dimensions _tmp1_ = {0};
ZoomState _tmp2_ = {0};
Dimensions _tmp3_ = {0};
ZoomState _tmp4_ = {0};
gdouble _tmp5_ = 0.0;
GdkPoint _tmp6_ = {0};
#line 526 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (existing != NULL);
#line 526 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (new_viewport_center != NULL);
#line 526 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (self, 0, sizeof (ZoomState));
#line 527 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *existing;
#line 527 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.content_dimensions;
#line 527 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).content_dimensions = _tmp1_;
#line 528 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = *existing;
#line 528 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.viewport_dimensions;
#line 528 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_dimensions = _tmp3_;
#line 529 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = *existing;
#line 529 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = _tmp4_.interpolation_factor;
#line 529 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).interpolation_factor = _tmp5_;
#line 531 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_compute_zoom_factors (&(*self));
#line 533 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = *new_viewport_center;
#line 533 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center = _tmp6_;
#line 535 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_clamp_viewport_center (&(*self));
#line 3197 "Dimensions.c"
}
static void zoom_state_clamp_viewport_center (ZoomState *self) {
gint zoomed_width = 0;
gint _tmp0_ = 0;
gint zoomed_height = 0;
gint _tmp1_ = 0;
GdkPoint _tmp2_ = {0};
gint _tmp3_ = 0;
Dimensions _tmp4_ = {0};
gint _tmp5_ = 0;
Dimensions _tmp6_ = {0};
gint _tmp7_ = 0;
gint _tmp8_ = 0;
GdkPoint _tmp9_ = {0};
gint _tmp10_ = 0;
Dimensions _tmp11_ = {0};
gint _tmp12_ = 0;
Dimensions _tmp13_ = {0};
gint _tmp14_ = 0;
gint _tmp15_ = 0;
#line 539 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = zoom_state_get_zoomed_width (&(*self));
#line 539 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoomed_width = _tmp0_;
#line 540 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = zoom_state_get_zoomed_height (&(*self));
#line 540 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoomed_height = _tmp1_;
#line 542 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).viewport_center;
#line 542 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.x;
#line 542 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = (*self).viewport_dimensions;
#line 542 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = _tmp4_.width;
#line 542 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = (*self).viewport_dimensions;
#line 542 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = _tmp6_.width;
#line 542 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = CLAMP (_tmp3_, _tmp5_ / 2, (zoomed_width - (_tmp7_ / 2)) - 1);
#line 542 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center.x = _tmp8_;
#line 544 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = (*self).viewport_center;
#line 544 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = _tmp9_.y;
#line 544 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = (*self).viewport_dimensions;
#line 544 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = _tmp11_.height;
#line 544 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = (*self).viewport_dimensions;
#line 544 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = _tmp13_.height;
#line 544 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = CLAMP (_tmp10_, _tmp12_ / 2, (zoomed_height - (_tmp14_ / 2)) - 1);
#line 544 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center.y = _tmp15_;
#line 3260 "Dimensions.c"
}
static void zoom_state_center_viewport (ZoomState *self) {
gint _tmp0_ = 0;
gint _tmp1_ = 0;
#line 549 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = zoom_state_get_zoomed_width (&(*self));
#line 549 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center.x = _tmp0_ / 2;
#line 550 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = zoom_state_get_zoomed_height (&(*self));
#line 550 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).viewport_center.y = _tmp1_ / 2;
#line 3275 "Dimensions.c"
}
static void zoom_state_compute_zoom_factors (ZoomState *self) {
gdouble viewport_to_content_x = 0.0;
gdouble viewport_to_content_y = 0.0;
Dimensions _tmp0_ = {0};
gdouble _tmp1_ = 0.0;
gdouble _tmp2_ = 0.0;
gdouble _tmp3_ = 0.0;
gdouble _tmp4_ = 0.0;
gdouble _tmp5_ = 0.0;
gdouble _tmp6_ = 0.0;
gdouble _tmp7_ = 0.0;
gdouble _tmp8_ = 0.0;
gdouble _tmp9_ = 0.0;
gdouble _tmp10_ = 0.0;
gdouble _tmp11_ = 0.0;
#line 554 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).max_factor = 2.0;
#line 558 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).viewport_dimensions;
#line 558 "/home/jens/Source/shotwell/src/Dimensions.vala"
dimensions_get_scale_ratios (&(*self).content_dimensions, &_tmp0_, &_tmp1_, &_tmp2_);
#line 558 "/home/jens/Source/shotwell/src/Dimensions.vala"
viewport_to_content_x = _tmp1_;
#line 558 "/home/jens/Source/shotwell/src/Dimensions.vala"
viewport_to_content_y = _tmp2_;
#line 560 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = viewport_to_content_x;
#line 560 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = viewport_to_content_y;
#line 560 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = MIN (_tmp3_, _tmp4_);
#line 560 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).min_factor = _tmp5_;
#line 561 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = (*self).min_factor;
#line 561 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp6_ > 1.0) {
#line 562 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).min_factor = 1.0;
#line 3318 "Dimensions.c"
}
#line 564 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = (*self).min_factor;
#line 564 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = (*self).max_factor;
#line 564 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = (*self).min_factor;
#line 564 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = (*self).interpolation_factor;
#line 564 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = pow (_tmp8_ / _tmp9_, _tmp10_);
#line 564 "/home/jens/Source/shotwell/src/Dimensions.vala"
(*self).zoom_factor = _tmp7_ * _tmp11_;
#line 3332 "Dimensions.c"
}
gdouble zoom_state_get_interpolation_factor (ZoomState *self) {
gdouble result = 0.0;
gdouble _tmp0_ = 0.0;
#line 568 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).interpolation_factor;
#line 568 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 568 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 3345 "Dimensions.c"
}
void zoom_state_get_viewing_rectangle_wrt_content (ZoomState *self, GdkRectangle* result) {
gint zoomed_width = 0;
gint _tmp0_ = 0;
gint zoomed_height = 0;
gint _tmp1_ = 0;
GdkRectangle _result_ = {0};
Dimensions _tmp2_ = {0};
gint _tmp3_ = 0;
gint _tmp4_ = 0;
GdkRectangle _tmp12_ = {0};
gint _tmp13_ = 0;
Dimensions _tmp14_ = {0};
gint _tmp15_ = 0;
gint _tmp16_ = 0;
GdkRectangle _tmp24_ = {0};
gint _tmp25_ = 0;
gint right = 0;
GdkRectangle _tmp26_ = {0};
gint _tmp27_ = 0;
Dimensions _tmp28_ = {0};
gint _tmp29_ = 0;
gint _tmp30_ = 0;
gint _tmp31_ = 0;
gint _tmp33_ = 0;
GdkRectangle _tmp34_ = {0};
gint _tmp35_ = 0;
gint bottom = 0;
GdkRectangle _tmp36_ = {0};
gint _tmp37_ = 0;
Dimensions _tmp38_ = {0};
gint _tmp39_ = 0;
gint _tmp40_ = 0;
gint _tmp41_ = 0;
gint _tmp43_ = 0;
GdkRectangle _tmp44_ = {0};
gint _tmp45_ = 0;
GdkRectangle _tmp46_ = {0};
gint _tmp47_ = 0;
gint _tmp48_ = 0;
GdkRectangle _tmp49_ = {0};
gint _tmp50_ = 0;
gint _tmp51_ = 0;
#line 573 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = zoom_state_get_zoomed_width (&(*self));
#line 573 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoomed_width = _tmp0_;
#line 574 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = zoom_state_get_zoomed_height (&(*self));
#line 574 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoomed_height = _tmp1_;
#line 576 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (&_result_, 0, sizeof (GdkRectangle));
#line 578 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).viewport_dimensions;
#line 578 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = _tmp2_.width;
#line 578 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = zoomed_width;
#line 578 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp3_ < _tmp4_) {
#line 3409 "Dimensions.c"
GdkPoint _tmp5_ = {0};
gint _tmp6_ = 0;
Dimensions _tmp7_ = {0};
gint _tmp8_ = 0;
#line 579 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = (*self).viewport_center;
#line 579 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp5_.x;
#line 579 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = (*self).viewport_dimensions;
#line 579 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = _tmp7_.width;
#line 579 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.x = _tmp6_ - (_tmp8_ / 2);
#line 3424 "Dimensions.c"
} else {
gint _tmp9_ = 0;
Dimensions _tmp10_ = {0};
gint _tmp11_ = 0;
#line 581 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = zoomed_width;
#line 581 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = (*self).viewport_dimensions;
#line 581 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = _tmp10_.width;
#line 581 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.x = (_tmp9_ - _tmp11_) / 2;
#line 3437 "Dimensions.c"
}
#line 583 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = _result_;
#line 583 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = _tmp12_.x;
#line 583 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp13_ < 0) {
#line 584 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.x = 0;
#line 3447 "Dimensions.c"
}
#line 586 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = (*self).viewport_dimensions;
#line 586 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = _tmp14_.height;
#line 586 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = zoomed_height;
#line 586 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp15_ < _tmp16_) {
#line 3457 "Dimensions.c"
GdkPoint _tmp17_ = {0};
gint _tmp18_ = 0;
Dimensions _tmp19_ = {0};
gint _tmp20_ = 0;
#line 587 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = (*self).viewport_center;
#line 587 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = _tmp17_.y;
#line 587 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = (*self).viewport_dimensions;
#line 587 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = _tmp19_.height;
#line 587 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.y = _tmp18_ - (_tmp20_ / 2);
#line 3472 "Dimensions.c"
} else {
gint _tmp21_ = 0;
Dimensions _tmp22_ = {0};
gint _tmp23_ = 0;
#line 589 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = zoomed_height;
#line 589 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = (*self).viewport_dimensions;
#line 589 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp23_ = _tmp22_.height;
#line 589 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.y = (_tmp21_ - _tmp23_) / 2;
#line 3485 "Dimensions.c"
}
#line 591 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp24_ = _result_;
#line 591 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp25_ = _tmp24_.y;
#line 591 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp25_ < 0) {
#line 592 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.y = 0;
#line 3495 "Dimensions.c"
}
#line 594 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp26_ = _result_;
#line 594 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp27_ = _tmp26_.x;
#line 594 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp28_ = (*self).viewport_dimensions;
#line 594 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp29_ = _tmp28_.width;
#line 594 "/home/jens/Source/shotwell/src/Dimensions.vala"
right = _tmp27_ + _tmp29_;
#line 595 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp30_ = right;
#line 595 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp31_ = zoomed_width;
#line 595 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp30_ > _tmp31_) {
#line 3513 "Dimensions.c"
gint _tmp32_ = 0;
#line 596 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp32_ = zoomed_width;
#line 596 "/home/jens/Source/shotwell/src/Dimensions.vala"
right = _tmp32_;
#line 3519 "Dimensions.c"
}
#line 597 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp33_ = right;
#line 597 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp34_ = _result_;
#line 597 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp35_ = _tmp34_.x;
#line 597 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.width = _tmp33_ - _tmp35_;
#line 599 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp36_ = _result_;
#line 599 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp37_ = _tmp36_.y;
#line 599 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp38_ = (*self).viewport_dimensions;
#line 599 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp39_ = _tmp38_.height;
#line 599 "/home/jens/Source/shotwell/src/Dimensions.vala"
bottom = _tmp37_ + _tmp39_;
#line 600 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp40_ = bottom;
#line 600 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp41_ = zoomed_height;
#line 600 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp40_ > _tmp41_) {
#line 3545 "Dimensions.c"
gint _tmp42_ = 0;
#line 601 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp42_ = zoomed_height;
#line 601 "/home/jens/Source/shotwell/src/Dimensions.vala"
bottom = _tmp42_;
#line 3551 "Dimensions.c"
}
#line 602 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp43_ = bottom;
#line 602 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp44_ = _result_;
#line 602 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp45_ = _tmp44_.y;
#line 602 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.height = _tmp43_ - _tmp45_;
#line 604 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp46_ = _result_;
#line 604 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp47_ = _tmp46_.width;
#line 604 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp48_ = CLAMP (_tmp47_, 1, G_MAXINT);
#line 604 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.width = _tmp48_;
#line 605 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp49_ = _result_;
#line 605 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp50_ = _tmp49_.height;
#line 605 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp51_ = CLAMP (_tmp50_, 1, G_MAXINT);
#line 605 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.height = _tmp51_;
#line 607 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _result_;
#line 607 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 3581 "Dimensions.c"
}
void zoom_state_get_viewing_rectangle_wrt_screen (ZoomState *self, GdkRectangle* result) {
GdkRectangle wrt_content = {0};
GdkRectangle _tmp0_ = {0};
GdkRectangle _result_ = {0};
Dimensions _tmp1_ = {0};
gint _tmp2_ = 0;
GdkRectangle _tmp3_ = {0};
gint _tmp4_ = 0;
GdkRectangle _tmp5_ = {0};
gint _tmp6_ = 0;
Dimensions _tmp7_ = {0};
gint _tmp8_ = 0;
GdkRectangle _tmp9_ = {0};
gint _tmp10_ = 0;
GdkRectangle _tmp11_ = {0};
gint _tmp12_ = 0;
GdkRectangle _tmp13_ = {0};
gint _tmp14_ = 0;
GdkRectangle _tmp15_ = {0};
gint _tmp16_ = 0;
#line 613 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_get_viewing_rectangle_wrt_content (&(*self), &_tmp0_);
#line 613 "/home/jens/Source/shotwell/src/Dimensions.vala"
wrt_content = _tmp0_;
#line 615 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (&_result_, 0, sizeof (GdkRectangle));
#line 616 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).viewport_dimensions;
#line 616 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = _tmp1_.width;
#line 616 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = wrt_content;
#line 616 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_.width;
#line 616 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.x = (_tmp2_ / 2) - (_tmp4_ / 2);
#line 617 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = _result_;
#line 617 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = _tmp5_.x;
#line 617 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp6_ < 0) {
#line 618 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.x = 0;
#line 3629 "Dimensions.c"
}
#line 619 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = (*self).viewport_dimensions;
#line 619 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = _tmp7_.height;
#line 619 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = wrt_content;
#line 619 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = _tmp9_.height;
#line 619 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.y = (_tmp8_ / 2) - (_tmp10_ / 2);
#line 620 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = _result_;
#line 620 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = _tmp11_.y;
#line 620 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp12_ < 0) {
#line 621 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.y = 0;
#line 3649 "Dimensions.c"
}
#line 622 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = wrt_content;
#line 622 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = _tmp13_.width;
#line 622 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.width = _tmp14_;
#line 623 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = wrt_content;
#line 623 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = _tmp15_.height;
#line 623 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.height = _tmp16_;
#line 625 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _result_;
#line 625 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 3667 "Dimensions.c"
}
void zoom_state_get_viewing_rectangle_projection (ZoomState *self, GdkPixbuf* for_pixbuf, GdkRectangle* result) {
gdouble zoomed_width = 0.0;
gint _tmp0_ = 0;
gdouble zoomed_height = 0.0;
gint _tmp1_ = 0;
gdouble horiz_scale = 0.0;
GdkPixbuf* _tmp2_ = NULL;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
gdouble vert_scale = 0.0;
GdkPixbuf* _tmp5_ = NULL;
gint _tmp6_ = 0;
gint _tmp7_ = 0;
gdouble scale = 0.0;
GdkRectangle viewing_rectangle = {0};
GdkRectangle _tmp8_ = {0};
GdkRectangle _result_ = {0};
GdkRectangle _tmp9_ = {0};
gint _tmp10_ = 0;
GdkRectangle _tmp11_ = {0};
gint _tmp12_ = 0;
GdkPixbuf* _tmp13_ = NULL;
gint _tmp14_ = 0;
gint _tmp15_ = 0;
gint _tmp16_ = 0;
GdkRectangle _tmp17_ = {0};
gint _tmp18_ = 0;
GdkRectangle _tmp19_ = {0};
gint _tmp20_ = 0;
GdkPixbuf* _tmp21_ = NULL;
gint _tmp22_ = 0;
gint _tmp23_ = 0;
gint _tmp24_ = 0;
gint right = 0;
GdkRectangle _tmp25_ = {0};
gint _tmp26_ = 0;
GdkRectangle _tmp27_ = {0};
gint _tmp28_ = 0;
gint _tmp29_ = 0;
GdkPixbuf* _tmp30_ = NULL;
gint _tmp31_ = 0;
gint _tmp32_ = 0;
gint _tmp33_ = 0;
gint bottom = 0;
GdkRectangle _tmp34_ = {0};
gint _tmp35_ = 0;
GdkRectangle _tmp36_ = {0};
gint _tmp37_ = 0;
gint _tmp38_ = 0;
GdkPixbuf* _tmp39_ = NULL;
gint _tmp40_ = 0;
gint _tmp41_ = 0;
gint _tmp42_ = 0;
gint _tmp43_ = 0;
GdkRectangle _tmp44_ = {0};
gint _tmp45_ = 0;
gint _tmp46_ = 0;
GdkRectangle _tmp47_ = {0};
gint _tmp48_ = 0;
#line 629 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_if_fail (GDK_IS_PIXBUF (for_pixbuf));
#line 630 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = zoom_state_get_zoomed_width (&(*self));
#line 630 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoomed_width = (gdouble) _tmp0_;
#line 631 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = zoom_state_get_zoomed_height (&(*self));
#line 631 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoomed_height = (gdouble) _tmp1_;
#line 633 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = for_pixbuf;
#line 633 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = gdk_pixbuf_get_width (_tmp2_);
#line 633 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_;
#line 633 "/home/jens/Source/shotwell/src/Dimensions.vala"
horiz_scale = _tmp4_ / zoomed_width;
#line 634 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = for_pixbuf;
#line 634 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = gdk_pixbuf_get_height (_tmp5_);
#line 634 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = _tmp6_;
#line 634 "/home/jens/Source/shotwell/src/Dimensions.vala"
vert_scale = _tmp7_ / zoomed_height;
#line 635 "/home/jens/Source/shotwell/src/Dimensions.vala"
scale = (horiz_scale + vert_scale) / 2.0;
#line 637 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_get_viewing_rectangle_wrt_content (&(*self), &_tmp8_);
#line 637 "/home/jens/Source/shotwell/src/Dimensions.vala"
viewing_rectangle = _tmp8_;
#line 639 "/home/jens/Source/shotwell/src/Dimensions.vala"
memset (&_result_, 0, sizeof (GdkRectangle));
#line 640 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = viewing_rectangle;
#line 640 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = _tmp9_.x;
#line 640 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.x = (gint) (_tmp10_ * scale);
#line 641 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = _result_;
#line 641 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = _tmp11_.x;
#line 641 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = for_pixbuf;
#line 641 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = gdk_pixbuf_get_width (_tmp13_);
#line 641 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = _tmp14_;
#line 641 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = CLAMP (_tmp12_, 0, _tmp15_);
#line 641 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.x = _tmp16_;
#line 642 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = viewing_rectangle;
#line 642 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = _tmp17_.y;
#line 642 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.y = (gint) (_tmp18_ * scale);
#line 643 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = _result_;
#line 643 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = _tmp19_.y;
#line 643 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = for_pixbuf;
#line 643 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = gdk_pixbuf_get_height (_tmp21_);
#line 643 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp23_ = _tmp22_;
#line 643 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp24_ = CLAMP (_tmp20_, 0, _tmp23_);
#line 643 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.y = _tmp24_;
#line 644 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp25_ = viewing_rectangle;
#line 644 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp26_ = _tmp25_.x;
#line 644 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp27_ = viewing_rectangle;
#line 644 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp28_ = _tmp27_.width;
#line 644 "/home/jens/Source/shotwell/src/Dimensions.vala"
right = (gint) ((_tmp26_ + _tmp28_) * scale);
#line 645 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp29_ = right;
#line 645 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp30_ = for_pixbuf;
#line 645 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp31_ = gdk_pixbuf_get_width (_tmp30_);
#line 645 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp32_ = _tmp31_;
#line 645 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp33_ = CLAMP (_tmp29_, 0, _tmp32_);
#line 645 "/home/jens/Source/shotwell/src/Dimensions.vala"
right = _tmp33_;
#line 646 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp34_ = viewing_rectangle;
#line 646 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp35_ = _tmp34_.y;
#line 646 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp36_ = viewing_rectangle;
#line 646 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp37_ = _tmp36_.height;
#line 646 "/home/jens/Source/shotwell/src/Dimensions.vala"
bottom = (gint) ((_tmp35_ + _tmp37_) * scale);
#line 647 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp38_ = bottom;
#line 647 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp39_ = for_pixbuf;
#line 647 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp40_ = gdk_pixbuf_get_height (_tmp39_);
#line 647 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp41_ = _tmp40_;
#line 647 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp42_ = CLAMP (_tmp38_, 0, _tmp41_);
#line 647 "/home/jens/Source/shotwell/src/Dimensions.vala"
bottom = _tmp42_;
#line 648 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp43_ = right;
#line 648 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp44_ = _result_;
#line 648 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp45_ = _tmp44_.x;
#line 648 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.width = _tmp43_ - _tmp45_;
#line 649 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp46_ = bottom;
#line 649 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp47_ = _result_;
#line 649 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp48_ = _tmp47_.y;
#line 649 "/home/jens/Source/shotwell/src/Dimensions.vala"
_result_.height = _tmp46_ - _tmp48_;
#line 651 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _result_;
#line 651 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 3868 "Dimensions.c"
}
gdouble zoom_state_get_zoom_factor (ZoomState *self) {
gdouble result = 0.0;
gdouble _tmp0_ = 0.0;
#line 656 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).zoom_factor;
#line 656 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 656 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 3881 "Dimensions.c"
}
gint zoom_state_get_zoomed_width (ZoomState *self) {
gint result = 0;
Dimensions _tmp0_ = {0};
gint _tmp1_ = 0;
gdouble _tmp2_ = 0.0;
#line 660 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).content_dimensions;
#line 660 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.width;
#line 660 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).zoom_factor;
#line 660 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = (gint) (_tmp1_ * _tmp2_);
#line 660 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 3900 "Dimensions.c"
}
gint zoom_state_get_zoomed_height (ZoomState *self) {
gint result = 0;
Dimensions _tmp0_ = {0};
gint _tmp1_ = 0;
gdouble _tmp2_ = 0.0;
#line 664 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).content_dimensions;
#line 664 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.height;
#line 664 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = (*self).zoom_factor;
#line 664 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = (gint) (_tmp1_ * _tmp2_);
#line 664 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 3919 "Dimensions.c"
}
void zoom_state_get_viewport_center (ZoomState *self, GdkPoint* result) {
GdkPoint _tmp0_ = {0};
#line 668 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).viewport_center;
#line 668 "/home/jens/Source/shotwell/src/Dimensions.vala"
*result = _tmp0_;
#line 668 "/home/jens/Source/shotwell/src/Dimensions.vala"
return;
#line 3931 "Dimensions.c"
}
gchar* zoom_state_to_string (ZoomState *self) {
gchar* result = NULL;
gchar* named_modes = NULL;
gchar* _tmp0_ = NULL;
gboolean _tmp1_ = FALSE;
gboolean _tmp6_ = FALSE;
gboolean _tmp11_ = FALSE;
gboolean _tmp16_ = FALSE;
const gchar* _tmp21_ = NULL;
GdkRectangle viewing_rect = {0};
GdkRectangle _tmp23_ = {0};
Dimensions _tmp24_ = {0};
gint _tmp25_ = 0;
Dimensions _tmp26_ = {0};
gint _tmp27_ = 0;
Dimensions _tmp28_ = {0};
gint _tmp29_ = 0;
Dimensions _tmp30_ = {0};
gint _tmp31_ = 0;
gdouble _tmp32_ = 0.0;
gdouble _tmp33_ = 0.0;
gdouble _tmp34_ = 0.0;
gint _tmp35_ = 0;
gint _tmp36_ = 0;
const gchar* _tmp37_ = NULL;
GdkRectangle _tmp38_ = {0};
gint _tmp39_ = 0;
GdkRectangle _tmp40_ = {0};
gint _tmp41_ = 0;
GdkRectangle _tmp42_ = {0};
gint _tmp43_ = 0;
GdkRectangle _tmp44_ = {0};
gint _tmp45_ = 0;
GdkPoint _tmp46_ = {0};
gint _tmp47_ = 0;
GdkPoint _tmp48_ = {0};
gint _tmp49_ = 0;
gchar* _tmp50_ = NULL;
#line 672 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = g_strdup ("");
#line 672 "/home/jens/Source/shotwell/src/Dimensions.vala"
named_modes = _tmp0_;
#line 673 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = zoom_state_is_min (&(*self));
#line 673 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp1_) {
#line 3981 "Dimensions.c"
const gchar* _tmp2_ = NULL;
const gchar* _tmp3_ = NULL;
const gchar* _tmp4_ = NULL;
gchar* _tmp5_ = NULL;
#line 674 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = named_modes;
#line 674 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (g_strcmp0 (_tmp3_, "") == 0) {
#line 674 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = "MIN";
#line 3992 "Dimensions.c"
} else {
#line 674 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = ", MIN";
#line 3996 "Dimensions.c"
}
#line 674 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = named_modes;
#line 674 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = g_strconcat (_tmp4_, _tmp2_, NULL);
#line 674 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (named_modes);
#line 674 "/home/jens/Source/shotwell/src/Dimensions.vala"
named_modes = _tmp5_;
#line 4006 "Dimensions.c"
}
#line 675 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = zoom_state_is_default (&(*self));
#line 675 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp6_) {
#line 4012 "Dimensions.c"
const gchar* _tmp7_ = NULL;
const gchar* _tmp8_ = NULL;
const gchar* _tmp9_ = NULL;
gchar* _tmp10_ = NULL;
#line 676 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = named_modes;
#line 676 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (g_strcmp0 (_tmp8_, "") == 0) {
#line 676 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = "DEFAULT";
#line 4023 "Dimensions.c"
} else {
#line 676 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = ", DEFAULT";
#line 4027 "Dimensions.c"
}
#line 676 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = named_modes;
#line 676 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = g_strconcat (_tmp9_, _tmp7_, NULL);
#line 676 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (named_modes);
#line 676 "/home/jens/Source/shotwell/src/Dimensions.vala"
named_modes = _tmp10_;
#line 4037 "Dimensions.c"
}
#line 677 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = zoom_state_is_isomorphic (&(*self));
#line 677 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp11_) {
#line 4043 "Dimensions.c"
const gchar* _tmp12_ = NULL;
const gchar* _tmp13_ = NULL;
const gchar* _tmp14_ = NULL;
gchar* _tmp15_ = NULL;
#line 678 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = named_modes;
#line 678 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (g_strcmp0 (_tmp13_, "") == 0) {
#line 678 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = "ISOMORPHIC";
#line 4054 "Dimensions.c"
} else {
#line 678 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = ", ISOMORPHIC";
#line 4058 "Dimensions.c"
}
#line 678 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = named_modes;
#line 678 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = g_strconcat (_tmp14_, _tmp12_, NULL);
#line 678 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (named_modes);
#line 678 "/home/jens/Source/shotwell/src/Dimensions.vala"
named_modes = _tmp15_;
#line 4068 "Dimensions.c"
}
#line 679 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = zoom_state_is_max (&(*self));
#line 679 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp16_) {
#line 4074 "Dimensions.c"
const gchar* _tmp17_ = NULL;
const gchar* _tmp18_ = NULL;
const gchar* _tmp19_ = NULL;
gchar* _tmp20_ = NULL;
#line 680 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = named_modes;
#line 680 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (g_strcmp0 (_tmp18_, "") == 0) {
#line 680 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = "MAX";
#line 4085 "Dimensions.c"
} else {
#line 680 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = ", MAX";
#line 4089 "Dimensions.c"
}
#line 680 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = named_modes;
#line 680 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = g_strconcat (_tmp19_, _tmp17_, NULL);
#line 680 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (named_modes);
#line 680 "/home/jens/Source/shotwell/src/Dimensions.vala"
named_modes = _tmp20_;
#line 4099 "Dimensions.c"
}
#line 681 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = named_modes;
#line 681 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (g_strcmp0 (_tmp21_, "") == 0) {
#line 4105 "Dimensions.c"
gchar* _tmp22_ = NULL;
#line 682 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = g_strdup ("(none)");
#line 682 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (named_modes);
#line 682 "/home/jens/Source/shotwell/src/Dimensions.vala"
named_modes = _tmp22_;
#line 4113 "Dimensions.c"
}
#line 684 "/home/jens/Source/shotwell/src/Dimensions.vala"
zoom_state_get_viewing_rectangle_wrt_content (&(*self), &_tmp23_);
#line 684 "/home/jens/Source/shotwell/src/Dimensions.vala"
viewing_rect = _tmp23_;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp24_ = (*self).content_dimensions;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp25_ = _tmp24_.width;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp26_ = (*self).content_dimensions;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp27_ = _tmp26_.height;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp28_ = (*self).viewport_dimensions;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp29_ = _tmp28_.width;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp30_ = (*self).viewport_dimensions;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp31_ = _tmp30_.height;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp32_ = (*self).min_factor;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp33_ = (*self).max_factor;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp34_ = (*self).zoom_factor;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp35_ = zoom_state_get_zoomed_width (&(*self));
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp36_ = zoom_state_get_zoomed_height (&(*self));
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp37_ = named_modes;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp38_ = viewing_rect;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp39_ = _tmp38_.x;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp40_ = viewing_rect;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp41_ = _tmp40_.y;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp42_ = viewing_rect;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp43_ = _tmp42_.width;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp44_ = viewing_rect;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp45_ = _tmp44_.height;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp46_ = (*self).viewport_center;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp47_ = _tmp46_.x;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp48_ = (*self).viewport_center;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp49_ = _tmp48_.y;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp50_ = g_strdup_printf ("ZoomState {\n" \
" content dimensions = %d x %d;\n" \
" viewport dimensions = " "%d x %d;\n" \
" min factor = %f;\n" \
" max factor = %f;\n" \
" current factor = %f;" "\n" \
" zoomed width = %d;\n" \
" zoomed height = %d;\n" \
" named modes = %s;" "\n viewing rectangle = { x: %d, y: %d, width: %d, height: %d };" "\n viewport center = (%d, %d);\n}\n", _tmp25_, _tmp27_, _tmp29_, _tmp31_, _tmp32_, _tmp33_, _tmp34_, _tmp35_, _tmp36_, _tmp37_, _tmp39_, _tmp41_, _tmp43_, _tmp45_, _tmp47_, _tmp49_);
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp50_;
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
_g_free0 (named_modes);
#line 686 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4179 "Dimensions.c"
}
gboolean zoom_state_is_min (ZoomState *self) {
gboolean result = FALSE;
gdouble _tmp0_ = 0.0;
gdouble _tmp1_ = 0.0;
#line 698 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).zoom_factor;
#line 698 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).min_factor;
#line 698 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_ == _tmp1_;
#line 698 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4195 "Dimensions.c"
}
gboolean zoom_state_is_default (ZoomState *self) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
#line 702 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = zoom_state_is_min (&(*self));
#line 702 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_;
#line 702 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4208 "Dimensions.c"
}
gboolean zoom_state_is_max (ZoomState *self) {
gboolean result = FALSE;
gdouble _tmp0_ = 0.0;
gdouble _tmp1_ = 0.0;
#line 706 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).zoom_factor;
#line 706 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = (*self).max_factor;
#line 706 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_ == _tmp1_;
#line 706 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4224 "Dimensions.c"
}
gboolean zoom_state_is_isomorphic (ZoomState *self) {
gboolean result = FALSE;
gdouble _tmp0_ = 0.0;
#line 710 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = (*self).zoom_factor;
#line 710 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = _tmp0_ == 1.0;
#line 710 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4237 "Dimensions.c"
}
gboolean zoom_state_equals (ZoomState *self, ZoomState* other) {
gboolean result = FALSE;
ZoomState _tmp0_ = {0};
Dimensions _tmp1_ = {0};
gboolean _tmp2_ = FALSE;
ZoomState _tmp3_ = {0};
Dimensions _tmp4_ = {0};
gboolean _tmp5_ = FALSE;
gdouble _tmp6_ = 0.0;
ZoomState _tmp7_ = {0};
gdouble _tmp8_ = 0.0;
gdouble _tmp9_ = 0.0;
ZoomState _tmp10_ = {0};
gdouble _tmp11_ = 0.0;
gdouble _tmp12_ = 0.0;
ZoomState _tmp13_ = {0};
gdouble _tmp14_ = 0.0;
GdkPoint _tmp15_ = {0};
gint _tmp16_ = 0;
ZoomState _tmp17_ = {0};
GdkPoint _tmp18_ = {0};
gint _tmp19_ = 0;
GdkPoint _tmp20_ = {0};
gint _tmp21_ = 0;
ZoomState _tmp22_ = {0};
GdkPoint _tmp23_ = {0};
gint _tmp24_ = 0;
#line 713 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_return_val_if_fail (other != NULL, FALSE);
#line 714 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp0_ = *other;
#line 714 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp1_ = _tmp0_.content_dimensions;
#line 714 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp2_ = dimensions_equals (&(*self).content_dimensions, &_tmp1_);
#line 714 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (!_tmp2_) {
#line 715 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 715 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4282 "Dimensions.c"
}
#line 716 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp3_ = *other;
#line 716 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp4_ = _tmp3_.viewport_dimensions;
#line 716 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp5_ = dimensions_equals (&(*self).viewport_dimensions, &_tmp4_);
#line 716 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (!_tmp5_) {
#line 717 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 717 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4296 "Dimensions.c"
}
#line 718 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp6_ = (*self).zoom_factor;
#line 718 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp7_ = *other;
#line 718 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp8_ = _tmp7_.zoom_factor;
#line 718 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp6_ != _tmp8_) {
#line 719 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 719 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4310 "Dimensions.c"
}
#line 720 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp9_ = (*self).min_factor;
#line 720 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp10_ = *other;
#line 720 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp11_ = _tmp10_.min_factor;
#line 720 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp9_ != _tmp11_) {
#line 721 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 721 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4324 "Dimensions.c"
}
#line 722 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp12_ = (*self).max_factor;
#line 722 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp13_ = *other;
#line 722 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp14_ = _tmp13_.max_factor;
#line 722 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp12_ != _tmp14_) {
#line 723 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 723 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4338 "Dimensions.c"
}
#line 724 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp15_ = (*self).viewport_center;
#line 724 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp16_ = _tmp15_.x;
#line 724 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp17_ = *other;
#line 724 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp18_ = _tmp17_.viewport_center;
#line 724 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp19_ = _tmp18_.x;
#line 724 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp16_ != _tmp19_) {
#line 725 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 725 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4356 "Dimensions.c"
}
#line 726 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp20_ = (*self).viewport_center;
#line 726 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp21_ = _tmp20_.y;
#line 726 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp22_ = *other;
#line 726 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp23_ = _tmp22_.viewport_center;
#line 726 "/home/jens/Source/shotwell/src/Dimensions.vala"
_tmp24_ = _tmp23_.y;
#line 726 "/home/jens/Source/shotwell/src/Dimensions.vala"
if (_tmp21_ != _tmp24_) {
#line 727 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = FALSE;
#line 727 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4374 "Dimensions.c"
}
#line 729 "/home/jens/Source/shotwell/src/Dimensions.vala"
result = TRUE;
#line 729 "/home/jens/Source/shotwell/src/Dimensions.vala"
return result;
#line 4380 "Dimensions.c"
}
ZoomState* zoom_state_dup (const ZoomState* self) {
ZoomState* dup;
#line 463 "/home/jens/Source/shotwell/src/Dimensions.vala"
dup = g_new0 (ZoomState, 1);
#line 463 "/home/jens/Source/shotwell/src/Dimensions.vala"
memcpy (dup, self, sizeof (ZoomState));
#line 463 "/home/jens/Source/shotwell/src/Dimensions.vala"
return dup;
#line 4392 "Dimensions.c"
}
void zoom_state_free (ZoomState* self) {
#line 463 "/home/jens/Source/shotwell/src/Dimensions.vala"
g_free (self);
#line 4399 "Dimensions.c"
}
GType zoom_state_get_type (void) {
static volatile gsize zoom_state_type_id__volatile = 0;
if (g_once_init_enter (&zoom_state_type_id__volatile)) {
GType zoom_state_type_id;
zoom_state_type_id = g_boxed_type_register_static ("ZoomState", (GBoxedCopyFunc) zoom_state_dup, (GBoxedFreeFunc) zoom_state_free);
g_once_init_leave (&zoom_state_type_id__volatile, zoom_state_type_id);
}
return zoom_state_type_id__volatile;
}
|