From 1e9822c7817062a9b853269b9418fd78782090b5 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Sat, 12 Jun 2010 18:08:56 -0300 Subject: Add support for non-GObject fundamental objects This patch adds support for instantiable fundamental object types, which are not GObject based. This is mostly interesting for being able to support GstMiniObject's which are extensivly used in GStreamer. Includes a big test case to the Everything module (inspired by GstMiniObject) which should be used by language bindings who wishes to test this functionallity. This patch increases the size of the typelib and breaks compatibility with older typelibs. https://bugzilla.gnome.org/show_bug.cgi?id=568913 --- girepository/girwriter.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'girepository/girwriter.c') diff --git a/girepository/girwriter.c b/girepository/girwriter.c index 19862b0d..56d61b23 100644 --- a/girepository/girwriter.c +++ b/girepository/girwriter.c @@ -999,8 +999,10 @@ write_object_info (const gchar *namespace, const gchar *name; const gchar *type_name; const gchar *type_init; + const gchar *func; gboolean deprecated; gboolean is_abstract; + gboolean is_fundamental; GIObjectInfo *pnode; GIStructInfo *class_struct; gint i; @@ -1008,6 +1010,7 @@ write_object_info (const gchar *namespace, name = g_base_info_get_name ((GIBaseInfo *)info); deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); is_abstract = g_object_info_get_abstract (info); + is_fundamental = g_object_info_get_fundamental (info); type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); @@ -1033,6 +1036,25 @@ write_object_info (const gchar *namespace, xml_printf (file, " glib:type-name=\"%s\" glib:get-type=\"%s\"", type_name, type_init); + if (is_fundamental) + xml_printf (file, " glib:fundamental=\"1\""); + + func = g_object_info_get_unref_function (info); + if (func) + xml_printf (file, " glib:unref-function=\"%s\"", func); + + func = g_object_info_get_ref_function (info); + if (func) + xml_printf (file, " glib:ref-function=\"%s\"", func); + + func = g_object_info_get_set_value_function (info); + if (func) + xml_printf (file, " glib:set-value-function=\"%s\"", func); + + func = g_object_info_get_get_value_function (info); + if (func) + xml_printf (file, " glib:get-value-function=\"%s\"", func); + if (deprecated) xml_printf (file, " deprecated=\"1\""); -- cgit v1.2.1