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
|
/* DataObject.c generated by valac 0.40.4, the Vala compiler
* generated from DataObject.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.
*/
/**/
/* DataObject*/
/**/
/* Object IDs are incremented for each DataObject, and therefore may be used to compare*/
/* creation order. This behavior may be relied upon elsewhere. Object IDs may be recycled when*/
/* DataObjects are reconstituted by a proxy.*/
/**/
/* Ordinal IDs are supplied by DataCollections to record the ordering of the object being added*/
/* to the collection. This value is primarily only used by DataCollection, but may be used*/
/* elsewhere to resolve ordering questions (including stabilizing a sort).*/
/**/
/* Have to inherit from Object due to ContainerSource and this bug:*/
/* https://bugzilla.gnome.org/show_bug.cgi?id=615904*/
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#define TYPE_DATA_OBJECT (data_object_get_type ())
#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject))
#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass))
#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT))
#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT))
#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass))
typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;
typedef struct _DataObjectPrivate DataObjectPrivate;
#define TYPE_ALTERATION (alteration_get_type ())
#define ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALTERATION, Alteration))
#define ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALTERATION, AlterationClass))
#define IS_ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALTERATION))
#define IS_ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALTERATION))
#define ALTERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALTERATION, AlterationClass))
typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;
#define TYPE_DATA_COLLECTION (data_collection_get_type ())
#define DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_COLLECTION, DataCollection))
#define DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_COLLECTION, DataCollectionClass))
#define IS_DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_COLLECTION))
#define IS_DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_COLLECTION))
#define DATA_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_COLLECTION, DataCollectionClass))
typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;
enum {
DATA_OBJECT_0_PROPERTY,
DATA_OBJECT_NUM_PROPERTIES
};
static GParamSpec* data_object_properties[DATA_OBJECT_NUM_PROPERTIES];
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
#define __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
struct _DataObject {
GObject parent_instance;
DataObjectPrivate * priv;
};
struct _DataObjectClass {
GObjectClass parent_class;
void (*notify_altered) (DataObject* self, Alteration* alteration);
void (*notify_membership_changed) (DataObject* self, DataCollection* collection);
void (*notify_collection_property_set) (DataObject* self, const gchar* name, GValue* old, GValue* val);
void (*notify_collection_property_cleared) (DataObject* self, const gchar* name);
gchar* (*get_name) (DataObject* self);
gchar* (*to_string) (DataObject* self);
};
struct _DataObjectPrivate {
gint64 object_id;
DataCollection* member_of;
gint64 ordinal;
};
typedef gboolean (*ValueEqualFunc) (GValue* a, GValue* b, void* user_data);
static gpointer data_object_parent_class = NULL;
static gint64 data_object_object_id_generator;
static gint64 data_object_object_id_generator = (gint64) 0;
GType data_object_get_type (void) G_GNUC_CONST;
gpointer alteration_ref (gpointer instance);
void alteration_unref (gpointer instance);
GParamSpec* param_spec_alteration (const gchar* name,
const gchar* nick,
const gchar* blurb,
GType object_type,
GParamFlags flags);
void value_set_alteration (GValue* value,
gpointer v_object);
void value_take_alteration (GValue* value,
gpointer v_object);
gpointer value_get_alteration (const GValue* value);
GType alteration_get_type (void) G_GNUC_CONST;
gpointer data_collection_ref (gpointer instance);
void data_collection_unref (gpointer instance);
GParamSpec* param_spec_data_collection (const gchar* name,
const gchar* nick,
const gchar* blurb,
GType object_type,
GParamFlags flags);
void value_set_data_collection (GValue* value,
gpointer v_object);
void value_take_data_collection (GValue* value,
gpointer v_object);
gpointer value_get_data_collection (const GValue* value);
GType data_collection_get_type (void) G_GNUC_CONST;
#define DATA_OBJECT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DATA_OBJECT, DataObjectPrivate))
#define DATA_OBJECT_INVALID_OBJECT_ID ((gint64) -1)
#define DATA_COLLECTION_INVALID_OBJECT_ORDINAL ((gint64) -1)
DataObject* data_object_construct (GType object_type,
gint64 object_id);
void data_object_notify_altered (DataObject* self,
Alteration* alteration);
static void data_object_real_notify_altered (DataObject* self,
Alteration* alteration);
void data_collection_internal_notify_altered (DataCollection* self,
DataObject* object,
Alteration* alteration);
void data_object_notify_membership_changed (DataObject* self,
DataCollection* collection);
static void data_object_real_notify_membership_changed (DataObject* self,
DataCollection* collection);
void data_object_notify_collection_property_set (DataObject* self,
const gchar* name,
GValue* old,
GValue* val);
static void data_object_real_notify_collection_property_set (DataObject* self,
const gchar* name,
GValue* old,
GValue* val);
void data_object_notify_collection_property_cleared (DataObject* self,
const gchar* name);
static void data_object_real_notify_collection_property_cleared (DataObject* self,
const gchar* name);
gchar* data_object_get_name (DataObject* self);
static gchar* data_object_real_get_name (DataObject* self);
gchar* data_object_to_string (DataObject* self);
static gchar* data_object_real_to_string (DataObject* self);
DataCollection* data_object_get_membership (DataObject* self);
gboolean data_object_has_membership (DataObject* self);
void data_object_internal_set_membership (DataObject* self,
DataCollection* collection,
gint64 ordinal);
void data_object_internal_set_ordinal (DataObject* self,
gint64 ordinal);
void data_object_internal_clear_membership (DataObject* self);
gint64 data_object_internal_get_ordinal (DataObject* self);
gint64 data_object_get_object_id (DataObject* self);
void data_object_get_collection_property (DataObject* self,
const gchar* name,
GValue* def,
GValue* result);
GValue* data_collection_get_property (DataCollection* self,
const gchar* name);
static void _vala_GValue_free (GValue* self);
void data_object_set_collection_property (DataObject* self,
const gchar* name,
GValue* val,
ValueEqualFunc value_equals,
void* value_equals_target);
void data_collection_set_property (DataCollection* self,
const gchar* name,
GValue* val,
ValueEqualFunc value_equals,
void* value_equals_target);
void data_object_clear_collection_property (DataObject* self,
const gchar* name);
void data_collection_clear_property (DataCollection* self,
const gchar* name);
static void data_object_finalize (GObject * obj);
DataObject*
data_object_construct (GType object_type,
gint64 object_id)
{
DataObject * self = NULL;
gint64 _tmp0_ = 0LL;
#line 38 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self = (DataObject*) g_object_new (object_type, NULL);
#line 39 "/home/jens/Source/shotwell/src/core/DataObject.vala"
if (object_id == DATA_OBJECT_INVALID_OBJECT_ID) {
#line 203 "DataObject.c"
gint64 _tmp1_;
#line 39 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp1_ = data_object_object_id_generator;
#line 39 "/home/jens/Source/shotwell/src/core/DataObject.vala"
data_object_object_id_generator = _tmp1_ + 1;
#line 39 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = _tmp1_;
#line 211 "DataObject.c"
} else {
#line 39 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = object_id;
#line 215 "DataObject.c"
}
#line 39 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->object_id = _tmp0_;
#line 38 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return self;
#line 221 "DataObject.c"
}
static void
data_object_real_notify_altered (DataObject* self,
Alteration* alteration)
{
DataCollection* _tmp0_;
#line 42 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_ALTERATION (alteration));
#line 43 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->member_of;
#line 43 "/home/jens/Source/shotwell/src/core/DataObject.vala"
if (_tmp0_ != NULL) {
#line 236 "DataObject.c"
DataCollection* _tmp1_;
#line 44 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp1_ = self->priv->member_of;
#line 44 "/home/jens/Source/shotwell/src/core/DataObject.vala"
data_collection_internal_notify_altered (_tmp1_, self, alteration);
#line 242 "DataObject.c"
}
}
void
data_object_notify_altered (DataObject* self,
Alteration* alteration)
{
#line 42 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 42 "/home/jens/Source/shotwell/src/core/DataObject.vala"
DATA_OBJECT_GET_CLASS (self)->notify_altered (self, alteration);
#line 255 "DataObject.c"
}
static void
data_object_real_notify_membership_changed (DataObject* self,
DataCollection* collection)
{
#line 56 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail ((collection == NULL) || IS_DATA_COLLECTION (collection));
#line 265 "DataObject.c"
}
void
data_object_notify_membership_changed (DataObject* self,
DataCollection* collection)
{
#line 56 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 56 "/home/jens/Source/shotwell/src/core/DataObject.vala"
DATA_OBJECT_GET_CLASS (self)->notify_membership_changed (self, collection);
#line 277 "DataObject.c"
}
static void
data_object_real_notify_collection_property_set (DataObject* self,
const gchar* name,
GValue* old,
GValue* val)
{
#line 61 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (name != NULL);
#line 61 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (val != NULL);
#line 291 "DataObject.c"
}
void
data_object_notify_collection_property_set (DataObject* self,
const gchar* name,
GValue* old,
GValue* val)
{
#line 61 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 61 "/home/jens/Source/shotwell/src/core/DataObject.vala"
DATA_OBJECT_GET_CLASS (self)->notify_collection_property_set (self, name, old, val);
#line 305 "DataObject.c"
}
static void
data_object_real_notify_collection_property_cleared (DataObject* self,
const gchar* name)
{
#line 66 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (name != NULL);
#line 315 "DataObject.c"
}
void
data_object_notify_collection_property_cleared (DataObject* self,
const gchar* name)
{
#line 66 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 66 "/home/jens/Source/shotwell/src/core/DataObject.vala"
DATA_OBJECT_GET_CLASS (self)->notify_collection_property_cleared (self, name);
#line 327 "DataObject.c"
}
static gchar*
data_object_real_get_name (DataObject* self)
{
#line 69 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_critical ("Type `%s' does not implement abstract method `data_object_get_name'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 69 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return NULL;
#line 338 "DataObject.c"
}
gchar*
data_object_get_name (DataObject* self)
{
#line 69 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_val_if_fail (IS_DATA_OBJECT (self), NULL);
#line 69 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return DATA_OBJECT_GET_CLASS (self)->get_name (self);
#line 349 "DataObject.c"
}
static gchar*
data_object_real_to_string (DataObject* self)
{
#line 71 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_critical ("Type `%s' does not implement abstract method `data_object_to_string'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 71 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return NULL;
#line 360 "DataObject.c"
}
gchar*
data_object_to_string (DataObject* self)
{
#line 71 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_val_if_fail (IS_DATA_OBJECT (self), NULL);
#line 71 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return DATA_OBJECT_GET_CLASS (self)->to_string (self);
#line 371 "DataObject.c"
}
static gpointer
_data_collection_ref0 (gpointer self)
{
#line 74 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return self ? data_collection_ref (self) : NULL;
#line 380 "DataObject.c"
}
DataCollection*
data_object_get_membership (DataObject* self)
{
DataCollection* result = NULL;
DataCollection* _tmp0_;
DataCollection* _tmp1_;
#line 73 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_val_if_fail (IS_DATA_OBJECT (self), NULL);
#line 74 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->member_of;
#line 74 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp1_ = _data_collection_ref0 (_tmp0_);
#line 74 "/home/jens/Source/shotwell/src/core/DataObject.vala"
result = _tmp1_;
#line 74 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return result;
#line 400 "DataObject.c"
}
gboolean
data_object_has_membership (DataObject* self)
{
gboolean result = FALSE;
DataCollection* _tmp0_;
#line 77 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_val_if_fail (IS_DATA_OBJECT (self), FALSE);
#line 78 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->member_of;
#line 78 "/home/jens/Source/shotwell/src/core/DataObject.vala"
result = _tmp0_ != NULL;
#line 78 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return result;
#line 417 "DataObject.c"
}
void
data_object_internal_set_membership (DataObject* self,
DataCollection* collection,
gint64 ordinal)
{
DataCollection* _tmp0_;
DataCollection* _tmp1_;
#line 83 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 83 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_COLLECTION (collection));
#line 84 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->member_of;
#line 84 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_vala_assert (_tmp0_ == NULL, "member_of == null");
#line 86 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp1_ = _data_collection_ref0 (collection);
#line 86 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_data_collection_unref0 (self->priv->member_of);
#line 86 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->member_of = _tmp1_;
#line 87 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->ordinal = ordinal;
#line 444 "DataObject.c"
}
void
data_object_internal_set_ordinal (DataObject* self,
gint64 ordinal)
{
DataCollection* _tmp0_;
#line 96 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 97 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->member_of;
#line 97 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_vala_assert (_tmp0_ == NULL, "member_of == null");
#line 99 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->ordinal = ordinal;
#line 461 "DataObject.c"
}
void
data_object_internal_clear_membership (DataObject* self)
{
#line 104 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 105 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_data_collection_unref0 (self->priv->member_of);
#line 105 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->member_of = NULL;
#line 106 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->ordinal = DATA_COLLECTION_INVALID_OBJECT_ORDINAL;
#line 476 "DataObject.c"
}
inline gint64
data_object_internal_get_ordinal (DataObject* self)
{
gint64 result = 0LL;
gint64 _tmp0_;
#line 110 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_val_if_fail (IS_DATA_OBJECT (self), 0LL);
#line 111 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->ordinal;
#line 111 "/home/jens/Source/shotwell/src/core/DataObject.vala"
result = _tmp0_;
#line 111 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return result;
#line 493 "DataObject.c"
}
inline gint64
data_object_get_object_id (DataObject* self)
{
gint64 result = 0LL;
gint64 _tmp0_;
#line 114 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_val_if_fail (IS_DATA_OBJECT (self), 0LL);
#line 115 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->object_id;
#line 115 "/home/jens/Source/shotwell/src/core/DataObject.vala"
result = _tmp0_;
#line 115 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return result;
#line 510 "DataObject.c"
}
static void
_vala_GValue_free (GValue* self)
{
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_value_unset (self);
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_free (self);
#line 521 "DataObject.c"
}
void
data_object_get_collection_property (DataObject* self,
const gchar* name,
GValue* def,
GValue* result)
{
DataCollection* _tmp0_;
GValue* _result_ = NULL;
DataCollection* _tmp2_;
GValue* _tmp3_;
GValue* _tmp4_ = NULL;
GValue* _tmp5_;
GValue _tmp7_ = {0};
#line 118 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 118 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (name != NULL);
#line 119 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->member_of;
#line 119 "/home/jens/Source/shotwell/src/core/DataObject.vala"
if (_tmp0_ == NULL) {
#line 546 "DataObject.c"
GValue _tmp1_ = {0};
#line 120 "/home/jens/Source/shotwell/src/core/DataObject.vala"
if (G_IS_VALUE (def)) {
#line 120 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_value_init (&_tmp1_, G_VALUE_TYPE (def));
#line 120 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_value_copy (def, &_tmp1_);
#line 554 "DataObject.c"
} else {
#line 120 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp1_ = *def;
#line 558 "DataObject.c"
}
#line 120 "/home/jens/Source/shotwell/src/core/DataObject.vala"
*result = _tmp1_;
#line 120 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return;
#line 564 "DataObject.c"
}
#line 122 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp2_ = self->priv->member_of;
#line 122 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp3_ = data_collection_get_property (_tmp2_, name);
#line 122 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_result_ = _tmp3_;
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp5_ = _result_;
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
if (_tmp5_ != NULL) {
#line 576 "DataObject.c"
GValue* _tmp6_;
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp6_ = _result_;
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp4_ = _tmp6_;
#line 582 "DataObject.c"
} else {
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp4_ = def;
#line 586 "DataObject.c"
}
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
if (G_IS_VALUE (_tmp4_)) {
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_value_init (&_tmp7_, G_VALUE_TYPE (_tmp4_));
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_value_copy (_tmp4_, &_tmp7_);
#line 594 "DataObject.c"
} else {
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp7_ = *_tmp4_;
#line 598 "DataObject.c"
}
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
*result = _tmp7_;
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
__vala_GValue_free0 (_result_);
#line 124 "/home/jens/Source/shotwell/src/core/DataObject.vala"
return;
#line 606 "DataObject.c"
}
void
data_object_set_collection_property (DataObject* self,
const gchar* name,
GValue* val,
ValueEqualFunc value_equals,
void* value_equals_target)
{
DataCollection* _tmp0_;
#line 127 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 127 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (name != NULL);
#line 127 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (val != NULL);
#line 128 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->member_of;
#line 128 "/home/jens/Source/shotwell/src/core/DataObject.vala"
if (_tmp0_ != NULL) {
#line 628 "DataObject.c"
DataCollection* _tmp1_;
GValue _tmp2_;
#line 129 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp1_ = self->priv->member_of;
#line 129 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp2_ = *val;
#line 129 "/home/jens/Source/shotwell/src/core/DataObject.vala"
data_collection_set_property (_tmp1_, name, &_tmp2_, value_equals, value_equals_target);
#line 637 "DataObject.c"
}
}
void
data_object_clear_collection_property (DataObject* self,
const gchar* name)
{
DataCollection* _tmp0_;
#line 132 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (IS_DATA_OBJECT (self));
#line 132 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_return_if_fail (name != NULL);
#line 133 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp0_ = self->priv->member_of;
#line 133 "/home/jens/Source/shotwell/src/core/DataObject.vala"
if (_tmp0_ != NULL) {
#line 655 "DataObject.c"
DataCollection* _tmp1_;
#line 134 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_tmp1_ = self->priv->member_of;
#line 134 "/home/jens/Source/shotwell/src/core/DataObject.vala"
data_collection_clear_property (_tmp1_, name);
#line 661 "DataObject.c"
}
}
static void
data_object_class_init (DataObjectClass * klass)
{
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
data_object_parent_class = g_type_class_peek_parent (klass);
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
g_type_class_add_private (klass, sizeof (DataObjectPrivate));
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
((DataObjectClass *) klass)->notify_altered = (void (*) (DataObject *, Alteration*)) data_object_real_notify_altered;
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
((DataObjectClass *) klass)->notify_membership_changed = (void (*) (DataObject *, DataCollection*)) data_object_real_notify_membership_changed;
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
((DataObjectClass *) klass)->notify_collection_property_set = (void (*) (DataObject *, const gchar*, GValue*, GValue*)) data_object_real_notify_collection_property_set;
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
((DataObjectClass *) klass)->notify_collection_property_cleared = (void (*) (DataObject *, const gchar*)) data_object_real_notify_collection_property_cleared;
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
((DataObjectClass *) klass)->get_name = (gchar* (*) (DataObject *)) data_object_real_get_name;
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
((DataObjectClass *) klass)->to_string = (gchar* (*) (DataObject *)) data_object_real_to_string;
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
G_OBJECT_CLASS (klass)->finalize = data_object_finalize;
#line 687 "DataObject.c"
}
static void
data_object_instance_init (DataObject * self)
{
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv = DATA_OBJECT_GET_PRIVATE (self);
#line 32 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->object_id = DATA_OBJECT_INVALID_OBJECT_ID;
#line 33 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->member_of = NULL;
#line 34 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self->priv->ordinal = DATA_COLLECTION_INVALID_OBJECT_ORDINAL;
#line 702 "DataObject.c"
}
static void
data_object_finalize (GObject * obj)
{
DataObject * self;
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DATA_OBJECT, DataObject);
#line 33 "/home/jens/Source/shotwell/src/core/DataObject.vala"
_data_collection_unref0 (self->priv->member_of);
#line 21 "/home/jens/Source/shotwell/src/core/DataObject.vala"
G_OBJECT_CLASS (data_object_parent_class)->finalize (obj);
#line 716 "DataObject.c"
}
GType
data_object_get_type (void)
{
static volatile gsize data_object_type_id__volatile = 0;
if (g_once_init_enter (&data_object_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (DataObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) data_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DataObject), 0, (GInstanceInitFunc) data_object_instance_init, NULL };
GType data_object_type_id;
data_object_type_id = g_type_register_static (G_TYPE_OBJECT, "DataObject", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
g_once_init_leave (&data_object_type_id__volatile, data_object_type_id);
}
return data_object_type_id__volatile;
}
|