gobject-introspection r127 - in trunk: . tests/parser tools



Author: juergbi
Date: Mon Mar 10 15:03:03 2008
New Revision: 127
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=127&view=rev

Log:
2008-03-10  Juerg Billeter  <j bitron ch>

	* tests/parser/Foo-expected.gidl:
	* tests/parser/foo-object.h:
	* tests/parser/foo.c: (foo_enum_method):
	* tools/scanner.c: (g_igenerator_process_function_symbol):
	Don't skip functions that are defined in the namespace of a type
	that doesn't support methods, as for example enums.


Modified:
   trunk/ChangeLog
   trunk/tests/parser/Foo-expected.gidl
   trunk/tests/parser/foo-object.h
   trunk/tests/parser/foo.c
   trunk/tools/scanner.c

Modified: trunk/tests/parser/Foo-expected.gidl
==============================================================================
--- trunk/tests/parser/Foo-expected.gidl	(original)
+++ trunk/tests/parser/Foo-expected.gidl	Mon Mar 10 15:03:03 2008
@@ -1,6 +1,12 @@
 <?xml version="1.0"?>
 <api version="1.0">
 	<namespace name="Foo">
+		<function name="enum_type_method" symbol="foo_enum_type_method">
+			<return-type type="int"/>
+			<parameters>
+				<parameter name="foo_enum" type="FooEnumType"/>
+			</parameters>
+		</function>
 		<function name="init" symbol="foo_init" deprecated="1">
 			<return-type type="gint"/>
 		</function>

Modified: trunk/tests/parser/foo-object.h
==============================================================================
--- trunk/tests/parser/foo-object.h	(original)
+++ trunk/tests/parser/foo-object.h	Mon Mar 10 15:03:03 2008
@@ -70,6 +70,8 @@
 
 GType foo_enum_type_get_type (void);
 
+int                   foo_enum_type_method         (FooEnumType foo_enum);
+
 typedef enum
 {
   FOO_FLAGS_FIRST  = 1 << 0,

Modified: trunk/tests/parser/foo.c
==============================================================================
--- trunk/tests/parser/foo.c	(original)
+++ trunk/tests/parser/foo.c	Mon Mar 10 15:03:03 2008
@@ -79,6 +79,12 @@
     return etype;
 }
 
+int foo_enum_method (FooEnumType foo_enum)
+{
+  return 0;
+}
+
+
 GType
 foo_flags_type_get_type (void)
 {

Modified: trunk/tools/scanner.c
==============================================================================
--- trunk/tools/scanner.c	(original)
+++ trunk/tools/scanner.c	Mon Mar 10 15:03:03 2008
@@ -628,8 +628,18 @@
 	  else
 	    func->is_method = TRUE;
 	  if (g_idl_node_can_have_member (node))
-		g_idl_node_add_member (node, func);
-	  break;
+	    {
+	      g_idl_node_add_member (node, func);
+	      break;
+	    }
+	  else
+	    {
+	      /* reset function attributes */
+	      g_free (func->node.name);
+	      func->node.name = NULL;
+	      func->is_constructor = FALSE;
+	      func->is_method = FALSE;
+	    }
 	}
       else if (strcmp (igenerator->lower_case_namespace, prefix) == 0)
 	{



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