### ----------------------------------------------------
### -- Gnome::GObject
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/GObject/Type.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 4
gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:add-interface-static:
=begin pod
=head2 add-interface-static

Adds the static I<interface-type> to I<instantiable-type>. The information contained in the B<Gnome::GObject::InterfaceInfo> structure pointed to by I<info> is used to manage the relationship.

  method add-interface-static ( N-GObject $interface_type, GInterfaceInfo $info )

=item N-GObject $interface_type; B<Gnome::GObject::Type> value of an interface type
=item GInterfaceInfo $info; B<Gnome::GObject::InterfaceInfo> structure for this (I<instance-type>, I<interface-type>) combination
=end pod

method add-interface-static ( $interface_type is copy, GInterfaceInfo $info ) {
  $interface_type .= _get-native-object-no-reffing unless $interface_type ~~ N-GObject;

  g_type_add_interface_static(
    self._get-native-object-no-reffing, $interface_type, $info
  );
}

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

#-------------------------------------------------------------------------------
# TM:0:check-class-cast:
=begin pod
=head2 check-class-cast



  method check-class-cast ( GTypeClass $g_class, N-GObject $is_a_type --> GTypeClass )

=item GTypeClass $g_class;
=item N-GObject $is_a_type;
=end pod

method check-class-cast ( GTypeClass $g_class, $is_a_type is copy --> GTypeClass ) {
  $is_a_type .= _get-native-object-no-reffing unless $is_a_type ~~ N-GObject;

  g_type_check_class_cast(
    self._get-native-object-no-reffing, $g_class, $is_a_type
  )
}

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

#-------------------------------------------------------------------------------
# TM:0:check-class-is-a:
=begin pod
=head2 check-class-is-a



  method check-class-is-a ( GTypeClass $g_class, N-GObject $is_a_type --> Bool )

=item GTypeClass $g_class;
=item N-GObject $is_a_type;
=end pod

method check-class-is-a ( GTypeClass $g_class, $is_a_type is copy --> Bool ) {
  $is_a_type .= _get-native-object-no-reffing unless $is_a_type ~~ N-GObject;

  g_type_check_class_is_a(
    self._get-native-object-no-reffing, $g_class, $is_a_type
  ).Bool
}

sub g_type_check_class_is_a (
  GTypeClass $g_class, N-GObject $is_a_type --> gboolean
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:check-instance:
=begin pod
=head2 check-instance

Private helper function to aid implementation of the C<G-TYPE-CHECK-INSTANCE()> macro.

Returns: C<True> if I<instance> is valid, C<False> otherwise

  method check-instance ( GTypeInstance $instance --> Bool )

=item GTypeInstance $instance; a valid B<Gnome::GObject::TypeInstance> structure
=end pod

method check-instance ( GTypeInstance $instance --> Bool ) {

  g_type_check_instance(
    self._get-native-object-no-reffing, $instance
  ).Bool
}

sub g_type_check_instance (
  GTypeInstance $instance --> gboolean
) is native(&gobject-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:2:check-instance-cast:
=begin pod
=head2 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.

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

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

method check-instance-cast (
  $instance is copy, UInt $iface_gtype --> N-GObject
) {
  $instance .= _get-native-object-no-reffing unless $instance ~~ N-GObject;
  g_type_check_instance_cast( $instance, $iface_gtype)
}

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

#-------------------------------------------------------------------------------
#TM:2:check-instance-is-a:
=begin pod
=head2 check-instance-is-a

Check if an instance is of type C<$iface-gtype>. Returns True if it is.

  method check-instance-is-a (
    N-GObject $instance, UInt $iface_gtype --> Bool
  )

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

method check-instance-is-a (
  $instance is copy, UInt $iface_gtype --> Bool
) {
  $instance .= _get-native-object-no-reffing unless $instance ~~ N-GObject;
  g_type_check_instance_is_a( $instance, $iface_gtype).Bool
}

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

#`{{
#-------------------------------------------------------------------------------
# TM:0:check-instance-is-fundamentally-a:
=begin pod
=head2 check-instance-is-fundamentally-a



  method check-instance-is-fundamentally-a ( GTypeInstance $instance, N-GObject $fundamental_type --> Bool )

=item GTypeInstance $instance;
=item N-GObject $fundamental_type;
=end pod

method check-instance-is-fundamentally-a ( GTypeInstance $instance, $fundamental_type is copy --> Bool ) {
  $fundamental_type .= _get-native-object-no-reffing unless $fundamental_type ~~ N-GObject;

  g_type_check_instance_is_fundamentally_a(
    self._get-native-object-no-reffing, $instance, $fundamental_type
  ).Bool
}

sub g_type_check_instance_is_fundamentally_a (
  GTypeInstance $instance, N-GObject $fundamental_type --> gboolean
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:check-value:
=begin pod
=head2 check-value



  method check-value ( N-GObject $value --> Bool )

=item N-GObject $value;
=end pod

method check-value ( $value is copy --> Bool ) {
  $value .= _get-native-object-no-reffing unless $value ~~ N-GObject;

  g_type_check_value(
    self._get-native-object-no-reffing, $value
  ).Bool
}

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

#-------------------------------------------------------------------------------
# TM:0:check-value-holds:
=begin pod
=head2 check-value-holds



  method check-value-holds ( N-GObject $value, N-GObject $type --> Bool )

=item N-GObject $value;
=item N-GObject $type;
=end pod

method check-value-holds ( $value is copy, $type is copy --> Bool ) {
  $value .= _get-native-object-no-reffing unless $value ~~ N-GObject;
  $type .= _get-native-object-no-reffing unless $type ~~ N-GObject;

  g_type_check_value_holds(
    self._get-native-object-no-reffing, $value, $type
  ).Bool
}

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

#-------------------------------------------------------------------------------
# TM:0:children:
=begin pod
=head2 children

Return a newly allocated and 0-terminated array of type IDs, listing the child types of I<type>.

Returns: (array length=n-children) : Newly allocated and 0-terminated array of child types, free with C<g-free()>

  method children ( guInt-ptr $n_children --> N-GObject )

=item guInt-ptr $n_children; location to store the length of the returned array, or C<undefined>
=end pod

method children ( guInt-ptr $n_children --> N-GObject ) {

  g_type_children(
    self._get-native-object-no-reffing, $n_children
  )
}

sub g_type_children (
  N-GObject $type, gugint-ptr $n_children --> N-GObject
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:class-adjust-private-offset:
=begin pod
=head2 class-adjust-private-offset



  method class-adjust-private-offset ( Pointer $g_class )

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

method class-adjust-private-offset ( Pointer $g_class ) {

  g_type_class_adjust_private_offset(
    self._get-native-object-no-reffing, $g_class, my gint $private_size_or_offset
  );
}

sub g_type_class_adjust_private_offset (
  gpointer $g_class, gint $private_size_or_offset is rw
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:class-get-instance-private-offset:
=begin pod
=head2 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<class-add-private()>.

Returns: the offset, in bytes

  method class-get-instance-private-offset ( Pointer $g_class --> Int )

=item Pointer $g_class; (type GObject.TypeClass): a B<Gnome::GObject::TypeClass>
=end pod

method class-get-instance-private-offset ( Pointer $g_class --> Int ) {

  g_type_class_get_instance_private_offset(
    self._get-native-object-no-reffing, $g_class
  )
}

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

#-------------------------------------------------------------------------------
# TM:0:class-get-private:
=begin pod
=head2 class-get-private



  method class-get-private ( GTypeClass $klass, N-GObject $private_type --> Pointer )

=item GTypeClass $klass;
=item N-GObject $private_type;
=end pod

method class-get-private ( GTypeClass $klass, $private_type is copy --> Pointer ) {
  $private_type .= _get-native-object-no-reffing unless $private_type ~~ N-GObject;

  g_type_class_get_private(
    self._get-native-object-no-reffing, $klass, $private_type
  )
}

sub g_type_class_get_private (
  GTypeClass $klass, N-GObject $private_type --> gpointer
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:class-peek:
=begin pod
=head2 class-peek

This function is essentially the same as C<class-ref()>, except that the classes reference count isn't incremented. As a consequence, this function may return C<undefined> if the class of the type passed in does not currently exist (hasn't been referenced before).

Returns: (type GObject.TypeClass) : the B<Gnome::GObject::TypeClass> structure for the given type ID or C<undefined> if the class does not currently exist

  method class-peek ( --> Pointer )

=end pod

method class-peek ( --> Pointer ) {

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

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

#-------------------------------------------------------------------------------
# TM:0:class-peek-parent:
=begin pod
=head2 class-peek-parent

This is a convenience function often needed in class initializers. It returns the class structure of the immediate parent type of the class passed in. Since derived classes hold a reference count on their parent classes as long as they are instantiated, the returned class will always exist.

This function is essentially equivalent to: class-peek (g-type-parent (G-TYPE-FROM-CLASS (g-class)))

Returns: (type GObject.TypeClass) : the parent class of I<g-class>

  method class-peek-parent ( Pointer $g_class --> Pointer )

=item Pointer $g_class; (type GObject.TypeClass): the B<Gnome::GObject::TypeClass> structure to retrieve the parent class for
=end pod

method class-peek-parent ( Pointer $g_class --> Pointer ) {

  g_type_class_peek_parent(
    self._get-native-object-no-reffing, $g_class
  )
}

sub g_type_class_peek_parent (
  gpointer $g_class --> gpointer
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:class-peek-static:
=begin pod
=head2 class-peek-static

A more efficient version of C<class-peek()> which works only for static types.

Returns: (type GObject.TypeClass) : the B<Gnome::GObject::TypeClass> structure for the given type ID or C<undefined> if the class does not currently exist or is dynamically loaded

  method class-peek-static ( --> Pointer )

=end pod

method class-peek-static ( --> Pointer ) {

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

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

#-------------------------------------------------------------------------------
# TM:0:class-ref:
=begin pod
=head2 class-ref

Increments the reference count of the class structure belonging to I<type>. This function will demand-create the class if it doesn't exist already.

Returns: (type GObject.TypeClass) : the B<Gnome::GObject::TypeClass> structure for the given type ID

  method class-ref ( --> Pointer )

=end pod

method class-ref ( --> Pointer ) {

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

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

#-------------------------------------------------------------------------------
# TM:0:class-unref:
=begin pod
=head2 class-unref

Decrements the reference count of the class structure being passed in. Once the last reference count of a class has been released, classes may be finalized by the type system, so further dereferencing of a class pointer after C<class-unref()> are invalid.

  method class-unref ( Pointer $g_class )

=item Pointer $g_class; (type GObject.TypeClass): a B<Gnome::GObject::TypeClass> structure to unref
=end pod

method class-unref ( Pointer $g_class ) {

  g_type_class_unref(
    self._get-native-object-no-reffing, $g_class
  );
}

sub g_type_class_unref (
  gpointer $g_class
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:class-unref-uncached:
=begin pod
=head2 class-unref-uncached

A variant of C<class-unref()> for use in B<Gnome::GObject::TypeClassCacheFunc> implementations. It unreferences a class without consulting the chain of B<Gnome::GObject::TypeClassCacheFuncs>, avoiding the recursion which would occur otherwise.

  method class-unref-uncached ( Pointer $g_class )

=item Pointer $g_class; (type GObject.TypeClass): a B<Gnome::GObject::TypeClass> structure to unref
=end pod

method class-unref-uncached ( Pointer $g_class ) {

  g_type_class_unref_uncached(
    self._get-native-object-no-reffing, $g_class
  );
}

sub g_type_class_unref_uncached (
  gpointer $g_class
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:create-instance:
=begin pod
=head2 create-instance

Creates and initializes an instance of I<type> if I<type> is valid and can be instantiated. The type system only performs basic allocation and structure setups for instances: actual instance creation should happen through functions supplied by the type's fundamental type implementation. So use of C<create-instance()> is reserved for implementators of fundamental types only. E.g. instances of the B<Gnome::GObject::Object> hierarchy should be created via C<g-object-new()> and never directly through C<g-type-create-instance()> which doesn't handle things like singleton objects or object construction.

The extended members of the returned instance are guaranteed to be filled with zeros.

Note: Do not use this function, unless you're implementing a fundamental type. Also language bindings should not use this function, but C<g-object-new()> instead.

Returns: an allocated and initialized instance, subject to further treatment by the fundamental type implementation

  method create-instance ( --> GTypeInstance )

=end pod

method create-instance ( --> GTypeInstance ) {

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

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

#-------------------------------------------------------------------------------
# TM:0:default-interface-peek:
=begin pod
=head2 default-interface-peek

If the interface type I<g-type> is currently in use, returns its default interface vtable.

Returns: (type GObject.TypeInterface) : the default vtable for the interface, or C<undefined> if the type is not currently in use

  method default-interface-peek ( --> Pointer )

=end pod

method default-interface-peek ( --> Pointer ) {

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

sub g_type_default_interface_peek (
  N-GObject $g_type --> gpointer
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:default-interface-ref:
=begin pod
=head2 default-interface-ref

Increments the reference count for the interface type I<g-type>, and returns the default interface vtable for the type.

If the type is not currently in use, then the default vtable for the type will be created and initalized by calling the base interface init and default vtable init functions for the type (the I<base-init> and I<class-init> members of B<Gnome::GObject::TypeInfo>). Calling C<default-interface-ref()> is useful when you want to make sure that signals and properties for an interface have been installed.

Returns: (type GObject.TypeInterface) : the default vtable for the interface; call C<g-type-default-interface-unref()> when you are done using the interface.

  method default-interface-ref ( --> Pointer )

=end pod

method default-interface-ref ( --> Pointer ) {

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

sub g_type_default_interface_ref (
  N-GObject $g_type --> gpointer
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:default-interface-unref:
=begin pod
=head2 default-interface-unref

Decrements the reference count for the type corresponding to the interface default vtable I<g-iface>. If the type is dynamic, then when no one is using the interface and all references have been released, the finalize function for the interface's default vtable (the I<class-finalize> member of B<Gnome::GObject::TypeInfo>) will be called.

  method default-interface-unref ( Pointer $g_iface )

=item Pointer $g_iface; (type GObject.TypeInterface): the default vtable structure for a interface, as returned by C<default-interface-ref()>
=end pod

method default-interface-unref ( Pointer $g_iface ) {

  g_type_default_interface_unref(
    self._get-native-object-no-reffing, $g_iface
  );
}

sub g_type_default_interface_unref (
  gpointer $g_iface
) is native(&gobject-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:2:depth:
=begin pod
=head2 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<$gtype>

  method depth ( UInt $gtype --> UInt )

=end pod

method depth ( UInt $gtype --> UInt ) {
  g_type_depth($gtype)
}

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

#`{{
#-------------------------------------------------------------------------------
# TM:0:ensure:
=begin pod
=head2 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 incorrect (since C<G-GNUC-CONST> requires that the function not have side effects, which C<-get-type()> methods do on the first call). As a result, if you write a bare call to a C<-get-type()> macro, it may get optimized out by the compiler. Using C<ensure()> guarantees that the type's C<-get-type()> method is called.

  method ensure ( )

=end pod

method ensure ( ) {

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

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

#-------------------------------------------------------------------------------
# TM:0:free-instance:
=begin pod
=head2 free-instance

Frees an instance of a type, returning it to the instance pool for the type, if there is one.

Like C<create-instance()>, this function is reserved for implementors of fundamental types.

  method free-instance ( GTypeInstance $instance )

=item GTypeInstance $instance; an instance of a type
=end pod

method free-instance ( GTypeInstance $instance ) {

  g_type_free_instance(
    self._get-native-object-no-reffing, $instance
  );
}

sub g_type_free_instance (
  GTypeInstance $instance
) is native(&gobject-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:2:from-name:
=begin pod
=head2 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 from-name ( Str $name --> UInt )

=item Str $name; type name to lookup
=end pod

method from-name ( Str $name --> UInt ) {
  g_type_from_name($name)
}

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

#`{{
#-------------------------------------------------------------------------------
# TM:0:fundamental:
=begin pod
=head2 fundamental

Internal function, used to extract the fundamental type ID portion. Use C<G-TYPE-FUNDAMENTAL()> instead.

Returns: fundamental type ID

  method fundamental ( --> N-GObject )

=end pod

method fundamental ( --> N-GObject ) {

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

sub g_type_fundamental (
  N-GObject $type_id --> N-GObject
) is native(&gobject-lib)
  { * }

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

Returns the next free fundamental type id which can be used to register a new fundamental type with C<register-fundamental()>. The returned type ID represents the highest currently registered fundamental type identifier.

Returns: the next available fundamental type ID to be registered, or 0 if the type system ran out of fundamental type IDs

  method fundamental-next ( --> N-GObject )

=end pod

method fundamental-next ( --> N-GObject ) {

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

sub g_type_fundamental_next (
   --> N-GObject
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:get-instance-count:
=begin pod
=head2 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 get-instance-count ( --> Int )

=end pod

method get-instance-count ( --> Int ) {

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

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

#-------------------------------------------------------------------------------
# TM:0:get-plugin:
=begin pod
=head2 get-plugin

Returns the B<Gnome::GObject::TypePlugin> structure for I<type>.

Returns: the corresponding plugin if I<type> is a dynamic type, C<undefined> otherwise

  method get-plugin ( --> N-GObject )

=end pod

method get-plugin ( --> N-GObject ) {

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

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

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

Obtains data which has previously been attached to I<type> with C<set-qdata()>.

Note that this does not take subtyping into account; data attached to one type with C<g-type-set-qdata()> cannot be retrieved from a subtype using C<g-type-get-qdata()>.

Returns: the data, or C<undefined> if no data was found

  method get-qdata ( UInt $quark --> Pointer )

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

method get-qdata ( UInt $quark --> Pointer ) {

  g_type_get_qdata(
    self._get-native-object-no-reffing, $quark
  )
}

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

#-------------------------------------------------------------------------------
# TM:0:get-type-registration-serial:
=begin pod
=head2 get-type-registration-serial

Returns an opaque serial number that represents the state of the set of registered types. Any time a type is registered this serial changes, which means you can cache information based on type lookups (such as C<from-name()>) and know if the cache is still valid at a later time by comparing the current serial with the one at the type lookup.

Returns: An unsigned int, representing the state of type registrations

  method get-type-registration-serial ( --> UInt )

=end pod

method get-type-registration-serial ( --> UInt ) {

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

sub g_type_get_type_registration_serial (
   --> guint
) is native(&gobject-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:2:gtype-get-type:t/Value.t
=begin pod
=head2 gtype-get-type

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

  method gtype_get_type ( --> UInt )

=end pod

method gtype-get-type ( --> UInt ) {
  g_gtype_get_type
}

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

#`{{
#-------------------------------------------------------------------------------
# TM:0:instance-get-private:
=begin pod
=head2 instance-get-private



  method instance-get-private ( GTypeInstance $instance, N-GObject $private_type --> Pointer )

=item GTypeInstance $instance;
=item N-GObject $private_type;
=end pod

method instance-get-private ( GTypeInstance $instance, $private_type is copy --> Pointer ) {
  $private_type .= _get-native-object-no-reffing unless $private_type ~~ N-GObject;

  g_type_instance_get_private(
    self._get-native-object-no-reffing, $instance, $private_type
  )
}

sub g_type_instance_get_private (
  GTypeInstance $instance, N-GObject $private_type --> gpointer
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:interface-add-prerequisite:
=begin pod
=head2 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 interface-add-prerequisite ( N-GObject $prerequisite_type )

=item N-GObject $prerequisite_type; B<Gnome::GObject::Type> value of an interface or instantiatable type
=end pod

method interface-add-prerequisite ( $prerequisite_type is copy ) {
  $prerequisite_type .= _get-native-object-no-reffing unless $prerequisite_type ~~ N-GObject;

  g_type_interface_add_prerequisite(
    self._get-native-object-no-reffing, $prerequisite_type
  );
}

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

#-------------------------------------------------------------------------------
# TM:0:interface-get-plugin:
=begin pod
=head2 interface-get-plugin

Returns the B<Gnome::GObject::TypePlugin> structure for the dynamic interface I<interface-type> which has been added to I<instance-type>, or C<undefined> if I<interface-type> has not been added to I<instance-type> or does not have a B<Gnome::GObject::TypePlugin> structure. See C<add-interface-dynamic()>.

Returns: the B<Gnome::GObject::TypePlugin> for the dynamic interface I<interface-type> of I<instance-type>

  method interface-get-plugin ( N-GObject $interface_type --> N-GObject )

=item N-GObject $interface_type; B<Gnome::GObject::Type> of an interface type
=end pod

method interface-get-plugin ( $interface_type is copy --> N-GObject ) {
  $interface_type .= _get-native-object-no-reffing unless $interface_type ~~ N-GObject;

  g_type_interface_get_plugin(
    self._get-native-object-no-reffing, $interface_type
  )
}

sub g_type_interface_get_plugin (
  N-GObject $instance_type, N-GObject $interface_type --> N-GObject
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:interface-peek:
=begin pod
=head2 interface-peek

Returns the B<Gnome::GObject::TypeInterface> structure of an interface to which the passed in class conforms.

Returns: (type GObject.TypeInterface) : the B<Gnome::GObject::TypeInterface> structure of I<iface-type> if implemented by I<instance-class>, C<undefined> otherwise

  method interface-peek ( Pointer $instance_class, N-GObject $iface_type --> Pointer )

=item Pointer $instance_class; (type GObject.TypeClass): a B<Gnome::GObject::TypeClass> structure
=item N-GObject $iface_type; an interface ID which this class conforms to
=end pod

method interface-peek ( Pointer $instance_class, $iface_type is copy --> Pointer ) {
  $iface_type .= _get-native-object-no-reffing unless $iface_type ~~ N-GObject;

  g_type_interface_peek(
    self._get-native-object-no-reffing, $instance_class, $iface_type
  )
}

sub g_type_interface_peek (
  gpointer $instance_class, N-GObject $iface_type --> gpointer
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:interface-peek-parent:
=begin pod
=head2 interface-peek-parent

Returns the corresponding B<Gnome::GObject::TypeInterface> structure of the parent type of the instance type to which I<g-iface> belongs. This is useful when deriving the implementation of an interface from the parent type and then possibly overriding some methods.

Returns:  (type GObject.TypeInterface): the corresponding B<Gnome::GObject::TypeInterface> structure of the parent type of the instance type to which I<g-iface> belongs, or C<undefined> if the parent type doesn't conform to the interface

  method interface-peek-parent ( Pointer $g_iface --> Pointer )

=item Pointer $g_iface; (type GObject.TypeInterface): a B<Gnome::GObject::TypeInterface> structure
=end pod

method interface-peek-parent ( Pointer $g_iface --> Pointer ) {

  g_type_interface_peek_parent(
    self._get-native-object-no-reffing, $g_iface
  )
}

sub g_type_interface_peek_parent (
  gpointer $g_iface --> gpointer
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:interface-prerequisites:
=begin pod
=head2 interface-prerequisites

Returns the prerequisites of an interfaces type.

Returns: (array length=n-prerequisites) : a newly-allocated zero-terminated array of B<Gnome::GObject::Type> containing the prerequisites of I<interface-type>

  method interface-prerequisites ( guInt-ptr $n_prerequisites --> N-GObject )

=item guInt-ptr $n_prerequisites; location to return the number of prerequisites, or C<undefined>
=end pod

method interface-prerequisites ( guInt-ptr $n_prerequisites --> N-GObject ) {

  g_type_interface_prerequisites(
    self._get-native-object-no-reffing, $n_prerequisites
  )
}

sub g_type_interface_prerequisites (
  N-GObject $interface_type, gugint-ptr $n_prerequisites --> N-GObject
) is native(&gobject-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:interfaces:
=begin pod
=head2 interfaces

Return a newly allocated and 0-terminated array of type IDs, listing the interface types that I<type> conforms to.

Returns: (array length=n-interfaces) : Newly allocated and 0-terminated array of interface types, free with C<g-free()>

  method interfaces ( guInt-ptr $n_interfaces --> N-GObject )

=item guInt-ptr $n_interfaces; location to store the length of the returned array, or C<undefined>
=end pod

method interfaces ( guInt-ptr $n_interfaces --> N-GObject ) {

  g_type_interfaces(
    self._get-native-object-no-reffing, $n_interfaces
  )
}

sub g_type_interfaces (
  N-GObject $type, gugint-ptr $n_interfaces --> N-GObject
) is native(&gobject-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:2:is-a:
=begin pod
=head2 is-a

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

Returns: C<True> if I<$gtype> is a I<$is-a-gtype>

  method is-a ( UInt $gtype, UInt $is_a_gtype --> Bool )

=item UInt $is_a_gtype; possible anchestor of I<$gtype> or interface that I<$gtype> could conform to
=end pod

method is-a ( UInt $gtype, $is_a_type --> Bool ) {
  g_type_is_a( $gtype, $is_a_type).Bool
}

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

#-------------------------------------------------------------------------------
#TM:2:name:
=begin pod
=head2 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 C<undefined>

  method name ( UInt $gtype --> Str )

=end pod

method name ( UInt $gtype --> Str ) {
  g_type_name($gtype)
}

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

#`{{
#-------------------------------------------------------------------------------
# TM:0:name-from-class:
=begin pod
=head2 name-from-class



  method name-from-class ( GTypeClass $g_class --> Str )

=item GTypeClass $g_class;
=end pod

method name-from-class ( GTypeClass $g_class --> Str ) {

  g_type_name_from_class(
    self._get-native-object-no-reffing, $g_class
  )
}

sub g_type_name_from_class (
  GTypeClass $g_class --> gchar-ptr
) is native(&gobject-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:2:name-from-instance:
=begin pod
=head2 name-from-instance