summaryrefslogtreecommitdiff
path: root/src/core/SourceHoldingTank.c
blob: 1203f7204e5c82c63204a0dc71bd29cd1516d73a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
/* SourceHoldingTank.c generated by valac 0.34.7, the Vala compiler
 * generated from SourceHoldingTank.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */
/* A SourceHoldingTank is similar to the holding tank used by ContainerSourceCollection, but for*/
/* non-ContainerSources to be held offline from their natural SourceCollection (i.e. PhotoSources*/
/* being held in a trashcan, for example).  It is *not* a DataCollection (important!), but rather*/
/* a signalled collection that moves DataSources to and from their SourceCollection.*/
/**/
/* DataSources can be shuttled from their SourceCollection to the SourceHoldingTank manually*/
/* (via unlink_and_hold) or can be automatically moved by installing a HoldingPredicate.*/
/* Only one HoldingConditional may be installed.  Because of assertions in the methods, it's unwise*/
/* to use more than one method.  add() and add_many() should ONLY be used for DataSources not*/
/* first installed in their SourceCollection (i.e. they're born in the SourceHoldingTank).*/
/**/
/* NOTE: DataSources should never be in more than one SourceHoldingTank.  No tests are performed*/
/* here to verify this.  This is why a filter/predicate method (which could automatically move*/
/* them in as they're altered) is not offered; there's no easy way to keep DataSources from being*/
/* moved into more than one holding tank, or which should have preference.  The CheckToRemove*/
/* predicate is offered only to know when to release them.*/

#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>


#define TYPE_SOURCE_HOLDING_TANK (source_holding_tank_get_type ())
#define SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank))
#define SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTankClass))
#define IS_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_HOLDING_TANK))
#define IS_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_HOLDING_TANK))
#define SOURCE_HOLDING_TANK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTankClass))

typedef struct _SourceHoldingTank SourceHoldingTank;
typedef struct _SourceHoldingTankClass SourceHoldingTankClass;
typedef struct _SourceHoldingTankPrivate SourceHoldingTankPrivate;

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

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;

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

typedef struct _DataSource DataSource;
typedef struct _DataSourceClass DataSourceClass;

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

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

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

typedef struct _SourceCollection SourceCollection;
typedef struct _SourceCollectionClass SourceCollectionClass;

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

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;

#define TYPE_DATA_SET (data_set_get_type ())
#define DATA_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SET, DataSet))
#define DATA_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SET, DataSetClass))
#define IS_DATA_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SET))
#define IS_DATA_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SET))
#define DATA_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SET, DataSetClass))

typedef struct _DataSet DataSet;
typedef struct _DataSetClass DataSetClass;
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
#define _data_set_unref0(var) ((var == NULL) ? NULL : (var = (data_set_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_MARKER (marker_get_type ())
#define MARKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MARKER, Marker))
#define IS_MARKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MARKER))
#define MARKER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MARKER, MarkerIface))

typedef struct _Marker Marker;
typedef struct _MarkerIface MarkerIface;

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

typedef struct _SourceBacklink SourceBacklink;
typedef struct _SourceBacklinkClass SourceBacklinkClass;

#define TYPE_SINGLETON_COLLECTION (singleton_collection_get_type ())
#define SINGLETON_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SINGLETON_COLLECTION, SingletonCollection))
#define SINGLETON_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SINGLETON_COLLECTION, SingletonCollectionClass))
#define IS_SINGLETON_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SINGLETON_COLLECTION))
#define IS_SINGLETON_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SINGLETON_COLLECTION))
#define SINGLETON_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SINGLETON_COLLECTION, SingletonCollectionClass))

typedef struct _SingletonCollection SingletonCollection;
typedef struct _SingletonCollectionClass SingletonCollectionClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ParamSpecSourceHoldingTank ParamSpecSourceHoldingTank;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _SourceHoldingTank {
	GTypeInstance parent_instance;
	volatile int ref_count;
	SourceHoldingTankPrivate * priv;
};

struct _SourceHoldingTankClass {
	GTypeClass parent_class;
	void (*finalize) (SourceHoldingTank *self);
	void (*notify_contents_altered) (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed);
	void (*contents_altered) (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed);
};

typedef gboolean (*SourceHoldingTankCheckToKeep) (DataSource* source, Alteration* alteration, void* user_data);
struct _SourceHoldingTankPrivate {
	SourceCollection* sources;
	SourceHoldingTankCheckToKeep check_to_keep;
	gpointer check_to_keep_target;
	DataSet* tank;
	GeeHashSet* relinks;
	GeeHashSet* unlinking;
	gint64 ordinal;
};

struct _MarkerIface {
	GTypeInterface parent_iface;
	void (*mark) (Marker* self, DataObject* object);
	void (*unmark) (Marker* self, DataObject* object);
	gboolean (*toggle) (Marker* self, DataObject* object);
	void (*mark_many) (Marker* self, GeeCollection* list);
	void (*unmark_many) (Marker* self, GeeCollection* list);
	void (*mark_all) (Marker* self);
	gint (*get_count) (Marker* self);
	GeeCollection* (*get_all) (Marker* self);
};

typedef gboolean (*ProgressMonitor) (guint64 current, guint64 total, gboolean do_event_loop, void* user_data);
struct _ParamSpecSourceHoldingTank {
	GParamSpec parent_instance;
};


static gpointer source_holding_tank_parent_class = NULL;

gpointer source_holding_tank_ref (gpointer instance);
void source_holding_tank_unref (gpointer instance);
GParamSpec* param_spec_source_holding_tank (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_source_holding_tank (GValue* value, gpointer v_object);
void value_take_source_holding_tank (GValue* value, gpointer v_object);
gpointer value_get_source_holding_tank (const GValue* value);
GType source_holding_tank_get_type (void) G_GNUC_CONST;
GType data_object_get_type (void) G_GNUC_CONST;
GType data_source_get_type (void) G_GNUC_CONST;
gpointer data_collection_ref (gpointer instance);
void data_collection_unref (gpointer instance);
GParamSpec* param_spec_data_collection (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_data_collection (GValue* value, gpointer v_object);
void value_take_data_collection (GValue* value, gpointer v_object);
gpointer value_get_data_collection (const GValue* value);
GType data_collection_get_type (void) G_GNUC_CONST;
GType source_collection_get_type (void) G_GNUC_CONST;
gpointer alteration_ref (gpointer instance);
void alteration_unref (gpointer instance);
GParamSpec* param_spec_alteration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_alteration (GValue* value, gpointer v_object);
void value_take_alteration (GValue* value, gpointer v_object);
gpointer value_get_alteration (const GValue* value);
GType alteration_get_type (void) G_GNUC_CONST;
gpointer data_set_ref (gpointer instance);
void data_set_unref (gpointer instance);
GParamSpec* param_spec_data_set (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_data_set (GValue* value, gpointer v_object);
void value_take_data_set (GValue* value, gpointer v_object);
gpointer value_get_data_set (const GValue* value);
GType data_set_get_type (void) G_GNUC_CONST;
#define SOURCE_HOLDING_TANK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTankPrivate))
enum  {
	SOURCE_HOLDING_TANK_DUMMY_PROPERTY
};
static void source_holding_tank_on_source_destroyed (SourceHoldingTank* self, DataSource* source);
static void _source_holding_tank_on_source_destroyed_source_collection_item_destroyed (SourceCollection* _sender, DataSource* source, gpointer self);
static void source_holding_tank_on_source_collection_thawed (SourceHoldingTank* self);
static void _source_holding_tank_on_source_collection_thawed_data_collection_thawed (DataCollection* _sender, gpointer self);
DataSet* data_set_new (void);
DataSet* data_set_construct (GType object_type);
SourceHoldingTank* source_holding_tank_new (SourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target);
SourceHoldingTank* source_holding_tank_construct (GType object_type, SourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target);
void source_holding_tank_notify_contents_altered (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed);
static void source_holding_tank_real_notify_contents_altered (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed);
void data_source_notify_held_in_tank (DataSource* self, SourceHoldingTank* holding_tank);
gint source_holding_tank_get_count (SourceHoldingTank* self);
gint data_set_get_count (DataSet* self);
GeeCollection* source_holding_tank_get_all (SourceHoldingTank* self);
GeeList* data_set_get_all (DataSet* self);
gboolean source_holding_tank_contains (SourceHoldingTank* self, DataSource* source);
gboolean data_set_contains (DataSet* self, DataObject* object);
void source_holding_tank_add_many (SourceHoldingTank* self, GeeCollection* many);
void data_object_internal_set_ordinal (DataObject* self, gint64 ordinal);
gboolean data_set_add_many (DataSet* self, GeeCollection* objects);
void source_holding_tank_unlink_and_hold (SourceHoldingTank* self, GeeCollection* unlink);
GType marker_get_type (void) G_GNUC_CONST;
GeeCollection* source_collection_unlink_marked (SourceCollection* self, Marker* marker, ProgressMonitor monitor, void* monitor_target);
Marker* data_collection_mark_many (DataCollection* self, GeeCollection* objects);
gpointer source_backlink_ref (gpointer instance);
void source_backlink_unref (gpointer instance);
GParamSpec* param_spec_source_backlink (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_source_backlink (GValue* value, gpointer v_object);
void value_take_source_backlink (GValue* value, gpointer v_object);
gpointer value_get_source_backlink (const GValue* value);
GType source_backlink_get_type (void) G_GNUC_CONST;
gboolean source_holding_tank_has_backlink (SourceHoldingTank* self, SourceBacklink* backlink);
DataObject* data_set_get_at (DataSet* self, gint index);
gboolean data_source_has_backlink (DataSource* self, SourceBacklink* backlink);
void source_holding_tank_remove_backlink (SourceHoldingTank* self, SourceBacklink* backlink);
gboolean data_source_remove_backlink (DataSource* self, SourceBacklink* backlink);
void source_holding_tank_destroy_orphans (SourceHoldingTank* self, GeeList* destroy, gboolean delete_backing, ProgressMonitor monitor, void* monitor_target, GeeList* not_removed);
gboolean data_set_remove_many (DataSet* self, GeeCollection* objects);
gboolean data_source_destroy_orphan (DataSource* self, gboolean delete_backing);
gboolean data_set_remove (DataSet* self, DataObject* object);
SingletonCollection* singleton_collection_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer object);
SingletonCollection* singleton_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer object);
GType singleton_collection_get_type (void) G_GNUC_CONST;
void source_holding_tank_internal_notify_altered (SourceHoldingTank* self, DataSource* source, Alteration* alteration);
gchar* data_object_to_string (DataObject* self);
gchar* source_holding_tank_to_string (SourceHoldingTank* self);
gboolean data_collection_are_notifications_frozen (DataCollection* self);
void source_collection_relink (SourceCollection* self, DataSource* source);
void source_collection_relink_many (SourceCollection* self, GeeCollection* relink);
static void source_holding_tank_real_contents_altered (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void source_holding_tank_finalize (SourceHoldingTank* obj);


static void _source_holding_tank_on_source_destroyed_source_collection_item_destroyed (SourceCollection* _sender, DataSource* source, gpointer self) {
#line 48 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_on_source_destroyed ((SourceHoldingTank*) self, source);
#line 279 "SourceHoldingTank.c"
}


static void _source_holding_tank_on_source_collection_thawed_data_collection_thawed (DataCollection* _sender, gpointer self) {
#line 49 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_on_source_collection_thawed ((SourceHoldingTank*) self);
#line 286 "SourceHoldingTank.c"
}


static gpointer _data_collection_ref0 (gpointer self) {
#line 40 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return self ? data_collection_ref (self) : NULL;
#line 293 "SourceHoldingTank.c"
}


SourceHoldingTank* source_holding_tank_construct (GType object_type, SourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target) {
	SourceHoldingTank* self = NULL;
	SourceCollection* _tmp0_ = NULL;
	SourceCollection* _tmp1_ = NULL;
	SourceHoldingTankCheckToKeep _tmp2_ = NULL;
	void* _tmp2__target = NULL;
	SourceCollection* _tmp3_ = NULL;
	SourceCollection* _tmp4_ = NULL;
#line 39 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (IS_SOURCE_COLLECTION (sources), NULL);
#line 39 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self = (SourceHoldingTank*) g_type_create_instance (object_type);
#line 40 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = sources;
#line 40 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = _data_collection_ref0 (_tmp0_);
#line 40 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_data_collection_unref0 (self->priv->sources);
#line 40 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv->sources = _tmp1_;
#line 41 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = check_to_keep;
#line 41 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2__target = check_to_keep_target;
#line 41 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv->check_to_keep = _tmp2_;
#line 41 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv->check_to_keep_target = _tmp2__target;
#line 43 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp3_ = self->priv->sources;
#line 43 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_connect (_tmp3_, "item-destroyed", (GCallback) _source_holding_tank_on_source_destroyed_source_collection_item_destroyed, self);
#line 44 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp4_ = self->priv->sources;
#line 44 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DATA_COLLECTION, DataCollection), "thawed", (GCallback) _source_holding_tank_on_source_collection_thawed_data_collection_thawed, self);
#line 39 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return self;
#line 335 "SourceHoldingTank.c"
}


SourceHoldingTank* source_holding_tank_new (SourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target) {
#line 39 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return source_holding_tank_construct (TYPE_SOURCE_HOLDING_TANK, sources, check_to_keep, check_to_keep_target);
#line 342 "SourceHoldingTank.c"
}


static void source_holding_tank_real_notify_contents_altered (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed) {
	GeeCollection* _tmp0_ = NULL;
	GeeCollection* _tmp8_ = NULL;
	GeeCollection* _tmp16_ = NULL;
	GeeCollection* _tmp17_ = NULL;
#line 52 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_COLLECTION (added));
#line 52 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_COLLECTION (removed));
#line 54 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = added;
#line 54 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp0_ != NULL) {
#line 359 "SourceHoldingTank.c"
		{
			GeeIterator* _source_it = NULL;
			GeeCollection* _tmp1_ = NULL;
			GeeIterator* _tmp2_ = NULL;
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp1_ = added;
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp2_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ITERABLE, GeeIterable));
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_source_it = _tmp2_;
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			while (TRUE) {
#line 372 "SourceHoldingTank.c"
				GeeIterator* _tmp3_ = NULL;
				gboolean _tmp4_ = FALSE;
				DataSource* source = NULL;
				GeeIterator* _tmp5_ = NULL;
				gpointer _tmp6_ = NULL;
				DataSource* _tmp7_ = NULL;
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp3_ = _source_it;
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp4_ = gee_iterator_next (_tmp3_);
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!_tmp4_) {
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					break;
#line 387 "SourceHoldingTank.c"
				}
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp5_ = _source_it;
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp6_ = gee_iterator_get (_tmp5_);
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				source = (DataSource*) _tmp6_;
#line 56 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp7_ = source;
#line 56 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				data_source_notify_held_in_tank (_tmp7_, self);
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_g_object_unref0 (source);
#line 401 "SourceHoldingTank.c"
			}
#line 55 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_g_object_unref0 (_source_it);
#line 405 "SourceHoldingTank.c"
		}
	}
#line 59 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp8_ = removed;
#line 59 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp8_ != NULL) {
#line 412 "SourceHoldingTank.c"
		{
			GeeIterator* _source_it = NULL;
			GeeCollection* _tmp9_ = NULL;
			GeeIterator* _tmp10_ = NULL;
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp9_ = removed;
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp10_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ITERABLE, GeeIterable));
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_source_it = _tmp10_;
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			while (TRUE) {
#line 425 "SourceHoldingTank.c"
				GeeIterator* _tmp11_ = NULL;
				gboolean _tmp12_ = FALSE;
				DataSource* source = NULL;
				GeeIterator* _tmp13_ = NULL;
				gpointer _tmp14_ = NULL;
				DataSource* _tmp15_ = NULL;
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp11_ = _source_it;
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp12_ = gee_iterator_next (_tmp11_);
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!_tmp12_) {
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					break;
#line 440 "SourceHoldingTank.c"
				}
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp13_ = _source_it;
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp14_ = gee_iterator_get (_tmp13_);
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				source = (DataSource*) _tmp14_;
#line 61 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp15_ = source;
#line 61 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				data_source_notify_held_in_tank (_tmp15_, NULL);
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_g_object_unref0 (source);
#line 454 "SourceHoldingTank.c"
			}
#line 60 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_g_object_unref0 (_source_it);
#line 458 "SourceHoldingTank.c"
		}
	}
#line 64 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp16_ = added;
#line 64 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp17_ = removed;
#line 64 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_emit_by_name (self, "contents-altered", _tmp16_, _tmp17_);
#line 467 "SourceHoldingTank.c"
}


void source_holding_tank_notify_contents_altered (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed) {
#line 52 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_HOLDING_TANK (self));
#line 52 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	SOURCE_HOLDING_TANK_GET_CLASS (self)->notify_contents_altered (self, added, removed);
#line 476 "SourceHoldingTank.c"
}


gint source_holding_tank_get_count (SourceHoldingTank* self) {
	gint result = 0;
	DataSet* _tmp0_ = NULL;
	gint _tmp1_ = 0;
#line 67 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (IS_SOURCE_HOLDING_TANK (self), 0);
#line 68 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = self->priv->tank;
#line 68 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = data_set_get_count (_tmp0_);
#line 68 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	result = _tmp1_;
#line 68 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return result;
#line 494 "SourceHoldingTank.c"
}


GeeCollection* source_holding_tank_get_all (SourceHoldingTank* self) {
	GeeCollection* result = NULL;
	DataSet* _tmp0_ = NULL;
	GeeList* _tmp1_ = NULL;
#line 71 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (IS_SOURCE_HOLDING_TANK (self), NULL);
#line 72 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = self->priv->tank;
#line 72 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = data_set_get_all (_tmp0_);
#line 72 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection);
#line 72 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return result;
#line 512 "SourceHoldingTank.c"
}


gboolean source_holding_tank_contains (SourceHoldingTank* self, DataSource* source) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	DataSet* _tmp1_ = NULL;
	DataSource* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
#line 75 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (IS_SOURCE_HOLDING_TANK (self), FALSE);
#line 75 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (IS_DATA_SOURCE (source), FALSE);
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = self->priv->tank;
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = source;
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp3_ = data_set_contains (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_DATA_OBJECT, DataObject));
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp3_) {
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp0_ = TRUE;
#line 536 "SourceHoldingTank.c"
	} else {
		GeeHashSet* _tmp4_ = NULL;
		DataSource* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp4_ = self->priv->unlinking;
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp5_ = source;
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp6_ = gee_abstract_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp5_);
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp0_ = _tmp6_;
#line 549 "SourceHoldingTank.c"
	}
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	result = _tmp0_;
#line 76 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return result;
#line 555 "SourceHoldingTank.c"
}


void source_holding_tank_add_many (SourceHoldingTank* self, GeeCollection* many) {
	GeeCollection* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gboolean added = FALSE;
	DataSet* _tmp11_ = NULL;
	GeeCollection* _tmp12_ = NULL;
	gboolean _tmp13_ = FALSE;
	gboolean _tmp14_ = FALSE;
	GeeCollection* _tmp15_ = NULL;
#line 80 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_HOLDING_TANK (self));
#line 80 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (GEE_IS_COLLECTION (many));
#line 81 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = many;
#line 81 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = gee_collection_get_size (_tmp0_);
#line 81 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = _tmp1_;
#line 81 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp2_ == 0) {
#line 82 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return;
#line 583 "SourceHoldingTank.c"
	}
	{
		GeeIterator* _source_it = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp3_ = many;
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_source_it = _tmp4_;
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		while (TRUE) {
#line 597 "SourceHoldingTank.c"
			GeeIterator* _tmp5_ = NULL;
			gboolean _tmp6_ = FALSE;
			DataSource* source = NULL;
			GeeIterator* _tmp7_ = NULL;
			gpointer _tmp8_ = NULL;
			DataSource* _tmp9_ = NULL;
			gint64 _tmp10_ = 0LL;
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp5_ = _source_it;
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp6_ = gee_iterator_next (_tmp5_);
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			if (!_tmp6_) {
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				break;
#line 613 "SourceHoldingTank.c"
			}
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp7_ = _source_it;
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp8_ = gee_iterator_get (_tmp7_);
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			source = (DataSource*) _tmp8_;
#line 85 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp9_ = source;
#line 85 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp10_ = self->priv->ordinal;
#line 85 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			self->priv->ordinal = _tmp10_ + 1;
#line 85 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			data_object_internal_set_ordinal (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_DATA_OBJECT, DataObject), _tmp10_);
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_g_object_unref0 (source);
#line 631 "SourceHoldingTank.c"
		}
#line 84 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_g_object_unref0 (_source_it);
#line 635 "SourceHoldingTank.c"
	}
#line 87 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp11_ = self->priv->tank;
#line 87 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp12_ = many;
#line 87 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp13_ = data_set_add_many (_tmp11_, _tmp12_);
#line 87 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	added = _tmp13_;
#line 88 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp14_ = added;
#line 88 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_vala_assert (_tmp14_, "added");
#line 90 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp15_ = many;
#line 90 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_notify_contents_altered (self, _tmp15_, NULL);
#line 653 "SourceHoldingTank.c"
}


void source_holding_tank_unlink_and_hold (SourceHoldingTank* self, GeeCollection* unlink) {
	GeeCollection* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	GeeHashSet* _tmp3_ = NULL;
	GeeCollection* _tmp4_ = NULL;
	SourceCollection* _tmp5_ = NULL;
	SourceCollection* _tmp6_ = NULL;
	GeeCollection* _tmp7_ = NULL;
	Marker* _tmp8_ = NULL;
	Marker* _tmp9_ = NULL;
	GeeCollection* _tmp10_ = NULL;
	GeeCollection* _tmp11_ = NULL;
	gboolean added = FALSE;
	DataSet* _tmp20_ = NULL;
	GeeCollection* _tmp21_ = NULL;
	gboolean _tmp22_ = FALSE;
	gboolean _tmp23_ = FALSE;
	GeeHashSet* _tmp24_ = NULL;
	GeeCollection* _tmp25_ = NULL;
	GeeCollection* _tmp26_ = NULL;
#line 95 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_HOLDING_TANK (self));
#line 95 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (GEE_IS_COLLECTION (unlink));
#line 96 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = unlink;
#line 96 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = gee_collection_get_size (_tmp0_);
#line 96 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = _tmp1_;
#line 96 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp2_ == 0) {
#line 97 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return;
#line 692 "SourceHoldingTank.c"
	}
#line 100 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp3_ = self->priv->unlinking;
#line 100 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp4_ = unlink;
#line 100 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection), _tmp4_);
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp5_ = self->priv->sources;
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp6_ = self->priv->sources;
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp7_ = unlink;
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp8_ = data_collection_mark_many (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection), _tmp7_);
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp9_ = _tmp8_;
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp10_ = source_collection_unlink_marked (_tmp5_, _tmp9_, NULL, NULL);
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp11_ = _tmp10_;
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_g_object_unref0 (_tmp11_);
#line 102 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_g_object_unref0 (_tmp9_);
#line 718 "SourceHoldingTank.c"
	{
		GeeIterator* _source_it = NULL;
		GeeCollection* _tmp12_ = NULL;
		GeeIterator* _tmp13_ = NULL;
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp12_ = unlink;
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp13_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_ITERABLE, GeeIterable));
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_source_it = _tmp13_;
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		while (TRUE) {
#line 731 "SourceHoldingTank.c"
			GeeIterator* _tmp14_ = NULL;
			gboolean _tmp15_ = FALSE;
			DataSource* source = NULL;
			GeeIterator* _tmp16_ = NULL;
			gpointer _tmp17_ = NULL;
			DataSource* _tmp18_ = NULL;
			gint64 _tmp19_ = 0LL;
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp14_ = _source_it;
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp15_ = gee_iterator_next (_tmp14_);
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			if (!_tmp15_) {
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				break;
#line 747 "SourceHoldingTank.c"
			}
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp16_ = _source_it;
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp17_ = gee_iterator_get (_tmp16_);
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			source = (DataSource*) _tmp17_;
#line 105 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp18_ = source;
#line 105 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp19_ = self->priv->ordinal;
#line 105 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			self->priv->ordinal = _tmp19_ + 1;
#line 105 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			data_object_internal_set_ordinal (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_DATA_OBJECT, DataObject), _tmp19_);
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_g_object_unref0 (source);
#line 765 "SourceHoldingTank.c"
		}
#line 104 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_g_object_unref0 (_source_it);
#line 769 "SourceHoldingTank.c"
	}
#line 107 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp20_ = self->priv->tank;
#line 107 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp21_ = unlink;
#line 107 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp22_ = data_set_add_many (_tmp20_, _tmp21_);
#line 107 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	added = _tmp22_;
#line 108 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp23_ = added;
#line 108 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_vala_assert (_tmp23_, "added");
#line 111 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp24_ = self->priv->unlinking;
#line 111 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp25_ = unlink;
#line 111 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	gee_collection_remove_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, GEE_TYPE_COLLECTION, GeeCollection), _tmp25_);
#line 113 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp26_ = unlink;
#line 113 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_notify_contents_altered (self, _tmp26_, NULL);
#line 793 "SourceHoldingTank.c"
}


gboolean source_holding_tank_has_backlink (SourceHoldingTank* self, SourceBacklink* backlink) {
	gboolean result = FALSE;
	gint count = 0;
	DataSet* _tmp0_ = NULL;
	gint _tmp1_ = 0;
#line 116 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (IS_SOURCE_HOLDING_TANK (self), FALSE);
#line 116 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (IS_SOURCE_BACKLINK (backlink), FALSE);
#line 117 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = self->priv->tank;
#line 117 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = data_set_get_count (_tmp0_);
#line 117 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	count = _tmp1_;
#line 812 "SourceHoldingTank.c"
	{
		gint ctr = 0;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		ctr = 0;
#line 817 "SourceHoldingTank.c"
		{
			gboolean _tmp2_ = FALSE;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp2_ = TRUE;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			while (TRUE) {
#line 824 "SourceHoldingTank.c"
				gint _tmp4_ = 0;
				gint _tmp5_ = 0;
				DataSet* _tmp6_ = NULL;
				gint _tmp7_ = 0;
				DataObject* _tmp8_ = NULL;
				DataSource* _tmp9_ = NULL;
				SourceBacklink* _tmp10_ = NULL;
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!_tmp2_) {
#line 836 "SourceHoldingTank.c"
					gint _tmp3_ = 0;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp3_ = ctr;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					ctr = _tmp3_ + 1;
#line 842 "SourceHoldingTank.c"
				}
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp2_ = FALSE;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp4_ = ctr;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp5_ = count;
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!(_tmp4_ < _tmp5_)) {
#line 118 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					break;
#line 854 "SourceHoldingTank.c"
				}
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp6_ = self->priv->tank;
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp7_ = ctr;
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp8_ = data_set_get_at (_tmp6_, _tmp7_);
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp9_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_DATA_SOURCE, DataSource);
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp10_ = backlink;
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp11_ = data_source_has_backlink (_tmp9_, _tmp10_);
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp12_ = _tmp11_;
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_g_object_unref0 (_tmp9_);
#line 119 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (_tmp12_) {
#line 120 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					result = TRUE;
#line 120 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					return result;
#line 878 "SourceHoldingTank.c"
				}
			}
		}
	}
#line 123 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	result = FALSE;
#line 123 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return result;
#line 887 "SourceHoldingTank.c"
}


void source_holding_tank_remove_backlink (SourceHoldingTank* self, SourceBacklink* backlink) {
	gint count = 0;
	DataSet* _tmp0_ = NULL;
	gint _tmp1_ = 0;
#line 126 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_HOLDING_TANK (self));
#line 126 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_BACKLINK (backlink));
#line 127 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = self->priv->tank;
#line 127 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = data_set_get_count (_tmp0_);
#line 127 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	count = _tmp1_;
#line 905 "SourceHoldingTank.c"
	{
		gint ctr = 0;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		ctr = 0;
#line 910 "SourceHoldingTank.c"
		{
			gboolean _tmp2_ = FALSE;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp2_ = TRUE;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			while (TRUE) {
#line 917 "SourceHoldingTank.c"
				gint _tmp4_ = 0;
				gint _tmp5_ = 0;
				DataSet* _tmp6_ = NULL;
				gint _tmp7_ = 0;
				DataObject* _tmp8_ = NULL;
				DataSource* _tmp9_ = NULL;
				SourceBacklink* _tmp10_ = NULL;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!_tmp2_) {
#line 927 "SourceHoldingTank.c"
					gint _tmp3_ = 0;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp3_ = ctr;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					ctr = _tmp3_ + 1;
#line 933 "SourceHoldingTank.c"
				}
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp2_ = FALSE;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp4_ = ctr;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp5_ = count;
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!(_tmp4_ < _tmp5_)) {
#line 128 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					break;
#line 945 "SourceHoldingTank.c"
				}
#line 129 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp6_ = self->priv->tank;
#line 129 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp7_ = ctr;
#line 129 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp8_ = data_set_get_at (_tmp6_, _tmp7_);
#line 129 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp9_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_DATA_SOURCE, DataSource);
#line 129 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp10_ = backlink;
#line 129 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				data_source_remove_backlink (_tmp9_, _tmp10_);
#line 129 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_g_object_unref0 (_tmp9_);
#line 961 "SourceHoldingTank.c"
			}
		}
	}
}


void source_holding_tank_destroy_orphans (SourceHoldingTank* self, GeeList* destroy, gboolean delete_backing, ProgressMonitor monitor, void* monitor_target, GeeList* not_removed) {
	GeeList* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gboolean removed = FALSE;
	DataSet* _tmp3_ = NULL;
	GeeList* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	GeeList* _tmp7_ = NULL;
	gint count = 0;
	GeeList* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
#line 132 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_HOLDING_TANK (self));
#line 132 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (GEE_IS_LIST (destroy));
#line 132 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail ((not_removed == NULL) || GEE_IS_LIST (not_removed));
#line 134 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = destroy;
#line 134 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection));
#line 134 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = _tmp1_;
#line 134 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp2_ == 0) {
#line 135 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return;
#line 998 "SourceHoldingTank.c"
	}
#line 137 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp3_ = self->priv->tank;
#line 137 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp4_ = destroy;
#line 137 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp5_ = data_set_remove_many (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection));
#line 137 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	removed = _tmp5_;
#line 138 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp6_ = removed;
#line 138 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_vala_assert (_tmp6_, "removed");
#line 140 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp7_ = destroy;
#line 140 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_notify_contents_altered (self, NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COLLECTION, GeeCollection));
#line 142 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp8_ = destroy;
#line 142 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp9_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection));
#line 142 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp10_ = _tmp9_;
#line 142 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	count = _tmp10_;
#line 1024 "SourceHoldingTank.c"
	{
		gint ctr = 0;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		ctr = 0;
#line 1029 "SourceHoldingTank.c"
		{
			gboolean _tmp11_ = FALSE;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			_tmp11_ = TRUE;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			while (TRUE) {
#line 1036 "SourceHoldingTank.c"
				gint _tmp13_ = 0;
				gint _tmp14_ = 0;
				DataSource* source = NULL;
				GeeList* _tmp15_ = NULL;
				gint _tmp16_ = 0;
				gpointer _tmp17_ = NULL;
				DataSource* _tmp18_ = NULL;
				gboolean _tmp19_ = FALSE;
				gboolean _tmp20_ = FALSE;
				ProgressMonitor _tmp24_ = NULL;
				void* _tmp24__target = NULL;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!_tmp11_) {
#line 1050 "SourceHoldingTank.c"
					gint _tmp12_ = 0;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp12_ = ctr;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					ctr = _tmp12_ + 1;
#line 1056 "SourceHoldingTank.c"
				}
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp11_ = FALSE;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp13_ = ctr;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp14_ = count;
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!(_tmp13_ < _tmp14_)) {
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					break;
#line 1068 "SourceHoldingTank.c"
				}
#line 144 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp15_ = destroy;
#line 144 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp16_ = ctr;
#line 144 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp17_ = gee_list_get (_tmp15_, _tmp16_);
#line 144 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				source = (DataSource*) _tmp17_;
#line 145 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp18_ = source;
#line 145 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp19_ = delete_backing;
#line 145 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp20_ = data_source_destroy_orphan (_tmp18_, _tmp19_);
#line 145 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (!_tmp20_) {
#line 1086 "SourceHoldingTank.c"
					GeeList* _tmp21_ = NULL;
#line 146 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp21_ = not_removed;
#line 146 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					if (NULL != _tmp21_) {
#line 1092 "SourceHoldingTank.c"
						GeeList* _tmp22_ = NULL;
						DataSource* _tmp23_ = NULL;
#line 147 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
						_tmp22_ = not_removed;
#line 147 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
						_tmp23_ = source;
#line 147 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
						gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GEE_TYPE_COLLECTION, GeeCollection), _tmp23_);
#line 1101 "SourceHoldingTank.c"
					}
				}
#line 150 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp24_ = monitor;
#line 150 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_tmp24__target = monitor_target;
#line 150 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				if (_tmp24_ != NULL) {
#line 1110 "SourceHoldingTank.c"
					ProgressMonitor _tmp25_ = NULL;
					void* _tmp25__target = NULL;
					gint _tmp26_ = 0;
					gint _tmp27_ = 0;
#line 151 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp25_ = monitor;
#line 151 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp25__target = monitor_target;
#line 151 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp26_ = ctr;
#line 151 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp27_ = count;
#line 151 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
					_tmp25_ ((guint64) (_tmp26_ + 1), (guint64) _tmp27_, TRUE, _tmp25__target);
#line 1125 "SourceHoldingTank.c"
				}
#line 143 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
				_g_object_unref0 (source);
#line 1129 "SourceHoldingTank.c"
			}
		}
	}
}


static void source_holding_tank_on_source_destroyed (SourceHoldingTank* self, DataSource* source) {
	DataSet* _tmp0_ = NULL;
	DataSource* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean removed = FALSE;
	DataSet* _tmp3_ = NULL;
	DataSource* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	DataSource* _tmp7_ = NULL;
	SingletonCollection* _tmp8_ = NULL;
	SingletonCollection* _tmp9_ = NULL;
#line 155 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_HOLDING_TANK (self));
#line 155 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_DATA_SOURCE (source));
#line 156 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = self->priv->tank;
#line 156 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = source;
#line 156 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = data_set_contains (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_OBJECT, DataObject));
#line 156 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (!_tmp2_) {
#line 157 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return;
#line 1162 "SourceHoldingTank.c"
	}
#line 159 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp3_ = self->priv->tank;
#line 159 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp4_ = source;
#line 159 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp5_ = data_set_remove (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DATA_OBJECT, DataObject));
#line 159 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	removed = _tmp5_;
#line 160 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp6_ = removed;
#line 160 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_vala_assert (_tmp6_, "removed");
#line 162 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp7_ = source;
#line 162 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp8_ = singleton_collection_new (TYPE_DATA_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp7_);
#line 162 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp9_ = _tmp8_;
#line 162 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_notify_contents_altered (self, NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_COLLECTION, GeeCollection));
#line 162 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_g_object_unref0 (_tmp9_);
#line 1186 "SourceHoldingTank.c"
}


void source_holding_tank_internal_notify_altered (SourceHoldingTank* self, DataSource* source, Alteration* alteration) {
	DataSet* _tmp0_ = NULL;
	DataSource* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	SourceHoldingTankCheckToKeep _tmp8_ = NULL;
	void* _tmp8__target = NULL;
	DataSource* _tmp9_ = NULL;
	Alteration* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	gboolean removed = FALSE;
	DataSet* _tmp12_ = NULL;
	DataSource* _tmp13_ = NULL;
	gboolean _tmp14_ = FALSE;
	gboolean _tmp15_ = FALSE;
	SourceCollection* _tmp16_ = NULL;
	gboolean _tmp17_ = FALSE;
	DataSource* _tmp20_ = NULL;
	SingletonCollection* _tmp21_ = NULL;
	SingletonCollection* _tmp22_ = NULL;
	SourceCollection* _tmp23_ = NULL;
	DataSource* _tmp24_ = NULL;
#line 166 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_HOLDING_TANK (self));
#line 166 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_DATA_SOURCE (source));
#line 166 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_ALTERATION (alteration));
#line 167 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = self->priv->tank;
#line 167 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = source;
#line 167 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = data_set_contains (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_OBJECT, DataObject));
#line 167 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (!_tmp2_) {
#line 1225 "SourceHoldingTank.c"
		DataSource* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
#line 168 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp3_ = source;
#line 168 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp4_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_OBJECT, DataObject));
#line 168 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp5_ = _tmp4_;
#line 168 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp6_ = source_holding_tank_to_string (self);
#line 168 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp7_ = _tmp6_;
#line 168 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		g_debug ("SourceHoldingTank.vala:168: SourceHoldingTank.internal_notify_altered " \
"called for %s not stored in %s", _tmp5_, _tmp7_);
#line 168 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_g_free0 (_tmp7_);
#line 168 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_g_free0 (_tmp5_);
#line 171 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return;
#line 1249 "SourceHoldingTank.c"
	}
#line 175 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp8_ = self->priv->check_to_keep;
#line 175 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp8__target = self->priv->check_to_keep_target;
#line 175 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp9_ = source;
#line 175 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp10_ = alteration;
#line 175 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp11_ = _tmp8_ (_tmp9_, _tmp10_, _tmp8__target);
#line 175 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp11_) {
#line 176 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return;
#line 1265 "SourceHoldingTank.c"
	}
#line 178 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp12_ = self->priv->tank;
#line 178 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp13_ = source;
#line 178 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp14_ = data_set_remove (_tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_OBJECT, DataObject));
#line 178 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	removed = _tmp14_;
#line 179 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp15_ = removed;
#line 179 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_vala_assert (_tmp15_, "removed");
#line 181 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp16_ = self->priv->sources;
#line 181 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp17_ = data_collection_are_notifications_frozen (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_DATA_COLLECTION, DataCollection));
#line 181 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp17_) {
#line 1285 "SourceHoldingTank.c"
		GeeHashSet* _tmp18_ = NULL;
		DataSource* _tmp19_ = NULL;
#line 182 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp18_ = self->priv->relinks;
#line 182 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		_tmp19_ = source;
#line 182 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp19_);
#line 184 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return;
#line 1296 "SourceHoldingTank.c"
	}
#line 187 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp20_ = source;
#line 187 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp21_ = singleton_collection_new (TYPE_DATA_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp20_);
#line 187 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp22_ = _tmp21_;
#line 187 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_notify_contents_altered (self, NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GEE_TYPE_COLLECTION, GeeCollection));
#line 187 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_g_object_unref0 (_tmp22_);
#line 189 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp23_ = self->priv->sources;
#line 189 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp24_ = source;
#line 189 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_collection_relink (_tmp23_, _tmp24_);
#line 1314 "SourceHoldingTank.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 197 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return self ? g_object_ref (self) : NULL;
#line 1321 "SourceHoldingTank.c"
}


static void source_holding_tank_on_source_collection_thawed (SourceHoldingTank* self) {
	GeeHashSet* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	GeeHashSet* copy = NULL;
	GeeHashSet* _tmp3_ = NULL;
	GeeHashSet* _tmp4_ = NULL;
	GeeHashSet* _tmp5_ = NULL;
	GeeHashSet* _tmp6_ = NULL;
	SourceCollection* _tmp7_ = NULL;
	GeeHashSet* _tmp8_ = NULL;
#line 192 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (IS_SOURCE_HOLDING_TANK (self));
#line 193 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = self->priv->relinks;
#line 193 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
#line 193 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = _tmp1_;
#line 193 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (_tmp2_ == 0) {
#line 194 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return;
#line 1348 "SourceHoldingTank.c"
	}
#line 197 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp3_ = self->priv->relinks;
#line 197 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp4_ = _g_object_ref0 (_tmp3_);
#line 197 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	copy = _tmp4_;
#line 198 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp5_ = gee_hash_set_new (TYPE_DATA_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 198 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_g_object_unref0 (self->priv->relinks);
#line 198 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv->relinks = _tmp5_;
#line 200 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp6_ = copy;
#line 200 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_notify_contents_altered (self, NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_COLLECTION, GeeCollection));
#line 202 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp7_ = self->priv->sources;
#line 202 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp8_ = copy;
#line 202 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_collection_relink_many (_tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection));
#line 192 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_g_object_unref0 (copy);
#line 1374 "SourceHoldingTank.c"
}


gchar* source_holding_tank_to_string (SourceHoldingTank* self) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
#line 205 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (IS_SOURCE_HOLDING_TANK (self), NULL);
#line 206 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = g_strdup_printf ("SourceHoldingTank @ 0x%p", self);
#line 206 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	result = _tmp0_;
#line 206 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return result;
#line 1389 "SourceHoldingTank.c"
}


static void source_holding_tank_real_contents_altered (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed) {
#line 35 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_COLLECTION (added));
#line 35 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_COLLECTION (removed));
#line 1398 "SourceHoldingTank.c"
}


static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (n_param_values == 3);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		data1 = closure->data;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		data2 = param_values->data[0].v_pointer;
#line 1417 "SourceHoldingTank.c"
	} else {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		data1 = param_values->data[0].v_pointer;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		data2 = closure->data;
#line 1423 "SourceHoldingTank.c"
	}
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), data2);
#line 1429 "SourceHoldingTank.c"
}


static void value_source_holding_tank_init (GValue* value) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	value->data[0].v_pointer = NULL;
#line 1436 "SourceHoldingTank.c"
}


static void value_source_holding_tank_free_value (GValue* value) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (value->data[0].v_pointer) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		source_holding_tank_unref (value->data[0].v_pointer);
#line 1445 "SourceHoldingTank.c"
	}
}


static void value_source_holding_tank_copy_value (const GValue* src_value, GValue* dest_value) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (src_value->data[0].v_pointer) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		dest_value->data[0].v_pointer = source_holding_tank_ref (src_value->data[0].v_pointer);
#line 1455 "SourceHoldingTank.c"
	} else {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		dest_value->data[0].v_pointer = NULL;
#line 1459 "SourceHoldingTank.c"
	}
}


static gpointer value_source_holding_tank_peek_pointer (const GValue* value) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return value->data[0].v_pointer;
#line 1467 "SourceHoldingTank.c"
}


static gchar* value_source_holding_tank_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (collect_values[0].v_pointer) {
#line 1474 "SourceHoldingTank.c"
		SourceHoldingTank* object;
		object = collect_values[0].v_pointer;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		if (object->parent_instance.g_class == NULL) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 1481 "SourceHoldingTank.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 1485 "SourceHoldingTank.c"
		}
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		value->data[0].v_pointer = source_holding_tank_ref (object);
#line 1489 "SourceHoldingTank.c"
	} else {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		value->data[0].v_pointer = NULL;
#line 1493 "SourceHoldingTank.c"
	}
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return NULL;
#line 1497 "SourceHoldingTank.c"
}


static gchar* value_source_holding_tank_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	SourceHoldingTank** object_p;
	object_p = collect_values[0].v_pointer;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (!object_p) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 1508 "SourceHoldingTank.c"
	}
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (!value->data[0].v_pointer) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		*object_p = NULL;
#line 1514 "SourceHoldingTank.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		*object_p = value->data[0].v_pointer;
#line 1518 "SourceHoldingTank.c"
	} else {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		*object_p = source_holding_tank_ref (value->data[0].v_pointer);
#line 1522 "SourceHoldingTank.c"
	}
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return NULL;
#line 1526 "SourceHoldingTank.c"
}


GParamSpec* param_spec_source_holding_tank (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecSourceHoldingTank* spec;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_SOURCE_HOLDING_TANK), NULL);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return G_PARAM_SPEC (spec);
#line 1540 "SourceHoldingTank.c"
}


gpointer value_get_source_holding_tank (const GValue* value) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SOURCE_HOLDING_TANK), NULL);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return value->data[0].v_pointer;
#line 1549 "SourceHoldingTank.c"
}


void value_set_source_holding_tank (GValue* value, gpointer v_object) {
	SourceHoldingTank* old;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SOURCE_HOLDING_TANK));
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	old = value->data[0].v_pointer;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (v_object) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_SOURCE_HOLDING_TANK));
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		value->data[0].v_pointer = v_object;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		source_holding_tank_ref (value->data[0].v_pointer);
#line 1569 "SourceHoldingTank.c"
	} else {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		value->data[0].v_pointer = NULL;
#line 1573 "SourceHoldingTank.c"
	}
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (old) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		source_holding_tank_unref (old);
#line 1579 "SourceHoldingTank.c"
	}
}


void value_take_source_holding_tank (GValue* value, gpointer v_object) {
	SourceHoldingTank* old;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SOURCE_HOLDING_TANK));
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	old = value->data[0].v_pointer;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (v_object) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_SOURCE_HOLDING_TANK));
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		value->data[0].v_pointer = v_object;
#line 1598 "SourceHoldingTank.c"
	} else {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		value->data[0].v_pointer = NULL;
#line 1602 "SourceHoldingTank.c"
	}
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (old) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		source_holding_tank_unref (old);
#line 1608 "SourceHoldingTank.c"
	}
}


static void source_holding_tank_class_init (SourceHoldingTankClass * klass) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	source_holding_tank_parent_class = g_type_class_peek_parent (klass);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	((SourceHoldingTankClass *) klass)->finalize = source_holding_tank_finalize;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_type_class_add_private (klass, sizeof (SourceHoldingTankPrivate));
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	((SourceHoldingTankClass *) klass)->notify_contents_altered = (void (*)(SourceHoldingTank*, GeeCollection*, GeeCollection*)) source_holding_tank_real_notify_contents_altered;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	((SourceHoldingTankClass *) klass)->contents_altered = source_holding_tank_real_contents_altered;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_new ("contents_altered", TYPE_SOURCE_HOLDING_TANK, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (SourceHoldingTankClass, contents_altered), NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, GEE_TYPE_COLLECTION, GEE_TYPE_COLLECTION);
#line 1626 "SourceHoldingTank.c"
}


static void source_holding_tank_instance_init (SourceHoldingTank * self) {
	DataSet* _tmp0_ = NULL;
	GeeHashSet* _tmp1_ = NULL;
	GeeHashSet* _tmp2_ = NULL;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv = SOURCE_HOLDING_TANK_GET_PRIVATE (self);
#line 30 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = data_set_new ();
#line 30 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv->tank = _tmp0_;
#line 31 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp1_ = gee_hash_set_new (TYPE_DATA_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 31 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv->relinks = _tmp1_;
#line 32 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = gee_hash_set_new (TYPE_DATA_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 32 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv->unlinking = _tmp2_;
#line 33 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->priv->ordinal = (gint64) 0;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self->ref_count = 1;
#line 1652 "SourceHoldingTank.c"
}


static void source_holding_tank_finalize (SourceHoldingTank* obj) {
	SourceHoldingTank * self;
	SourceCollection* _tmp0_ = NULL;
	guint _tmp1_ = 0U;
	SourceCollection* _tmp2_ = NULL;
	guint _tmp3_ = 0U;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_handlers_destroy (self);
#line 48 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp0_ = self->priv->sources;
#line 48 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_parse_name ("item-destroyed", TYPE_SOURCE_COLLECTION, &_tmp1_, NULL, FALSE);
#line 48 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _source_holding_tank_on_source_destroyed_source_collection_item_destroyed, self);
#line 49 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_tmp2_ = self->priv->sources;
#line 49 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_parse_name ("thawed", TYPE_DATA_COLLECTION, &_tmp3_, NULL, FALSE);
#line 49 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _source_holding_tank_on_source_collection_thawed_data_collection_thawed, self);
#line 28 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_data_collection_unref0 (self->priv->sources);
#line 30 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_data_set_unref0 (self->priv->tank);
#line 31 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_g_object_unref0 (self->priv->relinks);
#line 32 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	_g_object_unref0 (self->priv->unlinking);
#line 1686 "SourceHoldingTank.c"
}


GType source_holding_tank_get_type (void) {
	static volatile gsize source_holding_tank_type_id__volatile = 0;
	if (g_once_init_enter (&source_holding_tank_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_source_holding_tank_init, value_source_holding_tank_free_value, value_source_holding_tank_copy_value, value_source_holding_tank_peek_pointer, "p", value_source_holding_tank_collect_value, "p", value_source_holding_tank_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (SourceHoldingTankClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) source_holding_tank_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SourceHoldingTank), 0, (GInstanceInitFunc) source_holding_tank_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType source_holding_tank_type_id;
		source_holding_tank_type_id = g_type_register_fundamental (g_type_fundamental_next (), "SourceHoldingTank", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&source_holding_tank_type_id__volatile, source_holding_tank_type_id);
	}
	return source_holding_tank_type_id__volatile;
}


gpointer source_holding_tank_ref (gpointer instance) {
	SourceHoldingTank* self;
	self = instance;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	g_atomic_int_inc (&self->ref_count);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	return instance;
#line 1711 "SourceHoldingTank.c"
}


void source_holding_tank_unref (gpointer instance) {
	SourceHoldingTank* self;
	self = instance;
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		SOURCE_HOLDING_TANK_GET_CLASS (self)->finalize (self);
#line 24 "/home/jens/Source/shotwell/src/core/SourceHoldingTank.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 1724 "SourceHoldingTank.c"
	}
}