G-Golf Registered Type Info low level API.
GIRegisteredTypeInfo — Struct representing a struct with a GType
.
GIBaseInfo
+—-GIRegisteredTypeInfo
+—-GIEnumInfo
+—-GIInterfaceInfo
+—-GIObjectInfo
+—-GIStructInfo
+—-GIUnionInfo
GIRegisteredTypeInfo
represents an entity with a GType
associated. Could be either a GIEnumInfo
, GIInterfaceInfo
,
GIObjectInfo
, GIStructInfo
or a GIUnionInfo
.
A registered type info struct has a name and a type function.
Note: in this section, the info argument is [must be] a pointer to
a GIRegisteredTypeInfo
.
Returns a type name.
Some registered type are not ‘registered’, and calling
g-registered-type-info-get-type-name returns
#f
33.
Even though they are ‘unnamed’, some are present in their typelib,
like "GLib" "SpawnFlags"
, or "GObject" "ParamFlags"
, and
may be imported - sometimes manually, sometimes automatically.
In G-Golf, imported GIRegisteredTypeInfo
must have a unique name,
since it is used as the secondary key in its cache ‘mechanism’ (See
Cache Park).
Obtains and returns a unique name for info. If
g-registered-type-info-get-type-name returns a name, that name is
returned. Otherwise, it returns a name composed of the namespace
and name
for info.
Here is an example, to illustrate:
(g-irepository-find-by-name "GObject" "ParamFlags") ⇒ $2 = #<pointer 0x5654c59ee4f0> (g-registered-type-info-get-type-name $2) ⇒ $3 = #f (gi-registered-type-info-name $2) ⇒ $4 = "GObjectParamFlags" (g-name->name $4) ⇒ $5 = g-object-param-flags
Returns the type name.
Obtain the type name of the struct within the GObject type system. This name can be passed to g_type_from_name to get a GType.
Returns the name of the type init function.
Obtain the type init function for info. The type init function is
the function which will register the GType
within the
GObject
type system. Usually this is not called by langauge
bindings or applications.
Returns the GType
for info.
Obtain the GType
for this registered type or G_TYPE_NONE
which has a special meaning. It means that either there is no type
information associated with this info or that the shared library which
provides the type_init function for this info cannot be called.
Another symptom for those is that if if you call
(g-type-name g-type)
, it returns "void"
.