#defineG_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {})#defineG_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()#define_G_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags) \\staticvoidtype_name##_init (TypeName*self); \staticvoidtype_name##_class_init (TypeName##Class*klass); \staticgpointer type_name##_parent_class=NULL; \staticvoidtype_name##_class_intern_init (gpointer klass) \
{ \
type_name##_parent_class=g_type_class_peek_parent (klass); \
type_name##_class_init ((TypeName##Class*) klass); \
} \
\
gulong\
type_name##_get_type (void) \
{ \staticvolatilegsize g_define_type_id__volatile=0; \if(g_once_init_enter (&g_define_type_id__volatile)) \
{ \
gulongg_define_type_id=\
g_type_register_static_simple (TYPE_PARENT, \
g_intern_static_string (#TypeName), \sizeof(TypeName##Class), \
(GClassInitFunc) type_name##_class_intern_init, \sizeof(TypeName), \
(GInstanceInitFunc) type_name##_init, \
(GTypeFlags) flags); \
{/*custom code follows*/#define_G_DEFINE_TYPE_EXTENDED_END() \/*following custom code*/\
} \
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
} \returng_define_type_id__volatile; \
}/*closes type_name##_get_type()*/