diff options
author | Colin Walters <walters@verbum.org> | 2009-02-20 17:34:20 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2009-02-25 17:31:49 -0500 |
commit | 251de52b083d3e0e42f25cb164a46865c2c2b9a9 (patch) | |
tree | 99db442fd1bb299466f5d277561becfca4b220ee /tools/generate.c | |
parent | 0b9dda0e725446882dca84b6a64688c8f0e5a4e3 (diff) | |
download | gobject-introspection-251de52b083d3e0e42f25cb164a46865c2c2b9a9.tar.gz |
Bug 572434 - Associate interfaces with their C structures
Similar to GObject class structs, we pair up GInterfaces with
their C structures.
Also, move some GLib-specific things into glibast.py, and make
the naming more generic.
Diffstat (limited to 'tools/generate.c')
-rw-r--r-- | tools/generate.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/generate.c b/tools/generate.c index 8b4185fc..80c39807 100644 --- a/tools/generate.c +++ b/tools/generate.c @@ -566,7 +566,7 @@ write_struct_info (const gchar *namespace, const gchar *type_name; const gchar *type_init; gboolean deprecated; - gboolean is_class_struct; + gboolean is_gtype_struct; gint i; int n_elts; @@ -593,9 +593,9 @@ write_struct_info (const gchar *namespace, if (deprecated) xml_printf (file, " deprecated=\"1\""); - is_class_struct = g_struct_info_is_class_struct (info); - if (is_class_struct) - xml_printf (file, " glib:is-class-struct=\"1\""); + is_gtype_struct = g_struct_info_is_gtype_struct (info); + if (is_gtype_struct) + xml_printf (file, " glib:is-gtype-struct=\"1\""); n_elts = g_struct_info_get_n_fields (info) + g_struct_info_get_n_methods (info); if (n_elts > 0) @@ -931,7 +931,7 @@ write_object_info (const gchar *namespace, class_struct = g_object_info_get_class_struct (info); if (class_struct) { - write_type_name_attribute (namespace, (GIBaseInfo*) class_struct, "glib:class-struct", file); + write_type_name_attribute (namespace, (GIBaseInfo*) class_struct, "glib:type-struct", file); g_base_info_unref ((GIBaseInfo*)class_struct); } @@ -1009,6 +1009,7 @@ write_interface_info (const gchar *namespace, const gchar *name; const gchar *type_name; const gchar *type_init; + GIStructInfo *class_struct; gboolean deprecated; gint i; @@ -1021,6 +1022,13 @@ write_interface_info (const gchar *namespace, xml_printf (file, " name=\"%s\" glib:type-name=\"%s\" glib:get-type=\"%s\"", name, type_name, type_init); + class_struct = g_interface_info_get_iface_struct (info); + if (class_struct) + { + write_type_name_attribute (namespace, (GIBaseInfo*) class_struct, "glib:type-struct", file); + g_base_info_unref ((GIBaseInfo*)class_struct); + } + if (deprecated) xml_printf (file, " deprecated=\"1\""); |