Fix generation of enum/bitfields
authorJohan Dahlin <johan@gnome.org>
Thu, 14 Aug 2008 19:35:36 +0000 (19:35 +0000)
committerJohan Dahlin <johan@src.gnome.org>
Thu, 14 Aug 2008 19:35:36 +0000 (19:35 +0000)
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

svn path=/trunk/; revision=378

ChangeLog
tests/Makefile.am
tests/enum.gir
tools/generate.c

index 39a8602..9917a4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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
index 69e6952..bb55f25 100644 (file)
@@ -18,6 +18,7 @@ EXTRA_DIST = \
 
 GIRTESTS =             \
        boxed.gir.test  \
+       enum.gir.test  \
        object.gir.test
 
 %.gir.test: %.gir
index f91e6a9..5da381e 100644 (file)
@@ -4,20 +4,20 @@
             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>
index 226f1ac..4cbf23e 100644 (file)
@@ -603,13 +603,13 @@ write_enum_info (const gchar *namespace,
   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\"");
@@ -624,9 +624,9 @@ write_enum_info (const gchar *namespace,
     }
 
   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