2008-08-14 Johan Dahlin <johan@gnome.org>
+ * tests/Makefile.am:
+ * tests/enum.gir:
+ * tools/generate.c (write_enum_info):
+ Fix generation of enum/bitfields
+
+2008-08-14 Johan Dahlin <johan@gnome.org>
+
* girepository/girparser.c (start_field), (start_constant),
(start_type), (end_element_handler):
Clear up constant parsing
GIRTESTS = \
boxed.gir.test \
+ enum.gir.test \
object.gir.test
%.gir.test: %.gir
xmlns:c="http://www.gtk.org/introspection/c/1.0"
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<namespace name="Foo">
- <enum name="Enum1" type-name="FooEnum" get-type="foo_enum_get_type">
+ <enumeration name="Enum1" glib:type-name="FooEnum" glib:get-type="foo_enum_get_type">
<member name="value1" value="0" />
<member name="value2" value="1" />
<member name="value3" value="2" />
- </enum>
- <flags name="Flags1" type-name="FooFlags" get-type="foo_flags_get_type">
+ </enumeration>
+ <bitfield name="Flags1" glib:type-name="FooFlags" glib:get-type="foo_flags_get_type">
<member name="value1" value="1" />
<member name="value2" value="2" />
<member name="value3" value="4" />
- </flags>
- <enum name="Enum2">
+ </bitfield>
+ <enumeration name="Enum2">
<member name="value1" value="0" />
<member name="value2" value="1" />
<member name="value3" value="2" />
- </enum>
+ </enumeration>
</namespace>
</repository>
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_ENUM)
- g_fprintf (file, " <enum ");
+ g_fprintf (file, " <enumeration ");
else
- g_fprintf (file, " <flags ");
+ g_fprintf (file, " <bitfield ");
g_fprintf (file, "name=\"%s\"", name);
if (type_init)
- g_fprintf (file, " type-name=\"%s\" get-type=\"%s\"", type_name, type_init);
+ g_fprintf (file, " glib:type-name=\"%s\" glib:get-type=\"%s\"", type_name, type_init);
if (deprecated)
g_fprintf (file, " deprecated=\"1\"");
}
if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_ENUM)
- g_fprintf (file, " </enum>\n");
+ g_fprintf (file, " </enumeration>\n");
else
- g_fprintf (file, " </flags>\n");
+ g_fprintf (file, " </bitfield>\n");
}
static void