Base Info

G-Golf Base Info low level API.
GIBaseInfo — Base struct for all GITypelib structs.

Procedures

g-base-info-ref
g-base-info-unref
g-base-info-equal
g-base-info-get-type
g-base-info-get-typelib
g-base-info-get-namespace
g-base-info-get-name
g-base-info-get-attribute
g-base-info-iterate-attributes
g-base-info-get-container
g-base-info-is-deprecated

Types and Values

%gi-info-type

Struct Hierarchy

GIBaseInfo
  +— GIArgInfo
  +— GICallableInfo
  +— GIConstantInfo
  +— GIFieldInfo
  +— GIPropertyInfo
  +— GIRegisteredTypeInfo
  +— GITypeInfo

Description

GIBaseInfo is the common base struct of all other *Info structs accessible through the GIRepository API.

Most GIRepository APIs returning a GIBaseInfo is actually creating a new struct, in other words, g-base-info-unref has to be called when done accessing the data. GIBaseInfos are normally accessed by calling either g-irepository-find-by-name, g-irepository-find-by-gtype or g-irepository-get-info.

Example: Getting the Button of the Gtk typelib
,use (g-golf gi)
(g-irepository-require "Gtk")
(g-irepository-find-by-name "Gtk" "Button")
⇒ $4 = #<pointer 0x20e0000>
... use button info ...
(g-base-info-unref $4)

Procedures

Note: in this section, the info, info1 and info2 arguments are [must be] pointers to a GIBaseInfo.

Procedure: g-base-info-ref info

Returns the same info.

Increases the reference count of info.

Procedure: g-base-info-unref info

Returns nothing.

Decreases the reference count of info. When its reference count drops to 0, the info is freed.

Procedure: g-base-info-equal info1 info2

Returns #t if and only if info1 equals info2.

Compares two GIBaseInfo.

Using pointer comparison is not practical since many functions return different instances of GIBaseInfo that refers to the same part of the typelib: use this procedure instead to do GIBaseInfo comparisons.

Procedure: g-base-info-get-type info

Returns the info type of info.

Procedure: g-base-info-get-typelib info

Returns a pointer to the GITypelib the info belongs to.

Procedure: g-base-info-get-namespace info

Returns the namespace of info

Procedure: g-base-info-get-name info

Returns the name of info or #f if it lacks a name.

What the name represents depends on the GIInfoType of the info. For instance for GIFunctionInfo it is the name of the function.

Procedure: g-base-info-get-attribute info name

Returns the value of the attribute or #f if not such attribute exists.

Procedure: g-base-info-iterate-attributes info proc

Returns nothing.

Iterate and calls proc over all attributes associated with this node. proc must be a procedure of two arguments, the name and the value of the attribute.

Procedure: g-base-info-get-container info

Returns a pointer to a GIBaseInfo.

The container is the parent GIBaseInfo. For instance, the parent of a GIFunctionInfo is an GIObjectInfo or GIInterfaceInfo.

Procedure: g-base-info-is-deprecated info

Returns #t if deprecated.

Obtain whether info represents a metadata which is deprecated or not.

Types and Values

Instance Variable of <gi-enum>: %gi-info-type

An instance of <gi-enum>, who’s members are the scheme representation of the type of a GIBaseInfo struct:

g-name: GIInfoType
name: gi-info-type
enum-set:

invalid
function
callback
struct
boxed
enum
flags
object
interface
constant
error-domain
union
value
signal
vfunc
property
field
arg
type
unresolved