1// Package gobject was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gobject
3
4import (
5 "fmt"
6 "structs"
7 "unsafe"
8
9 "github.com/ebitengine/purego"
10
11 "github.com/bnema/puregotk/pkg/core"
12 "github.com/bnema/puregotk/v4/glib"
13 "github.com/bnema/puregotk/v4/gobject/types"
14)
15
16// The type of the @finalize function of #GObjectClass.
17type ObjectFinalizeFunc func(uintptr)
18
19// The type of the @get_property function of #GObjectClass.
20type ObjectGetPropertyFunc func(uintptr, uint, *Value, uintptr)
21
22// The type of the @set_property function of #GObjectClass.
23type ObjectSetPropertyFunc func(uintptr, uint, *Value, uintptr)
24
25// A callback function used for notification when the state
26// of a toggle reference changes.
27//
28// See also: g_object_add_toggle_ref()
29type ToggleNotify func(uintptr, uintptr, bool)
30
31// A #GWeakNotify function can be added to an object as a callback that gets
32// triggered when the object is finalized.
33//
34// Since the object is already being disposed when the #GWeakNotify is called,
35// there's not much you could do with the object, apart from e.g. using its
36// address as hash-index or the like.
37//
38// In particular, this means it’s invalid to call g_object_ref(),
39// g_weak_ref_init(), g_weak_ref_set(), g_object_add_toggle_ref(),
40// g_object_weak_ref(), g_object_add_weak_pointer() or any function which calls
41// them on the object from this callback.
42type WeakNotify func(uintptr, uintptr)
43
44// The class structure for the GInitiallyUnowned type.
45type InitiallyUnownedClass struct {
46 _ structs.HostLayout
47
48 GTypeClass uintptr
49
50 ConstructProperties *glib.SList
51
52 xConstructor uintptr
53
54 xSetProperty uintptr
55
56 xGetProperty uintptr
57
58 xDispose uintptr
59
60 xFinalize uintptr
61
62 xDispatchPropertiesChanged uintptr
63
64 xNotify uintptr
65
66 xConstructed uintptr
67
68 Flags uint
69
70 NConstructProperties uint
71
72 Pspecs uintptr
73
74 NPspecs uint
75
76 Pdummy [3]uintptr
77}
78
79func (x *InitiallyUnownedClass) GoPointer() uintptr {
80 return uintptr(unsafe.Pointer(x))
81}
82
83// OverrideConstructor sets the "constructor" callback function.
84// the @constructor function is called by g_object_new () to
85//
86// complete the object initialization after all the construction properties are
87// set. The first thing a @constructor implementation must do is chain up to the
88// @constructor of the parent class. Overriding @constructor should be rarely
89// needed, e.g. to handle construct properties, or to implement singletons.
90func (x *InitiallyUnownedClass) OverrideConstructor(cb func(types.GType, uint, *ObjectConstructParam) *Object) {
91 if cb == nil {
92 x.xConstructor = 0
93 } else {
94 x.xConstructor = purego.NewCallback(func(TypeVarp types.GType, NConstructPropertiesVarp uint, ConstructPropertiesVarp *ObjectConstructParam) uintptr {
95 ret := cb(TypeVarp, NConstructPropertiesVarp, ConstructPropertiesVarp)
96 if ret == nil {
97 return 0
98 }
99 return ret.GoPointer()
100 })
101 }
102}
103
104// GetConstructor gets the "constructor" callback function.
105// the @constructor function is called by g_object_new () to
106//
107// complete the object initialization after all the construction properties are
108// set. The first thing a @constructor implementation must do is chain up to the
109// @constructor of the parent class. Overriding @constructor should be rarely
110// needed, e.g. to handle construct properties, or to implement singletons.
111func (x *InitiallyUnownedClass) GetConstructor() func(types.GType, uint, *ObjectConstructParam) *Object {
112 if x.xConstructor == 0 {
113 return nil
114 }
115 var rawCallback func(TypeVarp types.GType, NConstructPropertiesVarp uint, ConstructPropertiesVarp *ObjectConstructParam) uintptr
116 purego.RegisterFunc(&rawCallback, x.xConstructor)
117 return func(TypeVar types.GType, NConstructPropertiesVar uint, ConstructPropertiesVar *ObjectConstructParam) *Object {
118 rawRet := rawCallback(TypeVar, NConstructPropertiesVar, ConstructPropertiesVar)
119 if rawRet == 0 {
120 return nil
121 }
122 ret := &Object{}
123 ret.Ptr = rawRet
124 return ret
125 }
126}
127
128// OverrideSetProperty sets the "set_property" callback function.
129// the generic setter for all properties of this type. Should be
130//
131// overridden for every type with properties. If implementations of
132// @set_property don't emit property change notification explicitly, this will
133// be done implicitly by the type system. However, if the notify signal is
134// emitted explicitly, the type system will not emit it a second time.
135func (x *InitiallyUnownedClass) OverrideSetProperty(cb func(*Object, uint, *Value, *ParamSpec)) {
136 if cb == nil {
137 x.xSetProperty = 0
138 } else {
139 x.xSetProperty = purego.NewCallback(func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) {
140 cb(ObjectNewFromInternalPtr(ObjectVarp), PropertyIdVarp, ValueVarp, ParamSpecNewFromInternalPtr(PspecVarp))
141 })
142 }
143}
144
145// GetSetProperty gets the "set_property" callback function.
146// the generic setter for all properties of this type. Should be
147//
148// overridden for every type with properties. If implementations of
149// @set_property don't emit property change notification explicitly, this will
150// be done implicitly by the type system. However, if the notify signal is
151// emitted explicitly, the type system will not emit it a second time.
152func (x *InitiallyUnownedClass) GetSetProperty() func(*Object, uint, *Value, *ParamSpec) {
153 if x.xSetProperty == 0 {
154 return nil
155 }
156 var rawCallback func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr)
157 purego.RegisterFunc(&rawCallback, x.xSetProperty)
158 return func(ObjectVar *Object, PropertyIdVar uint, ValueVar *Value, PspecVar *ParamSpec) {
159 rawCallback(ObjectVar.GoPointer(), PropertyIdVar, ValueVar, PspecVar.GoPointer())
160 }
161}
162
163// OverrideGetProperty sets the "get_property" callback function.
164// the generic getter for all properties of this type. Should be
165//
166// overridden for every type with properties.
167func (x *InitiallyUnownedClass) OverrideGetProperty(cb func(*Object, uint, *Value, *ParamSpec)) {
168 if cb == nil {
169 x.xGetProperty = 0
170 } else {
171 x.xGetProperty = purego.NewCallback(func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) {
172 cb(ObjectNewFromInternalPtr(ObjectVarp), PropertyIdVarp, ValueVarp, ParamSpecNewFromInternalPtr(PspecVarp))
173 })
174 }
175}
176
177// GetGetProperty gets the "get_property" callback function.
178// the generic getter for all properties of this type. Should be
179//
180// overridden for every type with properties.
181func (x *InitiallyUnownedClass) GetGetProperty() func(*Object, uint, *Value, *ParamSpec) {
182 if x.xGetProperty == 0 {
183 return nil
184 }
185 var rawCallback func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr)
186 purego.RegisterFunc(&rawCallback, x.xGetProperty)
187 return func(ObjectVar *Object, PropertyIdVar uint, ValueVar *Value, PspecVar *ParamSpec) {
188 rawCallback(ObjectVar.GoPointer(), PropertyIdVar, ValueVar, PspecVar.GoPointer())
189 }
190}
191
192// OverrideDispose sets the "dispose" callback function.
193// the @dispose function is supposed to drop all references to other
194//
195// objects, but keep the instance otherwise intact, so that client method
196// invocations still work. It may be run multiple times (due to reference
197// loops). Before returning, @dispose should chain up to the @dispose method
198// of the parent class.
199func (x *InitiallyUnownedClass) OverrideDispose(cb func(*Object)) {
200 if cb == nil {
201 x.xDispose = 0
202 } else {
203 x.xDispose = purego.NewCallback(func(ObjectVarp uintptr) {
204 cb(ObjectNewFromInternalPtr(ObjectVarp))
205 })
206 }
207}
208
209// GetDispose gets the "dispose" callback function.
210// the @dispose function is supposed to drop all references to other
211//
212// objects, but keep the instance otherwise intact, so that client method
213// invocations still work. It may be run multiple times (due to reference
214// loops). Before returning, @dispose should chain up to the @dispose method
215// of the parent class.
216func (x *InitiallyUnownedClass) GetDispose() func(*Object) {
217 if x.xDispose == 0 {
218 return nil
219 }
220 var rawCallback func(ObjectVarp uintptr)
221 purego.RegisterFunc(&rawCallback, x.xDispose)
222 return func(ObjectVar *Object) {
223 rawCallback(ObjectVar.GoPointer())
224 }
225}
226
227// OverrideFinalize sets the "finalize" callback function.
228// instance finalization function, should finish the finalization of
229//
230// the instance begun in @dispose and chain up to the @finalize method of the
231// parent class.
232func (x *InitiallyUnownedClass) OverrideFinalize(cb func(*Object)) {
233 if cb == nil {
234 x.xFinalize = 0
235 } else {
236 x.xFinalize = purego.NewCallback(func(ObjectVarp uintptr) {
237 cb(ObjectNewFromInternalPtr(ObjectVarp))
238 })
239 }
240}
241
242// GetFinalize gets the "finalize" callback function.
243// instance finalization function, should finish the finalization of
244//
245// the instance begun in @dispose and chain up to the @finalize method of the
246// parent class.
247func (x *InitiallyUnownedClass) GetFinalize() func(*Object) {
248 if x.xFinalize == 0 {
249 return nil
250 }
251 var rawCallback func(ObjectVarp uintptr)
252 purego.RegisterFunc(&rawCallback, x.xFinalize)
253 return func(ObjectVar *Object) {
254 rawCallback(ObjectVar.GoPointer())
255 }
256}
257
258// OverrideDispatchPropertiesChanged sets the "dispatch_properties_changed" callback function.
259// emits property change notification for a bunch
260//
261// of properties. Overriding @dispatch_properties_changed should be rarely
262// needed.
263func (x *InitiallyUnownedClass) OverrideDispatchPropertiesChanged(cb func(*Object, uint, **ParamSpec)) {
264 if cb == nil {
265 x.xDispatchPropertiesChanged = 0
266 } else {
267 x.xDispatchPropertiesChanged = purego.NewCallback(func(ObjectVarp uintptr, NPspecsVarp uint, PspecsVarp uintptr) {
268 cb(ObjectNewFromInternalPtr(ObjectVarp), NPspecsVarp, (**ParamSpec)(unsafe.Pointer(PspecsVarp)))
269 })
270 }
271}
272
273// GetDispatchPropertiesChanged gets the "dispatch_properties_changed" callback function.
274// emits property change notification for a bunch
275//
276// of properties. Overriding @dispatch_properties_changed should be rarely
277// needed.
278func (x *InitiallyUnownedClass) GetDispatchPropertiesChanged() func(*Object, uint, **ParamSpec) {
279 if x.xDispatchPropertiesChanged == 0 {
280 return nil
281 }
282 var rawCallback func(ObjectVarp uintptr, NPspecsVarp uint, PspecsVarp uintptr)
283 purego.RegisterFunc(&rawCallback, x.xDispatchPropertiesChanged)
284 return func(ObjectVar *Object, NPspecsVar uint, PspecsVar **ParamSpec) {
285 rawCallback(ObjectVar.GoPointer(), NPspecsVar, *ConvertPtr(PspecsVar))
286 }
287}
288
289// OverrideNotify sets the "notify" callback function.
290// the class closure for the notify signal
291func (x *InitiallyUnownedClass) OverrideNotify(cb func(*Object, *ParamSpec)) {
292 if cb == nil {
293 x.xNotify = 0
294 } else {
295 x.xNotify = purego.NewCallback(func(ObjectVarp uintptr, PspecVarp uintptr) {
296 cb(ObjectNewFromInternalPtr(ObjectVarp), ParamSpecNewFromInternalPtr(PspecVarp))
297 })
298 }
299}
300
301// GetNotify gets the "notify" callback function.
302// the class closure for the notify signal
303func (x *InitiallyUnownedClass) GetNotify() func(*Object, *ParamSpec) {
304 if x.xNotify == 0 {
305 return nil
306 }
307 var rawCallback func(ObjectVarp uintptr, PspecVarp uintptr)
308 purego.RegisterFunc(&rawCallback, x.xNotify)
309 return func(ObjectVar *Object, PspecVar *ParamSpec) {
310 rawCallback(ObjectVar.GoPointer(), PspecVar.GoPointer())
311 }
312}
313
314// OverrideConstructed sets the "constructed" callback function.
315// the @constructed function is called by g_object_new() as the
316//
317// final step of the object creation process. At the point of the call, all
318// construction properties have been set on the object. The purpose of this
319// call is to allow for object initialisation steps that can only be performed
320// after construction properties have been set. @constructed implementors
321// should chain up to the @constructed call of their parent class to allow it
322// to complete its initialisation.
323func (x *InitiallyUnownedClass) OverrideConstructed(cb func(*Object)) {
324 if cb == nil {
325 x.xConstructed = 0
326 } else {
327 x.xConstructed = purego.NewCallback(func(ObjectVarp uintptr) {
328 cb(ObjectNewFromInternalPtr(ObjectVarp))
329 })
330 }
331}
332
333// GetConstructed gets the "constructed" callback function.
334// the @constructed function is called by g_object_new() as the
335//
336// final step of the object creation process. At the point of the call, all
337// construction properties have been set on the object. The purpose of this
338// call is to allow for object initialisation steps that can only be performed
339// after construction properties have been set. @constructed implementors
340// should chain up to the @constructed call of their parent class to allow it
341// to complete its initialisation.
342func (x *InitiallyUnownedClass) GetConstructed() func(*Object) {
343 if x.xConstructed == 0 {
344 return nil
345 }
346 var rawCallback func(ObjectVarp uintptr)
347 purego.RegisterFunc(&rawCallback, x.xConstructed)
348 return func(ObjectVar *Object) {
349 rawCallback(ObjectVar.GoPointer())
350 }
351}
352
353// The class structure for the GObject type.
354//
355// |[<!-- language="C" -->
356// // Example of implementing a singleton using a constructor.
357// static MySingleton *the_singleton = NULL;
358//
359// static GObject*
360// my_singleton_constructor (GType type,
361//
362// guint n_construct_params,
363// GObjectConstructParam *construct_params)
364//
365// {
366// GObject *object;
367//
368// if (!the_singleton)
369// {
370// object = G_OBJECT_CLASS (parent_class)->constructor (type,
371// n_construct_params,
372// construct_params);
373// the_singleton = MY_SINGLETON (object);
374// }
375// else
376// object = g_object_ref (G_OBJECT (the_singleton));
377//
378// return object;
379// }
380//
381// ]|
382type ObjectClass struct {
383 _ structs.HostLayout
384
385 GTypeClass uintptr
386
387 ConstructProperties *glib.SList
388
389 xConstructor uintptr
390
391 xSetProperty uintptr
392
393 xGetProperty uintptr
394
395 xDispose uintptr
396
397 xFinalize uintptr
398
399 xDispatchPropertiesChanged uintptr
400
401 xNotify uintptr
402
403 xConstructed uintptr
404
405 Flags uint
406
407 NConstructProperties uint
408
409 Pspecs uintptr
410
411 NPspecs uint
412
413 Pdummy [3]uintptr
414}
415
416func (x *ObjectClass) GoPointer() uintptr {
417 return uintptr(unsafe.Pointer(x))
418}
419
420var xObjectClassFindProperty func(uintptr, string) uintptr
421
422// Looks up the #GParamSpec for a property of a class.
423func (x *ObjectClass) FindProperty(PropertyNameVar string) *ParamSpec {
424 var cls *ParamSpec
425
426 cret := xObjectClassFindProperty(x.GoPointer(), PropertyNameVar)
427
428 if cret == 0 {
429 return nil
430 }
431 IncreaseRef(cret)
432 cls = &ParamSpec{}
433 cls.Ptr = cret
434 return cls
435}
436
437var xObjectClassInstallProperties func(uintptr, uint, uintptr)
438
439// Installs new properties from an array of #GParamSpecs.
440//
441// All properties should be installed during the class initializer. It
442// is possible to install properties after that, but doing so is not
443// recommend, and specifically, is not guaranteed to be thread-safe vs.
444// use of properties on the same type on other threads.
445//
446// The property id of each property is the index of each #GParamSpec in
447// the @pspecs array.
448//
449// The property id of 0 is treated specially by #GObject and it should not
450// be used to store a #GParamSpec.
451//
452// This function should be used if you plan to use a static array of
453// #GParamSpecs and g_object_notify_by_pspec(). For instance, this
454// class initialization:
455//
456// |[<!-- language="C" -->
457//
458// typedef enum {
459// PROP_FOO = 1,
460// PROP_BAR,
461// N_PROPERTIES
462// } MyObjectProperty;
463//
464// static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
465//
466// static void
467// my_object_class_init (MyObjectClass *klass)
468//
469// {
470// GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
471//
472// obj_properties[PROP_FOO] =
473// g_param_spec_int ("foo", NULL, NULL,
474// -1, G_MAXINT,
475// 0,
476// G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
477//
478// obj_properties[PROP_BAR] =
479// g_param_spec_string ("bar", NULL, NULL,
480// NULL,
481// G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
482//
483// gobject_class->set_property = my_object_set_property;
484// gobject_class->get_property = my_object_get_property;
485// g_object_class_install_properties (gobject_class,
486// G_N_ELEMENTS (obj_properties),
487// obj_properties);
488// }
489//
490// ]|
491//
492// allows calling g_object_notify_by_pspec() to notify of property changes:
493//
494// |[<!-- language="C" -->
495// void
496// my_object_set_foo (MyObject *self, gint foo)
497//
498// {
499// if (self->foo != foo)
500// {
501// self->foo = foo;
502// g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_FOO]);
503// }
504// }
505//
506// ]|
507func (x *ObjectClass) InstallProperties(NPspecsVar uint, PspecsVar uintptr) {
508
509 xObjectClassInstallProperties(x.GoPointer(), NPspecsVar, PspecsVar)
510
511}
512
513var xObjectClassInstallProperty func(uintptr, uint, uintptr)
514
515// Installs a new property.
516//
517// All properties should be installed during the class initializer. It
518// is possible to install properties after that, but doing so is not
519// recommend, and specifically, is not guaranteed to be thread-safe vs.
520// use of properties on the same type on other threads.
521//
522// Note that it is possible to redefine a property in a derived class,
523// by installing a property with the same name. This can be useful at times,
524// e.g. to change the range of allowed values or the default value.
525func (x *ObjectClass) InstallProperty(PropertyIdVar uint, PspecVar *ParamSpec) {
526
527 xObjectClassInstallProperty(x.GoPointer(), PropertyIdVar, PspecVar.GoPointer())
528
529}
530
531var xObjectClassListProperties func(uintptr, *uint) uintptr
532
533// Get an array of #GParamSpec* for all properties of a class.
534func (x *ObjectClass) ListProperties(NPropertiesVar *uint) uintptr {
535
536 cret := xObjectClassListProperties(x.GoPointer(), NPropertiesVar)
537 return cret
538}
539
540var xObjectClassOverrideProperty func(uintptr, uint, string)
541
542// Registers @property_id as referring to a property with the name
543// @name in a parent class or in an interface implemented by @oclass.
544// This allows this class to "override" a property implementation in
545// a parent class or to provide the implementation of a property from
546// an interface.
547//
548// Internally, overriding is implemented by creating a property of type
549// #GParamSpecOverride; generally operations that query the properties of
550// the object class, such as g_object_class_find_property() or
551// g_object_class_list_properties() will return the overridden
552// property. However, in one case, the @construct_properties argument of
553// the @constructor virtual function, the #GParamSpecOverride is passed
554// instead, so that the @param_id field of the #GParamSpec will be
555// correct. For virtually all uses, this makes no difference. If you
556// need to get the overridden property, you can call
557// g_param_spec_get_redirect_target().
558func (x *ObjectClass) OverrideProperty(PropertyIdVar uint, NameVar string) {
559
560 xObjectClassOverrideProperty(x.GoPointer(), PropertyIdVar, NameVar)
561
562}
563
564// OverrideConstructor sets the "constructor" callback function.
565// the @constructor function is called by g_object_new () to
566//
567// complete the object initialization after all the construction properties are
568// set. The first thing a @constructor implementation must do is chain up to the
569// @constructor of the parent class. Overriding @constructor should be rarely
570// needed, e.g. to handle construct properties, or to implement singletons.
571func (x *ObjectClass) OverrideConstructor(cb func(types.GType, uint, *ObjectConstructParam) *Object) {
572 if cb == nil {
573 x.xConstructor = 0
574 } else {
575 x.xConstructor = purego.NewCallback(func(TypeVarp types.GType, NConstructPropertiesVarp uint, ConstructPropertiesVarp *ObjectConstructParam) uintptr {
576 ret := cb(TypeVarp, NConstructPropertiesVarp, ConstructPropertiesVarp)
577 if ret == nil {
578 return 0
579 }
580 return ret.GoPointer()
581 })
582 }
583}
584
585// GetConstructor gets the "constructor" callback function.
586// the @constructor function is called by g_object_new () to
587//
588// complete the object initialization after all the construction properties are
589// set. The first thing a @constructor implementation must do is chain up to the
590// @constructor of the parent class. Overriding @constructor should be rarely
591// needed, e.g. to handle construct properties, or to implement singletons.
592func (x *ObjectClass) GetConstructor() func(types.GType, uint, *ObjectConstructParam) *Object {
593 if x.xConstructor == 0 {
594 return nil
595 }
596 var rawCallback func(TypeVarp types.GType, NConstructPropertiesVarp uint, ConstructPropertiesVarp *ObjectConstructParam) uintptr
597 purego.RegisterFunc(&rawCallback, x.xConstructor)
598 return func(TypeVar types.GType, NConstructPropertiesVar uint, ConstructPropertiesVar *ObjectConstructParam) *Object {
599 rawRet := rawCallback(TypeVar, NConstructPropertiesVar, ConstructPropertiesVar)
600 if rawRet == 0 {
601 return nil
602 }
603 ret := &Object{}
604 ret.Ptr = rawRet
605 return ret
606 }
607}
608
609// OverrideSetProperty sets the "set_property" callback function.
610// The type of the @set_property function of #GObjectClass.
611func (x *ObjectClass) OverrideSetProperty(cb func(*Object, uint, *Value, *ParamSpec)) {
612 if cb == nil {
613 x.xSetProperty = 0
614 } else {
615 x.xSetProperty = purego.NewCallback(func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) {
616 cb(ObjectNewFromInternalPtr(ObjectVarp), PropertyIdVarp, ValueVarp, ParamSpecNewFromInternalPtr(PspecVarp))
617 })
618 }
619}
620
621// GetSetProperty gets the "set_property" callback function.
622// The type of the @set_property function of #GObjectClass.
623func (x *ObjectClass) GetSetProperty() func(*Object, uint, *Value, *ParamSpec) {
624 if x.xSetProperty == 0 {
625 return nil
626 }
627 var rawCallback func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr)
628 purego.RegisterFunc(&rawCallback, x.xSetProperty)
629 return func(ObjectVar *Object, PropertyIdVar uint, ValueVar *Value, PspecVar *ParamSpec) {
630 rawCallback(ObjectVar.GoPointer(), PropertyIdVar, ValueVar, PspecVar.GoPointer())
631 }
632}
633
634// OverrideGetProperty sets the "get_property" callback function.
635// The type of the @get_property function of #GObjectClass.
636func (x *ObjectClass) OverrideGetProperty(cb func(*Object, uint, *Value, *ParamSpec)) {
637 if cb == nil {
638 x.xGetProperty = 0
639 } else {
640 x.xGetProperty = purego.NewCallback(func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) {
641 cb(ObjectNewFromInternalPtr(ObjectVarp), PropertyIdVarp, ValueVarp, ParamSpecNewFromInternalPtr(PspecVarp))
642 })
643 }
644}
645
646// GetGetProperty gets the "get_property" callback function.
647// The type of the @get_property function of #GObjectClass.
648func (x *ObjectClass) GetGetProperty() func(*Object, uint, *Value, *ParamSpec) {
649 if x.xGetProperty == 0 {
650 return nil
651 }
652 var rawCallback func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr)
653 purego.RegisterFunc(&rawCallback, x.xGetProperty)
654 return func(ObjectVar *Object, PropertyIdVar uint, ValueVar *Value, PspecVar *ParamSpec) {
655 rawCallback(ObjectVar.GoPointer(), PropertyIdVar, ValueVar, PspecVar.GoPointer())
656 }
657}
658
659// OverrideDispose sets the "dispose" callback function.
660// the @dispose function is supposed to drop all references to other
661//
662// objects, but keep the instance otherwise intact, so that client method
663// invocations still work. It may be run multiple times (due to reference
664// loops). Before returning, @dispose should chain up to the @dispose method
665// of the parent class.
666func (x *ObjectClass) OverrideDispose(cb func(*Object)) {
667 if cb == nil {
668 x.xDispose = 0
669 } else {
670 x.xDispose = purego.NewCallback(func(ObjectVarp uintptr) {
671 cb(ObjectNewFromInternalPtr(ObjectVarp))
672 })
673 }
674}
675
676// GetDispose gets the "dispose" callback function.
677// the @dispose function is supposed to drop all references to other
678//
679// objects, but keep the instance otherwise intact, so that client method
680// invocations still work. It may be run multiple times (due to reference
681// loops). Before returning, @dispose should chain up to the @dispose method
682// of the parent class.
683func (x *ObjectClass) GetDispose() func(*Object) {
684 if x.xDispose == 0 {
685 return nil
686 }
687 var rawCallback func(ObjectVarp uintptr)
688 purego.RegisterFunc(&rawCallback, x.xDispose)
689 return func(ObjectVar *Object) {
690 rawCallback(ObjectVar.GoPointer())
691 }
692}
693
694// OverrideFinalize sets the "finalize" callback function.
695// The type of the @finalize function of #GObjectClass.
696func (x *ObjectClass) OverrideFinalize(cb func(*Object)) {
697 if cb == nil {
698 x.xFinalize = 0
699 } else {
700 x.xFinalize = purego.NewCallback(func(ObjectVarp uintptr) {
701 cb(ObjectNewFromInternalPtr(ObjectVarp))
702 })
703 }
704}
705
706// GetFinalize gets the "finalize" callback function.
707// The type of the @finalize function of #GObjectClass.
708func (x *ObjectClass) GetFinalize() func(*Object) {
709 if x.xFinalize == 0 {
710 return nil
711 }
712 var rawCallback func(ObjectVarp uintptr)
713 purego.RegisterFunc(&rawCallback, x.xFinalize)
714 return func(ObjectVar *Object) {
715 rawCallback(ObjectVar.GoPointer())
716 }
717}
718
719// OverrideDispatchPropertiesChanged sets the "dispatch_properties_changed" callback function.
720// emits property change notification for a bunch
721//
722// of properties. Overriding @dispatch_properties_changed should be rarely
723// needed.
724func (x *ObjectClass) OverrideDispatchPropertiesChanged(cb func(*Object, uint, **ParamSpec)) {
725 if cb == nil {
726 x.xDispatchPropertiesChanged = 0
727 } else {
728 x.xDispatchPropertiesChanged = purego.NewCallback(func(ObjectVarp uintptr, NPspecsVarp uint, PspecsVarp uintptr) {
729 cb(ObjectNewFromInternalPtr(ObjectVarp), NPspecsVarp, (**ParamSpec)(unsafe.Pointer(PspecsVarp)))
730 })
731 }
732}
733
734// GetDispatchPropertiesChanged gets the "dispatch_properties_changed" callback function.
735// emits property change notification for a bunch
736//
737// of properties. Overriding @dispatch_properties_changed should be rarely
738// needed.
739func (x *ObjectClass) GetDispatchPropertiesChanged() func(*Object, uint, **ParamSpec) {
740 if x.xDispatchPropertiesChanged == 0 {
741 return nil
742 }
743 var rawCallback func(ObjectVarp uintptr, NPspecsVarp uint, PspecsVarp uintptr)
744 purego.RegisterFunc(&rawCallback, x.xDispatchPropertiesChanged)
745 return func(ObjectVar *Object, NPspecsVar uint, PspecsVar **ParamSpec) {
746 rawCallback(ObjectVar.GoPointer(), NPspecsVar, *ConvertPtr(PspecsVar))
747 }
748}
749
750// OverrideNotify sets the "notify" callback function.
751// the class closure for the notify signal
752func (x *ObjectClass) OverrideNotify(cb func(*Object, *ParamSpec)) {
753 if cb == nil {
754 x.xNotify = 0
755 } else {
756 x.xNotify = purego.NewCallback(func(ObjectVarp uintptr, PspecVarp uintptr) {
757 cb(ObjectNewFromInternalPtr(ObjectVarp), ParamSpecNewFromInternalPtr(PspecVarp))
758 })
759 }
760}
761
762// GetNotify gets the "notify" callback function.
763// the class closure for the notify signal
764func (x *ObjectClass) GetNotify() func(*Object, *ParamSpec) {
765 if x.xNotify == 0 {
766 return nil
767 }
768 var rawCallback func(ObjectVarp uintptr, PspecVarp uintptr)
769 purego.RegisterFunc(&rawCallback, x.xNotify)
770 return func(ObjectVar *Object, PspecVar *ParamSpec) {
771 rawCallback(ObjectVar.GoPointer(), PspecVar.GoPointer())
772 }
773}
774
775// OverrideConstructed sets the "constructed" callback function.
776// the @constructed function is called by g_object_new() as the
777//
778// final step of the object creation process. At the point of the call, all
779// construction properties have been set on the object. The purpose of this
780// call is to allow for object initialisation steps that can only be performed
781// after construction properties have been set. @constructed implementors
782// should chain up to the @constructed call of their parent class to allow it
783// to complete its initialisation.
784func (x *ObjectClass) OverrideConstructed(cb func(*Object)) {
785 if cb == nil {
786 x.xConstructed = 0
787 } else {
788 x.xConstructed = purego.NewCallback(func(ObjectVarp uintptr) {
789 cb(ObjectNewFromInternalPtr(ObjectVarp))
790 })
791 }
792}
793
794// GetConstructed gets the "constructed" callback function.
795// the @constructed function is called by g_object_new() as the
796//
797// final step of the object creation process. At the point of the call, all
798// construction properties have been set on the object. The purpose of this
799// call is to allow for object initialisation steps that can only be performed
800// after construction properties have been set. @constructed implementors
801// should chain up to the @constructed call of their parent class to allow it
802// to complete its initialisation.
803func (x *ObjectClass) GetConstructed() func(*Object) {
804 if x.xConstructed == 0 {
805 return nil
806 }
807 var rawCallback func(ObjectVarp uintptr)
808 purego.RegisterFunc(&rawCallback, x.xConstructed)
809 return func(ObjectVar *Object) {
810 rawCallback(ObjectVar.GoPointer())
811 }
812}
813
814// The GObjectConstructParam struct is an auxiliary structure used to hand
815// #GParamSpec/#GValue pairs to the @constructor of a #GObjectClass.
816type ObjectConstructParam struct {
817 _ structs.HostLayout
818
819 Pspec *ParamSpec
820
821 Value *Value
822}
823
824func (x *ObjectConstructParam) GoPointer() uintptr {
825 return uintptr(unsafe.Pointer(x))
826}
827
828// A structure containing a weak reference to a #GObject.
829//
830// A `GWeakRef` can either be empty (i.e. point to %NULL), or point to an
831// object for as long as at least one "strong" reference to that object
832// exists. Before the object's #GObjectClass.dispose method is called,
833// every #GWeakRef associated with becomes empty (i.e. points to %NULL).
834//
835// Like #GValue, #GWeakRef can be statically allocated, stack- or
836// heap-allocated, or embedded in larger structures.
837//
838// Unlike g_object_weak_ref() and g_object_add_weak_pointer(), this weak
839// reference is thread-safe: converting a weak pointer to a reference is
840// atomic with respect to invalidation of weak pointers to destroyed
841// objects.
842//
843// If the object's #GObjectClass.dispose method results in additional
844// references to the object being held (‘re-referencing’), any #GWeakRefs taken
845// before it was disposed will continue to point to %NULL. Any #GWeakRefs taken
846// during disposal and after re-referencing, or after disposal has returned due
847// to the re-referencing, will continue to point to the object until its refcount
848// goes back to zero, at which point they too will be invalidated.
849//
850// It is invalid to take a #GWeakRef on an object during #GObjectClass.dispose
851// without first having or creating a strong reference to the object.
852type WeakRef struct {
853 _ structs.HostLayout
854}
855
856func (x *WeakRef) GoPointer() uintptr {
857 return uintptr(unsafe.Pointer(x))
858}
859
860var xWeakRefClear func(uintptr)
861
862// Frees resources associated with a non-statically-allocated #GWeakRef.
863// After this call, the #GWeakRef is left in an undefined state.
864//
865// You should only call this on a #GWeakRef that previously had
866// g_weak_ref_init() called on it.
867func (x *WeakRef) Clear() {
868
869 xWeakRefClear(x.GoPointer())
870
871}
872
873var xWeakRefGet func(uintptr) uintptr
874
875// If @weak_ref is not empty, atomically acquire a strong
876// reference to the object it points to, and return that reference.
877//
878// This function is needed because of the potential race between taking
879// the pointer value and g_object_ref() on it, if the object was losing
880// its last reference at the same time in a different thread.
881//
882// The caller should release the resulting reference in the usual way,
883// by using g_object_unref().
884func (x *WeakRef) Get() *Object {
885 var cls *Object
886
887 cret := xWeakRefGet(x.GoPointer())
888
889 if cret == 0 {
890 return nil
891 }
892 cls = &Object{}
893 cls.Ptr = cret
894 return cls
895}
896
897var xWeakRefInit func(uintptr, uintptr)
898
899// Initialise a non-statically-allocated #GWeakRef.
900//
901// This function also calls g_weak_ref_set() with @object on the
902// freshly-initialised weak reference.
903//
904// This function should always be matched with a call to
905// g_weak_ref_clear(). It is not necessary to use this function for a
906// #GWeakRef in static storage because it will already be
907// properly initialised. Just use g_weak_ref_set() directly.
908func (x *WeakRef) Init(ObjectVar *Object) {
909
910 xWeakRefInit(x.GoPointer(), ObjectVar.GoPointer())
911
912}
913
914var xWeakRefSet func(uintptr, uintptr)
915
916// Change the object to which @weak_ref points, or set it to
917// %NULL.
918//
919// You must own a strong reference on @object while calling this
920// function.
921func (x *WeakRef) Set(ObjectVar *Object) {
922
923 xWeakRefSet(x.GoPointer(), ObjectVar.GoPointer())
924
925}
926
927var xCclosureNewObject func(uintptr, uintptr) *Closure
928
929// A variant of g_cclosure_new() which uses @object as @user_data and
930// calls g_object_watch_closure() on @object and the created
931// closure. This function is useful when you have a callback closely
932// associated with a #GObject, and want the callback to no longer run
933// after the object is is freed.
934func CclosureNewObject(CallbackFuncVar *Callback, ObjectVar *Object) *Closure {
935
936 var CallbackFuncVarRef uintptr
937 if CallbackFuncVar != nil {
938 CallbackFuncVarPtr := uintptr(unsafe.Pointer(CallbackFuncVar))
939 if cbRefPtr, ok := glib.GetCallback(CallbackFuncVarPtr); ok {
940 CallbackFuncVarRef = cbRefPtr
941 } else {
942 fcb := func() {
943 cbFn := *CallbackFuncVar
944 cbFn()
945 }
946 CallbackFuncVarRef = purego.NewCallback(fcb)
947 glib.SaveCallbackWithClosure(CallbackFuncVarPtr, CallbackFuncVarRef, CallbackFuncVar)
948 }
949 }
950
951 cret := xCclosureNewObject(CallbackFuncVarRef, ObjectVar.GoPointer())
952 return cret
953}
954
955var xCclosureNewObjectSwap func(uintptr, uintptr) *Closure
956
957// A variant of g_cclosure_new_swap() which uses @object as @user_data
958// and calls g_object_watch_closure() on @object and the created
959// closure. This function is useful when you have a callback closely
960// associated with a #GObject, and want the callback to no longer run
961// after the object is is freed.
962func CclosureNewObjectSwap(CallbackFuncVar *Callback, ObjectVar *Object) *Closure {
963
964 var CallbackFuncVarRef uintptr
965 if CallbackFuncVar != nil {
966 CallbackFuncVarPtr := uintptr(unsafe.Pointer(CallbackFuncVar))
967 if cbRefPtr, ok := glib.GetCallback(CallbackFuncVarPtr); ok {
968 CallbackFuncVarRef = cbRefPtr
969 } else {
970 fcb := func() {
971 cbFn := *CallbackFuncVar
972 cbFn()
973 }
974 CallbackFuncVarRef = purego.NewCallback(fcb)
975 glib.SaveCallbackWithClosure(CallbackFuncVarPtr, CallbackFuncVarRef, CallbackFuncVar)
976 }
977 }
978
979 cret := xCclosureNewObjectSwap(CallbackFuncVarRef, ObjectVar.GoPointer())
980 return cret
981}
982
983var xClearObject func(uintptr)
984
985// Clears a reference to a #GObject.
986//
987// @object_ptr must not be %NULL.
988//
989// If the reference is %NULL then this function does nothing.
990// Otherwise, the reference count of the object is decreased and the
991// pointer is set to %NULL.
992//
993// A macro is also included that allows this function to be used without
994// pointer casts.
995func ClearObject(ObjectPtrVar **Object) {
996
997 xClearObject(*ConvertPtr(ObjectPtrVar))
998
999}
1000
1001var xSignalConnectObject func(*TypeInstance, string, uintptr, uintptr, ConnectFlags) uint
1002
1003// This is similar to g_signal_connect_data(), but uses a closure which
1004// ensures that the @gobject stays alive during the call to @c_handler
1005// by temporarily adding a reference count to @gobject.
1006//
1007// When the @gobject is destroyed the signal handler will be automatically
1008// disconnected. Note that this is not currently threadsafe (ie:
1009// emitting a signal while @gobject is being destroyed in another thread
1010// is not safe).
1011//
1012// This function cannot fail. If the given signal name doesn’t exist,
1013// a critical warning is emitted. No validation is performed on the
1014// "detail" string when specified in @detailed_signal, other than a
1015// non-empty check.
1016//
1017// Refer to the [signals documentation](signals.html) for more
1018// details.
1019func SignalConnectObject(InstanceVar *TypeInstance, DetailedSignalVar string, CHandlerVar *Callback, GobjectVar *Object, ConnectFlagsVar ConnectFlags) uint {
1020
1021 var CHandlerVarRef uintptr
1022 if CHandlerVar != nil {
1023 CHandlerVarPtr := uintptr(unsafe.Pointer(CHandlerVar))
1024 if cbRefPtr, ok := glib.GetCallback(CHandlerVarPtr); ok {
1025 CHandlerVarRef = cbRefPtr
1026 } else {
1027 fcb := func() {
1028 cbFn := *CHandlerVar
1029 cbFn()
1030 }
1031 CHandlerVarRef = purego.NewCallback(fcb)
1032 glib.SaveCallbackWithClosure(CHandlerVarPtr, CHandlerVarRef, CHandlerVar)
1033 }
1034 }
1035
1036 cret := xSignalConnectObject(InstanceVar, DetailedSignalVar, CHandlerVarRef, GobjectVar.GoPointer(), ConnectFlagsVar)
1037 return cret
1038}
1039
1040// A type for objects that have an initially floating reference.
1041//
1042// All the fields in the `GInitiallyUnowned` structure are private to the
1043// implementation and should never be accessed directly.
1044type InitiallyUnowned struct {
1045 Object
1046}
1047
1048var xInitiallyUnownedGLibType func() types.GType
1049
1050func InitiallyUnownedGLibType() types.GType {
1051 return xInitiallyUnownedGLibType()
1052}
1053
1054func InitiallyUnownedNewFromInternalPtr(ptr uintptr) *InitiallyUnowned {
1055 cls := &InitiallyUnowned{}
1056 cls.Ptr = ptr
1057 return cls
1058}
1059
1060func (c *InitiallyUnowned) GoPointer() uintptr {
1061 if c == nil {
1062 return 0
1063 }
1064 return c.Ptr
1065}
1066
1067func (c *InitiallyUnowned) SetGoPointer(ptr uintptr) {
1068 c.Ptr = ptr
1069}
1070
1071// The base object type.
1072//
1073// `GObject` is the fundamental type providing the common attributes and
1074// methods for all object types in GTK, Pango and other libraries
1075// based on GObject. The `GObject` class provides methods for object
1076// construction and destruction, property access methods, and signal
1077// support. Signals are described in detail [here][gobject-Signals].
1078//
1079// For a tutorial on implementing a new `GObject` class, see [How to define and
1080// implement a new GObject](tutorial.html#how-to-define-and-implement-a-new-gobject).
1081// For a list of naming conventions for GObjects and their methods, see the
1082// [GType conventions](concepts.html#conventions). For the high-level concepts
1083// behind GObject, read
1084// [Instantiatable classed types: Objects](concepts.html#instantiatable-classed-types-objects).
1085//
1086// Since GLib 2.72, all `GObject`s are guaranteed to be aligned to at least the
1087// alignment of the largest basic GLib type (typically this is `guint64` or
1088// `gdouble`). If you need larger alignment for an element in a `GObject`, you
1089// should allocate it on the heap (aligned), or arrange for your `GObject` to be
1090// appropriately padded. This guarantee applies to the `GObject` (or derived)
1091// struct, the `GObjectClass` (or derived) struct, and any private data allocated
1092// by `G_ADD_PRIVATE()`.
1093type Object struct {
1094 Ptr uintptr
1095}
1096
1097var xObjectGLibType func() types.GType
1098
1099func ObjectGLibType() types.GType {
1100 return xObjectGLibType()
1101}
1102
1103func ObjectNewFromInternalPtr(ptr uintptr) *Object {
1104 cls := &Object{}
1105 cls.Ptr = ptr
1106 return cls
1107}
1108
1109var xNewObject func(types.GType, string, ...interface{}) uintptr
1110
1111// Creates a new instance of a #GObject subtype and sets its properties.
1112//
1113// Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY)
1114// which are not explicitly specified are set to their default values. Any
1115// private data for the object is guaranteed to be initialized with zeros, as
1116// per g_type_create_instance().
1117//
1118// Note that in C, small integer types in variable argument lists are promoted
1119// up to `gint` or `guint` as appropriate, and read back accordingly. `gint` is
1120// 32 bits on every platform on which GLib is currently supported. This means that
1121// you can use C expressions of type `gint` with g_object_new() and properties of
1122// type `gint` or `guint` or smaller. Specifically, you can use integer literals
1123// with these property types.
1124//
1125// When using property types of `gint64` or `guint64`, you must ensure that the
1126// value that you provide is 64 bit. This means that you should use a cast or
1127// make use of the %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros.
1128//
1129// Similarly, `gfloat` is promoted to `gdouble`, so you must ensure that the value
1130// you provide is a `gdouble`, even for a property of type `gfloat`.
1131//
1132// Since GLib 2.72, all #GObjects are guaranteed to be aligned to at least the
1133// alignment of the largest basic GLib type (typically this is `guint64` or
1134// `gdouble`). If you need larger alignment for an element in a #GObject, you
1135// should allocate it on the heap (aligned), or arrange for your #GObject to be
1136// appropriately padded.
1137func NewObject(ObjectTypeVar types.GType, FirstPropertyNameVar string, varArgs ...interface{}) *Object {
1138 var cls *Object
1139
1140 cret := xNewObject(ObjectTypeVar, FirstPropertyNameVar, varArgs...)
1141
1142 if cret == 0 {
1143 return nil
1144 }
1145 cls = &Object{}
1146 cls.Ptr = cret
1147 return cls
1148}
1149
1150var xNewObjectValist func(types.GType, string, []interface{}) uintptr
1151
1152// Creates a new instance of a #GObject subtype and sets its properties.
1153//
1154// Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY)
1155// which are not explicitly specified are set to their default values.
1156func NewObjectValist(ObjectTypeVar types.GType, FirstPropertyNameVar string, VarArgsVar []interface{}) *Object {
1157 var cls *Object
1158
1159 cret := xNewObjectValist(ObjectTypeVar, FirstPropertyNameVar, VarArgsVar)
1160
1161 if cret == 0 {
1162 return nil
1163 }
1164 cls = &Object{}
1165 cls.Ptr = cret
1166 return cls
1167}
1168
1169var xNewObjectWithProperties func(types.GType, uint, []string, []Value) uintptr
1170
1171// Creates a new instance of a #GObject subtype and sets its properties using
1172// the provided arrays. Both arrays must have exactly @n_properties elements,
1173// and the names and values correspond by index.
1174//
1175// Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY)
1176// which are not explicitly specified are set to their default values.
1177func NewObjectWithProperties(ObjectTypeVar types.GType, NPropertiesVar uint, NamesVar []string, ValuesVar []Value) *Object {
1178 var cls *Object
1179
1180 cret := xNewObjectWithProperties(ObjectTypeVar, NPropertiesVar, NamesVar, ValuesVar)
1181
1182 if cret == 0 {
1183 return nil
1184 }
1185 cls = &Object{}
1186 cls.Ptr = cret
1187 return cls
1188}
1189
1190var xNewObjectv func(types.GType, uint, []Parameter) uintptr
1191
1192// Creates a new instance of a #GObject subtype and sets its properties.
1193//
1194// Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY)
1195// which are not explicitly specified are set to their default values.
1196func NewObjectv(ObjectTypeVar types.GType, NParametersVar uint, ParametersVar []Parameter) *Object {
1197 var cls *Object
1198
1199 cret := xNewObjectv(ObjectTypeVar, NParametersVar, ParametersVar)
1200
1201 if cret == 0 {
1202 return nil
1203 }
1204 cls = &Object{}
1205 cls.Ptr = cret
1206 return cls
1207}
1208
1209var xObjectAddToggleRef func(uintptr, uintptr, uintptr)
1210
1211// Increases the reference count of the object by one and sets a
1212// callback to be called when all other references to the object are
1213// dropped, or when this is already the last reference to the object
1214// and another reference is established.
1215//
1216// This functionality is intended for binding @object to a proxy
1217// object managed by another memory manager. This is done with two
1218// paired references: the strong reference added by
1219// g_object_add_toggle_ref() and a reverse reference to the proxy
1220// object which is either a strong reference or weak reference.
1221//
1222// The setup is that when there are no other references to @object,
1223// only a weak reference is held in the reverse direction from @object
1224// to the proxy object, but when there are other references held to
1225// @object, a strong reference is held. The @notify callback is called
1226// when the reference from @object to the proxy object should be
1227// "toggled" from strong to weak (@is_last_ref true) or weak to strong
1228// (@is_last_ref false).
1229//
1230// Since a (normal) reference must be held to the object before
1231// calling g_object_add_toggle_ref(), the initial state of the reverse
1232// link is always strong.
1233//
1234// Multiple toggle references may be added to the same gobject,
1235// however if there are multiple toggle references to an object, none
1236// of them will ever be notified until all but one are removed. For
1237// this reason, you should only ever use a toggle reference if there
1238// is important state in the proxy object.
1239//
1240// Note that if you unref the object on another thread, then @notify might
1241// still be invoked after g_object_remove_toggle_ref(), and the object argument
1242// might be a dangling pointer. If the object is destroyed on other threads,
1243// you must take care of that yourself.
1244//
1245// A g_object_add_toggle_ref() must be released with g_object_remove_toggle_ref().
1246func (x *Object) AddToggleRef(NotifyVar *ToggleNotify, DataVar uintptr) {
1247
1248 var NotifyVarRef uintptr
1249 if NotifyVar != nil {
1250 NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar))
1251 if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok {
1252 NotifyVarRef = cbRefPtr
1253 } else {
1254 fcb := func(arg0 uintptr, arg1 uintptr, arg2 bool) {
1255 cbFn := *NotifyVar
1256 cbFn(arg0, arg1, arg2)
1257 }
1258 NotifyVarRef = purego.NewCallback(fcb)
1259 glib.SaveCallbackWithClosure(NotifyVarPtr, NotifyVarRef, NotifyVar)
1260 }
1261 }
1262
1263 xObjectAddToggleRef(x.GoPointer(), NotifyVarRef, DataVar)
1264
1265}
1266
1267var xObjectAddWeakPointer func(uintptr, uintptr)
1268
1269// Adds a weak reference from weak_pointer to @object to indicate that
1270// the pointer located at @weak_pointer_location is only valid during
1271// the lifetime of @object. When the @object is finalized,
1272// @weak_pointer will be set to %NULL.
1273//
1274// Note that as with g_object_weak_ref(), the weak references created by
1275// this method are not thread-safe: they cannot safely be used in one
1276// thread if the object's last g_object_unref() might happen in another
1277// thread. Use #GWeakRef if thread-safety is required.
1278func (x *Object) AddWeakPointer(WeakPointerLocationVar uintptr) {
1279
1280 xObjectAddWeakPointer(x.GoPointer(), WeakPointerLocationVar)
1281
1282}
1283
1284var xObjectBindProperty func(uintptr, string, uintptr, string, BindingFlags) uintptr
1285
1286// Creates a binding between @source_property on @source and @target_property
1287// on @target.
1288//
1289// Whenever the @source_property is changed the @target_property is
1290// updated using the same value. For instance:
1291//
1292// |[<!-- language="C" -->
1293//
1294// g_object_bind_property (action, "active", widget, "sensitive", 0);
1295//
1296// ]|
1297//
1298// Will result in the "sensitive" property of the widget #GObject instance to be
1299// updated with the same value of the "active" property of the action #GObject
1300// instance.
1301//
1302// If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1303// if @target_property on @target changes then the @source_property on @source
1304// will be updated as well.
1305//
1306// The binding will automatically be removed when either the @source or the
1307// @target instances are finalized. To remove the binding without affecting the
1308// @source and the @target you can just call g_object_unref() on the returned
1309// #GBinding instance.
1310//
1311// Removing the binding by calling g_object_unref() on it must only be done if
1312// the binding, @source and @target are only used from a single thread and it
1313// is clear that both @source and @target outlive the binding. Especially it
1314// is not safe to rely on this if the binding, @source or @target can be
1315// finalized from different threads. Keep another reference to the binding and
1316// use g_binding_unbind() instead to be on the safe side.
1317//
1318// A #GObject can have multiple bindings.
1319func (x *Object) BindProperty(SourcePropertyVar string, TargetVar *Object, TargetPropertyVar string, FlagsVar BindingFlags) *Binding {
1320 var cls *Binding
1321
1322 cret := xObjectBindProperty(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar)
1323
1324 if cret == 0 {
1325 return nil
1326 }
1327 IncreaseRef(cret)
1328 cls = &Binding{}
1329 cls.Ptr = cret
1330 return cls
1331}
1332
1333var xObjectBindPropertyFull func(uintptr, string, uintptr, string, BindingFlags, uintptr, uintptr, uintptr, uintptr) uintptr
1334
1335// Complete version of g_object_bind_property().
1336//
1337// Creates a binding between @source_property on @source and @target_property
1338// on @target, allowing you to set the transformation functions to be used by
1339// the binding.
1340//
1341// If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1342// if @target_property on @target changes then the @source_property on @source
1343// will be updated as well. The @transform_from function is only used in case
1344// of bidirectional bindings, otherwise it will be ignored
1345//
1346// The binding will automatically be removed when either the @source or the
1347// @target instances are finalized. This will release the reference that is
1348// being held on the #GBinding instance; if you want to hold on to the
1349// #GBinding instance, you will need to hold a reference to it.
1350//
1351// To remove the binding, call g_binding_unbind().
1352//
1353// A #GObject can have multiple bindings.
1354//
1355// The same @user_data parameter will be used for both @transform_to
1356// and @transform_from transformation functions; the @notify function will
1357// be called once, when the binding is removed. If you need different data
1358// for each transformation function, please use
1359// g_object_bind_property_with_closures() instead.
1360func (x *Object) BindPropertyFull(SourcePropertyVar string, TargetVar *Object, TargetPropertyVar string, FlagsVar BindingFlags, TransformToVar *BindingTransformFunc, TransformFromVar *BindingTransformFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) *Binding {
1361 var cls *Binding
1362
1363 var TransformToVarRef uintptr
1364 if TransformToVar != nil {
1365 TransformToVarPtr := uintptr(unsafe.Pointer(TransformToVar))
1366 if cbRefPtr, ok := glib.GetCallback(TransformToVarPtr); ok {
1367 TransformToVarRef = cbRefPtr
1368 } else {
1369 fcb := func(arg0 uintptr, arg1 *Value, arg2 *Value, arg3 uintptr) bool {
1370 cbFn := *TransformToVar
1371 return cbFn(arg0, arg1, arg2, arg3)
1372 }
1373 TransformToVarRef = purego.NewCallback(fcb)
1374 glib.SaveCallbackWithClosure(TransformToVarPtr, TransformToVarRef, TransformToVar)
1375 }
1376 }
1377
1378 var TransformFromVarRef uintptr
1379 if TransformFromVar != nil {
1380 TransformFromVarPtr := uintptr(unsafe.Pointer(TransformFromVar))
1381 if cbRefPtr, ok := glib.GetCallback(TransformFromVarPtr); ok {
1382 TransformFromVarRef = cbRefPtr
1383 } else {
1384 fcb := func(arg0 uintptr, arg1 *Value, arg2 *Value, arg3 uintptr) bool {
1385 cbFn := *TransformFromVar
1386 return cbFn(arg0, arg1, arg2, arg3)
1387 }
1388 TransformFromVarRef = purego.NewCallback(fcb)
1389 glib.SaveCallbackWithClosure(TransformFromVarPtr, TransformFromVarRef, TransformFromVar)
1390 }
1391 }
1392
1393 var NotifyVarRef uintptr
1394 if NotifyVar != nil {
1395 NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar))
1396 if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok {
1397 NotifyVarRef = cbRefPtr
1398 } else {
1399 fcb := func(arg0 uintptr) {
1400 cbFn := *NotifyVar
1401 cbFn(arg0)
1402 }
1403 NotifyVarRef = purego.NewCallback(fcb)
1404 glib.SaveCallbackWithClosure(NotifyVarPtr, NotifyVarRef, NotifyVar)
1405 }
1406 }
1407
1408 cret := xObjectBindPropertyFull(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar, TransformToVarRef, TransformFromVarRef, UserDataVar, NotifyVarRef)
1409
1410 if cret == 0 {
1411 return nil
1412 }
1413 IncreaseRef(cret)
1414 cls = &Binding{}
1415 cls.Ptr = cret
1416 return cls
1417}
1418
1419var xObjectBindPropertyWithClosures func(uintptr, string, uintptr, string, BindingFlags, *Closure, *Closure) uintptr
1420
1421// Creates a binding between @source_property on @source and @target_property
1422// on @target, allowing you to set the transformation functions to be used by
1423// the binding.
1424//
1425// This function is the language bindings friendly version of
1426// g_object_bind_property_full(), using #GClosures instead of
1427// function pointers.
1428func (x *Object) BindPropertyWithClosures(SourcePropertyVar string, TargetVar *Object, TargetPropertyVar string, FlagsVar BindingFlags, TransformToVar *Closure, TransformFromVar *Closure) *Binding {
1429 var cls *Binding
1430
1431 cret := xObjectBindPropertyWithClosures(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar, TransformToVar, TransformFromVar)
1432
1433 if cret == 0 {
1434 return nil
1435 }
1436 IncreaseRef(cret)
1437 cls = &Binding{}
1438 cls.Ptr = cret
1439 return cls
1440}
1441
1442var xObjectConnect func(uintptr, string, ...interface{}) uintptr
1443
1444// A convenience function to connect multiple signals at once.
1445//
1446// The signal specs expected by this function have the form
1447// `modifier::signal_name`, where `modifier` can be one of the
1448// following:
1449//
1450// - `signal`: equivalent to `g_signal_connect_data (..., NULL, G_CONNECT_DEFAULT)`
1451// - `object-signal`, `object_signal`: equivalent to `g_signal_connect_object (..., G_CONNECT_DEFAULT)`
1452// - `swapped-signal`, `swapped_signal`: equivalent to `g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)`
1453// - `swapped_object_signal`, `swapped-object-signal`: equivalent to `g_signal_connect_object (..., G_CONNECT_SWAPPED)`
1454// - `signal_after`, `signal-after`: equivalent to `g_signal_connect_data (..., NULL, G_CONNECT_AFTER)`
1455// - `object_signal_after`, `object-signal-after`: equivalent to `g_signal_connect_object (..., G_CONNECT_AFTER)`
1456// - `swapped_signal_after`, `swapped-signal-after`: equivalent to `g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)`
1457// - `swapped_object_signal_after`, `swapped-object-signal-after`: equivalent to `g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)`
1458//
1459// ```c
1460// menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
1461//
1462// "type", GTK_WINDOW_POPUP,
1463// "child", menu,
1464// NULL),
1465// "signal::event", gtk_menu_window_event, menu,
1466// "signal::size_request", gtk_menu_window_size_request, menu,
1467// "signal::destroy", gtk_widget_destroyed, &menu->toplevel,
1468// NULL);
1469//
1470// ```
1471func (x *Object) Connect(SignalSpecVar string, varArgs ...interface{}) *Object {
1472 var cls *Object
1473
1474 cret := xObjectConnect(x.GoPointer(), SignalSpecVar, varArgs...)
1475
1476 if cret == 0 {
1477 return nil
1478 }
1479 IncreaseRef(cret)
1480 cls = &Object{}
1481 cls.Ptr = cret
1482 return cls
1483}
1484
1485var xObjectDisconnect func(uintptr, string, ...interface{})
1486
1487// A convenience function to disconnect multiple signals at once.
1488//
1489// The signal specs expected by this function have the form
1490// "any_signal", which means to disconnect any signal with matching
1491// callback and data, or "any_signal::signal_name", which only
1492// disconnects the signal named "signal_name".
1493func (x *Object) Disconnect(SignalSpecVar string, varArgs ...interface{}) {
1494
1495 xObjectDisconnect(x.GoPointer(), SignalSpecVar, varArgs...)
1496
1497}
1498
1499var xObjectDupData func(uintptr, string, uintptr, uintptr) uintptr
1500
1501// This is a variant of g_object_get_data() which returns
1502// a 'duplicate' of the value. @dup_func defines the
1503// meaning of 'duplicate' in this context, it could e.g.
1504// take a reference on a ref-counted object.
1505//
1506// If the @key is not set on the object then @dup_func
1507// will be called with a %NULL argument.
1508//
1509// Note that @dup_func is called while user data of @object
1510// is locked.
1511//
1512// This function can be useful to avoid races when multiple
1513// threads are using object data on the same key on the same
1514// object.
1515func (x *Object) DupData(KeyVar string, DupFuncVar *glib.DuplicateFunc, UserDataVar uintptr) uintptr {
1516
1517 var DupFuncVarRef uintptr
1518 if DupFuncVar != nil {
1519 DupFuncVarPtr := uintptr(unsafe.Pointer(DupFuncVar))
1520 if cbRefPtr, ok := glib.GetCallback(DupFuncVarPtr); ok {
1521 DupFuncVarRef = cbRefPtr
1522 } else {
1523 fcb := func(arg0 uintptr, arg1 uintptr) uintptr {
1524 cbFn := *DupFuncVar
1525 return cbFn(arg0, arg1)
1526 }
1527 DupFuncVarRef = purego.NewCallback(fcb)
1528 glib.SaveCallbackWithClosure(DupFuncVarPtr, DupFuncVarRef, DupFuncVar)
1529 }
1530 }
1531
1532 cret := xObjectDupData(x.GoPointer(), KeyVar, DupFuncVarRef, UserDataVar)
1533 return cret
1534}
1535
1536var xObjectDupQdata func(uintptr, glib.Quark, uintptr, uintptr) uintptr
1537
1538// This is a variant of g_object_get_qdata() which returns
1539// a 'duplicate' of the value. @dup_func defines the
1540// meaning of 'duplicate' in this context, it could e.g.
1541// take a reference on a ref-counted object.
1542//
1543// If the @quark is not set on the object then @dup_func
1544// will be called with a %NULL argument.
1545//
1546// Note that @dup_func is called while user data of @object
1547// is locked.
1548//
1549// This function can be useful to avoid races when multiple
1550// threads are using object data on the same key on the same
1551// object.
1552func (x *Object) DupQdata(QuarkVar glib.Quark, DupFuncVar *glib.DuplicateFunc, UserDataVar uintptr) uintptr {
1553
1554 var DupFuncVarRef uintptr
1555 if DupFuncVar != nil {
1556 DupFuncVarPtr := uintptr(unsafe.Pointer(DupFuncVar))
1557 if cbRefPtr, ok := glib.GetCallback(DupFuncVarPtr); ok {
1558 DupFuncVarRef = cbRefPtr
1559 } else {
1560 fcb := func(arg0 uintptr, arg1 uintptr) uintptr {
1561 cbFn := *DupFuncVar
1562 return cbFn(arg0, arg1)
1563 }
1564 DupFuncVarRef = purego.NewCallback(fcb)
1565 glib.SaveCallbackWithClosure(DupFuncVarPtr, DupFuncVarRef, DupFuncVar)
1566 }
1567 }
1568
1569 cret := xObjectDupQdata(x.GoPointer(), QuarkVar, DupFuncVarRef, UserDataVar)
1570 return cret
1571}
1572
1573var xObjectForceFloating func(uintptr)
1574
1575// This function is intended for #GObject implementations to re-enforce
1576// a [floating][floating-ref] object reference. Doing this is seldom
1577// required: all #GInitiallyUnowneds are created with a floating reference
1578// which usually just needs to be sunken by calling g_object_ref_sink().
1579func (x *Object) ForceFloating() {
1580
1581 xObjectForceFloating(x.GoPointer())
1582
1583}
1584
1585var xObjectFreezeNotify func(uintptr)
1586
1587// Increases the freeze count on @object. If the freeze count is
1588// non-zero, the emission of "notify" signals on @object is
1589// stopped. The signals are queued until the freeze count is decreased
1590// to zero. Duplicate notifications are squashed so that at most one
1591// #GObject::notify signal is emitted for each property modified while the
1592// object is frozen.
1593//
1594// This is necessary for accessors that modify multiple properties to prevent
1595// premature notification while the object is still being modified.
1596func (x *Object) FreezeNotify() {
1597
1598 xObjectFreezeNotify(x.GoPointer())
1599
1600}
1601
1602var xObjectGet func(uintptr, string, ...interface{})
1603
1604// Gets properties of an object.
1605//
1606// In general, a copy is made of the property contents and the caller
1607// is responsible for freeing the memory in the appropriate manner for
1608// the type, for instance by calling g_free() or g_object_unref().
1609//
1610// Here is an example of using g_object_get() to get the contents
1611// of three properties: an integer, a string and an object:
1612// |[<!-- language="C" -->
1613//
1614// gint intval;
1615// guint64 uint64val;
1616// gchar *strval;
1617// GObject *objval;
1618//
1619// g_object_get (my_object,
1620// "int-property", &intval,
1621// "uint64-property", &uint64val,
1622// "str-property", &strval,
1623// "obj-property", &objval,
1624// NULL);
1625//
1626// // Do something with intval, uint64val, strval, objval
1627//
1628// g_free (strval);
1629// g_object_unref (objval);
1630//
1631// ]|
1632func (x *Object) Get(FirstPropertyNameVar string, varArgs ...interface{}) {
1633
1634 xObjectGet(x.GoPointer(), FirstPropertyNameVar, varArgs...)
1635
1636}
1637
1638var xObjectGetData func(uintptr, string) uintptr
1639
1640// Gets a named field from the objects table of associations (see g_object_set_data()).
1641func (x *Object) GetData(KeyVar string) uintptr {
1642
1643 cret := xObjectGetData(x.GoPointer(), KeyVar)
1644 return cret
1645}
1646
1647var xObjectGetProperty func(uintptr, string, *Value)
1648
1649// Gets a property of an object.
1650//
1651// The @value can be:
1652//
1653// - an empty #GValue initialized by %G_VALUE_INIT, which will be
1654// automatically initialized with the expected type of the property
1655// (since GLib 2.60)
1656// - a #GValue initialized with the expected type of the property
1657// - a #GValue initialized with a type to which the expected type
1658// of the property can be transformed
1659//
1660// In general, a copy is made of the property contents and the caller is
1661// responsible for freeing the memory by calling g_value_unset().
1662//
1663// Note that g_object_get_property() is really intended for language
1664// bindings, g_object_get() is much more convenient for C programming.
1665func (x *Object) GetProperty(PropertyNameVar string, ValueVar *Value) {
1666
1667 xObjectGetProperty(x.GoPointer(), PropertyNameVar, ValueVar)
1668
1669}
1670
1671var xObjectGetQdata func(uintptr, glib.Quark) uintptr
1672
1673// This function gets back user data pointers stored via
1674// g_object_set_qdata().
1675func (x *Object) GetQdata(QuarkVar glib.Quark) uintptr {
1676
1677 cret := xObjectGetQdata(x.GoPointer(), QuarkVar)
1678 return cret
1679}
1680
1681var xObjectGetValist func(uintptr, string, []interface{})
1682
1683// Gets properties of an object.
1684//
1685// In general, a copy is made of the property contents and the caller
1686// is responsible for freeing the memory in the appropriate manner for
1687// the type, for instance by calling g_free() or g_object_unref().
1688//
1689// See g_object_get().
1690func (x *Object) GetValist(FirstPropertyNameVar string, VarArgsVar []interface{}) {
1691
1692 xObjectGetValist(x.GoPointer(), FirstPropertyNameVar, VarArgsVar)
1693
1694}
1695
1696var xObjectGetv func(uintptr, uint, []string, []Value)
1697
1698// Gets @n_properties properties for an @object.
1699// Obtained properties will be set to @values. All properties must be valid.
1700// Warnings will be emitted and undefined behaviour may result if invalid
1701// properties are passed in.
1702func (x *Object) Getv(NPropertiesVar uint, NamesVar []string, ValuesVar []Value) {
1703
1704 xObjectGetv(x.GoPointer(), NPropertiesVar, NamesVar, ValuesVar)
1705
1706}
1707
1708var xObjectIsFloating func(uintptr) bool
1709
1710// Checks whether @object has a [floating][floating-ref] reference.
1711func (x *Object) IsFloating() bool {
1712
1713 cret := xObjectIsFloating(x.GoPointer())
1714 return cret
1715}
1716
1717var xObjectNotify func(uintptr, string)
1718
1719// Emits a "notify" signal for the property @property_name on @object.
1720//
1721// When possible, eg. when signaling a property change from within the class
1722// that registered the property, you should use g_object_notify_by_pspec()
1723// instead.
1724//
1725// Note that emission of the notify signal may be blocked with
1726// g_object_freeze_notify(). In this case, the signal emissions are queued
1727// and will be emitted (in reverse order) when g_object_thaw_notify() is
1728// called.
1729func (x *Object) Notify(PropertyNameVar string) {
1730
1731 xObjectNotify(x.GoPointer(), PropertyNameVar)
1732
1733}
1734
1735var xObjectNotifyByPspec func(uintptr, uintptr)
1736
1737// Emits a "notify" signal for the property specified by @pspec on @object.
1738//
1739// This function omits the property name lookup, hence it is faster than
1740// g_object_notify().
1741//
1742// One way to avoid using g_object_notify() from within the
1743// class that registered the properties, and using g_object_notify_by_pspec()
1744// instead, is to store the GParamSpec used with
1745// g_object_class_install_property() inside a static array, e.g.:
1746//
1747// |[<!-- language="C" -->
1748//
1749// typedef enum
1750// {
1751// PROP_FOO = 1,
1752// PROP_LAST
1753// } MyObjectProperty;
1754//
1755// static GParamSpec *properties[PROP_LAST];
1756//
1757// static void
1758// my_object_class_init (MyObjectClass *klass)
1759// {
1760// properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
1761// 0, 100,
1762// 50,
1763// G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
1764// g_object_class_install_property (gobject_class,
1765// PROP_FOO,
1766// properties[PROP_FOO]);
1767// }
1768//
1769// ]|
1770//
1771// and then notify a change on the "foo" property with:
1772//
1773// |[<!-- language="C" -->
1774//
1775// g_object_notify_by_pspec (self, properties[PROP_FOO]);
1776//
1777// ]|
1778func (x *Object) NotifyByPspec(PspecVar *ParamSpec) {
1779
1780 xObjectNotifyByPspec(x.GoPointer(), PspecVar.GoPointer())
1781
1782}
1783
1784var xObjectRef func(uintptr) uintptr
1785
1786// Increases the reference count of @object.
1787//
1788// Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
1789// of @object will be propagated to the return type (using the GCC typeof()
1790// extension), so any casting the caller needs to do on the return type must be
1791// explicit.
1792func (x *Object) Ref() *Object {
1793 var cls *Object
1794
1795 cret := xObjectRef(x.GoPointer())
1796
1797 if cret == 0 {
1798 return nil
1799 }
1800 cls = &Object{}
1801 cls.Ptr = cret
1802 return cls
1803}
1804
1805var xObjectRefSink func(uintptr) uintptr
1806
1807// Increase the reference count of @object, and possibly remove the
1808// [floating][floating-ref] reference, if @object has a floating reference.
1809//
1810// In other words, if the object is floating, then this call "assumes
1811// ownership" of the floating reference, converting it to a normal
1812// reference by clearing the floating flag while leaving the reference
1813// count unchanged. If the object is not floating, then this call
1814// adds a new normal reference increasing the reference count by one.
1815//
1816// Since GLib 2.56, the type of @object will be propagated to the return type
1817// under the same conditions as for g_object_ref().
1818func (x *Object) RefSink() *Object {
1819 var cls *Object
1820
1821 cret := xObjectRefSink(x.GoPointer())
1822
1823 if cret == 0 {
1824 return nil
1825 }
1826 IncreaseRef(cret)
1827 cls = &Object{}
1828 cls.Ptr = cret
1829 return cls
1830}
1831
1832var xObjectRemoveToggleRef func(uintptr, uintptr, uintptr)
1833
1834// Removes a reference added with g_object_add_toggle_ref(). The
1835// reference count of the object is decreased by one.
1836//
1837// Note that if you unref the object on another thread, then @notify might
1838// still be invoked after g_object_remove_toggle_ref(), and the object argument
1839// might be a dangling pointer. If the object is destroyed on other threads,
1840// you must take care of that yourself.
1841func (x *Object) RemoveToggleRef(NotifyVar *ToggleNotify, DataVar uintptr) {
1842
1843 var NotifyVarRef uintptr
1844 if NotifyVar != nil {
1845 NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar))
1846 if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok {
1847 NotifyVarRef = cbRefPtr
1848 } else {
1849 fcb := func(arg0 uintptr, arg1 uintptr, arg2 bool) {
1850 cbFn := *NotifyVar
1851 cbFn(arg0, arg1, arg2)
1852 }
1853 NotifyVarRef = purego.NewCallback(fcb)
1854 glib.SaveCallbackWithClosure(NotifyVarPtr, NotifyVarRef, NotifyVar)
1855 }
1856 }
1857
1858 xObjectRemoveToggleRef(x.GoPointer(), NotifyVarRef, DataVar)
1859
1860}
1861
1862var xObjectRemoveWeakPointer func(uintptr, uintptr)
1863
1864// Removes a weak reference from @object that was previously added
1865// using g_object_add_weak_pointer(). The @weak_pointer_location has
1866// to match the one used with g_object_add_weak_pointer().
1867func (x *Object) RemoveWeakPointer(WeakPointerLocationVar uintptr) {
1868
1869 xObjectRemoveWeakPointer(x.GoPointer(), WeakPointerLocationVar)
1870
1871}
1872
1873var xObjectReplaceData func(uintptr, string, uintptr, uintptr, uintptr, *glib.DestroyNotify) bool
1874
1875// Compares the user data for the key @key on @object with
1876// @oldval, and if they are the same, replaces @oldval with
1877// @newval.
1878//
1879// This is like a typical atomic compare-and-exchange
1880// operation, for user data on an object.
1881//
1882// If the previous value was replaced then ownership of the
1883// old value (@oldval) is passed to the caller, including
1884// the registered destroy notify for it (passed out in @old_destroy).
1885// It’s up to the caller to free this as needed, which may
1886// or may not include using @old_destroy as sometimes replacement
1887// should not destroy the object in the normal way.
1888//
1889// See g_object_set_data() for guidance on using a small, bounded set of values
1890// for @key.
1891func (x *Object) ReplaceData(KeyVar string, OldvalVar uintptr, NewvalVar uintptr, DestroyVar *glib.DestroyNotify, OldDestroyVar *glib.DestroyNotify) bool {
1892
1893 var DestroyVarRef uintptr
1894 if DestroyVar != nil {
1895 DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
1896 if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
1897 DestroyVarRef = cbRefPtr
1898 } else {
1899 fcb := func(arg0 uintptr) {
1900 cbFn := *DestroyVar
1901 cbFn(arg0)
1902 }
1903 DestroyVarRef = purego.NewCallback(fcb)
1904 glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
1905 }
1906 }
1907
1908 cret := xObjectReplaceData(x.GoPointer(), KeyVar, OldvalVar, NewvalVar, DestroyVarRef, OldDestroyVar)
1909 return cret
1910}
1911
1912var xObjectReplaceQdata func(uintptr, glib.Quark, uintptr, uintptr, uintptr, *glib.DestroyNotify) bool
1913
1914// Compares the user data for the key @quark on @object with
1915// @oldval, and if they are the same, replaces @oldval with
1916// @newval.
1917//
1918// This is like a typical atomic compare-and-exchange
1919// operation, for user data on an object.
1920//
1921// If the previous value was replaced then ownership of the
1922// old value (@oldval) is passed to the caller, including
1923// the registered destroy notify for it (passed out in @old_destroy).
1924// It’s up to the caller to free this as needed, which may
1925// or may not include using @old_destroy as sometimes replacement
1926// should not destroy the object in the normal way.
1927func (x *Object) ReplaceQdata(QuarkVar glib.Quark, OldvalVar uintptr, NewvalVar uintptr, DestroyVar *glib.DestroyNotify, OldDestroyVar *glib.DestroyNotify) bool {
1928
1929 var DestroyVarRef uintptr
1930 if DestroyVar != nil {
1931 DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
1932 if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
1933 DestroyVarRef = cbRefPtr
1934 } else {
1935 fcb := func(arg0 uintptr) {
1936 cbFn := *DestroyVar
1937 cbFn(arg0)
1938 }
1939 DestroyVarRef = purego.NewCallback(fcb)
1940 glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
1941 }
1942 }
1943
1944 cret := xObjectReplaceQdata(x.GoPointer(), QuarkVar, OldvalVar, NewvalVar, DestroyVarRef, OldDestroyVar)
1945 return cret
1946}
1947
1948var xObjectRunDispose func(uintptr)
1949
1950// Releases all references to other objects. This can be used to break
1951// reference cycles.
1952//
1953// This function should only be called from object system implementations.
1954func (x *Object) RunDispose() {
1955
1956 xObjectRunDispose(x.GoPointer())
1957
1958}
1959
1960var xObjectSet func(uintptr, string, ...interface{})
1961
1962// Sets properties on an object.
1963//
1964// The same caveats about passing integer literals as varargs apply as with
1965// g_object_new(). In particular, any integer literals set as the values for
1966// properties of type #gint64 or #guint64 must be 64 bits wide, using the
1967// %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros.
1968//
1969// Note that the "notify" signals are queued and only emitted (in
1970// reverse order) after all properties have been set. See
1971// g_object_freeze_notify().
1972func (x *Object) Set(FirstPropertyNameVar string, varArgs ...interface{}) {
1973
1974 xObjectSet(x.GoPointer(), FirstPropertyNameVar, varArgs...)
1975
1976}
1977
1978var xObjectSetData func(uintptr, string, uintptr)
1979
1980// Each object carries around a table of associations from
1981// strings to pointers. This function lets you set an association.
1982//
1983// If the object already had an association with that name,
1984// the old association will be destroyed.
1985//
1986// Internally, the @key is converted to a #GQuark using g_quark_from_string().
1987// This means a copy of @key is kept permanently (even after @object has been
1988// finalized) — so it is recommended to only use a small, bounded set of values
1989// for @key in your program, to avoid the #GQuark storage growing unbounded.
1990func (x *Object) SetData(KeyVar string, DataVar uintptr) {
1991
1992 xObjectSetData(x.GoPointer(), KeyVar, DataVar)
1993
1994}
1995
1996var xObjectSetDataFull func(uintptr, string, uintptr, uintptr)
1997
1998// Like g_object_set_data() except it adds notification
1999// for when the association is destroyed, either by setting it
2000// to a different value or when the object is destroyed.
2001//
2002// Note that the @destroy callback is not called if @data is %NULL.
2003func (x *Object) SetDataFull(KeyVar string, DataVar uintptr, DestroyVar *glib.DestroyNotify) {
2004
2005 var DestroyVarRef uintptr
2006 if DestroyVar != nil {
2007 DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
2008 if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
2009 DestroyVarRef = cbRefPtr
2010 } else {
2011 fcb := func(arg0 uintptr) {
2012 cbFn := *DestroyVar
2013 cbFn(arg0)
2014 }
2015 DestroyVarRef = purego.NewCallback(fcb)
2016 glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
2017 }
2018 }
2019
2020 xObjectSetDataFull(x.GoPointer(), KeyVar, DataVar, DestroyVarRef)
2021
2022}
2023
2024var xObjectSetProperty func(uintptr, string, *Value)
2025
2026// Sets a property on an object.
2027func (x *Object) SetProperty(PropertyNameVar string, ValueVar *Value) {
2028
2029 xObjectSetProperty(x.GoPointer(), PropertyNameVar, ValueVar)
2030
2031}
2032
2033var xObjectSetQdata func(uintptr, glib.Quark, uintptr)
2034
2035// This sets an opaque, named pointer on an object.
2036// The name is specified through a #GQuark (retrieved e.g. via
2037// g_quark_from_static_string()), and the pointer
2038// can be gotten back from the @object with g_object_get_qdata()
2039// until the @object is finalized.
2040// Setting a previously set user data pointer, overrides (frees)
2041// the old pointer set, using #NULL as pointer essentially
2042// removes the data stored.
2043func (x *Object) SetQdata(QuarkVar glib.Quark, DataVar uintptr) {
2044
2045 xObjectSetQdata(x.GoPointer(), QuarkVar, DataVar)
2046
2047}
2048
2049var xObjectSetQdataFull func(uintptr, glib.Quark, uintptr, uintptr)
2050
2051// This function works like g_object_set_qdata(), but in addition,
2052// a void (*destroy) (gpointer) function may be specified which is
2053// called with @data as argument when the @object is finalized, or
2054// the data is being overwritten by a call to g_object_set_qdata()
2055// with the same @quark.
2056func (x *Object) SetQdataFull(QuarkVar glib.Quark, DataVar uintptr, DestroyVar *glib.DestroyNotify) {
2057
2058 var DestroyVarRef uintptr
2059 if DestroyVar != nil {
2060 DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
2061 if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
2062 DestroyVarRef = cbRefPtr
2063 } else {
2064 fcb := func(arg0 uintptr) {
2065 cbFn := *DestroyVar
2066 cbFn(arg0)
2067 }
2068 DestroyVarRef = purego.NewCallback(fcb)
2069 glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
2070 }
2071 }
2072
2073 xObjectSetQdataFull(x.GoPointer(), QuarkVar, DataVar, DestroyVarRef)
2074
2075}
2076
2077var xObjectSetValist func(uintptr, string, []interface{})
2078
2079// Sets properties on an object.
2080func (x *Object) SetValist(FirstPropertyNameVar string, VarArgsVar []interface{}) {
2081
2082 xObjectSetValist(x.GoPointer(), FirstPropertyNameVar, VarArgsVar)
2083
2084}
2085
2086var xObjectSetv func(uintptr, uint, []string, []Value)
2087
2088// Sets @n_properties properties for an @object.
2089// Properties to be set will be taken from @values. All properties must be
2090// valid. Warnings will be emitted and undefined behaviour may result if invalid
2091// properties are passed in.
2092func (x *Object) Setv(NPropertiesVar uint, NamesVar []string, ValuesVar []Value) {
2093
2094 xObjectSetv(x.GoPointer(), NPropertiesVar, NamesVar, ValuesVar)
2095
2096}
2097
2098var xObjectStealData func(uintptr, string) uintptr
2099
2100// Remove a specified datum from the object's data associations,
2101// without invoking the association's destroy handler.
2102func (x *Object) StealData(KeyVar string) uintptr {
2103
2104 cret := xObjectStealData(x.GoPointer(), KeyVar)
2105 return cret
2106}
2107
2108var xObjectStealQdata func(uintptr, glib.Quark) uintptr
2109
2110// This function gets back user data pointers stored via
2111// g_object_set_qdata() and removes the @data from object
2112// without invoking its destroy() function (if any was
2113// set).
2114// Usually, calling this function is only required to update
2115// user data pointers with a destroy notifier, for example:
2116// |[<!-- language="C" -->
2117// void
2118// object_add_to_user_list (GObject *object,
2119//
2120// const gchar *new_string)
2121//
2122// {
2123// // the quark, naming the object data
2124// GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
2125// // retrieve the old string list
2126// GList *list = g_object_steal_qdata (object, quark_string_list);
2127//
2128// // prepend new string
2129// list = g_list_prepend (list, g_strdup (new_string));
2130// // this changed 'list', so we need to set it again
2131// g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
2132// }
2133//
2134// static void
2135// free_string_list (gpointer data)
2136//
2137// {
2138// GList *node, *list = data;
2139//
2140// for (node = list; node; node = node->next)
2141// g_free (node->data);
2142// g_list_free (list);
2143// }
2144//
2145// ]|
2146// Using g_object_get_qdata() in the above example, instead of
2147// g_object_steal_qdata() would have left the destroy function set,
2148// and thus the partial string list would have been freed upon
2149// g_object_set_qdata_full().
2150func (x *Object) StealQdata(QuarkVar glib.Quark) uintptr {
2151
2152 cret := xObjectStealQdata(x.GoPointer(), QuarkVar)
2153 return cret
2154}
2155
2156var xObjectTakeRef func(uintptr) uintptr
2157
2158// If @object is floating, sink it. Otherwise, do nothing.
2159//
2160// In other words, this function will convert a floating reference (if
2161// present) into a full reference.
2162//
2163// Typically you want to use g_object_ref_sink() in order to
2164// automatically do the correct thing with respect to floating or
2165// non-floating references, but there is one specific scenario where
2166// this function is helpful.
2167//
2168// The situation where this function is helpful is when creating an API
2169// that allows the user to provide a callback function that returns a
2170// GObject. We certainly want to allow the user the flexibility to
2171// return a non-floating reference from this callback (for the case
2172// where the object that is being returned already exists).
2173//
2174// At the same time, the API style of some popular GObject-based
2175// libraries (such as Gtk) make it likely that for newly-created GObject
2176// instances, the user can be saved some typing if they are allowed to
2177// return a floating reference.
2178//
2179// Using this function on the return value of the user's callback allows
2180// the user to do whichever is more convenient for them. The caller will
2181// always receives exactly one full reference to the value: either the
2182// one that was returned in the first place, or a floating reference
2183// that has been converted to a full reference.
2184//
2185// This function has an odd interaction when combined with
2186// g_object_ref_sink() running at the same time in another thread on
2187// the same #GObject instance. If g_object_ref_sink() runs first then
2188// the result will be that the floating reference is converted to a hard
2189// reference. If g_object_take_ref() runs first then the result will be
2190// that the floating reference is converted to a hard reference and an
2191// additional reference on top of that one is added. It is best to avoid
2192// this situation.
2193func (x *Object) TakeRef() *Object {
2194 var cls *Object
2195
2196 cret := xObjectTakeRef(x.GoPointer())
2197
2198 if cret == 0 {
2199 return nil
2200 }
2201 cls = &Object{}
2202 cls.Ptr = cret
2203 return cls
2204}
2205
2206var xObjectThawNotify func(uintptr)
2207
2208// Reverts the effect of a previous call to
2209// g_object_freeze_notify(). The freeze count is decreased on @object
2210// and when it reaches zero, queued "notify" signals are emitted.
2211//
2212// Duplicate notifications for each property are squashed so that at most one
2213// #GObject::notify signal is emitted for each property, in the reverse order
2214// in which they have been queued.
2215//
2216// It is an error to call this function when the freeze count is zero.
2217func (x *Object) ThawNotify() {
2218
2219 xObjectThawNotify(x.GoPointer())
2220
2221}
2222
2223var xObjectUnref func(uintptr)
2224
2225// Decreases the reference count of @object. When its reference count
2226// drops to 0, the object is finalized (i.e. its memory is freed).
2227//
2228// If the pointer to the #GObject may be reused in future (for example, if it is
2229// an instance variable of another object), it is recommended to clear the
2230// pointer to %NULL rather than retain a dangling pointer to a potentially
2231// invalid #GObject instance. Use g_clear_object() for this.
2232func (x *Object) Unref() {
2233
2234 xObjectUnref(x.GoPointer())
2235
2236}
2237
2238var xObjectWatchClosure func(uintptr, *Closure)
2239
2240// This function essentially limits the life time of the @closure to
2241// the life time of the object. That is, when the object is finalized,
2242// the @closure is invalidated by calling g_closure_invalidate() on
2243// it, in order to prevent invocations of the closure with a finalized
2244// (nonexisting) object. Also, g_object_ref() and g_object_unref() are
2245// added as marshal guards to the @closure, to ensure that an extra
2246// reference count is held on @object during invocation of the
2247// @closure. Usually, this function will be called on closures that
2248// use this @object as closure data.
2249func (x *Object) WatchClosure(ClosureVar *Closure) {
2250
2251 xObjectWatchClosure(x.GoPointer(), ClosureVar)
2252
2253}
2254
2255var xObjectWeakRef func(uintptr, uintptr, uintptr)
2256
2257// Adds a weak reference callback to an object. Weak references are
2258// used for notification when an object is disposed. They are called
2259// "weak references" because they allow you to safely hold a pointer
2260// to an object without calling g_object_ref() (g_object_ref() adds a
2261// strong reference, that is, forces the object to stay alive).
2262//
2263// Note that the weak references created by this method are not
2264// thread-safe: they cannot safely be used in one thread if the
2265// object's last g_object_unref() might happen in another thread.
2266// Use #GWeakRef if thread-safety is required.
2267func (x *Object) WeakRef(NotifyVar *WeakNotify, DataVar uintptr) {
2268
2269 var NotifyVarRef uintptr
2270 if NotifyVar != nil {
2271 NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar))
2272 if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok {
2273 NotifyVarRef = cbRefPtr
2274 } else {
2275 fcb := func(arg0 uintptr, arg1 uintptr) {
2276 cbFn := *NotifyVar
2277 cbFn(arg0, arg1)
2278 }
2279 NotifyVarRef = purego.NewCallback(fcb)
2280 glib.SaveCallbackWithClosure(NotifyVarPtr, NotifyVarRef, NotifyVar)
2281 }
2282 }
2283
2284 xObjectWeakRef(x.GoPointer(), NotifyVarRef, DataVar)
2285
2286}
2287
2288var xObjectWeakUnref func(uintptr, uintptr, uintptr)
2289
2290// Removes a weak reference callback to an object.
2291func (x *Object) WeakUnref(NotifyVar *WeakNotify, DataVar uintptr) {
2292
2293 var NotifyVarRef uintptr
2294 if NotifyVar != nil {
2295 NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar))
2296 if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok {
2297 NotifyVarRef = cbRefPtr
2298 } else {
2299 fcb := func(arg0 uintptr, arg1 uintptr) {
2300 cbFn := *NotifyVar
2301 cbFn(arg0, arg1)
2302 }
2303 NotifyVarRef = purego.NewCallback(fcb)
2304 glib.SaveCallbackWithClosure(NotifyVarPtr, NotifyVarRef, NotifyVar)
2305 }
2306 }
2307
2308 xObjectWeakUnref(x.GoPointer(), NotifyVarRef, DataVar)
2309
2310}
2311
2312func (c *Object) GoPointer() uintptr {
2313 if c == nil {
2314 return 0
2315 }
2316 return c.Ptr
2317}
2318
2319func (c *Object) SetGoPointer(ptr uintptr) {
2320 c.Ptr = ptr
2321}
2322
2323// The notify signal is emitted on an object when one of its properties has
2324// its value set through g_object_set_property(), g_object_set(), et al.
2325//
2326// Note that getting this signal doesn’t itself guarantee that the value of
2327// the property has actually changed. When it is emitted is determined by the
2328// derived GObject class. If the implementor did not create the property with
2329// %G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results
2330// in ::notify being emitted, even if the new value is the same as the old.
2331// If they did pass %G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only
2332// when they explicitly call g_object_notify() or g_object_notify_by_pspec(),
2333// and common practice is to do that only when the value has actually changed.
2334//
2335// This signal is typically used to obtain change notification for a
2336// single property, by specifying the property name as a detail in the
2337// g_signal_connect() call, like this:
2338//
2339// |[<!-- language="C" -->
2340// g_signal_connect (text_view->buffer, "notify::paste-target-list",
2341//
2342// G_CALLBACK (gtk_text_view_target_list_notify),
2343// text_view)
2344//
2345// ]|
2346//
2347// It is important to note that you must use
2348// [canonical parameter names][class@GObject.ParamSpec#parameter-names] as
2349// detail strings for the notify signal.
2350func (x *Object) ConnectNotify(cb *func(Object, uintptr)) uint {
2351 cbPtr := uintptr(unsafe.Pointer(cb))
2352 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2353 handlerID := SignalConnect(x.GoPointer(), "notify", cbRefPtr)
2354 glib.SaveHandlerMapping(handlerID, cbPtr)
2355 return handlerID
2356 }
2357
2358 fcb := func(clsPtr uintptr, PspecVarp uintptr) {
2359 fa := Object{}
2360 fa.Ptr = clsPtr
2361 cbFn := *cb
2362
2363 cbFn(fa, PspecVarp)
2364
2365 }
2366 cbRefPtr := purego.NewCallback(fcb)
2367 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2368 handlerID := SignalConnect(x.GoPointer(), "notify", cbRefPtr)
2369 glib.SaveHandlerMapping(handlerID, cbPtr)
2370 return handlerID
2371}
2372
2373// ConnectNotifyWithDetail connects to the "notify" signal with a detail string.
2374// The detail is appended as "notify::<detail>".
2375func (x *Object) ConnectNotifyWithDetail(detail string, cb *func(Object, uintptr)) uint {
2376 cbPtr := uintptr(unsafe.Pointer(cb))
2377 signalName := fmt.Sprintf("notify::%s", detail)
2378 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2379 handlerID := SignalConnect(x.GoPointer(), signalName, cbRefPtr)
2380 glib.SaveHandlerMapping(handlerID, cbPtr)
2381 return handlerID
2382 }
2383
2384 fcb := func(clsPtr uintptr, PspecVarp uintptr) {
2385 fa := Object{}
2386 fa.Ptr = clsPtr
2387 cbFn := *cb
2388
2389 cbFn(fa, PspecVarp)
2390
2391 }
2392 cbRefPtr := purego.NewCallback(fcb)
2393 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2394 handlerID := SignalConnect(x.GoPointer(), signalName, cbRefPtr)
2395 glib.SaveHandlerMapping(handlerID, cbPtr)
2396 return handlerID
2397}
2398
2399var xObjectCompatControl func(uint, uintptr) uint
2400
2401func ObjectCompatControl(WhatVar uint, DataVar uintptr) uint {
2402
2403 cret := xObjectCompatControl(WhatVar, DataVar)
2404 return cret
2405}
2406
2407var xObjectInterfaceFindProperty func(*TypeInterface, string) uintptr
2408
2409// Find the #GParamSpec with the given name for an
2410// interface. Generally, the interface vtable passed in as @g_iface
2411// will be the default vtable from g_type_default_interface_ref(), or,
2412// if you know the interface has already been loaded,
2413// g_type_default_interface_peek().
2414func ObjectInterfaceFindProperty(GIfaceVar *TypeInterface, PropertyNameVar string) *ParamSpec {
2415 var cls *ParamSpec
2416
2417 cret := xObjectInterfaceFindProperty(GIfaceVar, PropertyNameVar)
2418
2419 if cret == 0 {
2420 return nil
2421 }
2422 IncreaseRef(cret)
2423 cls = &ParamSpec{}
2424 cls.Ptr = cret
2425 return cls
2426}
2427
2428var xObjectInterfaceInstallProperty func(*TypeInterface, uintptr)
2429
2430// Add a property to an interface; this is only useful for interfaces
2431// that are added to GObject-derived types. Adding a property to an
2432// interface forces all objects classes with that interface to have a
2433// compatible property. The compatible property could be a newly
2434// created #GParamSpec, but normally
2435// g_object_class_override_property() will be used so that the object
2436// class only needs to provide an implementation and inherits the
2437// property description, default value, bounds, and so forth from the
2438// interface property.
2439//
2440// This function is meant to be called from the interface's default
2441// vtable initialization function (the @class_init member of
2442// #GTypeInfo.) It must not be called after after @class_init has
2443// been called for any object types implementing this interface.
2444//
2445// If @pspec is a floating reference, it will be consumed.
2446func ObjectInterfaceInstallProperty(GIfaceVar *TypeInterface, PspecVar *ParamSpec) {
2447
2448 xObjectInterfaceInstallProperty(GIfaceVar, PspecVar.GoPointer())
2449
2450}
2451
2452var xObjectInterfaceListProperties func(*TypeInterface, *uint) uintptr
2453
2454// Lists the properties of an interface.Generally, the interface
2455// vtable passed in as @g_iface will be the default vtable from
2456// g_type_default_interface_ref(), or, if you know the interface has
2457// already been loaded, g_type_default_interface_peek().
2458func ObjectInterfaceListProperties(GIfaceVar *TypeInterface, NPropertiesPVar *uint) uintptr {
2459
2460 cret := xObjectInterfaceListProperties(GIfaceVar, NPropertiesPVar)
2461 return cret
2462}
2463
2464func init() {
2465 core.SetPackageName("GOBJECT", "gobject-2.0")
2466 core.SetSharedLibraries("GOBJECT", []string{"libgobject-2.0.so.0"})
2467 var libs []uintptr
2468 for _, libPath := range core.GetPaths("GOBJECT") {
2469 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
2470 if err != nil {
2471 panic(err)
2472 }
2473 libs = append(libs, lib)
2474 }
2475
2476 core.PuregoSafeRegister(&xCclosureNewObject, libs, "g_cclosure_new_object")
2477 core.PuregoSafeRegister(&xCclosureNewObjectSwap, libs, "g_cclosure_new_object_swap")
2478 core.PuregoSafeRegister(&xClearObject, libs, "g_clear_object")
2479 core.PuregoSafeRegister(&xSignalConnectObject, libs, "g_signal_connect_object")
2480
2481 core.PuregoSafeRegister(&xObjectClassFindProperty, libs, "g_object_class_find_property")
2482 core.PuregoSafeRegister(&xObjectClassInstallProperties, libs, "g_object_class_install_properties")
2483 core.PuregoSafeRegister(&xObjectClassInstallProperty, libs, "g_object_class_install_property")
2484 core.PuregoSafeRegister(&xObjectClassListProperties, libs, "g_object_class_list_properties")
2485 core.PuregoSafeRegister(&xObjectClassOverrideProperty, libs, "g_object_class_override_property")
2486
2487 core.PuregoSafeRegister(&xWeakRefClear, libs, "g_weak_ref_clear")
2488 core.PuregoSafeRegister(&xWeakRefGet, libs, "g_weak_ref_get")
2489 core.PuregoSafeRegister(&xWeakRefInit, libs, "g_weak_ref_init")
2490 core.PuregoSafeRegister(&xWeakRefSet, libs, "g_weak_ref_set")
2491
2492 core.PuregoSafeRegister(&xInitiallyUnownedGLibType, libs, "g_initially_unowned_get_type")
2493
2494 core.PuregoSafeRegister(&xObjectGLibType, libs, "g_object_get_type")
2495
2496 core.PuregoSafeRegister(&xNewObject, libs, "g_object_new")
2497 core.PuregoSafeRegister(&xNewObjectValist, libs, "g_object_new_valist")
2498 core.PuregoSafeRegister(&xNewObjectWithProperties, libs, "g_object_new_with_properties")
2499 core.PuregoSafeRegister(&xNewObjectv, libs, "g_object_newv")
2500
2501 core.PuregoSafeRegister(&xObjectAddToggleRef, libs, "g_object_add_toggle_ref")
2502 core.PuregoSafeRegister(&xObjectAddWeakPointer, libs, "g_object_add_weak_pointer")
2503 core.PuregoSafeRegister(&xObjectBindProperty, libs, "g_object_bind_property")
2504 core.PuregoSafeRegister(&xObjectBindPropertyFull, libs, "g_object_bind_property_full")
2505 core.PuregoSafeRegister(&xObjectBindPropertyWithClosures, libs, "g_object_bind_property_with_closures")
2506 core.PuregoSafeRegister(&xObjectConnect, libs, "g_object_connect")
2507 core.PuregoSafeRegister(&xObjectDisconnect, libs, "g_object_disconnect")
2508 core.PuregoSafeRegister(&xObjectDupData, libs, "g_object_dup_data")
2509 core.PuregoSafeRegister(&xObjectDupQdata, libs, "g_object_dup_qdata")
2510 core.PuregoSafeRegister(&xObjectForceFloating, libs, "g_object_force_floating")
2511 core.PuregoSafeRegister(&xObjectFreezeNotify, libs, "g_object_freeze_notify")
2512 core.PuregoSafeRegister(&xObjectGet, libs, "g_object_get")
2513 core.PuregoSafeRegister(&xObjectGetData, libs, "g_object_get_data")
2514 core.PuregoSafeRegister(&xObjectGetProperty, libs, "g_object_get_property")
2515 core.PuregoSafeRegister(&xObjectGetQdata, libs, "g_object_get_qdata")
2516 core.PuregoSafeRegister(&xObjectGetValist, libs, "g_object_get_valist")
2517 core.PuregoSafeRegister(&xObjectGetv, libs, "g_object_getv")
2518 core.PuregoSafeRegister(&xObjectIsFloating, libs, "g_object_is_floating")
2519 core.PuregoSafeRegister(&xObjectNotify, libs, "g_object_notify")
2520 core.PuregoSafeRegister(&xObjectNotifyByPspec, libs, "g_object_notify_by_pspec")
2521 core.PuregoSafeRegister(&xObjectRef, libs, "g_object_ref")
2522 core.PuregoSafeRegister(&xObjectRefSink, libs, "g_object_ref_sink")
2523 core.PuregoSafeRegister(&xObjectRemoveToggleRef, libs, "g_object_remove_toggle_ref")
2524 core.PuregoSafeRegister(&xObjectRemoveWeakPointer, libs, "g_object_remove_weak_pointer")
2525 core.PuregoSafeRegister(&xObjectReplaceData, libs, "g_object_replace_data")
2526 core.PuregoSafeRegister(&xObjectReplaceQdata, libs, "g_object_replace_qdata")
2527 core.PuregoSafeRegister(&xObjectRunDispose, libs, "g_object_run_dispose")
2528 core.PuregoSafeRegister(&xObjectSet, libs, "g_object_set")
2529 core.PuregoSafeRegister(&xObjectSetData, libs, "g_object_set_data")
2530 core.PuregoSafeRegister(&xObjectSetDataFull, libs, "g_object_set_data_full")
2531 core.PuregoSafeRegister(&xObjectSetProperty, libs, "g_object_set_property")
2532 core.PuregoSafeRegister(&xObjectSetQdata, libs, "g_object_set_qdata")
2533 core.PuregoSafeRegister(&xObjectSetQdataFull, libs, "g_object_set_qdata_full")
2534 core.PuregoSafeRegister(&xObjectSetValist, libs, "g_object_set_valist")
2535 core.PuregoSafeRegister(&xObjectSetv, libs, "g_object_setv")
2536 core.PuregoSafeRegister(&xObjectStealData, libs, "g_object_steal_data")
2537 core.PuregoSafeRegister(&xObjectStealQdata, libs, "g_object_steal_qdata")
2538 core.PuregoSafeRegister(&xObjectTakeRef, libs, "g_object_take_ref")
2539 core.PuregoSafeRegister(&xObjectThawNotify, libs, "g_object_thaw_notify")
2540 core.PuregoSafeRegister(&xObjectUnref, libs, "g_object_unref")
2541 core.PuregoSafeRegister(&xObjectWatchClosure, libs, "g_object_watch_closure")
2542 core.PuregoSafeRegister(&xObjectWeakRef, libs, "g_object_weak_ref")
2543 core.PuregoSafeRegister(&xObjectWeakUnref, libs, "g_object_weak_unref")
2544
2545 core.PuregoSafeRegister(&xObjectCompatControl, libs, "g_object_compat_control")
2546 core.PuregoSafeRegister(&xObjectInterfaceFindProperty, libs, "g_object_interface_find_property")
2547 core.PuregoSafeRegister(&xObjectInterfaceInstallProperty, libs, "g_object_interface_install_property")
2548 core.PuregoSafeRegister(&xObjectInterfaceListProperties, libs, "g_object_interface_list_properties")
2549
2550}