[vala] GIR writer: Generate c:type attribute on callbacks



commit 7f07fa0c0d1eb32f8297a71124a9c2423522a2fd
Author: Didier 'Ptitjes <ptitjes free fr>
Date:   Sat Mar 21 04:38:19 2009 +0100

    GIR writer: Generate c:type attribute on callbacks
    
    Signed-off-by: Didier 'Ptitjes <ptitjes free fr>
---
 gobject/valagirwriter.vala |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gobject/valagirwriter.vala b/gobject/valagirwriter.vala
index 1ba0ea8..b7ce3d8 100644
--- a/gobject/valagirwriter.vala
+++ b/gobject/valagirwriter.vala
@@ -467,7 +467,8 @@ public class Vala.GIRWriter : CodeVisitor {
 		}
 
 		write_indent ();
-		stream.printf ("<callback name=\"%s\"", cb.get_cname ());
+		stream.printf ("<callback name=\"%s\"", cb.name);
+		stream.printf (" c:type=\"%s\"", cb.get_cname ());
 		stream.printf (">\n");
 		indent++;
 
@@ -499,15 +500,17 @@ public class Vala.GIRWriter : CodeVisitor {
 		write_signature (m, tag_name);
 
 		if (m.is_abstract || m.is_virtual) {
-			write_signature (m, "virtual-method", false, true);
+			write_signature (m, "virtual-method", false);
 		}
 	}
 
-	private void write_signature (Method m, string tag_name, bool instance = false, bool is_virtual = false) {
+	private void write_signature (Method m, string tag_name, bool instance = false) {
 		write_indent ();
 		stream.printf ("<%s name=\"%s\"", tag_name, m.name);
-		if (is_virtual) {
+		if (tag_name == "virtual-method") {
 			stream.printf (" invoker=\"%s\"", m.name);
+		} else if (tag_name == "callback") {
+			stream.printf (" c:type=\"%s\"", m.get_cname ());
 		} else {
 			stream.printf (" c:identifier=\"%s\"", m.get_cname ());
 		}



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