support setting gobjects and ginterfaces in struct fields

https://bugzilla.gnome.org/show_bug.cgi?id=644749
This commit is contained in:
John (J5) Palmieri 2011-03-14 14:18:22 -04:00
parent 8304598583
commit feedce8029

View File

@ -512,6 +512,23 @@ g_field_info_set_field (GIFieldInfo *field_info,
}
break;
}
} else {
switch (g_type_info_get_tag (type_info))
{
case GI_TYPE_TAG_INTERFACE:
{
GIBaseInfo *interface = g_type_info_get_interface (type_info);
switch (g_base_info_get_type (interface))
{
case GI_INFO_TYPE_OBJECT:
case GI_INFO_TYPE_INTERFACE:
G_STRUCT_MEMBER (gpointer, mem, offset) = (gpointer)value->v_pointer;
result = TRUE;
break;
}
g_base_info_unref ((GIBaseInfo *)interface);
}
}
}
g_base_info_unref ((GIBaseInfo *)type_info);