gobject-introspection r309 - in branches/gir-compiler: tests tools



Author: johan
Date: Thu Aug  7 07:18:44 2008
New Revision: 309
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=309&view=rev

Log:
parse glib:boxed tag

Modified:
   branches/gir-compiler/tests/boxed.test
   branches/gir-compiler/tools/girparser.c

Modified: branches/gir-compiler/tests/boxed.test
==============================================================================
--- branches/gir-compiler/tests/boxed.test	(original)
+++ branches/gir-compiler/tests/boxed.test	Thu Aug  7 07:18:44 2008
@@ -4,7 +4,7 @@
             xmlns:c="http://www.gtk.org/introspection/c/1.0";
             xmlns:glib="http://www.gtk.org/introspection/glib/1.0";>
   <namespace name="Foo">
-    <glib:boxed glib:name="BoxedType1" c:type="boxed1" glib:get-type="boxed1_get_type" deprecated="1">
+    <glib:boxed glib:name="BoxedType1" glib:type-name="boxed1" glib:get-type="boxed1_get_type" deprecated="1">
       <field name="field1" readable="1" writable="1" offset="0">
 	<type name="guint32" c:type="guint32"/>
       </field>
@@ -42,7 +42,7 @@
           <parameter name="val" c:type="gint*" transfer="full" direction="inout" />
         </parameters>
       </method>
-    </boxed>
+    </glib:boxed>
     <function name="freefunc" c:identifier="freefunc" deprecated="1">
       <return-type c:type="gint" />
       <parameters>
@@ -50,7 +50,7 @@
         <parameter name="val2" c:type="gint" direction="in" />
       </parameters>
     </function>
-    <boxed name="boxed2" type-name="BoxedType2" get-type="boxed2_get_type" deprecated="1">
-    </boxed>
+    <glib:boxed glib:name="boxed2" glib:type-name="BoxedType2" glib:get-type="boxed2_get_type" deprecated="1">
+    </glib:boxed>
   </namespace>
 </repository>

Modified: branches/gir-compiler/tools/girparser.c
==============================================================================
--- branches/gir-compiler/tools/girparser.c	(original)
+++ branches/gir-compiler/tools/girparser.c	Thu Aug  7 07:18:44 2008
@@ -406,14 +406,14 @@
 }
 
 static gboolean
-start_boxed (GMarkupParseContext *context,
-	     const gchar         *element_name,
-	     const gchar        **attribute_names,
-	     const gchar        **attribute_values,
-	     ParseContext        *ctx,
-	     GError             **error)
+start_glib_boxed (GMarkupParseContext *context,
+		  const gchar         *element_name,
+		  const gchar        **attribute_names,
+		  const gchar        **attribute_values,
+		  ParseContext        *ctx,
+		  GError             **error)
 {
-  if (strcmp (element_name, "boxed") == 0 && 
+  if (strcmp (element_name, "glib:boxed") == 0 && 
       ctx->state == STATE_NAMESPACE)
     {
       const gchar *name;
@@ -421,16 +421,14 @@
       const gchar *typeinit;
       const gchar *deprecated;
       
-      name = find_attribute ("name", attribute_names, attribute_values);
+      name = find_attribute ("glib:name", attribute_names, attribute_values);
       typename = find_attribute ("glib:type-name", attribute_names, attribute_values);
       typeinit = find_attribute ("glib:get-type", attribute_names, attribute_values);
       deprecated = find_attribute ("deprecated", attribute_names, attribute_values);
       
       if (name == NULL)
 	MISSING_ATTRIBUTE (context, error, element_name, "name");
-      else if (typename == NULL)
-	MISSING_ATTRIBUTE (context, error, element_name, "glib:type-name");
-      else if (typeinit == NULL)
+      else if (typename == NULL || typeinit == NULL)
 	MISSING_ATTRIBUTE (context, error, element_name, "glib:get-type");
       else
 	{
@@ -1349,12 +1347,12 @@
 }
 
 static gboolean
-start_signal (GMarkupParseContext *context,
-	      const gchar         *element_name,
-	      const gchar        **attribute_names,
-	      const gchar        **attribute_values,
-	      ParseContext       *ctx,
-	      GError             **error)
+start_glib_signal (GMarkupParseContext *context,
+		   const gchar         *element_name,
+		   const gchar        **attribute_names,
+		   const gchar        **attribute_values,
+		   ParseContext       *ctx,
+		   GError             **error)
 {
   if (strcmp (element_name, "glib:signal") == 0 && 
       (ctx->state == STATE_OBJECT ||
@@ -1646,13 +1644,6 @@
 
   switch (element_name[0]) 
     {
-    case 'b':
-      if (start_boxed (context, element_name,
-		       attribute_names, attribute_values,
-		       ctx, error))
-	goto out;
-      break;
-
     case 'c':
       if (start_function (context, element_name, 
 			  attribute_names, attribute_values,
@@ -1722,9 +1713,15 @@
       break;
 
     case 'g':
-      if (start_signal (context, element_name,
-			attribute_names, attribute_values,
-			ctx, error))
+      if (start_glib_boxed (context, element_name,
+			    attribute_names, attribute_values,
+			    ctx, error))
+	goto out;
+      break;
+
+      if (start_glib_signal (context, element_name,
+			     attribute_names, attribute_values,
+			     ctx, error))
 	goto out;      
       break;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]