mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
Implement callbacks as part of struct fields. Fixes #557383
gir: embed <callback> inside <field> typelib: if a field contains a callback, store it just after the FieldBlob girepository API: no additions
This commit is contained in:
parent
7a6056cbeb
commit
90c166144c
@ -339,6 +339,11 @@ write_constant_value (const gchar *namespace,
|
||||
GArgument *argument,
|
||||
Xml *file);
|
||||
|
||||
static void
|
||||
write_callback_info (const gchar *namespace,
|
||||
GICallbackInfo *info,
|
||||
Xml *file);
|
||||
|
||||
static void
|
||||
write_field_info (const gchar *namespace,
|
||||
GIFieldInfo *info,
|
||||
@ -350,6 +355,7 @@ write_field_info (const gchar *namespace,
|
||||
gint size;
|
||||
gint offset;
|
||||
GITypeInfo *type;
|
||||
GIBaseInfo *interface;
|
||||
GArgument value;
|
||||
|
||||
name = g_base_info_get_name ((GIBaseInfo *)info);
|
||||
@ -389,8 +395,16 @@ write_field_info (const gchar *namespace,
|
||||
if (offset >= 0)
|
||||
xml_printf (file, "offset=\"%d\"", offset);
|
||||
}
|
||||
|
||||
write_type_info (namespace, type, file);
|
||||
|
||||
interface = g_type_info_get_interface (type);
|
||||
if (interface && g_base_info_get_type(interface) == GI_INFO_TYPE_CALLBACK)
|
||||
write_callback_info (namespace, (GICallbackInfo *)interface, file);
|
||||
else
|
||||
write_type_info (namespace, type, file);
|
||||
|
||||
if (interface)
|
||||
g_base_info_unref (interface);
|
||||
|
||||
g_base_info_unref ((GIBaseInfo *)type);
|
||||
|
||||
xml_end_element (file, "field");
|
||||
|
Loading…
Reference in New Issue
Block a user