summaryrefslogtreecommitdiff
path: root/girepository/girwriter.c
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-06-12 18:08:56 -0300
committerJohan Dahlin <johan@gnome.org>2010-07-09 10:15:45 -0300
commit1e9822c7817062a9b853269b9418fd78782090b5 (patch)
tree684a6bc8520db45c9d126d954d7b82921cb2a753 /girepository/girwriter.c
parent017727630d09a854b1c1a4767066fb675b139de9 (diff)
downloadgobject-introspection-1e9822c7817062a9b853269b9418fd78782090b5.tar.gz
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
Diffstat (limited to 'girepository/girwriter.c')
-rw-r--r--girepository/girwriter.c22
1 files changed, 22 insertions, 0 deletions
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\"");