@c -*-texinfo-*-

@c This is part of the GNU G-Golf Reference Manual.
@c Copyright (C) 2016 - 2023 Free Software Foundation, Inc.
@c See the file g-golf.texi for copying conditions.


@defindex oi


@node Object Info
@subsection Object Info

G-Golf Object Info low level API.@*
GIObjectInfo — Structs representing a GObject.


@subheading Procedures

@indentedblock
@table @code
@c @item @ref{gi-object-import}
@item @ref{gi-object-show}
@item @ref{gi-object-property-names}
@item @ref{gi-object-method-names}
@item @ref{gi-object-method-find-by-name}
@item @ref{g-object-info-get-abstract}
@item @ref{g-object-info-get-parent}
@item @ref{g-object-info-get-type-name}
@item @ref{g-object-info-get-type-init}
@item @ref{g-object-info-get-n-constants}
@item @ref{g-object-info-get-constant}
@item @ref{g-object-info-get-n-fields}
@item @ref{g-object-info-get-field}
@item @ref{g-object-info-get-n-interfaces}
@item @ref{g-object-info-get-interface}
@item @ref{g-object-info-get-n-methods}
@item @ref{g-object-info-get-method}
@item @ref{g-object-info-find-method}
@item @ref{g-object-info-get-n-properties}
@item @ref{g-object-info-get-property}
@item @ref{g-object-info-get-n-signals}
@item @ref{g-object-info-get-signal}
@item @ref{g-object-info-find-signal}
@item @ref{g-object-info-get-n-vfuncs}
@item @ref{g-object-info-get-vfunc}
@item @ref{g-object-info-get-class-struct}
@item @ref{g-object-info-get-set-value-function}
@item @ref{g-object-info-get-set-value-function-pointer}
@item @ref{g-object-info-get-get-value-function}
@item @ref{g-object-info-get-get-value-function-pointer}
@end table
@end indentedblock


@c @subheading Types and Values

@c @indentedblock
@c @table @code
@c @item @ref{%g-arg-info-transfer}
@c @end table
@c @end indentedblock


@subheading Struct Hierarchy

@indentedblock
GIBaseInfo           	       		@*
@ @ +--- GIRegisteredTypeInfo  		@*
@ @ @ @ @ @ @ @ @ @ @  +--- GIObjectInfo
@end indentedblock


@subheading Description

@code{GIObjectInfo} represents a classed type.

Classed types in GType inherit from
@uref{@value{UGOBJECT-Class-Hierarchy}, GTypeInstance}. The most common
type is GObject. This doesn't represent a specific instance of a
GObject, instead this represent the object type (eg class).

A @code{GIObjectInfo} has methods, fields, properties, signals,
interfaces, constants and virtual functions.


@subheading Procedures

Note: in this section, unless otherwise specified, the @var{info}
argument is [must be] a pointer to a @code{GIObjectInfo}.


@c @anchor{gi-object-import}
@c @deffn Procedure gi-object-import info

@c Returns a @code{<gobject>} instance.

@c Obtain the values this objecteration contains and construct ...
@c @end deffn


@anchor{gi-object-show}
@deffn Procedure gi-object-show info

Returns nothing.

Obtains and displays the following informations about the object
(and its parent) pointed to by @var{info}:

@lisp
,use (g-golf)
(g-irepository-require "Clutter")
@result{} $2 = #<pointer 0x56396a4f9f80>

(g-irepository-find-by-name "Clutter" "Actor")
@result{} $3 = #<pointer 0x56396a4fdc00>

(gi-object-show $3)
@print{}
@print{} #<pointer 0x56396a4fdc00> is a (pointer to a) GIObjectInfo:
@print{}
@print{}   Parent:
@print{}           namespace: "GObject"
@print{}                name: "InitiallyUnowned"
@print{}              g-type: 94804596757600
@print{}         g-type-name: "GInitiallyUnowned"
@print{}
@print{}   Object:
@print{}           namespace: "Clutter"
@print{}                name: "Actor"
@print{}              g-type: 94804596864480
@print{}         g-type-name: "ClutterActor"
@print{}            abstract: #f
@print{}         n-constants: 0
@print{}            n-fields: 4
@print{}        n-interfaces: 4
@print{}           n-methods: 238
@print{}        n-properties: 82
@print{}           n-signals: 26
@print{}           n-vfuncts: 35

@end lisp
@end deffn


@anchor{gi-object-property-names}
@deffn Procedure gi-object-property-names info

Returns a (possibly empty) list.

Obtains and returns the (possibly empty) list of the (untranslated) GI
property names for @var{info} (see @ref{g-name->name} to obtain their
scheme representation).
@end deffn


@anchor{gi-object-method-names}
@deffn Procedure gi-object-method-names info

Returns a (possibly empty) list.

Obtains and returns the (possibly empty) list of pairs of the
(untranslated) GI method names for @var{info} (see @ref{g-name->name} to
obtain their scheme representation).

Each pair is composed of the @var{info} @ref{g-function-info-get-symbol}
and @ref{g-base-info-get-name} names.
@end deffn


@anchor{gi-object-method-find-by-name}
@deffn Procedure gi-object-method-find-by-name info name

Returns a pointer or @code{#f}.

Obtains and returns a pointer to the method @code{GIFunctionInfo}
contained in @var{info}, for which @ref{g-function-info-get-symbol} is
@code{string=?} to @var{name}. If there is such method, it returns
@code{#f}.
@end deffn


@anchor{g-object-info-get-abstract}
@deffn Procedure g-object-info-get-abstract info

Returns #t if the @var{info} object type is abstract.

Obtain if the object type is an abstract type, eg if it cannot be
instantiated.
@end deffn


@anchor{g-object-info-get-parent}
@deffn Procedure g-object-info-get-parent info

Returns a pointer or #f.

Obtains and returns a pointer to the @var{info}'s parent
@code{GIObjectInfo}, or #f if @var{info} has no parent.
@end deffn


@anchor{g-object-info-get-type-name}
@deffn Procedure g-object-info-get-type-name info

Returns the name of the object type for @var{info}.

Obtain the name of the object class/type for @var{info}.
@end deffn


@anchor{g-object-info-get-type-init}
@deffn Procedure g-object-info-get-type-init info

Returns a function name (a string).

Obtain the function name which when called will return the GType
function for which this object type is registered.
@end deffn


@anchor{g-object-info-get-n-constants}
@deffn Procedure g-object-info-get-n-constants info

Returns the number of constants for @var{info}.

Obtain the number of constants that this object type has.
@end deffn


@anchor{g-object-info-get-constant}
@deffn Procedure g-object-info-get-constant info n

Returns a pointer to the @var{n}th @code{GIConstantInfo} of @var{info}.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-get-n-fields}
@deffn Procedure g-object-info-get-n-fields info

Returns the number of fields for @var{info}.

Obtain the number of fields that this object type has.
@end deffn


@anchor{g-object-info-get-field}
@deffn Procedure g-object-info-get-field info n

Returns a pointer to the @var{n}th @code{GIFieldInfo} of @var{info}.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-get-n-interfaces}
@deffn Procedure g-object-info-get-n-interfaces info

Returns the number of interfaces for @var{info}.

Obtain the number of interfaces that this object type has.
@end deffn


@anchor{g-object-info-get-interface}
@deffn Procedure g-object-info-get-interface info n

Returns a pointer to the @var{n}th @code{GIInterfaceInfo} of @var{info}.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-get-n-methods}
@deffn Procedure g-object-info-get-n-methods info

Returns the number of methods for @var{info}.

Obtain the number of methods that this object type has.
@end deffn


@anchor{g-object-info-get-method}
@deffn Procedure g-object-info-get-method info n

Returns a pointer to the @var{n}th @code{GIFunctionInfo} of @var{info}.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-find-method}
@deffn Procedure g-object-info-find-method info name

Returns a pointer to a @code{GIFunctionInfo} or #f if there is no method
available with that name.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-get-n-properties}
@deffn Procedure g-object-info-get-n-properties info

Returns the number of properties for @var{info}.

Obtain the number of properties that this object type has.
@end deffn


@anchor{g-object-info-get-property}
@deffn Procedure g-object-info-get-property info n

Returns a pointer to the @var{n}th @code{GIPropertyInfo} of @var{info}.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-get-n-signals}
@deffn Procedure g-object-info-get-n-signals info

Returns the number of signals for @var{info}.

Obtain the number of signals that this object type has.
@end deffn


@anchor{g-object-info-get-signal}
@deffn Procedure g-object-info-get-signal info n

Returns a pointer to the @var{n}th @code{GISignalInfo} of @var{info}.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-find-signal}
@deffn Procedure g-object-info-find-signal info name

Returns a pointer to a @code{GISignalInfo} or #f if there is no signal
available with that name.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-get-n-vfuncs}
@deffn Procedure g-object-info-get-n-vfuncs info

Returns the number of vfuncs for @var{info}.

Obtain the number of vfuncs that this object type has.
@end deffn


@anchor{g-object-info-get-vfunc}
@deffn Procedure g-object-info-get-vfunc info n

Returns a pointer to the @var{n}th @code{GIVfuncInfo} of @var{info}.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-get-class-struct}
@deffn Procedure g-object-info-get-class-struct info

Returns a pointer to the @var{n}th @code{GIStructInfo} of @var{info}, or
#f.

Every @code{GObject} has two structures: an instance structure and a
class structure. This function returns a pointer to the @var{info} class
structure.

It must be freed by calling @ref{g-base-info-unref} when done accessing
the data.
@end deffn


@anchor{g-object-info-get-set-value-function}
@deffn Procedure g-object-info-get-set-value-function info

Returns a string.

Obtain the symbol name (within the GI context, a symbol name is a
string) of the function that should be called to set a GValue giving an
object instance pointer of this object type.
@end deffn


@anchor{g-object-info-get-set-value-function-pointer}
@deffn Procedure g-object-info-get-set-value-function-pointer info

Returns a pointer.

Obtain a pointer to a function which can be used to set a GValue giving
an object instance pointer of this object type. This takes derivation
into account and will reversely traverse the base classes of this type,
starting at the top type.
@end deffn


@anchor{g-object-info-get-get-value-function}
@deffn Procedure g-object-info-get-get-value-function info

Returns a string.

Obtain the symbol name (within the GI context, a symbol name is a
string) of the function that should be called to get a GValue instance
pointer of this object type giving an object instance pointer of this
object type.
@end deffn


@anchor{g-object-info-get-get-value-function-pointer}
@deffn Procedure g-object-info-get-get-value-function-pointer info

Returns a pointer.

Obtain a pointer to a function which can be used to get a GValue
instance pointer giving an object instance pointer of this object
type. This takes derivation into account and will reversely traverse the
base classes of this type, starting at the top type.
@end deffn


@c @subheading Types and Values
