Type Alias GTypeInfo

Source
pub type GTypeInfo = _GTypeInfo;
Expand description

GTypeInfo: @class_size: Size of the class structure (required for interface, classed and instantiatable types) @base_init: Location of the base initialization function (optional) @base_finalize: Location of the base finalization function (optional) @class_init: Location of the class initialization function for classed and instantiatable types. Location of the default vtable inititalization function for interface types. (optional) This function is used both to fill in virtual functions in the class or default vtable, and to do type-specific setup such as registering signals and object properties. @class_finalize: Location of the class finalization function for classed and instantiatable types. Location of the default vtable finalization function for interface types. (optional) @class_data: User-supplied data passed to the class init/finalize functions @instance_size: Size of the instance (object) structure (required for instantiatable types only) @n_preallocs: Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10 this field is ignored. @instance_init: Location of the instance initialization function (optional, for instantiatable types only) @value_table: A #GTypeValueTable function table for generic handling of GValues of this type (usually only useful for fundamental types)

This structure is used to provide the type system with the information required to initialize and destruct (finalize) a type’s class and its instances.

The initialized structure is passed to the g_type_register_static() function (or is copied into the provided #GTypeInfo structure in the g_type_plugin_complete_type_info()). The type system will perform a deep copy of this structure, so its memory does not need to be persistent across invocation of g_type_register_static().

Aliased Type§

struct GTypeInfo {
    pub class_size: u16,
    pub base_init: Option<unsafe extern "C" fn(*mut c_void)>,
    pub base_finalize: Option<unsafe extern "C" fn(*mut c_void)>,
    pub class_init: Option<unsafe extern "C" fn(*mut c_void, *mut c_void)>,
    pub class_finalize: Option<unsafe extern "C" fn(*mut c_void, *mut c_void)>,
    pub class_data: *const c_void,
    pub instance_size: u16,
    pub n_preallocs: u16,
    pub instance_init: Option<unsafe extern "C" fn(*mut _GTypeInstance, *mut c_void)>,
    pub value_table: *const _GTypeValueTable,
}

Fields§

§class_size: u16§base_init: Option<unsafe extern "C" fn(*mut c_void)>§base_finalize: Option<unsafe extern "C" fn(*mut c_void)>§class_init: Option<unsafe extern "C" fn(*mut c_void, *mut c_void)>§class_finalize: Option<unsafe extern "C" fn(*mut c_void, *mut c_void)>§class_data: *const c_void§instance_size: u16§n_preallocs: u16§instance_init: Option<unsafe extern "C" fn(*mut _GTypeInstance, *mut c_void)>§value_table: *const _GTypeValueTable