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
|
/* objects_property_enum.c generated by valac, the Vala compiler
* generated from objects_property_enum.vala, do not modify */
#include <glib-object.h>
#include <glib.h>
#include <gobject/gvaluecollector.h>
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif
typedef enum {
FOO_ENUM_VALUE1,
FOO_ENUM_VALUE2
} FooEnum;
#define TYPE_FOO_ENUM (foo_enum_get_type ())
typedef enum {
FOO_FLAG_VALUE1 = 1 << 0,
FOO_FLAG_VALUE2 = 1 << 1
} FooFlag;
#define TYPE_FOO_FLAG (foo_flag_get_type ())
typedef enum {
BAR_ENUM_VALUE1,
BAR_ENUM_VALUE2
} BarEnum;
typedef enum {
BAR_FLAG_VALUE1 = 1 << 0,
BAR_FLAG_VALUE2 = 1 << 1
} BarFlag;
#define TYPE_MANAM (manam_get_type ())
#define MANAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MANAM, Manam))
#define MANAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MANAM, ManamClass))
#define IS_MANAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MANAM))
#define IS_MANAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MANAM))
#define MANAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MANAM, ManamClass))
typedef struct _Manam Manam;
typedef struct _ManamClass ManamClass;
typedef struct _ManamPrivate ManamPrivate;
typedef struct _ParamSpecManam ParamSpecManam;
#define TYPE_MINIM (minim_get_type ())
#define MINIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MINIM, Minim))
#define MINIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MINIM, MinimClass))
#define IS_MINIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MINIM))
#define IS_MINIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MINIM))
#define MINIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MINIM, MinimClass))
typedef struct _Minim Minim;
typedef struct _MinimClass MinimClass;
typedef struct _MinimPrivate MinimPrivate;
enum {
MINIM_0_PROPERTY,
MINIM_PROP1_PROPERTY,
MINIM_PROP2_PROPERTY,
MINIM_PROP3_PROPERTY,
MINIM_PROP4_PROPERTY,
MINIM_NUM_PROPERTIES
};
static GParamSpec* minim_properties[MINIM_NUM_PROPERTIES];
#define _manam_unref0(var) ((var == NULL) ? NULL : (var = (manam_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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 _Manam {
GTypeInstance parent_instance;
volatile int ref_count;
ManamPrivate * priv;
};
struct _ManamClass {
GTypeClass parent_class;
void (*finalize) (Manam *self);
};
struct _ManamPrivate {
FooEnum _prop1;
FooFlag _prop2;
BarEnum _prop3;
BarFlag _prop4;
};
struct _ParamSpecManam {
GParamSpec parent_instance;
};
struct _Minim {
GObject parent_instance;
MinimPrivate * priv;
};
struct _MinimClass {
GObjectClass parent_class;
};
struct _MinimPrivate {
FooEnum _prop1;
FooFlag _prop2;
BarEnum _prop3;
BarFlag _prop4;
};
static gint Manam_private_offset;
static gpointer manam_parent_class = NULL;
static gint Minim_private_offset;
static gpointer minim_parent_class = NULL;
VALA_EXTERN GType foo_enum_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType foo_flag_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer manam_ref (gpointer instance);
VALA_EXTERN void manam_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_manam (const gchar* name,
const gchar* nick,
const gchar* blurb,
GType object_type,
GParamFlags flags);
VALA_EXTERN void value_set_manam (GValue* value,
gpointer v_object);
VALA_EXTERN void value_take_manam (GValue* value,
gpointer v_object);
VALA_EXTERN gpointer value_get_manam (const GValue* value);
VALA_EXTERN GType manam_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Manam, manam_unref)
VALA_EXTERN Manam* manam_new (void);
VALA_EXTERN Manam* manam_construct (GType object_type);
VALA_EXTERN FooEnum manam_get_prop1 (Manam* self);
VALA_EXTERN void manam_set_prop1 (Manam* self,
FooEnum value);
VALA_EXTERN FooFlag manam_get_prop2 (Manam* self);
VALA_EXTERN void manam_set_prop2 (Manam* self,
FooFlag value);
VALA_EXTERN BarEnum manam_get_prop3 (Manam* self);
VALA_EXTERN void manam_set_prop3 (Manam* self,
BarEnum value);
VALA_EXTERN BarFlag manam_get_prop4 (Manam* self);
VALA_EXTERN void manam_set_prop4 (Manam* self,
BarFlag value);
static void manam_finalize (Manam * obj);
static GType manam_get_type_once (void);
VALA_EXTERN GType minim_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Minim, g_object_unref)
VALA_EXTERN Minim* minim_new (void);
VALA_EXTERN Minim* minim_construct (GType object_type);
VALA_EXTERN FooEnum minim_get_prop1 (Minim* self);
VALA_EXTERN void minim_set_prop1 (Minim* self,
FooEnum value);
VALA_EXTERN FooFlag minim_get_prop2 (Minim* self);
VALA_EXTERN void minim_set_prop2 (Minim* self,
FooFlag value);
VALA_EXTERN BarEnum minim_get_prop3 (Minim* self);
VALA_EXTERN void minim_set_prop3 (Minim* self,
BarEnum value);
VALA_EXTERN BarFlag minim_get_prop4 (Minim* self);
VALA_EXTERN void minim_set_prop4 (Minim* self,
BarFlag value);
static void minim_finalize (GObject * obj);
static GType minim_get_type_once (void);
static void _vala_minim_get_property (GObject * object,
guint property_id,
GValue * value,
GParamSpec * pspec);
static void _vala_minim_set_property (GObject * object,
guint property_id,
const GValue * value,
GParamSpec * pspec);
static void _vala_main (void);
static GType
foo_enum_get_type_once (void)
{
static const GEnumValue values[] = {{FOO_ENUM_VALUE1, "FOO_ENUM_VALUE1", "value1"}, {FOO_ENUM_VALUE2, "FOO_ENUM_VALUE2", "value2"}, {0, NULL, NULL}};
GType foo_enum_type_id;
foo_enum_type_id = g_enum_register_static ("FooEnum", values);
return foo_enum_type_id;
}
GType
foo_enum_get_type (void)
{
static volatile gsize foo_enum_type_id__volatile = 0;
if (g_once_init_enter (&foo_enum_type_id__volatile)) {
GType foo_enum_type_id;
foo_enum_type_id = foo_enum_get_type_once ();
g_once_init_leave (&foo_enum_type_id__volatile, foo_enum_type_id);
}
return foo_enum_type_id__volatile;
}
static GType
foo_flag_get_type_once (void)
{
static const GFlagsValue values[] = {{FOO_FLAG_VALUE1, "FOO_FLAG_VALUE1", "value1"}, {FOO_FLAG_VALUE2, "FOO_FLAG_VALUE2", "value2"}, {0, NULL, NULL}};
GType foo_flag_type_id;
foo_flag_type_id = g_flags_register_static ("FooFlag", values);
return foo_flag_type_id;
}
GType
foo_flag_get_type (void)
{
static volatile gsize foo_flag_type_id__volatile = 0;
if (g_once_init_enter (&foo_flag_type_id__volatile)) {
GType foo_flag_type_id;
foo_flag_type_id = foo_flag_get_type_once ();
g_once_init_leave (&foo_flag_type_id__volatile, foo_flag_type_id);
}
return foo_flag_type_id__volatile;
}
static inline gpointer
manam_get_instance_private (Manam* self)
{
return G_STRUCT_MEMBER_P (self, Manam_private_offset);
}
Manam*
manam_construct (GType object_type)
{
Manam* self = NULL;
self = (Manam*) g_type_create_instance (object_type);
return self;
}
Manam*
manam_new (void)
{
return manam_construct (TYPE_MANAM);
}
FooEnum
manam_get_prop1 (Manam* self)
{
FooEnum result;
FooEnum _tmp0_;
g_return_val_if_fail (IS_MANAM (self), 0);
_tmp0_ = self->priv->_prop1;
result = _tmp0_;
return result;
}
void
manam_set_prop1 (Manam* self,
FooEnum value)
{
g_return_if_fail (IS_MANAM (self));
self->priv->_prop1 = value;
}
FooFlag
manam_get_prop2 (Manam* self)
{
FooFlag result;
FooFlag _tmp0_;
g_return_val_if_fail (IS_MANAM (self), 0U);
_tmp0_ = self->priv->_prop2;
result = _tmp0_;
return result;
}
void
manam_set_prop2 (Manam* self,
FooFlag value)
{
g_return_if_fail (IS_MANAM (self));
self->priv->_prop2 = value;
}
BarEnum
manam_get_prop3 (Manam* self)
{
BarEnum result;
BarEnum _tmp0_;
g_return_val_if_fail (IS_MANAM (self), 0);
_tmp0_ = self->priv->_prop3;
result = _tmp0_;
return result;
}
void
manam_set_prop3 (Manam* self,
BarEnum value)
{
g_return_if_fail (IS_MANAM (self));
self->priv->_prop3 = value;
}
BarFlag
manam_get_prop4 (Manam* self)
{
BarFlag result;
BarFlag _tmp0_;
g_return_val_if_fail (IS_MANAM (self), 0U);
_tmp0_ = self->priv->_prop4;
result = _tmp0_;
return result;
}
void
manam_set_prop4 (Manam* self,
BarFlag value)
{
g_return_if_fail (IS_MANAM (self));
self->priv->_prop4 = value;
}
static void
value_manam_init (GValue* value)
{
value->data[0].v_pointer = NULL;
}
static void
value_manam_free_value (GValue* value)
{
if (value->data[0].v_pointer) {
manam_unref (value->data[0].v_pointer);
}
}
static void
value_manam_copy_value (const GValue* src_value,
GValue* dest_value)
{
if (src_value->data[0].v_pointer) {
dest_value->data[0].v_pointer = manam_ref (src_value->data[0].v_pointer);
} else {
dest_value->data[0].v_pointer = NULL;
}
}
static gpointer
value_manam_peek_pointer (const GValue* value)
{
return value->data[0].v_pointer;
}
static gchar*
value_manam_collect_value (GValue* value,
guint n_collect_values,
GTypeCValue* collect_values,
guint collect_flags)
{
if (collect_values[0].v_pointer) {
Manam * object;
object = collect_values[0].v_pointer;
if (object->parent_instance.g_class == NULL) {
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
}
value->data[0].v_pointer = manam_ref (object);
} else {
value->data[0].v_pointer = NULL;
}
return NULL;
}
static gchar*
value_manam_lcopy_value (const GValue* value,
guint n_collect_values,
GTypeCValue* collect_values,
guint collect_flags)
{
Manam ** object_p;
object_p = collect_values[0].v_pointer;
if (!object_p) {
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
}
if (!value->data[0].v_pointer) {
*object_p = NULL;
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
*object_p = value->data[0].v_pointer;
} else {
*object_p = manam_ref (value->data[0].v_pointer);
}
return NULL;
}
GParamSpec*
param_spec_manam (const gchar* name,
const gchar* nick,
const gchar* blurb,
GType object_type,
GParamFlags flags)
{
ParamSpecManam* spec;
g_return_val_if_fail (g_type_is_a (object_type, TYPE_MANAM), NULL);
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
G_PARAM_SPEC (spec)->value_type = object_type;
return G_PARAM_SPEC (spec);
}
gpointer
value_get_manam (const GValue* value)
{
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MANAM), NULL);
return value->data[0].v_pointer;
}
void
value_set_manam (GValue* value,
gpointer v_object)
{
Manam * old;
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MANAM));
old = value->data[0].v_pointer;
if (v_object) {
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MANAM));
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
value->data[0].v_pointer = v_object;
manam_ref (value->data[0].v_pointer);
} else {
value->data[0].v_pointer = NULL;
}
if (old) {
manam_unref (old);
}
}
void
value_take_manam (GValue* value,
gpointer v_object)
{
Manam * old;
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MANAM));
old = value->data[0].v_pointer;
if (v_object) {
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MANAM));
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
value->data[0].v_pointer = v_object;
} else {
value->data[0].v_pointer = NULL;
}
if (old) {
manam_unref (old);
}
}
static void
manam_class_init (ManamClass * klass,
gpointer klass_data)
{
manam_parent_class = g_type_class_peek_parent (klass);
((ManamClass *) klass)->finalize = manam_finalize;
g_type_class_adjust_private_offset (klass, &Manam_private_offset);
}
static void
manam_instance_init (Manam * self,
gpointer klass)
{
self->priv = manam_get_instance_private (self);
self->ref_count = 1;
}
static void
manam_finalize (Manam * obj)
{
Manam * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MANAM, Manam);
g_signal_handlers_destroy (self);
}
static GType
manam_get_type_once (void)
{
static const GTypeValueTable g_define_type_value_table = { value_manam_init, value_manam_free_value, value_manam_copy_value, value_manam_peek_pointer, "p", value_manam_collect_value, "p", value_manam_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (ManamClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) manam_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Manam), 0, (GInstanceInitFunc) manam_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 manam_type_id;
manam_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Manam", &g_define_type_info, &g_define_type_fundamental_info, 0);
Manam_private_offset = g_type_add_instance_private (manam_type_id, sizeof (ManamPrivate));
return manam_type_id;
}
GType
manam_get_type (void)
{
static volatile gsize manam_type_id__volatile = 0;
if (g_once_init_enter (&manam_type_id__volatile)) {
GType manam_type_id;
manam_type_id = manam_get_type_once ();
g_once_init_leave (&manam_type_id__volatile, manam_type_id);
}
return manam_type_id__volatile;
}
gpointer
manam_ref (gpointer instance)
{
Manam * self;
self = instance;
g_atomic_int_inc (&self->ref_count);
return instance;
}
void
manam_unref (gpointer instance)
{
Manam * self;
self = instance;
if (g_atomic_int_dec_and_test (&self->ref_count)) {
MANAM_GET_CLASS (self)->finalize (self);
g_type_free_instance ((GTypeInstance *) self);
}
}
static inline gpointer
minim_get_instance_private (Minim* self)
{
return G_STRUCT_MEMBER_P (self, Minim_private_offset);
}
Minim*
minim_construct (GType object_type)
{
Minim * self = NULL;
self = (Minim*) g_object_new (object_type, NULL);
return self;
}
Minim*
minim_new (void)
{
return minim_construct (TYPE_MINIM);
}
FooEnum
minim_get_prop1 (Minim* self)
{
FooEnum result;
FooEnum _tmp0_;
g_return_val_if_fail (IS_MINIM (self), 0);
_tmp0_ = self->priv->_prop1;
result = _tmp0_;
return result;
}
void
minim_set_prop1 (Minim* self,
FooEnum value)
{
FooEnum old_value;
g_return_if_fail (IS_MINIM (self));
old_value = minim_get_prop1 (self);
if (old_value != value) {
self->priv->_prop1 = value;
g_object_notify_by_pspec ((GObject *) self, minim_properties[MINIM_PROP1_PROPERTY]);
}
}
FooFlag
minim_get_prop2 (Minim* self)
{
FooFlag result;
FooFlag _tmp0_;
g_return_val_if_fail (IS_MINIM (self), 0U);
_tmp0_ = self->priv->_prop2;
result = _tmp0_;
return result;
}
void
minim_set_prop2 (Minim* self,
FooFlag value)
{
FooFlag old_value;
g_return_if_fail (IS_MINIM (self));
old_value = minim_get_prop2 (self);
if (old_value != value) {
self->priv->_prop2 = value;
g_object_notify_by_pspec ((GObject *) self, minim_properties[MINIM_PROP2_PROPERTY]);
}
}
BarEnum
minim_get_prop3 (Minim* self)
{
BarEnum result;
BarEnum _tmp0_;
g_return_val_if_fail (IS_MINIM (self), 0);
_tmp0_ = self->priv->_prop3;
result = _tmp0_;
return result;
}
void
minim_set_prop3 (Minim* self,
BarEnum value)
{
BarEnum old_value;
g_return_if_fail (IS_MINIM (self));
old_value = minim_get_prop3 (self);
if (old_value != value) {
self->priv->_prop3 = value;
g_object_notify_by_pspec ((GObject *) self, minim_properties[MINIM_PROP3_PROPERTY]);
}
}
BarFlag
minim_get_prop4 (Minim* self)
{
BarFlag result;
BarFlag _tmp0_;
g_return_val_if_fail (IS_MINIM (self), 0U);
_tmp0_ = self->priv->_prop4;
result = _tmp0_;
return result;
}
void
minim_set_prop4 (Minim* self,
BarFlag value)
{
BarFlag old_value;
g_return_if_fail (IS_MINIM (self));
old_value = minim_get_prop4 (self);
if (old_value != value) {
self->priv->_prop4 = value;
g_object_notify_by_pspec ((GObject *) self, minim_properties[MINIM_PROP4_PROPERTY]);
}
}
static void
minim_class_init (MinimClass * klass,
gpointer klass_data)
{
minim_parent_class = g_type_class_peek_parent (klass);
g_type_class_adjust_private_offset (klass, &Minim_private_offset);
G_OBJECT_CLASS (klass)->get_property = _vala_minim_get_property;
G_OBJECT_CLASS (klass)->set_property = _vala_minim_set_property;
G_OBJECT_CLASS (klass)->finalize = minim_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), MINIM_PROP1_PROPERTY, minim_properties[MINIM_PROP1_PROPERTY] = g_param_spec_enum ("prop1", "prop1", "prop1", TYPE_FOO_ENUM, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), MINIM_PROP2_PROPERTY, minim_properties[MINIM_PROP2_PROPERTY] = g_param_spec_flags ("prop2", "prop2", "prop2", TYPE_FOO_FLAG, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), MINIM_PROP3_PROPERTY, minim_properties[MINIM_PROP3_PROPERTY] = g_param_spec_int ("prop3", "prop3", "prop3", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), MINIM_PROP4_PROPERTY, minim_properties[MINIM_PROP4_PROPERTY] = g_param_spec_uint ("prop4", "prop4", "prop4", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}
static void
minim_instance_init (Minim * self,
gpointer klass)
{
self->priv = minim_get_instance_private (self);
}
static void
minim_finalize (GObject * obj)
{
Minim * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MINIM, Minim);
G_OBJECT_CLASS (minim_parent_class)->finalize (obj);
}
static GType
minim_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (MinimClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) minim_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Minim), 0, (GInstanceInitFunc) minim_instance_init, NULL };
GType minim_type_id;
minim_type_id = g_type_register_static (G_TYPE_OBJECT, "Minim", &g_define_type_info, 0);
Minim_private_offset = g_type_add_instance_private (minim_type_id, sizeof (MinimPrivate));
return minim_type_id;
}
GType
minim_get_type (void)
{
static volatile gsize minim_type_id__volatile = 0;
if (g_once_init_enter (&minim_type_id__volatile)) {
GType minim_type_id;
minim_type_id = minim_get_type_once ();
g_once_init_leave (&minim_type_id__volatile, minim_type_id);
}
return minim_type_id__volatile;
}
static void
_vala_minim_get_property (GObject * object,
guint property_id,
GValue * value,
GParamSpec * pspec)
{
Minim * self;
self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MINIM, Minim);
switch (property_id) {
case MINIM_PROP1_PROPERTY:
g_value_set_enum (value, minim_get_prop1 (self));
break;
case MINIM_PROP2_PROPERTY:
g_value_set_flags (value, minim_get_prop2 (self));
break;
case MINIM_PROP3_PROPERTY:
g_value_set_int (value, minim_get_prop3 (self));
break;
case MINIM_PROP4_PROPERTY:
g_value_set_uint (value, minim_get_prop4 (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
_vala_minim_set_property (GObject * object,
guint property_id,
const GValue * value,
GParamSpec * pspec)
{
Minim * self;
self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MINIM, Minim);
switch (property_id) {
case MINIM_PROP1_PROPERTY:
minim_set_prop1 (self, g_value_get_enum (value));
break;
case MINIM_PROP2_PROPERTY:
minim_set_prop2 (self, g_value_get_flags (value));
break;
case MINIM_PROP3_PROPERTY:
minim_set_prop3 (self, g_value_get_int (value));
break;
case MINIM_PROP4_PROPERTY:
minim_set_prop4 (self, g_value_get_uint (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
_vala_main (void)
{
{
Manam* manam = NULL;
Manam* _tmp0_;
FooEnum _tmp1_;
FooEnum _tmp2_;
FooFlag _tmp3_;
FooFlag _tmp4_;
BarEnum _tmp5_;
BarEnum _tmp6_;
BarFlag _tmp7_;
BarFlag _tmp8_;
_tmp0_ = manam_new ();
manam = _tmp0_;
manam_set_prop1 (manam, FOO_ENUM_VALUE2);
_tmp1_ = manam_get_prop1 (manam);
_tmp2_ = _tmp1_;
_vala_assert (_tmp2_ == FOO_ENUM_VALUE2, "manam.prop1 == FooEnum.VALUE2");
manam_set_prop2 (manam, FOO_FLAG_VALUE2);
_tmp3_ = manam_get_prop2 (manam);
_tmp4_ = _tmp3_;
_vala_assert (_tmp4_ == FOO_FLAG_VALUE2, "manam.prop2 == FooFlag.VALUE2");
manam_set_prop3 (manam, BAR_ENUM_VALUE2);
_tmp5_ = manam_get_prop3 (manam);
_tmp6_ = _tmp5_;
_vala_assert (_tmp6_ == BAR_ENUM_VALUE2, "manam.prop3 == BarEnum.VALUE2");
manam_set_prop4 (manam, BAR_FLAG_VALUE2);
_tmp7_ = manam_get_prop4 (manam);
_tmp8_ = _tmp7_;
_vala_assert (_tmp8_ == BAR_FLAG_VALUE2, "manam.prop4 == BarFlag.VALUE2");
_manam_unref0 (manam);
}
{
Minim* minim = NULL;
Minim* _tmp9_;
FooEnum _tmp10_;
FooEnum _tmp11_;
FooFlag _tmp12_;
FooFlag _tmp13_;
BarEnum _tmp14_;
BarEnum _tmp15_;
BarFlag _tmp16_;
BarFlag _tmp17_;
_tmp9_ = minim_new ();
minim = _tmp9_;
minim_set_prop1 (minim, FOO_ENUM_VALUE2);
_tmp10_ = minim_get_prop1 (minim);
_tmp11_ = _tmp10_;
_vala_assert (_tmp11_ == FOO_ENUM_VALUE2, "minim.prop1 == FooEnum.VALUE2");
minim_set_prop2 (minim, FOO_FLAG_VALUE2);
_tmp12_ = minim_get_prop2 (minim);
_tmp13_ = _tmp12_;
_vala_assert (_tmp13_ == FOO_FLAG_VALUE2, "minim.prop2 == FooFlag.VALUE2");
minim_set_prop3 (minim, BAR_ENUM_VALUE2);
_tmp14_ = minim_get_prop3 (minim);
_tmp15_ = _tmp14_;
_vala_assert (_tmp15_ == BAR_ENUM_VALUE2, "minim.prop3 == BarEnum.VALUE2");
minim_set_prop4 (minim, BAR_FLAG_VALUE2);
_tmp16_ = minim_get_prop4 (minim);
_tmp17_ = _tmp16_;
_vala_assert (_tmp17_ == BAR_FLAG_VALUE2, "minim.prop4 == BarFlag.VALUE2");
_g_object_unref0 (minim);
}
}
int
main (int argc,
char ** argv)
{
_vala_main ();
return 0;
}
|