### ----------------------------------------------------
### -- Gnome::GObject
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/GObject/Type.rakumod
### ----------------------------------------------------
### -- Chunk 3 of 4


Get name of type from the instance.

  method name-from-instance ( N-GObject $instance --> Str )

=item N-GObject $instance;
=end pod

method name-from-instance ( N-GObject $instance --> Str ) {
  g_type_name_from_instance($instance)
}

sub g_type_name_from_instance (
  N-GObject $instance --> gchar-ptr
) is native(&gobject-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:next-base:
=begin pod
=head2 next-base

Given a I<leaf-type> and a I<root-type> which is contained in its anchestry, return the type that I<root-type> is the immediate parent of. In other words, this function determines the type that is derived directly from I<root-type> which is also a base class of I<leaf-type>. Given a root type and a leaf type, this function can be used to determine the types and order in which the leaf type is descended from the root type.

Returns: immediate child of I<root-type> and anchestor of I<leaf-type>

  method next-base ( N-GObject $root_type --> N-GObject )

=item N-GObject $root_type; immediate parent of the returned type
=end pod

method next-base ( $root_type is copy --> N-GObject ) {
  $root_type .= _get-native-object-no-reffing unless $root_type ~~ N-GObject;

  g_type_next_base(
    self._get-native-object-no-reffing, $root_type
  )
}

sub g_type_next_base (
  N-GObject $leaf_type, N-GObject $root_type --> N-GObject
) is native(&gobject-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:2:parent:
=begin pod
=head2 parent

Return the direct parent type of the passed in type. If the passed in type has no parent, i.e. is a fundamental type, 0 is returned.

Returns: the parent type

  method parent ( UInt $parent-gtype --> UInt )

=end pod

method parent ( UInt $parent-gtype --> UInt ) {
  g_type_parent($parent-gtype)
}

sub g_type_parent (
  GType $type --> GType
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:qname:
=begin pod
=head2 qname

Get the corresponding quark of the type IDs name.

Returns: the type names quark or 0

  method qname ( UInt $gtype --> UInt )

=end pod

method qname ( UInt $gtype --> UInt ) {
  g_type_qname($gtype)
}

sub g_type_qname (
  GType $type --> GQuark
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:query:
=begin pod
=head2 query

Queries the type system for information about a specific type. This function will fill in a user-provided structure to hold type-specific information. If an invalid B<Gnome::GObject::Type> is passed in, the I<$type> member of the B<N-GTypeQuery> is 0. All members filled into the B<N-GTypeQuery> structure should be considered constant and have to be left untouched.

  method query ( UInt $gtype --> N-GTypeQuery )

=end pod

method query ( UInt $gtype --> N-GTypeQuery ) {
  my N-GTypeQuery $query .= new;
  g_type_query( $gtype, $query);

  $query
}

sub g_type_query (
  GType $gtype, N-GTypeQuery $query
) is native(&gobject-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:register-dynamic:
=begin pod
=head2 register-dynamic

Registers I<type-name> as the name of a new dynamic type derived from I<parent-type>. The type system uses the information contained in the B<Gnome::GObject::TypePlugin> structure pointed to by I<plugin> to manage the type and its instances (if not abstract). The value of I<flags> determines the nature (e.g. abstract or not) of the type.

Returns: the new type identifier or B<Gnome::GObject::-TYPE-INVALID> if registration failed

  method register-dynamic ( Str $type_name, N-GObject $plugin, GTypeFlags $flags --> N-GObject )

=item Str $type_name; 0-terminated string used as the name of the new type
=item N-GObject $plugin; B<Gnome::GObject::TypePlugin> structure to retrieve the B<Gnome::GObject::TypeInfo> from
=item GTypeFlags $flags; bitwise combination of B<Gnome::GObject::TypeFlags> values
=end pod

method register-dynamic ( Str $type_name, $plugin is copy, GTypeFlags $flags --> N-GObject ) {
  $plugin .= _get-native-object-no-reffing unless $plugin ~~ N-GObject;

  g_type_register_dynamic(
    self._get-native-object-no-reffing, $type_name, $plugin, $flags
  )
}

sub g_type_register_dynamic (
  N-GObject $parent_type, gchar-ptr $type_name, N-GObject $plugin, GTypeFlags $flags --> N-GObject
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:register-fundamental:
=begin pod
=head2 register-fundamental

Registers I<type-id> as the predefined identifier and I<type-name> as the name of a fundamental type. If I<type-id> is already registered, or a type named I<type-name> is already registered, the behaviour is undefined. The type system uses the information contained in the B<Gnome::GObject::TypeInfo> structure pointed to by I<info> and the B<Gnome::GObject::TypeFundamentalInfo> structure pointed to by I<finfo> to manage the type and its instances. The value of I<flags> determines additional characteristics of the fundamental type.

Returns: the predefined type identifier

  method register-fundamental ( Str $type_name, GTypeInfo $info, GTypeFundamentalInfo $finfo, GTypeFlags $flags --> N-GObject )

=item Str $type_name; 0-terminated string used as the name of the new type
=item GTypeInfo $info; B<Gnome::GObject::TypeInfo> structure for this type
=item GTypeFundamentalInfo $finfo; B<Gnome::GObject::TypeFundamentalInfo> structure for this type
=item GTypeFlags $flags; bitwise combination of B<Gnome::GObject::TypeFlags> values
=end pod

method register-fundamental ( Str $type_name, GTypeInfo $info, GTypeFundamentalInfo $finfo, GTypeFlags $flags --> N-GObject ) {

  g_type_register_fundamental(
    self._get-native-object-no-reffing, $type_name, $info, $finfo, $flags
  )
}

sub g_type_register_fundamental (
  N-GObject $type_id, gchar-ptr $type_name, GTypeInfo $info, GTypeFundamentalInfo $finfo, GTypeFlags $flags --> N-GObject
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:register-static:
=begin pod
=head2 register-static

Registers I<type-name> as the name of a new static type derived from I<parent-type>. The type system uses the information contained in the B<Gnome::GObject::TypeInfo> structure pointed to by I<info> to manage the type and its instances (if not abstract). The value of I<flags> determines the nature (e.g. abstract or not) of the type.

Returns: the new type identifier

  method register-static ( Str $type_name, GTypeInfo $info, GTypeFlags $flags --> N-GObject )

=item Str $type_name; 0-terminated string used as the name of the new type
=item GTypeInfo $info; B<Gnome::GObject::TypeInfo> structure for this type
=item GTypeFlags $flags; bitwise combination of B<Gnome::GObject::TypeFlags> values
=end pod

method register-static ( Str $type_name, GTypeInfo $info, GTypeFlags $flags --> N-GObject ) {

  g_type_register_static(
    self._get-native-object-no-reffing, $type_name, $info, $flags
  )
}

sub g_type_register_static (
  N-GObject $parent_type, gchar-ptr $type_name, GTypeInfo $info, GTypeFlags $flags --> N-GObject
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:register-static-simple:
=begin pod
=head2 register-static-simple

Registers I<type-name> as the name of a new static type derived from I<parent-type>. The value of I<flags> determines the nature (e.g. abstract or not) of the type. It works by filling a B<Gnome::GObject::TypeInfo> struct and calling C<register-static()>.

Returns: the new type identifier

  method register-static-simple ( Str $type_name, UInt $class_size, GClassInitFunc $class_init, UInt $instance_size, GInstanceInitFunc $instance_init, GTypeFlags $flags --> N-GObject )

=item Str $type_name; 0-terminated string used as the name of the new type
=item UInt $class_size; size of the class structure (see B<Gnome::GObject::TypeInfo>)
=item GClassInitFunc $class_init; location of the class initialization function (see B<Gnome::GObject::TypeInfo>)
=item UInt $instance_size; size of the instance structure (see B<Gnome::GObject::TypeInfo>)
=item GInstanceInitFunc $instance_init; location of the instance initialization function (see B<Gnome::GObject::TypeInfo>)
=item GTypeFlags $flags; bitwise combination of B<Gnome::GObject::TypeFlags> values
=end pod

method register-static-simple ( Str $type_name, UInt $class_size, GClassInitFunc $class_init, UInt $instance_size, GInstanceInitFunc $instance_init, GTypeFlags $flags --> N-GObject ) {

  g_type_register_static_simple(
    self._get-native-object-no-reffing, $type_name, $class_size, $class_init, $instance_size, $instance_init, $flags
  )
}

sub g_type_register_static_simple (
  N-GObject $parent_type, gchar-ptr $type_name, guint $class_size, GClassInitFunc $class_init, guint $instance_size, GInstanceInitFunc $instance_init, GTypeFlags $flags --> N-GObject
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:remove-class-cache-func:
=begin pod
=head2 remove-class-cache-func

Removes a previously installed B<Gnome::GObject::TypeClassCacheFunc>. The cache maintained by I<cache-func> has to be empty when calling C<remove-class-cache-func()> to avoid leaks.

  method remove-class-cache-func ( Pointer $cache_data, GTypeClassCacheFunc $cache_func )

=item Pointer $cache_data; data that was given when adding I<cache-func>
=item GTypeClassCacheFunc $cache_func; a B<Gnome::GObject::TypeClassCacheFunc>
=end pod

method remove-class-cache-func ( Pointer $cache_data, GTypeClassCacheFunc $cache_func ) {

  g_type_remove_class_cache_func(
    self._get-native-object-no-reffing, $cache_data, $cache_func
  );
}

sub g_type_remove_class_cache_func (
  gpointer $cache_data, GTypeClassCacheFunc $cache_func
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:remove-interface-check:
=begin pod
=head2 remove-interface-check

Removes an interface check function added with C<add-interface-check()>.

  method remove-interface-check ( Pointer $check_data, GTypeInterfaceCheckFunc $check_func )

=item Pointer $check_data; callback data passed to C<add-interface-check()>
=item GTypeInterfaceCheckFunc $check_func; callback function passed to C<add-interface-check()>
=end pod

method remove-interface-check ( Pointer $check_data, GTypeInterfaceCheckFunc $check_func ) {

  g_type_remove_interface_check(
    self._get-native-object-no-reffing, $check_data, $check_func
  );
}

sub g_type_remove_interface_check (
  gpointer $check_data, GTypeInterfaceCheckFunc $check_func
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:set-qdata:
=begin pod
=head2 set-qdata

Attaches arbitrary data to a type.

  method set-qdata ( UInt $quark, Pointer $data )

=item UInt $quark; a B<Gnome::GObject::Quark> id to identify the data
=item Pointer $data; the data
=end pod

method set-qdata ( UInt $quark, Pointer $data ) {

  g_type_set_qdata(
    self._get-native-object-no-reffing, $quark, $data
  );
}

sub g_type_set_qdata (
  N-GObject $type, GQuark $quark, gpointer $data
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:value-table-peek:
=begin pod
=head2 value-table-peek

Returns the location of the B<Gnome::GObject::TypeValueTable> associated with I<type>.

Note that this function should only be used from source code that implements or has internal knowledge of the implementation of I<type>.

Returns: location of the B<Gnome::GObject::TypeValueTable> associated with I<type> or C<undefined> if there is no B<Gnome::GObject::TypeValueTable> associated with I<type>

  method value-table-peek ( --> GTypeValueTable )

=end pod

method value-table-peek ( --> GTypeValueTable ) {

  g_type_value_table_peek(
    self._get-native-object-no-reffing,
  )
}

sub g_type_value_table_peek (
  N-GObject $type --> GTypeValueTable
) is native(&gobject-lib)
  { * }
}}












































=finish
#-------------------------------------------------------------------------------
#TM:2:g_type_name:xt/Type.t
=begin pod
=head2 [g_] type_name

Get the unique name that is assigned to a type ID. Note that this function (like all other GType API) cannot cope with invalid type IDs. C<G_TYPE_INVALID> may be passed to this function, as may be any other validly registered type ID, but randomized type IDs should not be passed in and will most likely lead to a crash.

Returns: static type name or undefined

  method g_type_name ( UInt $gtype --> Str )

=end pod

sub g_type_name ( GType $type --> Str )
  is native(&gobject-lib)
  { * }

#`{{
}}
#-------------------------------------------------------------------------------
#TM:2:g_type_qname:xt/Type.t
=begin pod
=head2 [g_] type_qname

Get the corresponding quark of the type IDs name.

Returns: the type names quark or 0

  method g_type_qname ( UInt $gtype --> UInt  )

=end pod

sub g_type_qname ( GType $type --> GQuark )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:g_type_from_name:xt/Type.t
=begin pod
=head2 [[g_] type_] from_name

Lookup the type ID from a given type name, returning 0 if no type has been registered under this name (this is the preferred method to find out by name whether a specific type has been registered yet).

Returns: corresponding type ID or 0

  method g_type_from_name ( Str $name --> UInt )

=item Str $name; type name to lookup

=end pod

sub g_type_from_name ( Str $name --> GType )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:g_type_parent:xt/Type.t
=begin pod
=head2 [g_] type_parent

Return the direct parent type of the passed in type. If the passed in type has no parent, i.e. is a fundamental type, 0 is returned.

Returns: the parent type

  method g_type_parent ( UInt $parent-type --> UInt )

=end pod

sub g_type_parent ( GType $type --> GType )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:g_type_depth:xt/Type.t
=begin pod
=head2 [g_] type_depth

Returns the length of the ancestry of the passed in type. This includes the type itself, so that e.g. a fundamental type has depth 1.

Returns: the depth of I<$type>

  method g_type_depth ( UInt $type --> UInt  )


=end pod

sub g_type_depth ( GType $type --> guint )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:g_type_is_a:xt/Type.t
=begin pod
=head2 [[g_] type_] is_a

If I<$is_a_type> is a derivable type, check whether I<$type> is a descendant of I<$is_a_type>. If I<$is_a_type> is an interface, check whether I<$type> conforms to it.

Returns: C<1> if I<$type> is a I<$is_a_type>.

  method g_type_is_a ( UInt $type, UInt $is_a_type --> Int )

=item UInt $is_a_type; possible anchestor of I<$type> or interface that I<$type> could conform to.

=end pod

sub g_type_is_a ( GType $type, GType $is_a_type --> gboolean )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:g_type_query:xt/Type.t
=begin pod
=head2 [g_] type_query

Queries the type system for information about a specific type. This function will fill in a user-provided structure to hold type-specific information. If an invalid I<GType> is passed in, the I<$type> member of the I<N-GTypeQuery> is 0. All members filled into the I<N-GTypeQuery> structure should be considered constant and have to be left untouched.

  method g_type_query ( int32 $type --> N-GTypeQuery )

=item N-GTypeQuery $query; a structure that is filled in with constant values upon success

=end pod

sub g_type_query ( GType $type --> N-GTypeQuery ) {
  my N-GTypeQuery $query .= new;
  _g_type_query( $type, $query);

  $query
}

sub _g_type_query ( GType $type, N-GTypeQuery $query is rw )
  is native(&gobject-lib)
  is symbol('g_type_query')
  { * }

#-------------------------------------------------------------------------------
#TM:2:g_type_check_instance_cast:xt/Type.t
=begin pod
=head2 [[g_] type_] check_instance_cast

Checks that instance is an instance of the type identified by g_type and issues a warning if this is not the case. Returns instance casted to a pointer to c_type.

No warning will be issued if instance is NULL, and NULL will be returned.

This macro should only be used in type implementations.

  method g_type_check_instance_cast (
    N-GObject $instance, UInt $iface_type
    --> N-GObject
  )

=item N-GObject $instance;
=item UInt $iface_type;

=end pod

sub g_type_check_instance_cast ( N-GObject $instance, GType $iface_type --> N-GObject )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:g_type_check_instance_is_a:xt/Type.t
=begin pod
=head2 [[g_] type_] check_instance_is_a

  method g_type_check_instance_is_a (
    N-GObject $instance, UInt $iface_type --> Int
  )

=item N-GObject $instance; the native object to check.
=item UInt $iface_type; the gtype the instance is inheriting from.

=end pod

sub g_type_check_instance_is_a (
  N-GObject $instance, GType $iface_type --> int32
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:6:g_type_name_from_instance:Gnome::Gtk3::Builder
=begin pod
=head2 [[g_] type_] name_from_instance

Get name of type from the instance.

  method g_type_name_from_instance ( N-GObject $instance --> Str  )

=item int32 $instance;

Returns the name of the instance.

=end pod

sub g_type_name_from_instance ( N-GObject $instance --> Str )
  is native(&gobject-lib)
  { * }


#-------------------------------------------------------------------------------
#TM:2:g_gtype_get_type:t/Value.t
=begin pod
=head2 [g_] gtype_get_type

Get dynamic type for a GTyped value. In C there is this name G_TYPE_GTYPE.

  method g_gtype_get_type ( --> UInt  )

=end pod

sub g_gtype_get_type (  --> GType )
  is native(&gobject-lib)
  { * }





=finish

#-------------------------------------------------------------------------------
#--[ Unused code of subs ]------------------------------------------------------
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
# TM:0:g_type_name_from_class:
=begin pod
=head2 [[g_] type_] name_from_class



  method g_type_name_from_class ( int32 $g_class --> Str  )

=item int32 $g_class;

=end pod

sub g_type_name_from_class ( int32 $g_class --> Str )
  is native(&gobject-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_check_instance_is_fundamentally_a:
=begin pod
=head2 [[g_] type_] check_instance_is_fundamentally_a



  method g_type_check_instance_is_fundamentally_a ( int32 $instance, int32 $fundamental_type --> Int  )

=item int32 $instance;
=item int32 $fundamental_type;

=end pod

sub g_type_check_instance_is_fundamentally_a ( int32 $instance, int32 $fundamental_type --> int32 )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_check_class_cast:
=begin pod
=head2 [[g_] type_] check_class_cast



  method g_type_check_class_cast ( int32 $g_class, int32 $is_a_type --> int32  )

=item int32 $g_class;
=item int32 $is_a_type;

=end pod

sub g_type_check_class_cast ( int32 $g_class, int32 $is_a_type --> int32 )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_check_class_is_a:
=begin pod
=head2 [[g_] type_] check_class_is_a



  method g_type_check_class_is_a ( int32 $g_class, int32 $is_a_type --> Int  )

=item int32 $g_class;
=item int32 $is_a_type;

=end pod

sub g_type_check_class_is_a ( int32 $g_class, int32 $is_a_type --> int32 )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_check_value:
=begin pod
=head2 [[g_] type_] check_value

Checks if value has been initialized to hold values of type g_type.

  method g_type_check_value ( N-GObject $value --> Int  )

=item N-GObject $value;

=end pod

sub g_type_check_value ( N-GObject $value --> int32 )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_check_value_holds:
=begin pod
=head2 [[g_] type_] check_value_holds



  method g_type_check_value_holds ( N-GObject $value, int32 $type --> Int  )

=item N-GObject $value;
=item int32 $type;

=end pod

sub g_type_check_value_holds ( N-GObject $value, int32 $type --> int32 )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_get_instance_count:
=begin pod
=head2 [[g_] type_] get_instance_count

Returns the number of instances allocated of the particular type;
this is only available if GLib is built with debugging support and
the instance_count debug flag is set (by setting the GOBJECT_DEBUG
variable to include instance-count).

Returns: the number of instances allocated of the given type;
if instance counts are not available, returns 0.

  method g_type_get_instance_count ( --> int32  )


=end pod

sub g_type_get_instance_count ( int32 $type --> int32 )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_register_static:
=begin pod
=head2 [[g_] type_] register_static

Registers I<type_name> as the name of a new static type derived from
I<parent_type>. The type system uses the information contained in the
I<GTypeInfo> structure pointed to by I<info> to manage the type and its
instances (if not abstract). The value of I<flags> determines the nature
(e.g. abstract or not) of the type.

Returns: the new type identifier

  method g_type_register_static ( Str $type_name, int32 $info, int32 $flags --> int32  )

=item Str $type_name; 0-terminated string used as the name of the new type
=item int32 $info; I<GTypeInfo> structure for this type
=item int32 $flags; bitwise combination of I<GTypeFlags> values

=end pod

sub g_type_register_static ( int32 $parent_type, Str $type_name, int32 $info, int32 $flags --> int32 )
  is native(&gobject-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_register_static_simple:
=begin pod
=head2 [[g_] type_] register_static_simple

Registers I<type_name> as the name of a new static type derived from
I<parent_type>.  The value of I<flags> determines the nature (e.g.
abstract or not) of the type. It works by filling a I<GTypeInfo>
struct and calling C<g_type_register_static()>.

Returns: the new type identifier

  method g_type_register_static_simple ( Str $type_name, UInt $class_size, GClassInitFunc $class_init, UInt $instance_size, GInstanceInitFunc $instance_init, int32 $flags --> int32  )

=item Str $type_name; 0-terminated string used as the name of the new type
=item UInt $class_size; size of the class structure (see I<GTypeInfo>)
=item GClassInitFunc $class_init; location of the class initialization function (see I<GTypeInfo>)
=item UInt $instance_size; size of the instance structure (see I<GTypeInfo>)
=item GInstanceInitFunc $instance_init; location of the instance initialization function (see I<GTypeInfo>)
=item int32 $flags; bitwise combination of I<GTypeFlags> values

=end pod

sub g_type_register_static_simple ( int32 $parent_type, Str $type_name, uint32 $class_size, GClassInitFunc $class_init, uint32 $instance_size, GInstanceInitFunc $instance_init, int32 $flags --> int32 )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_register_dynamic:
=begin pod
=head2 [[g_] type_] register_dynamic

Registers I<type_name> as the name of a new dynamic type derived from
I<parent_type>.  The type system uses the information contained in the
I<GTypePlugin> structure pointed to by I<plugin> to manage the type and its
instances (if not abstract).  The value of I<flags> determines the nature
(e.g. abstract or not) of the type.

Returns: the new type identifier or I<G_TYPE_INVALID> if registration failed

  method g_type_register_dynamic ( Str $type_name, int32 $plugin, int32 $flags --> int32  )

=item Str $type_name; 0-terminated string used as the name of the new type
=item int32 $plugin; I<GTypePlugin> structure to retrieve the I<GTypeInfo> from
=item int32 $flags; bitwise combination of I<GTypeFlags> values

=end pod

sub g_type_register_dynamic ( int32 $parent_type, Str $type_name, int32 $plugin, int32 $flags --> int32 )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_register_fundamental:
=begin pod
=head2 [[g_] type_] register_fundamental

Registers I<type_id> as the predefined identifier and I<type_name> as the
name of a fundamental type. If I<type_id> is already registered, or a
type named I<type_name> is already registered, the behaviour is undefined.
The type system uses the information contained in the I<GTypeInfo> structure
pointed to by I<info> and the I<GTypeFundamentalInfo> structure pointed to by
I<finfo> to manage the type and its instances. The value of I<flags> determines
additional characteristics of the fundamental type.

Returns: the predefined type identifier

  method g_type_register_fundamental ( Str $type_name, int32 $info, int32 $finfo, int32 $flags --> int32  )

=item Str $type_name; 0-terminated string used as the name of the new type
=item int32 $info; I<GTypeInfo> structure for this type
=item int32 $finfo; I<GTypeFundamentalInfo> structure for this type
=item int32 $flags; bitwise combination of I<GTypeFlags> values

=end pod

sub g_type_register_fundamental ( int32 $type_id, Str $type_name, int32 $info, int32 $finfo, int32 $flags --> int32 )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_add_interface_static:
=begin pod
=head2 [[g_] type_] add_interface_static

Adds the static I<interface_type> to I<instantiable_type>.
The information contained in the I<N-GInterfaceInfo> structure
pointed to by I<info> is used to manage the relationship.

  method g_type_add_interface_static ( int32 $interface_type, N-GInterfaceInfo $info )

=item int32 $interface_type; I<GType> value of an interface type
=item N-GInterfaceInfo $info; I<N-GInterfaceInfo> structure for this (I<instance_type>, I<interface_type>) combination

=end pod

sub g_type_add_interface_static ( int32 $instance_type, int32 $interface_type, N-GInterfaceInfo $info )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_add_interface_dynamic:
=begin pod
=head2 [[g_] type_] add_interface_dynamic

Adds the dynamic I<interface_type> to I<instantiable_type>. The information
contained in the I<GTypePlugin> structure pointed to by I<plugin>
is used to manage the relationship.

  method g_type_add_interface_dynamic ( int32 $interface_type, int32 $plugin )

=item int32 $interface_type; I<GType> value of an interface type
=item int32 $plugin; I<GTypePlugin> structure to retrieve the I<N-GInterfaceInfo> from

=end pod

sub g_type_add_interface_dynamic ( int32 $instance_type, int32 $interface_type, int32 $plugin )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_interface_add_prerequisite:
=begin pod
=head2 [[g_] type_] interface_add_prerequisite

Adds I<prerequisite_type> to the list of prerequisites of I<interface_type>.
This means that any type implementing I<interface_type> must also implement
I<prerequisite_type>. Prerequisites can be thought of as an alternative to
interface derivation (which GType doesn't support). An interface can have
at most one instantiatable prerequisite type.

  method g_type_interface_add_prerequisite ( int32 $prerequisite_type )

=item int32 $prerequisite_type; I<GType> value of an interface or instantiatable type

=end pod

sub g_type_interface_add_prerequisite ( int32 $interface_type, int32 $prerequisite_type )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_interface_prerequisites:
=begin pod
=head2 [[g_] type_] interface_prerequisites

Returns the prerequisites of an interfaces type.

Returns: (array length=n_prerequisites) (transfer full): a
newly-allocated zero-terminated array of I<GType> containing
the prerequisites of I<interface_type>

  method g_type_interface_prerequisites ( UInt $n_prerequisites --> int32  )

=item UInt $n_prerequisites; (out) (optional): location to return the number of prerequisites, or C<Any>

=end pod

sub g_type_interface_prerequisites ( int32 $interface_type, uint32 $n_prerequisites --> int32 )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_add_instance_private:
=begin pod
=head2 [[g_] type_] add_instance_private



  method g_type_add_instance_private ( UInt $private_size --> Int  )

=item UInt $private_size;

=end pod

sub g_type_add_instance_private ( int32 $class_type, uint64 $private_size --> int32 )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_instance_get_private:
=begin pod
=head2 [[g_] type_] instance_get_private



  method g_type_instance_get_private ( int32 $instance, int32 $private_type --> Pointer  )

=item int32 $instance;
=item int32 $private_type;

=end pod

sub g_type_instance_get_private ( int32 $instance, int32 $private_type --> Pointer )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_class_adjust_private_offset:
=begin pod
=head2 [[g_] type_] class_adjust_private_offset



  method g_type_class_adjust_private_offset ( Pointer $g_class, Int $private_size_or_offset )

=item Pointer $g_class;
=item Int $private_size_or_offset;

=end pod

sub g_type_class_adjust_private_offset ( Pointer $g_class, int32 $private_size_or_offset )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_add_class_private:
=begin pod
=head2 [[g_] type_] add_class_private

Registers a private class structure for a classed type;
when the class is allocated, the private structures for
the class and all of its parent types are allocated
sequentially in the same memory block as the public
structures, and are zero-filled.

This function should be called in the
type's C<get_type()> function after the type is registered.
The private structure can be retrieved using the
C<G_TYPE_CLASS_GET_PRIVATE()> macro.

  method g_type_add_class_private ( UInt $private_size )

=item UInt $private_size; size of private structure

=end pod

sub g_type_add_class_private ( int32 $class_type, uint64 $private_size )
  is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:g_type_class_get_private:
=begin pod
=head2 [[g_] type_] class_get_private



  method g_type_class_get_private ( int32 $klass, int32 $private_type --> Pointer  )

=item int32 $klass;
=item int32 $private_type;

=end pod

sub g_type_class_get_private ( int32 $klass, int32 $private_type --> Pointer )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_class_get_instance_private_offset:
=begin pod
=head2 [[g_] type_] class_get_instance_private_offset

Gets the offset of the private data for instances of I<g_class>.

This is how many bytes you should add to the instance pointer of a
class in order to get the private data for the type represented by
I<g_class>.

You can only call this function after you have registered a private
data area for I<g_class> using C<g_type_class_add_private()>.

Returns: the offset, in bytes

  method g_type_class_get_instance_private_offset ( Pointer $g_class --> Int  )

=item Pointer $g_class; (type GObject.TypeClass): a I<N-GTypeClass>

=end pod

sub g_type_class_get_instance_private_offset ( Pointer $g_class --> int32 )
  is native(&gobject-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:g_type_ensure:
=begin pod
=head2 [g_] type_ensure

Ensures that the indicated I<type> has been registered with the
type system, and its C<_class_init()> method has been run.

In theory, simply calling the type's C<_get_type()> method (or using
the corresponding macro) is supposed take care of this. However,
C<_get_type()> methods are often marked C<G_GNUC_CONST> for performance
reasons, even though this is technically