### ----------------------------------------------------
### -- Gnome::GObject
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/GObject/Object.rakumod
### ----------------------------------------------------
### -- Chunk 3 of 4
 )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_getv:
=begin pod
=head2 [g_] object_getv

Gets I<n_properties> properties for an I<object>.
Obtained properties will be set to I<values>. All properties must be valid.
Warnings will be emitted and undefined behaviour may result if invalid
properties are passed in.


  method g_object_getv (
    UInt $n_properties, CArray[Str] $names, CArray[N-GValue] $values )

=item UInt $n_properties; the number of properties
=item CArray[Str] $names; (array length=n_properties): the names of each property to get
=item CArray[N-GValue] $values; (array length=n_properties): the values of each property to get

=end pod

sub g_object_getv ( N-GObject $object, uint32 $n_properties, CArray[Str] $names, CArray[N-GValue] $values)
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_get_valist:
=begin pod
=head2 [[g_] object_] get_valist

Gets properties of an object.

In general, a copy is made of the property contents and the caller
is responsible for freeing the memory in the appropriate manner for
the type, for instance by calling C<g_free()> or C<g_object_unref()>.

See C<g_object_get()>.

  method g_object_get_valist (
    Str $first_property_name, CArray[N-GValue] $var_args
  )

=item Str $first_property_name; name of the first property to get
=item CArray[N-GValue] $var_args; return location for the first property, followed optionally by more name/return location pairs, followed by C<Any>

=end pod

sub g_object_get_valist ( N-GObject $object, Str $first_property_name, CArray[N-GValue] $var_args )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_class_install_property:
=begin pod
=head2 [[g_] object_] class_install_property

Installs a new property.

All properties should be installed during the class initializer.  It
is possible to install properties after that, but doing so is not
recommend, and specifically, is not guaranteed to be thread-safe vs.
use of properties on the same type on other threads.

Note that it is possible to redefine a property in a derived class,
by installing a property with the same name. This can be useful at times,
e.g. to change the range of allowed values or the default value.

  method g_object_class_install_property ( GObjectClass $oclass, UInt $property_id, N-GParamSpec $pspec )

=item GObjectClass $oclass; a I<GObjectClass>
=item UInt $property_id; the id for the new property
=item N-GParamSpec $pspec; the I<N-GParamSpec> for the new property

=end pod

sub g_object_class_install_property ( GObjectClass $oclass, uint32 $property_id, N-GParamSpec $pspec )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_class_find_property:
=begin pod
=head2 [[g_] object_] class_find_property

Looks up the I<N-GParamSpec> for a property of a class.

Returns: (transfer none): the I<N-GParamSpec> for the property, or
C<Any> if the class doesn't have a property of that name

  method g_object_class_find_property ( GObjectClass $oclass, Str $property_name --> N-GParamSpec  )

=item GObjectClass $oclass; a I<GObjectClass>
=item Str $property_name; the name of the property to look up

=end pod

sub g_object_class_find_property ( GObjectClass $oclass, Str $property_name )
  returns N-GParamSpec
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_class_list_properties:
=begin pod
=head2 [[g_] object_] class_list_properties

Get an array of I<N-GParamSpec>* for all properties of a class.

Returns: (array length=n_properties) (transfer container): an array of
I<N-GParamSpec>* which should be freed after use

  method g_object_class_list_properties ( GObjectClass $oclass, UInt $n_properties --> N-GParamSpec  )

=item GObjectClass $oclass; a I<GObjectClass>
=item UInt $n_properties; (out): return location for the length of the returned array

=end pod

sub g_object_class_list_properties ( GObjectClass $oclass, uint32 $n_properties )
  returns N-GParamSpec
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_class_override_property:
=begin pod
=head2 [[g_] object_] class_override_property

Registers I<property_id> as referring to a property with the name
I<name> in a parent class or in an interface implemented by I<oclass>.
This allows this class to "override" a property implementation in
a parent class or to provide the implementation of a property from
an interface.

Internally, overriding is implemented by creating a property of type
I<N-GParamSpecOverride>; generally operations that query the properties of
the object class, such as C<g_object_class_find_property()> or
C<g_object_class_list_properties()> will return the overridden
property. However, in one case, the I<construct_properties> argument of
the I<constructor> virtual function, the I<N-GParamSpecOverride> is passed
instead, so that the I<param_id> field of the I<N-GParamSpec> will be
correct.  For virtually all uses, this makes no difference. If you
need to get the overridden property, you can call
C<g_param_spec_get_redirect_target()>.


  method g_object_class_override_property ( GObjectClass $oclass, UInt $property_id, Str $name )

=item GObjectClass $oclass; a I<GObjectClass>
=item UInt $property_id; the new property ID
=item Str $name; the name of a property registered in a parent class or in an interface of this class.

=end pod

sub g_object_class_override_property ( GObjectClass $oclass, uint32 $property_id, Str $name )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_class_install_properties:
=begin pod
=head2 [[g_] object_] class_install_properties

Installs new properties from an array of I<N-GParamSpecs>.

All properties should be installed during the class initializer.  It
is possible to install properties after that, but doing so is not
recommend, and specifically, is not guaranteed to be thread-safe vs.
use of properties on the same type on other threads.

The property id of each property is the index of each I<N-GParamSpec> in
the I<pspecs> array.

The property id of 0 is treated specially by I<GObject> and it should not
be used to store a I<N-GParamSpec>.

This function should be used if you plan to use a static array of
I<N-GParamSpecs> and C<g_object_notify_by_pspec()>. For instance, this
class initialization:

|[<!-- language="C" -->
enum {
PROP_0, PROP_FOO, PROP_BAR, N_PROPERTIES
};

static N-GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };

static void
my_object_class_init (MyObjectClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

obj_properties[PROP_FOO] =
g_param_spec_int ("foo", "Foo", "Foo",
-1, G_MAXINT,
0,
G_PARAM_READWRITE);

obj_properties[PROP_BAR] =
g_param_spec_string ("bar", "Bar", "Bar",
NULL,
G_PARAM_READWRITE);

gobject_class->set_property = my_object_set_property;
gobject_class->get_property = my_object_get_property;
g_object_class_install_properties (gobject_class,
N_PROPERTIES,
obj_properties);
}
]|

allows calling C<g_object_notify_by_pspec()> to notify of property changes:

|[<!-- language="C" -->
void
my_object_set_foo (MyObject *self, gint foo)
{
if (self->foo != foo)
{
self->foo = foo;
g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_FOO]);
}
}
]|


  method g_object_class_install_properties ( GObjectClass $oclass, UInt $n_pspecs, N-GParamSpec $pspecs )

=item GObjectClass $oclass; a I<GObjectClass>
=item UInt $n_pspecs; the length of the I<N-GParamSpecs> array
=item N-GParamSpec $pspecs; (array length=n_pspecs): the I<N-GParamSpecs> array defining the new properties

=end pod

sub g_object_class_install_properties ( GObjectClass $oclass, uint32 $n_pspecs, N-GParamSpec $pspecs )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_interface_install_property:
=begin pod
=head2 [[g_] object_] interface_install_property

Add a property to an interface; this is only useful for interfaces
that are added to GObject-derived types. Adding a property to an
interface forces all objects classes with that interface to have a
compatible property. The compatible property could be a newly
created I<N-GParamSpec>, but normally
C<g_object_class_override_property()> will be used so that the object
class only needs to provide an implementation and inherits the
property description, default value, bounds, and so forth from the
interface property.

This function is meant to be called from the interface's default
vtable initialization function (the I<class_init> member of
I<GTypeInfo>.) It must not be called after after I<class_init> has
been called for any object types implementing this interface.

If I<pspec> is a floating reference, it will be consumed.


  method g_object_interface_install_property ( Pointer $g_iface, N-GParamSpec $pspec )

=item Pointer $g_iface; (type GObject.TypeInterface): any interface vtable for the interface, or the default vtable for the interface.
=item N-GParamSpec $pspec; the I<N-GParamSpec> for the new property

=end pod

sub g_object_interface_install_property ( Pointer $g_iface, N-GParamSpec $pspec )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_interface_find_property:
=begin pod
=head2 [[g_] object_] interface_find_property

Find the I<N-GParamSpec> with the given name for an
interface. Generally, the interface vtable passed in as I<g_iface>
will be the default vtable from C<g_type_default_interface_ref()>, or,
if you know the interface has already been loaded,
C<g_type_default_interface_peek()>.


Returns: (transfer none): the I<N-GParamSpec> for the property of the
interface with the name I<property_name>, or C<Any> if no
such property exists.

  method g_object_interface_find_property ( Pointer $g_iface, Str $property_name --> N-GParamSpec  )

=item Pointer $g_iface; (type GObject.TypeInterface): any interface vtable for the interface, or the default vtable for the interface
=item Str $property_name; name of a property to lookup.

=end pod

sub g_object_interface_find_property ( Pointer $g_iface, Str $property_name )
  returns N-GParamSpec
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_interface_list_properties:
=begin pod
=head2 [[g_] object_] interface_list_properties

Lists the properties of an interface.Generally, the interface
vtable passed in as I<g_iface> will be the default vtable from
C<g_type_default_interface_ref()>, or, if you know the interface has
already been loaded, C<g_type_default_interface_peek()>.


Returns: (array length=n_properties_p) (transfer container): a
pointer to an array of pointers to I<N-GParamSpec>
structures. The paramspecs are owned by GLib, but the
array should be freed with C<g_free()> when you are done with
it.

  method g_object_interface_list_properties ( Pointer $g_iface, UInt $n_properties_p --> N-GParamSpec  )

=item Pointer $g_iface; (type GObject.TypeInterface): any interface vtable for the interface, or the default vtable for the interface
=item UInt $n_properties_p; (out): location to store number of properties returned.

=end pod

sub g_object_interface_list_properties ( Pointer $g_iface, uint32 $n_properties_p )
  returns N-GParamSpec
  is native(&gobject-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_new:
=begin pod
=head2 [g_] object_new

Creates a new instance of a I<GObject> subtype and sets its properties.

Construction parameters (see I<G_PARAM_CONSTRUCT>, I<G_PARAM_CONSTRUCT_ONLY>)
which are not explicitly specified are set to their default values.

Returns: (transfer full) (type GObject.Object): a new instance of
I<object_type>

  method g_object_new ( int32 $object_type, Str $first_property_name --> Pointer  )

=item int32 $object_type; the type id of the I<GObject> subtype to instantiate
=item Str $first_property_name; the name of the first property @...: the value of the first property, followed optionally by more name/value pairs, followed by C<Any>

=end pod

sub g_object_new ( int32 $object_type, Str $first_property_name, Any $any = Any )
  returns Pointer
  is native(&gobject-lib)
  { * }
}}


}}
#-------------------------------------------------------------------------------
#TM:0:g_object_new_with_properties:
=begin pod
=head2 [[g_] object_] new_with_properties

Creates a new instance of a I<GObject> subtype and sets its properties using
the provided arrays. Both arrays must have exactly I<n_properties> elements,
and the names and values correspond by index.

Construction parameters (see C<G_PARAM_CONSTRUCT>, C<G_PARAM_CONSTRUCT_ONLY>)
which are not explicitly specified are set to their default values.

Returns: (type GObject.Object) (transfer full): a new instance of
I<object_type>


  method g_object_new_with_properties (
    int32 $object_type, UInt $n_properties,
    CArray[Str] $names, CArray[N-GValue] $values
    --> N-GObject
  )

=item int32 $object_type; the object type to instantiate
=item UInt $n_properties; the number of properties
=item CArray[Str] $names; (array length=n_properties): the names of each property to be set
=item CArray[N-GValue] $values; (array length=n_properties): the values of each property to be set

=end pod

sub g_object_new_with_properties (
  int32 $object_type, uint32 $n_properties,
  CArray[Str] $names, CArray[N-GValue] $values
) returns N-GObject
  is native(&gobject-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_new_valist:
=begin pod
=head2 [[g_] object_] new_valist

Creates a new instance of a I<GObject> subtype and sets its properties.

Construction parameters (see I<G_PARAM_CONSTRUCT>, I<G_PARAM_CONSTRUCT_ONLY>)
which are not explicitly specified are set to their default values.

Returns: a new instance of I<object_type>

  method g_object_new_valist ( int32 $object_type, Str $first_property_name, va_list $var_args --> N-GObject  )

=item int32 $object_type; the type id of the I<GObject> subtype to instantiate
=item Str $first_property_name; the name of the first property
=item va_list $var_args; the value of the first property, followed optionally by more name/value pairs, followed by C<Any>

=end pod

sub g_object_new_valist (
  int32 $object_type, Str $first_property_name, va_list $var_args
) returns N-GObject
  is native(&gobject-lib)
  { * }
}}


#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_connect:
=begin pod
=head2 [g_] object_connect

A convenience function to connect multiple signals at once.

The signal specs expected by this function have the form
"modifier::signal_name", where modifier can be one of the following:
* - signal: equivalent to g_signal_connect_data (..., NULL, 0)
- object-signal, object_signal: equivalent to g_signal_connect_object (..., 0)
- swapped-signal, swapped_signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)
- swapped_object_signal, swapped-object-signal: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED)
- signal_after, signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_AFTER)
- object_signal_after, object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_AFTER)
- swapped_signal_after, swapped-signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)
- swapped_object_signal_after, swapped-object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)

|[<!-- language="C" -->
menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
"type", GTK_WINDOW_POPUP,
"child", menu,
NULL),
"signal::event", gtk_menu_window_event, menu,
"signal::size_request", gtk_menu_window_size_request, menu,
"signal::destroy", gtk_widget_destroyed, &menu->toplevel,
NULL);
]|

Returns: (transfer none) (type GObject.Object): I<object>

  method g_object_connect ( Pointer $object, Str $signal_spec --> Pointer  )

=item Pointer $object; (type GObject.Object): a I<GObject>
=item Str $signal_spec; the spec for the first signal @...: I<GCallback> for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by C<Any>

=end pod

sub g_object_connect ( Pointer $object, Str $signal_spec, Any $any = Any )
  returns Pointer
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_disconnect:
=begin pod
=head2 [g_] object_disconnect

A convenience function to disconnect multiple signals at once.

The signal specs expected by this function have the form
"any_signal", which means to disconnect any signal with matching
callback and data, or "any_signal::signal_name", which only
disconnects the signal named "signal_name".

  method g_object_disconnect ( Pointer $object, Str $signal_spec )

=item Pointer $object; (type GObject.Object): a I<GObject>
=item Str $signal_spec; the spec for the first signal @...: I<GCallback> for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by C<Any>

=end pod

sub g_object_disconnect ( Pointer $object, Str $signal_spec, Any $any = Any )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_freeze_notify:
=begin pod
=head2 [[g_] object_] freeze_notify

Increases the freeze count on I<object>. If the freeze count is
non-zero, the emission of "notify" signals on I<object> is
stopped. The signals are queued until the freeze count is decreased
to zero. Duplicate notifications are squashed so that at most one
prop I<notify> signal is emitted for each property modified while the
object is frozen.

This is necessary for accessors that modify multiple properties to prevent
premature notification while the object is still being modified.

  method g_object_freeze_notify ( )


=end pod

sub g_object_freeze_notify ( N-GObject $object )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_notify:
=begin pod
=head2 [g_] object_notify

Emits a "notify" signal for the property I<property_name> on I<object>.

When possible, eg. when signaling a property change from within the class
that registered the property, you should use C<g_object_notify_by_pspec()>
instead.

Note that emission of the notify signal may be blocked with
C<g_object_freeze_notify()>. In this case, the signal emissions are queued
and will be emitted (in reverse order) when C<g_object_thaw_notify()> is
called.

  method g_object_notify ( Str $property_name )

=item Str $property_name; the name of a property installed on the class of I<object>.

=end pod

sub g_object_notify ( N-GObject $object, Str $property_name )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_notify_by_pspec:
=begin pod
=head2 [[g_] object_] notify_by_pspec

Emits a "notify" signal for the property specified by I<pspec> on I<object>.

This function omits the property name lookup, hence it is faster than
C<g_object_notify()>.

One way to avoid using C<g_object_notify()> from within the
class that registered the properties, and using C<g_object_notify_by_pspec()>
instead, is to store the N-GParamSpec used with
C<g_object_class_install_property()> inside a static array, e.g.:

enum
{
PROP_0,
PROP_FOO,
PROP_LAST
};

static N-GParamSpec *properties[PROP_LAST];

static void
my_object_class_init (MyObjectClass *klass)
{
properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
0, 100,
50,
G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
PROP_FOO,
properties[PROP_FOO]);
}
]|

and then notify a change on the "foo" property with:

|[<!-- language="C" -->
g_object_notify_by_pspec (self, properties[PROP_FOO]);
]|


  method g_object_notify_by_pspec ( N-GParamSpec $pspec )

=item N-GParamSpec $pspec; the I<N-GParamSpec> of a property installed on the class of I<object>.

=end pod

sub g_object_notify_by_pspec ( N-GObject $object, N-GParamSpec $pspec )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_thaw_notify:
=begin pod
=head2 [[g_] object_] thaw_notify

Reverts the effect of a previous call to
C<g_object_freeze_notify()>. The freeze count is decreased on I<object>
and when it reaches zero, queued "notify" signals are emitted.

Duplicate notifications for each property are squashed so that at most one
prop I<notify> signal is emitted for each property, in the reverse order
in which they have been queued.

It is an error to call this function when the freeze count is zero.

  method g_object_thaw_notify ( )


=end pod

sub g_object_thaw_notify ( N-GObject $object )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_weak_ref:
=begin pod
=head2 [[g_] object_] weak_ref

Adds a weak reference callback to an object. Weak references are
used for notification when an object is finalized. They are called
"weak references" because they allow you to safely hold a pointer
to an object without calling C<g_object_ref()> (C<g_object_ref()> adds a
strong reference, that is, forces the object to stay alive).

Note that the weak references created by this method are not
thread-safe: they cannot safely be used in one thread if the
object's last C<g_object_unref()> might happen in another thread.
Use I<GWeakRef> if thread-safety is required.

  method g_object_weak_ref ( GWeakNotify $notify, Pointer $data )

=item GWeakNotify $notify; callback to invoke before the object is freed
=item Pointer $data; extra data to pass to notify

=end pod

sub g_object_weak_ref ( N-GObject $object, GWeakNotify $notify, Pointer $data )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_weak_unref:
=begin pod
=head2 [[g_] object_] weak_unref

Removes a weak reference callback to an object.

  method g_object_weak_unref ( GWeakNotify $notify, Pointer $data )

=item GWeakNotify $notify; callback to search for
=item Pointer $data; data to search for

=end pod

sub g_object_weak_unref ( N-GObject $object, GWeakNotify $notify, Pointer $data )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_add_weak_pointer:
=begin pod
=head2 [[g_] object_] add_weak_pointer

Adds a weak reference from weak_pointer to I<object> to indicate that
the pointer located at I<weak_pointer_location> is only valid during
the lifetime of I<object>. When the I<object> is finalized,
I<weak_pointer> will be set to C<Any>.

Note that as with C<g_object_weak_ref()>, the weak references created by
this method are not thread-safe: they cannot safely be used in one
thread if the object's last C<g_object_unref()> might happen in another
thread. Use I<GWeakRef> if thread-safety is required.

  method g_object_add_weak_pointer ( Pointer $weak_pointer_location )

=item Pointer $weak_pointer_location; (inout) (not optional): The memory address of a pointer.

=end pod

sub g_object_add_weak_pointer ( N-GObject $object, Pointer $weak_pointer_location )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_remove_weak_pointer:
=begin pod
=head2 [[g_] object_] remove_weak_pointer

Removes a weak reference from I<object> that was previously added
using C<g_object_add_weak_pointer()>. The I<weak_pointer_location> has
to match the one used with C<g_object_add_weak_pointer()>.

  method g_object_remove_weak_pointer ( Pointer $weak_pointer_location )

=item Pointer $weak_pointer_location; (inout) (not optional): The memory address of a pointer.

=end pod

sub g_object_remove_weak_pointer ( N-GObject $object, Pointer $weak_pointer_location )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_add_toggle_ref:
=begin pod
=head2 [[g_] object_] add_toggle_ref

Increases the reference count of the object by one and sets a
callback to be called when all other references to the object are
dropped, or when this is already the last reference to the object
and another reference is established.

This functionality is intended for binding I<object> to a proxy
object managed by another memory manager. This is done with two
paired references: the strong reference added by
C<g_object_add_toggle_ref()> and a reverse reference to the proxy
object which is either a strong reference or weak reference.

The setup is that when there are no other references to I<object>,
only a weak reference is held in the reverse direction from I<object>
to the proxy object, but when there are other references held to
I<object>, a strong reference is held. The I<notify> callback is called
when the reference from I<object> to the proxy object should be
"toggled" from strong to weak (I<is_last_ref> true) or weak to strong
(I<is_last_ref> false).

Since a (normal) reference must be held to the object before
calling C<g_object_add_toggle_ref()>, the initial state of the reverse
link is always strong.

Multiple toggle references may be added to the same gobject,
however if there are multiple toggle references to an object, none
of them will ever be notified until all but one are removed.  For
this reason, you should only ever use a toggle reference if there
is important state in the proxy object.


  method g_object_add_toggle_ref ( GToggleNotify $notify, Pointer $data )

=item GToggleNotify $notify; a function to call when this reference is the last reference to the object, or is no longer the last reference.
=item Pointer $data; data to pass to I<notify>

=end pod

sub g_object_add_toggle_ref ( N-GObject $object, GToggleNotify $notify, Pointer $data )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_remove_toggle_ref:
=begin pod
=head2 [[g_] object_] remove_toggle_ref

Removes a reference added with C<g_object_add_toggle_ref()>. The
reference count of the object is decreased by one.


  method g_object_remove_toggle_ref ( GToggleNotify $notify, Pointer $data )

=item GToggleNotify $notify; a function to call when this reference is the last reference to the object, or is no longer the last reference.
=item Pointer $data; data to pass to I<notify>

=end pod

sub g_object_remove_toggle_ref ( N-GObject $object, GToggleNotify $notify, Pointer $data )
  is native(&gobject-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_get_qdata:
=begin pod
=head2 [[g_] object_] get_qdata

This function gets back user data pointers stored via
C<g_object_set_qdata()>.

Returns: (transfer none) (nullable): The user data pointer set, or C<Any>

  method g_object_get_qdata ( int32 $quark --> Pointer  )

=item int32 $quark; A I<GQuark>, naming the user data pointer

=end pod

sub g_object_get_qdata ( N-GObject $object, int32 $quark )
  returns Pointer
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_set_qdata:
=begin pod
=head2 [[g_] object_] set_qdata

This sets an opaque, named pointer on an object.
The name is specified through a I<GQuark> (retrived e.g. via
C<g_quark_from_static_string()>), and the pointer
can be gotten back from the I<object> with C<g_object_get_qdata()>
until the I<object> is finalized.
Setting a previously set user data pointer, overrides (frees)
the old pointer set, using I<NULL> as pointer essentially
removes the data stored.

  method g_object_set_qdata ( int32 $quark, Pointer $data )

=item int32 $quark; A I<GQuark>, naming the user data pointer
=item Pointer $data; (nullable): An opaque user data pointer

=end pod

sub g_object_set_qdata ( N-GObject $object, int32 $quark, Pointer $data )
  is native(&gobject-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_set_qdata_full:
=begin pod
=head2 [[g_] object_] set_qdata_full

This function works like C<g_object_set_qdata()>, but in addition,
a void (*destroy) (gpointer) function may be specified which is
called with I<data> as argument when the I<object> is finalized, or
the data is being overwritten by a call to C<g_object_set_qdata()>
with the same I<quark>.

  method g_object_set_qdata_full ( int32 $quark, Pointer $data, GDestroyNotify $destroy )

=item int32 $quark; A I<GQuark>, naming the user data pointer
=item Pointer $data; (nullable): An opaque user data pointer
=item GDestroyNotify $destroy; (nullable): Function to invoke with I<data> as argument, when I<data> needs to be freed

=end pod

sub g_object_set_qdata_full ( N-GObject $object, int32 $quark, Pointer $data, GDestroyNotify $destroy )
  is native(&gobject-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_steal_qdata:
=begin pod
=head2 [[g_] object_] steal_qdata

This function gets back user data pointers stored via
C<g_object_set_qdata()> and removes the I<data> from object
without invoking its C<destroy()> function (if any was
set).
Usually, calling this function is only required to update
user data pointers with a destroy notifier, for example:
|[<!-- language="C" -->
void
object_add_to_user_list (GObject     *object,
const gchar *new_string)
{
// the quark, naming the object data
GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
// retrive the old string list
GList *list = g_object_steal_qdata (object, quark_string_list);

// prepend new string
list = g_list_prepend (list, g_strdup (new_string));
// this changed 'list', so we need to set it again
g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
}
static void
free_string_list (gpointer data)
{
GList *node, *list = data;

for (node = list; node; node = node->next)
g_free (node->data);
g_list_free (list);
}
]|
Using C<g_object_get_qdata()> in the above example, instead of
C<g_object_steal_qdata()> would have left the destroy function set,
and thus the partial string list would have been freed upon
C<g_object_set_qdata_full()>.

Returns: (transfer full) (nullable): The user data pointer set, or C<Any>

  method g_object_steal_qdata ( int32 $quark --> Pointer  )

=item int32 $quark; A I<GQuark>, naming the user data pointer

=end pod

sub g_object_steal_qdata ( N-GObject $object, int32 $quark )
  returns Pointer
  is native(&gobject-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_dup_qdata:
=begin pod
=head2 [[g_] object_] dup_qdata

This is a variant of C<g_object_get_qdata()> which returns
a 'duplicate' of the value. I<dup_func> defines the
meaning of 'duplicate' in this context, it could e.g.
take a reference on a ref-counted object.

If the I<quark> is not set on the object then I<dup_func>
will be called with a C<Any> argument.

Note that I<dup_func> is called while user data of I<object>
is locked.

This function can be useful to avoid races when multiple
threads are using object data on the same key on the same
object.

Returns: the result of calling I<dup_func> on the value
associated with I<quark> on I<object>, or C<Any> if not set.
If I<dup_func> is C<Any>, the value is returned
unmodified.


  method g_object_dup_qdata ( int32 $quark, GDuplicateFunc $dup_func, Pointer $user_data --> Pointer  )

=item int32 $quark; a I<GQuark>, naming the user data pointer
=item GDuplicateFunc $dup_func; (nullable): function to dup the value
=item Pointer $user_data; (nullable): passed as user_data to I<dup_func>

=end pod

sub g_object_dup_qdata ( N-GObject $object, int32 $quark, GDuplicateFunc $dup_func, Pointer $user_data )
  returns Pointer
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:g_object_replace_qdata:
=begin pod
=head2 [[g_] object_] replace_qdata

Compares the user data for the key I<quark> on I<object> with
I<oldval>, and if they are the same, replaces I<oldval> with
I<newval>.

This is like a typical atomic compare-and-exchange
operation, for user data on an object.

If the previous value was replaced then ownership of the
old value (I<oldval>) is passed to the caller, including
the registered destroy notify for it (passed out in I<old_destroy>).
It’s up to the caller to free this as needed, which may
or may not include using I<old_destroy> as sometimes replacement
should not destroy the object in the normal way.

Returns: C<1> if the existing value for I<quark> was replaced
by I<newval>, C<0> otherwise.


  method g_object_replace_qdata ( int32 $quark, Pointer $oldval, Pointer $newval, GDestroyNotify $destroy, GDestroyNotify $old_destroy --> Int  )

=item int32 $quark; a I<GQuark>, naming the user data pointer
=item Pointer $oldval; (nullable): the old value to compare against
=item Pointer $newval; (nullable): the new value
=item GDestroyNotify $destroy; (nullable): a destroy notify for the new value
=item GDestroyNotify $old_destroy; (out) (optional): destroy notify for the existing value

=end pod

sub g_object_replace_qdata ( N-GObject $object, int32 $quark, Pointer $oldval, Pointer $newval, GDestroyNotify $destroy, GDestroyNotify $old_destroy )
  returns int32
  is native(&gobject-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
#TM:0:g_object_set_data_full:
=begin pod