diff --git a/girepository/tools/generate.c b/girepository/tools/generate.c
index f3acc9ce7..1292c3d70 100644
--- a/girepository/tools/generate.c
+++ b/girepository/tools/generate.c
@@ -54,24 +54,24 @@ write_type_info (const gchar *namespace,
GITypeInfo *type;
const gchar* basic[] = {
- "void",
- "gboolean",
- "gint8",
- "guint8",
- "gint16",
- "guint16",
- "gint32",
- "guint32",
- "gint64",
- "guint64",
- "gint",
- "guint",
- "glong",
- "gulong",
- "gssize",
- "gsize",
- "gfloat",
- "gdouble",
+ "none",
+ "boolean",
+ "int8",
+ "uint8",
+ "int16",
+ "uint16",
+ "int32",
+ "uint32",
+ "int64",
+ "uint64",
+ "int",
+ "uint",
+ "long",
+ "ulong",
+ "ssize",
+ "size",
+ "float",
+ "double",
"utf8",
"filename"
};
@@ -200,21 +200,16 @@ write_field_info (const gchar *namespace,
offset = g_field_info_get_offset (info);
g_fprintf (file,
- " \n");
+ g_fprintf (file,">\n");
+
+ g_fprintf (file, " \n");
+
+ g_fprintf (file, " \n");
+
}
static void
@@ -237,12 +242,9 @@ write_callable_info (const gchar *namespace,
GITypeInfo *type;
gint i;
- g_fprintf (file, "%*s \n", indent, "");
type = g_callable_info_get_return_type (info);
- write_type_info (namespace, type, file);
-
- g_fprintf (file, "\"");
if (g_type_info_is_pointer (type))
{
@@ -265,75 +267,86 @@ write_callable_info (const gchar *namespace,
if (g_callable_info_may_return_null (info))
g_fprintf (file, " null-ok=\"1\"");
- g_fprintf (file, " />\n");
+ g_fprintf (file, "%*s \n");
+
+ g_fprintf (file, "%*s \n", indent, "");
- if (g_callable_info_get_n_args (info) > 0)
+ if (g_callable_info_get_n_args (info) <= 0)
+ return;
+
+ g_fprintf (file, "%*s \n", indent, "");
+ for (i = 0; i < g_callable_info_get_n_args (info); i++)
{
- g_fprintf (file, "%*s \n", indent, "");
- for (i = 0; i < g_callable_info_get_n_args (info); i++)
+ GIArgInfo *arg = g_callable_info_get_arg (info, i);
+
+ g_fprintf (file, "%*s \n");
-
- g_base_info_unref ((GIBaseInfo *)arg);
+ }
+ g_base_info_unref ((GIBaseInfo *)type);
+
+ g_fprintf (file, " direction=\"");
+ switch (g_arg_info_get_direction (arg))
+ {
+ case GI_DIRECTION_IN:
+ g_fprintf (file, "in");
+ break;
+ case GI_DIRECTION_OUT:
+ g_fprintf (file, "out");
+ break;
+ case GI_DIRECTION_INOUT:
+ g_fprintf (file, "inout");
+ break;
}
-
- g_fprintf (file, "%*s \n", indent, "");
+ g_fprintf (file, "\"");
+
+ if (g_arg_info_may_be_null (arg))
+ g_fprintf (file, " null-ok=\"1\"");
+
+ if (g_arg_info_is_dipper (arg))
+ g_fprintf (file, " dipper=\"1\"");
+
+ if (g_arg_info_is_return_value (arg))
+ g_fprintf (file, " retval=\"1\"");
+
+ if (g_arg_info_is_optional (arg))
+ g_fprintf (file, " optional=\"1\"");
+
+ g_fprintf (file, ">\n");
+
+ g_fprintf (file, "%*s \n");
+
+ g_fprintf (file, "%*s \n", indent, "");
+
+ g_base_info_unref ((GIBaseInfo *)arg);
}
+
+ g_fprintf (file, "%*s \n", indent, "");
}
static void
@@ -417,7 +430,7 @@ write_struct_info (const gchar *namespace,
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
- g_fprintf (file, " \n");
+ g_fprintf (file, " \n");
else
g_fprintf (file, " \n");
}