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
|
/* delegates_delegates.c generated by valac, the Vala compiler
* generated from delegates_delegates.vala, do not modify */
#include <glib-object.h>
#include <glib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.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 {
PARAMETER_ENUM_FOO,
PARAMETER_ENUM_BAR
} ParameterEnum;
#define TYPE_PARAMETER_ENUM (parameter_enum_get_type ())
typedef void (*MamanVoidCallback) (void);
typedef gint (*MamanActionCallback) (void);
typedef void (*MamanInstanceCallback) (gint i, gpointer user_data);
typedef ParameterEnum (*MamanEnumDelegate) (ParameterEnum pe, gpointer user_data);
#define MAMAN_TYPE_DELEGATE_STRUCT (maman_delegate_struct_get_type ())
typedef struct _MamanDelegateStruct MamanDelegateStruct;
#define MAMAN_TYPE_FOO (maman_foo_get_type ())
#define MAMAN_FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_FOO, MamanFoo))
#define MAMAN_IS_FOO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_FOO))
#define MAMAN_FOO_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MAMAN_TYPE_FOO, MamanFooIface))
typedef struct _MamanFoo MamanFoo;
typedef struct _MamanFooIface MamanFooIface;
#define MAMAN_TYPE_BAR (maman_bar_get_type ())
#define MAMAN_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_BAR, MamanBar))
#define MAMAN_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAMAN_TYPE_BAR, MamanBarClass))
#define MAMAN_IS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_BAR))
#define MAMAN_IS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAMAN_TYPE_BAR))
#define MAMAN_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAMAN_TYPE_BAR, MamanBarClass))
typedef struct _MamanBar MamanBar;
typedef struct _MamanBarClass MamanBarClass;
typedef struct _MamanBarPrivate MamanBarPrivate;
enum {
MAMAN_BAR_0_PROPERTY,
MAMAN_BAR_NUM_PROPERTIES
};
static GParamSpec* maman_bar_properties[MAMAN_BAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_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 _MamanDelegateStruct {
MamanVoidCallback callback;
};
struct _MamanFooIface {
GTypeInterface parent_iface;
void (*foo_method) (MamanFoo* self, gint i);
};
struct _MamanBar {
GObject parent_instance;
MamanBarPrivate * priv;
};
struct _MamanBarClass {
GObjectClass parent_class;
};
struct _MamanBarPrivate {
MamanInstanceCallback callback_field;
gpointer callback_field_target;
GDestroyNotify callback_field_target_destroy_notify;
};
static gint MamanBar_private_offset;
static gpointer maman_bar_parent_class = NULL;
static MamanFooIface * maman_bar_maman_foo_parent_iface = NULL;
VALA_EXTERN GType parameter_enum_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType maman_delegate_struct_get_type (void) G_GNUC_CONST ;
VALA_EXTERN MamanDelegateStruct* maman_delegate_struct_dup (const MamanDelegateStruct* self);
VALA_EXTERN void maman_delegate_struct_free (MamanDelegateStruct* self);
VALA_EXTERN GType maman_foo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MamanFoo, g_object_unref)
VALA_EXTERN void maman_foo_foo_method (MamanFoo* self,
gint i);
static GType maman_foo_get_type_once (void);
VALA_EXTERN GType maman_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MamanBar, g_object_unref)
static void maman_bar_do_void_action (void);
static void _maman_bar_do_void_action_maman_void_callback (void);
VALA_EXTERN MamanBar* maman_bar_new (void);
VALA_EXTERN MamanBar* maman_bar_construct (GType object_type);
static gint maman_bar_do_action (void);
static void maman_bar_do_instance_action (MamanBar* self,
gint i);
static void maman_bar_call_instance_delegate (MamanInstanceCallback instance_cb,
gpointer instance_cb_target);
static void maman_bar_assign_instance_delegate (MamanBar* self,
MamanInstanceCallback* instance_cb,
gpointer* instance_cb_target,
GDestroyNotify* instance_cb_target_destroy_notify);
static void _maman_foo_foo_method_maman_instance_callback (gint i,
gpointer self);
static void maman_bar_test_function_pointers (void);
static void _g_object_unref_gdestroy_notify (void* data);
static void maman_bar_real_foo_method (MamanFoo* base,
gint i);
static void maman_bar_test_delegates_interface_method (void);
static void maman_bar_test_field_reference_transfer (MamanBar* self);
static MamanVoidCallback maman_bar_test_unowned_delegate_return (void);
static void __lambda4_ (void);
static void ___lambda4__maman_void_callback (void);
static gint maman_bar_main (void);
static gint _maman_bar_do_action_maman_action_callback (void);
static void _maman_bar_do_instance_action_maman_instance_callback (gint i,
gpointer self);
static void maman_bar_finalize (GObject * obj);
static GType maman_bar_get_type_once (void);
static const MamanDelegateStruct MAMAN_BAR_const_delegate_struct = {_maman_bar_do_void_action_maman_void_callback};
static GType
parameter_enum_get_type_once (void)
{
static const GEnumValue values[] = {{PARAMETER_ENUM_FOO, "PARAMETER_ENUM_FOO", "foo"}, {PARAMETER_ENUM_BAR, "PARAMETER_ENUM_BAR", "bar"}, {0, NULL, NULL}};
GType parameter_enum_type_id;
parameter_enum_type_id = g_enum_register_static ("ParameterEnum", values);
return parameter_enum_type_id;
}
GType
parameter_enum_get_type (void)
{
static volatile gsize parameter_enum_type_id__once = 0;
if (g_once_init_enter (¶meter_enum_type_id__once)) {
GType parameter_enum_type_id;
parameter_enum_type_id = parameter_enum_get_type_once ();
g_once_init_leave (¶meter_enum_type_id__once, parameter_enum_type_id);
}
return parameter_enum_type_id__once;
}
MamanDelegateStruct*
maman_delegate_struct_dup (const MamanDelegateStruct* self)
{
MamanDelegateStruct* dup;
dup = g_new0 (MamanDelegateStruct, 1);
memcpy (dup, self, sizeof (MamanDelegateStruct));
return dup;
}
void
maman_delegate_struct_free (MamanDelegateStruct* self)
{
g_free (self);
}
static GType
maman_delegate_struct_get_type_once (void)
{
GType maman_delegate_struct_type_id;
maman_delegate_struct_type_id = g_boxed_type_register_static ("MamanDelegateStruct", (GBoxedCopyFunc) maman_delegate_struct_dup, (GBoxedFreeFunc) maman_delegate_struct_free);
return maman_delegate_struct_type_id;
}
GType
maman_delegate_struct_get_type (void)
{
static volatile gsize maman_delegate_struct_type_id__once = 0;
if (g_once_init_enter (&maman_delegate_struct_type_id__once)) {
GType maman_delegate_struct_type_id;
maman_delegate_struct_type_id = maman_delegate_struct_get_type_once ();
g_once_init_leave (&maman_delegate_struct_type_id__once, maman_delegate_struct_type_id);
}
return maman_delegate_struct_type_id__once;
}
void
maman_foo_foo_method (MamanFoo* self,
gint i)
{
MamanFooIface* _iface_;
g_return_if_fail (MAMAN_IS_FOO (self));
_iface_ = MAMAN_FOO_GET_INTERFACE (self);
if (_iface_->foo_method) {
_iface_->foo_method (self, i);
}
}
static void
maman_foo_default_init (MamanFooIface * iface,
gpointer iface_data)
{
}
static GType
maman_foo_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (MamanFooIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) maman_foo_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
GType maman_foo_type_id;
maman_foo_type_id = g_type_register_static (G_TYPE_INTERFACE, "MamanFoo", &g_define_type_info, 0);
g_type_interface_add_prerequisite (maman_foo_type_id, G_TYPE_OBJECT);
return maman_foo_type_id;
}
GType
maman_foo_get_type (void)
{
static volatile gsize maman_foo_type_id__once = 0;
if (g_once_init_enter (&maman_foo_type_id__once)) {
GType maman_foo_type_id;
maman_foo_type_id = maman_foo_get_type_once ();
g_once_init_leave (&maman_foo_type_id__once, maman_foo_type_id);
}
return maman_foo_type_id__once;
}
static inline gpointer
maman_bar_get_instance_private (MamanBar* self)
{
return G_STRUCT_MEMBER_P (self, MamanBar_private_offset);
}
static void
_maman_bar_do_void_action_maman_void_callback (void)
{
maman_bar_do_void_action ();
}
MamanBar*
maman_bar_construct (GType object_type)
{
MamanBar * self = NULL;
self = (MamanBar*) g_object_new (object_type, NULL);
return self;
}
MamanBar*
maman_bar_new (void)
{
return maman_bar_construct (MAMAN_TYPE_BAR);
}
static void
maman_bar_do_void_action (void)
{
FILE* _tmp0_;
_tmp0_ = stdout;
fprintf (_tmp0_, " 2");
}
static gint
maman_bar_do_action (void)
{
gint result;
result = 4;
return result;
}
static void
maman_bar_do_instance_action (MamanBar* self,
gint i)
{
FILE* _tmp0_;
g_return_if_fail (MAMAN_IS_BAR (self));
_vala_assert (i == 42, "i == 42");
_tmp0_ = stdout;
fprintf (_tmp0_, " 6");
}
static void
maman_bar_call_instance_delegate (MamanInstanceCallback instance_cb,
gpointer instance_cb_target)
{
instance_cb (42, instance_cb_target);
}
static void
_maman_foo_foo_method_maman_instance_callback (gint i,
gpointer self)
{
maman_foo_foo_method ((MamanFoo*) self, i);
}
static void
maman_bar_assign_instance_delegate (MamanBar* self,
MamanInstanceCallback* instance_cb,
gpointer* instance_cb_target,
GDestroyNotify* instance_cb_target_destroy_notify)
{
MamanInstanceCallback _vala_instance_cb = NULL;
gpointer _vala_instance_cb_target = NULL;
GDestroyNotify _vala_instance_cb_target_destroy_notify = NULL;
g_return_if_fail (MAMAN_IS_BAR (self));
(_vala_instance_cb_target_destroy_notify == NULL) ? NULL : (_vala_instance_cb_target_destroy_notify (_vala_instance_cb_target), NULL);
_vala_instance_cb = NULL;
_vala_instance_cb_target = NULL;
_vala_instance_cb_target_destroy_notify = NULL;
_vala_instance_cb = _maman_foo_foo_method_maman_instance_callback;
_vala_instance_cb_target = g_object_ref (G_TYPE_CHECK_INSTANCE_CAST (self, MAMAN_TYPE_FOO, MamanFoo));
_vala_instance_cb_target_destroy_notify = g_object_unref;
if (instance_cb) {
*instance_cb = _vala_instance_cb;
*instance_cb_target = _vala_instance_cb_target;
*instance_cb_target_destroy_notify = _vala_instance_cb_target_destroy_notify;
} else {
(_vala_instance_cb_target_destroy_notify == NULL) ? NULL : (_vala_instance_cb_target_destroy_notify (_vala_instance_cb_target), NULL);
_vala_instance_cb = NULL;
_vala_instance_cb_target = NULL;
_vala_instance_cb_target_destroy_notify = NULL;
}
}
static void
_g_object_unref_gdestroy_notify (void* data)
{
g_object_unref (data);
}
static gpointer
_g_object_ref0 (gpointer self)
{
return self ? g_object_ref (self) : NULL;
}
static void
maman_bar_test_function_pointers (void)
{
FILE* _tmp0_;
GHashTable* table = NULL;
GHashFunc _tmp1_;
GEqualFunc _tmp2_;
GDestroyNotify _tmp3_;
GHashTable* _tmp4_;
FILE* _tmp5_;
gchar* _tmp6_;
MamanBar* _tmp7_;
FILE* _tmp8_;
MamanBar* bar = NULL;
gconstpointer _tmp9_;
MamanBar* _tmp10_;
FILE* _tmp11_;
_tmp0_ = stdout;
fprintf (_tmp0_, "testing function pointers:");
_tmp1_ = g_str_hash;
_tmp2_ = g_str_equal;
_tmp3_ = g_free;
_tmp4_ = g_hash_table_new_full (_tmp1_, _tmp2_, _tmp3_, _g_object_unref_gdestroy_notify);
table = _tmp4_;
_tmp5_ = stdout;
fprintf (_tmp5_, " 1");
_tmp6_ = g_strdup ("foo");
_tmp7_ = maman_bar_new ();
g_hash_table_insert (table, _tmp6_, _tmp7_);
_tmp8_ = stdout;
fprintf (_tmp8_, " 2");
_tmp9_ = g_hash_table_lookup (table, "foo");
_tmp10_ = _g_object_ref0 ((MamanBar*) _tmp9_);
bar = _tmp10_;
_tmp11_ = stdout;
fprintf (_tmp11_, " 3\n");
_g_object_unref0 (bar);
_g_hash_table_unref0 (table);
}
static void
maman_bar_real_foo_method (MamanFoo* base,
gint i)
{
MamanBar * self;
self = G_TYPE_CHECK_INSTANCE_CAST (base, MAMAN_TYPE_BAR, MamanBar);
}
static void
maman_bar_test_delegates_interface_method (void)
{
MamanBar* bar = NULL;
MamanBar* _tmp0_;
_tmp0_ = maman_bar_new ();
bar = _tmp0_;
maman_bar_call_instance_delegate (_maman_foo_foo_method_maman_instance_callback, G_TYPE_CHECK_INSTANCE_CAST (bar, MAMAN_TYPE_FOO, MamanFoo));
_g_object_unref0 (bar);
}
static void
maman_bar_test_field_reference_transfer (MamanBar* self)
{
MamanInstanceCallback foo = NULL;
MamanInstanceCallback _tmp0_;
gpointer _tmp0__target;
GDestroyNotify _tmp0__target_destroy_notify;
gpointer foo_target;
GDestroyNotify foo_target_destroy_notify;
g_return_if_fail (MAMAN_IS_BAR (self));
_tmp0_ = self->priv->callback_field;
_tmp0__target = self->priv->callback_field_target;
_tmp0__target_destroy_notify = self->priv->callback_field_target_destroy_notify;
self->priv->callback_field = NULL;
self->priv->callback_field_target = NULL;
self->priv->callback_field_target_destroy_notify = NULL;
foo = _tmp0_;
foo_target = _tmp0__target;
foo_target_destroy_notify = _tmp0__target_destroy_notify;
(foo_target_destroy_notify == NULL) ? NULL : (foo_target_destroy_notify (foo_target), NULL);
foo = NULL;
foo_target = NULL;
foo_target_destroy_notify = NULL;
}
static void
__lambda4_ (void)
{
}
static void
___lambda4__maman_void_callback (void)
{
__lambda4_ ();
}
static MamanVoidCallback
maman_bar_test_unowned_delegate_return (void)
{
MamanVoidCallback result;
result = ___lambda4__maman_void_callback;
return result;
}
static gint
_maman_bar_do_action_maman_action_callback (void)
{
gint result;
result = maman_bar_do_action ();
return result;
}
static void
_maman_bar_do_instance_action_maman_instance_callback (gint i,
gpointer self)
{
maman_bar_do_instance_action ((MamanBar*) self, i);
}
static gint
maman_bar_main (void)
{
FILE* _tmp0_;
MamanVoidCallback void_cb = NULL;
FILE* _tmp1_;
MamanActionCallback cb = NULL;
FILE* _tmp2_;
FILE* _tmp3_;
MamanBar* bar = NULL;
MamanBar* _tmp4_;
MamanInstanceCallback instance_cb = NULL;
gpointer instance_cb_target;
GDestroyNotify instance_cb_target_destroy_notify;
MamanInstanceCallback _tmp5_;
gpointer _tmp5__target;
MamanInstanceCallback _tmp6_ = NULL;
gpointer _tmp7_ = NULL;
GDestroyNotify _tmp8_ = NULL;
MamanInstanceCallback _tmp9_;
gpointer _tmp9__target;
FILE* _tmp10_;
MamanVoidCallback baz = NULL;
MamanVoidCallback _tmp11_;
gint result;
_tmp0_ = stdout;
fprintf (_tmp0_, "Delegate Test: 1");
void_cb = _maman_bar_do_void_action_maman_void_callback;
void_cb ();
_tmp1_ = stdout;
fprintf (_tmp1_, " 3");
cb = _maman_bar_do_action_maman_action_callback;
_tmp2_ = stdout;
fprintf (_tmp2_, " %d", cb ());
_tmp3_ = stdout;
fprintf (_tmp3_, " 5");
_tmp4_ = maman_bar_new ();
bar = _tmp4_;
instance_cb = _maman_bar_do_instance_action_maman_instance_callback;
instance_cb_target = g_object_ref (bar);
instance_cb_target_destroy_notify = g_object_unref;
_tmp5_ = instance_cb;
_tmp5__target = instance_cb_target;
maman_bar_call_instance_delegate (_tmp5_, _tmp5__target);
maman_bar_assign_instance_delegate (bar, &_tmp6_, &_tmp7_, &_tmp8_);
(instance_cb_target_destroy_notify == NULL) ? NULL : (instance_cb_target_destroy_notify (instance_cb_target), NULL);
instance_cb = NULL;
instance_cb_target = NULL;
instance_cb_target_destroy_notify = NULL;
instance_cb = _tmp6_;
instance_cb_target = _tmp7_;
instance_cb_target_destroy_notify = _tmp8_;
_tmp9_ = instance_cb;
_tmp9__target = instance_cb_target;
maman_bar_call_instance_delegate (_tmp9_, _tmp9__target);
_tmp10_ = stdout;
fprintf (_tmp10_, " 7\n");
maman_bar_test_function_pointers ();
maman_bar_test_delegates_interface_method ();
_tmp11_ = maman_bar_test_unowned_delegate_return ();
baz = _tmp11_;
result = 0;
(instance_cb_target_destroy_notify == NULL) ? NULL : (instance_cb_target_destroy_notify (instance_cb_target), NULL);
instance_cb = NULL;
instance_cb_target = NULL;
instance_cb_target_destroy_notify = NULL;
_g_object_unref0 (bar);
return result;
}
int
main (int argc,
char ** argv)
{
return maman_bar_main ();
}
static void
maman_bar_class_init (MamanBarClass * klass,
gpointer klass_data)
{
maman_bar_parent_class = g_type_class_peek_parent (klass);
g_type_class_adjust_private_offset (klass, &MamanBar_private_offset);
G_OBJECT_CLASS (klass)->finalize = maman_bar_finalize;
}
static void
maman_bar_maman_foo_interface_init (MamanFooIface * iface,
gpointer iface_data)
{
maman_bar_maman_foo_parent_iface = g_type_interface_peek_parent (iface);
iface->foo_method = (void (*) (MamanFoo*, gint)) maman_bar_real_foo_method;
}
static void
maman_bar_instance_init (MamanBar * self,
gpointer klass)
{
self->priv = maman_bar_get_instance_private (self);
}
static void
maman_bar_finalize (GObject * obj)
{
MamanBar * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, MAMAN_TYPE_BAR, MamanBar);
(self->priv->callback_field_target_destroy_notify == NULL) ? NULL : (self->priv->callback_field_target_destroy_notify (self->priv->callback_field_target), NULL);
self->priv->callback_field = NULL;
self->priv->callback_field_target = NULL;
self->priv->callback_field_target_destroy_notify = NULL;
G_OBJECT_CLASS (maman_bar_parent_class)->finalize (obj);
}
static GType
maman_bar_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (MamanBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) maman_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MamanBar), 0, (GInstanceInitFunc) maman_bar_instance_init, NULL };
static const GInterfaceInfo maman_foo_info = { (GInterfaceInitFunc) maman_bar_maman_foo_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
GType maman_bar_type_id;
maman_bar_type_id = g_type_register_static (G_TYPE_OBJECT, "MamanBar", &g_define_type_info, 0);
g_type_add_interface_static (maman_bar_type_id, MAMAN_TYPE_FOO, &maman_foo_info);
MamanBar_private_offset = g_type_add_instance_private (maman_bar_type_id, sizeof (MamanBarPrivate));
return maman_bar_type_id;
}
GType
maman_bar_get_type (void)
{
static volatile gsize maman_bar_type_id__once = 0;
if (g_once_init_enter (&maman_bar_type_id__once)) {
GType maman_bar_type_id;
maman_bar_type_id = maman_bar_get_type_once ();
g_once_init_leave (&maman_bar_type_id__once, maman_bar_type_id);
}
return maman_bar_type_id__once;
}
|