mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-29 02:50:04 +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,
|
GArgument *argument,
|
||||||
Xml *file);
|
Xml *file);
|
||||||
|
|
||||||
|
static void
|
||||||
|
write_callback_info (const gchar *namespace,
|
||||||
|
GICallbackInfo *info,
|
||||||
|
Xml *file);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_field_info (const gchar *namespace,
|
write_field_info (const gchar *namespace,
|
||||||
GIFieldInfo *info,
|
GIFieldInfo *info,
|
||||||
@ -350,6 +355,7 @@ write_field_info (const gchar *namespace,
|
|||||||
gint size;
|
gint size;
|
||||||
gint offset;
|
gint offset;
|
||||||
GITypeInfo *type;
|
GITypeInfo *type;
|
||||||
|
GIBaseInfo *interface;
|
||||||
GArgument value;
|
GArgument value;
|
||||||
|
|
||||||
name = g_base_info_get_name ((GIBaseInfo *)info);
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
||||||
@ -389,8 +395,16 @@ write_field_info (const gchar *namespace,
|
|||||||
if (offset >= 0)
|
if (offset >= 0)
|
||||||
xml_printf (file, "offset=\"%d\"", offset);
|
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);
|
g_base_info_unref ((GIBaseInfo *)type);
|
||||||
|
|
||||||
xml_end_element (file, "field");
|
xml_end_element (file, "field");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user