Add gdk-pixbuf.gidl as an example, and fix the code to handle it.

This commit is contained in:
Matthias Clasen 2005-05-19 19:05:05 +00:00 committed by Philip Withnall
parent 45cf94a492
commit 45405a6143

View File

@ -106,43 +106,66 @@ write_type_info (const gchar *namespace,
else if (tag == 22) else if (tag == 22)
{ {
type = g_type_info_get_param_type (info, 0); type = g_type_info_get_param_type (info, 0);
g_fprintf (file, "GList<"); g_fprintf (file, "GList");
write_type_info (namespace, type, file); if (type)
g_fprintf (file, ">"); {
g_base_info_unref ((GIBaseInfo *)type); g_fprintf (file, "<");
write_type_info (namespace, type, file);
g_fprintf (file, ">");
g_base_info_unref ((GIBaseInfo *)type);
}
g_fprintf (file, "*");
} }
else if (tag == 23) else if (tag == 23)
{ {
type = g_type_info_get_param_type (info, 0); type = g_type_info_get_param_type (info, 0);
g_fprintf (file, "GSList<"); g_fprintf (file, "GSList");
write_type_info (namespace, type, file); if (type)
g_fprintf (file, ">"); {
g_base_info_unref ((GIBaseInfo *)type); g_fprintf (file, "<");
write_type_info (namespace, type, file);
g_fprintf (file, ">");
g_base_info_unref ((GIBaseInfo *)type);
}
g_fprintf (file, "*");
} }
else if (tag == 24) else if (tag == 24)
{ {
type = g_type_info_get_param_type (info, 0); type = g_type_info_get_param_type (info, 0);
g_fprintf (file, "GHashTable<"); g_fprintf (file, "GHashTable");
write_type_info (namespace, type, file); if (type)
g_base_info_unref ((GIBaseInfo *)type); {
type = g_type_info_get_param_type (info, 1); g_fprintf (file, "<");
g_fprintf (file, ","); write_type_info (namespace, type, file);
write_type_info (namespace, type, file); g_base_info_unref ((GIBaseInfo *)type);
g_fprintf (file, ">"); type = g_type_info_get_param_type (info, 1);
g_base_info_unref ((GIBaseInfo *)type); g_fprintf (file, ",");
write_type_info (namespace, type, file);
g_fprintf (file, ">");
g_base_info_unref ((GIBaseInfo *)type);
}
g_fprintf (file, "*");
} }
else if (tag == 25) else if (tag == 25)
{ {
g_fprintf (file, "GError<"); gint n;
for (i = 0; i < g_type_info_get_n_error_domains (info); i++)
g_fprintf (file, "GError");
n = g_type_info_get_n_error_domains (info);
if (n > 0)
{ {
GIErrorDomainInfo *ed = g_type_info_get_error_domain (info, i); g_fprintf (file, "<");
if (i > 0) for (i = 0; i < n; i++)
g_fprintf (file, ","); {
write_type_name (namespace, (GIBaseInfo *)ed, file); GIErrorDomainInfo *ed = g_type_info_get_error_domain (info, i);
g_base_info_unref ((GIBaseInfo *)ed); if (i > 0)
g_fprintf (file, ",");
write_type_name (namespace, (GIBaseInfo *)ed, file);
g_base_info_unref ((GIBaseInfo *)ed);
}
g_fprintf (file, ">");
} }
g_fprintf (file, ">"); g_fprintf (file, "*");
} }
} }
@ -234,7 +257,7 @@ write_callable_info (const gchar *namespace,
} }
} }
if (g_callable_info_may_return_null (info)) if (g_callable_info_may_return_null (info))
g_fprintf (file, "null-ok=\"1\""); g_fprintf (file, " null-ok=\"1\"");
g_fprintf (file, " />\n"); g_fprintf (file, " />\n");