mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Allow both union and struct to be boxed or not
* girepository/girnode.c: Allow gtype_name and gtype_init in struct and union. * girepository/girparser.c: Parse glib: boxed bits for both structure and union. * girepository/gtypelib.c: Don't barf if structure is boxed. * giscanner/girparser.py: Parse new XML format. * giscanner/girwriter.py: Write out new XML format. * giscanner/glibast.py: Define new classes which are both Boxed and Struct/Union, as well as an "Other" for everything else. * giscanner/glibtransformer.py: Handle boxed types specially; we try to merge them with a struct/union if one exists, otherwise fall back to generic boxed. * tests/*: Update. * tools/generate.c: Write out new format. svn path=/trunk/; revision=575
This commit is contained in:
parent
886b9c66c5
commit
77683a327f
@ -413,16 +413,19 @@ write_struct_info (const gchar *namespace,
|
||||
name = g_base_info_get_name ((GIBaseInfo *)info);
|
||||
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
||||
|
||||
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
||||
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
||||
|
||||
if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED)
|
||||
{
|
||||
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
||||
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
||||
|
||||
g_fprintf (file, " <glib:boxed glib:name=\"%s\" glib:type-name=\"%s\" glib:get-type=\"%s\"", name, type_name, type_init);
|
||||
g_fprintf (file, " <glib:boxed glib:name=\"%s\"", name);
|
||||
}
|
||||
else
|
||||
g_fprintf (file, " <record name=\"%s\"", name);
|
||||
|
||||
if (type_name != NULL)
|
||||
g_fprintf (file, " glib:type-name=\"%s\" glib:get-type=\"%s\"", type_name, type_init);
|
||||
|
||||
if (deprecated)
|
||||
g_fprintf (file, " deprecated=\"1\"");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user