Method

GObjectTypeModuleregister_type

Declaration [src]

GType
g_type_module_register_type (
  GTypeModule* module,
  GType parent_type,
  const gchar* type_name,
  const GTypeInfo* type_info,
  GTypeFlags flags
)

Description [src]

Looks up or registers a type that is implemented with a particular type plugin. If a type with name type_name was previously registered, the GType identifier for the type is returned, otherwise the type is newly registered, and the resulting GType identifier returned.

When reregistering a type (typically because a module is unloaded then reloaded, and reinitialized), module and parent_type must be the same as they were previously.

As long as any instances of the type exist, the type plugin will not be unloaded.

Since 2.56 if module is NULL this will call g_type_register_static() instead. This can be used when making a static build of the module.

Parameters

parent_type

Type: GType

The type for the parent class.

type_name

Type: const gchar*

Name for the type.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
type_info

Type: GTypeInfo

Type information structure.

The data is owned by the caller of the method.
flags

Type: GTypeFlags

Flags field providing details about the type.

Return value

Type: GType

The new or existing type ID.