Registered Type Info

G-Golf Registered Type Info low level API.
GIRegisteredTypeInfo — Struct representing a struct with a GType.

Procedures

gi-registered-type-info-name
g-registered-type-info-get-type-name
g-registered-type-info-get-type-init
g-registered-type-info-get-g-type

Struct Hierarchy

GIBaseInfo
  +—-GIRegisteredTypeInfo
           +—-GIEnumInfo
           +—-GIInterfaceInfo
           +—-GIObjectInfo
           +—-GIStructInfo
           +—-GIUnionInfo

Description

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.

Procedures

Note: in this section, the info argument is [must be] a pointer to a GIRegisteredTypeInfo.

Procedure: gi-registered-type-info-name info

Returns a type name.

Some registered type are not ‘registered’, and calling g-registered-type-info-get-type-name returns #f32.

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
Procedure: g-registered-type-info-get-type-name info

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.

Procedure: g-registered-type-info-get-type-init info

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.

Procedure: g-registered-type-info-get-g-type info

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.


Footnotes

(32)

Another symptom for those is that if if you call (g-type-name g-type), it returns "void".