功能
GObjectboxed_type_register_static
声明 [源代码]
GType
g_boxed_type_register_static (
const gchar* name,
GBoxedCopyFunc boxed_copy,
GBoxedFreeFunc boxed_free
)
说明 [源代码]
此功能为具有名称name
的新框装类型创建一个新的 G_TYPE_BOXED
衍生类型 ID。
必须提供框装类型处理功能,以复制和释放此类型的未知框装结构。
对于一般情况,建议使用 G_DEFINE_BOXED_TYPE(),而不是直接调用 g_boxed_type_register_static()
。该宏将为框装类型创建适当的 *_get_type()
功能。
参数
name
-
类型:
const gchar*
新框装类型的名称。
数据归函数调用者所有。 该值为带空终止符的 UTF-8 字符串。 boxed_copy
-
类型:
GBoxedCopyFunc
框装结构复制功能。
boxed_free
-
类型:
GBoxedFreeFunc
框装结构释放功能。