Function Macro

GObjectDEFINE_TYPE_WITH_PRIVATE

since: 2.38

Declaration

#define G_DEFINE_TYPE_WITH_PRIVATE (
  TN,
  t_n,
  T_P
)

Description

A convenience macro for type implementations, which declares a class initialization function, an instance initialization function (see GTypeInfo for information about these), a static variable named t_n_parent_class pointing to the parent class, and adds private instance data to the type.

Furthermore, it defines a *_get_type() function. See G_DEFINE_TYPE_EXTENDED() for an example.

Note that private structs added with this macros must have a struct name of the form TN ## Private.

The private instance data can be retrieved using the automatically generated getter function t_n_get_instance_private().

See also: G_ADD_PRIVATE()

Available since: 2.38

This function is not directly available to language bindings.

Parameters

TN

Type: -

The name of the new type, in Camel case.

t_n

Type: -

The name of the new type, in lowercase, with words separated by _.

T_P

Type: -

The GType of the parent type.