g_ir_scanner=${bindir}/g-ir-scanner
g_ir_compiler=${bindir}/g-ir-compiler
+g_ir_generate=${bindir}/g-ir-generate
girdir=${prefix}/share/gir
-# FIXME: These needs to be ported to the GIR format first
-# g_idl_generator=${bindir}/g-idl-generator
-# g_idl_compiler=${bindir}/g-idl-compiler
-
Cflags: -I${includedir}/gobject-introspection-1.0
Requires: glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0
Libs: -L${libdir} -lgirepository
const gchar *type_init;
gboolean deprecated;
gint i;
+ int n_elts;
name = g_base_info_get_name ((GIBaseInfo *)info);
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
if (deprecated)
g_fprintf (file, " deprecated=\"1\"");
- g_fprintf (file, ">\n");
-
- for (i = 0; i < g_struct_info_get_n_fields (info); i++)
+ n_elts = g_struct_info_get_n_fields (info) + g_struct_info_get_n_methods (info);
+ if (n_elts > 0)
{
- GIFieldInfo *field = g_struct_info_get_field (info, i);
- write_field_info (namespace, field, NULL, file);
- g_base_info_unref ((GIBaseInfo *)field);
- }
-
- for (i = 0; i < g_struct_info_get_n_methods (info); i++)
+ g_fprintf (file, ">\n");
+
+ for (i = 0; i < g_struct_info_get_n_fields (info); i++)
+ {
+ GIFieldInfo *field = g_struct_info_get_field (info, i);
+ write_field_info (namespace, field, NULL, file);
+ g_base_info_unref ((GIBaseInfo *)field);
+ }
+
+ for (i = 0; i < g_struct_info_get_n_methods (info); i++)
+ {
+ GIFunctionInfo *function = g_struct_info_get_method (info, i);
+ write_function_info (namespace, function, file, 6);
+ g_base_info_unref ((GIBaseInfo *)function);
+ }
+
+ if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED)
+ g_fprintf (file, " </glib:boxed>\n");
+ else
+ g_fprintf (file, " </record>\n");
+ }
+ else
{
- GIFunctionInfo *function = g_struct_info_get_method (info, i);
- write_function_info (namespace, function, file, 6);
- g_base_info_unref ((GIBaseInfo *)function);
+ g_fprintf (file, "/>\n");
}
-
- if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED)
- g_fprintf (file, " </glib:boxed>\n");
- else
- g_fprintf (file, " </record>\n");
}
static void