Index: vala/valaproperty.vala
===================================================================
--- vala/valaproperty.vala	(revision 2400)
+++ vala/valaproperty.vala	(working copy)
@@ -243,7 +243,7 @@
 		return new CCodeConstant ("\"%s\"".printf (get_canonical_name ()));
 	}
 
-	private string get_canonical_name () {
+	public string get_canonical_name () {
 		var str = new StringBuilder ();
 		
 		string i = name;
Index: gobject/valagirwriter.vala
===================================================================
--- gobject/valagirwriter.vala	(revision 2400)
+++ gobject/valagirwriter.vala	(working copy)
@@ -240,7 +240,15 @@
 
 	public override void visit_enum_value (EnumValue ev) {
 		write_indent ();
-		stream.printf ("<member name=\"%s\"/>\n", string.joinv ("-", ev.name.down ().split ("_")));
+		stream.printf ("<member name=\"%s\" ", string.joinv ("-", ev.name.down ().split ("_")));
+		if(ev.value == null) {
+			warning("%s has no value, the gir file will be non-compilable", ev.name);
+		} else {
+			var integer = ev.value as IntegerLiteral;
+			assert(integer != null);
+			stream.printf (" value=\"%s\"", integer.value);
+		}
+		stream.printf ("/>\n");
 	}
 
 	public override void visit_error_domain (ErrorDomain edomain) {
@@ -279,7 +287,39 @@
 		}
 
 		write_indent ();
-		stream.printf ("<constant name=\"%s\"/>\n", c.get_cname ());
+		stream.printf ("<constant name=\"%s\" ", c.get_cname ());
+		var init = c.initializer as Literal;
+		var str = init as StringLiteral;
+		if(str != null) {
+			stream.printf("value=\"%s\"", Markup.escape_text(str.eval()));
+		}
+		var i = init as IntegerLiteral;
+		if(i != null) {
+			stream.printf("value=\"%s\"", i.value);
+		}
+		var real = init as RealLiteral;
+		if(real != null) {
+			stream.printf("value=\"%s\"", real.value);
+		}
+	/* NOTE: Below might be wrong*/
+		var ch = init as CharacterLiteral;
+		if(ch != null) {
+			/* FIXME: How to printf a unichar?*/
+			stream.printf("value=\"%lc\"", ch.get_char());
+		}
+		var b = init as BooleanLiteral;
+		if(b != null) {
+			/*how does GIR explain the value?*/
+			stream.printf("value=\"%s\"", b.value?"true":"false");
+		}
+		var n = init as NullLiteral;
+		if(n != null) {
+			/*how does GIR represent NULL*/
+			stream.printf("value=\"null\"");
+		}
+		stream.printf(">\n");
+		write_type (init.value_type);
+		stream.printf("</constant>\n");
 	}
 
 	public override void visit_field (Field f) {
@@ -309,7 +349,7 @@
 
 		if (instance_type != null) {
 			write_indent ();
-			stream.printf ("<parameter name=\"self\">\n");
+			stream.printf ("<parameter name=\"self\" transfer-ownership=\"none\">\n");
 			indent++;
 
 			write_type (instance_type);
@@ -338,6 +378,8 @@
 				// normal in paramter
 				if (param.parameter_type.value_owned) {
 					stream.printf (" transfer-ownership=\"full\"");
+				} else {
+					stream.printf (" transfer-ownership=\"none\"");
 				}
 			}
 			stream.printf (">\n");
@@ -388,23 +430,46 @@
 			return;
 		}
 
+		Class current_class = m.parent_symbol as Class;
+		bool in_namespace = m.parent_symbol is Namespace;
+		bool static_class_member  = (current_class != null && 
+				current_class.is_subtype_of (gobject_type) &&
+				m.binding == MemberBinding.STATIC);
 		write_indent ();
-		stream.printf ("<method name=\"%s\" c:identifier=\"%s\"", m.name, m.get_cname ());
+		string tag = null;
+		if(in_namespace || static_class_member){
+			tag = "function";
+		} else {
+			tag = "method";
+		}
+
+		stream.printf ("<%s name=\"%s\" c:identifier=\"%s\"", tag, m.name, m.get_cname ());
 		stream.printf (">\n");
 		indent++;
 
-		DataType instance_type = null;
-		if (m.binding == MemberBinding.INSTANCE) {
-			instance_type = CCodeBaseModule.get_data_type_for_symbol ((TypeSymbol) m.parent_symbol);
+		switch(m.binding) {
+			case MemberBinding.INSTANCE:
+			/* methods doesn't need the self instance anymore */
+				/*
+				DataType instance_type = null;
+				instance_type = CCodeBaseModule.get_data_type_for_symbol ((TypeSymbol) m.parent_symbol);
+				*/
+			write_params (m.get_parameters (), null);
+			break;
+			case MemberBinding.STATIC:
+			write_params (m.get_parameters (), null);
+			break;
+			case MemberBinding.CLASS:
+			/*FIXME: how to do this?*/
+			break;
 		}
 
-		write_params (m.get_parameters (), instance_type);
 
 		write_return_type (m.return_type);
 
 		indent--;
 		write_indent ();
-		stream.printf ("</method>\n");
+		stream.printf ("</%s>\n", tag);
 	}
 	
 	public override void visit_creation_method (CreationMethod m) {
@@ -436,7 +501,7 @@
 		}
 
 		write_indent ();
-		stream.printf ("<property name=\"%s\"", prop.name);
+		stream.printf ("<property name=\"%s\"", prop.get_canonical_name());
 		if (prop.get_accessor != null) {
 			stream.printf (" readable=\"1\"");
 		}
@@ -485,6 +550,8 @@
 		stream.printf ("<return-value");
 		if (type.value_owned) {
 			stream.printf (" transfer-ownership=\"full\"");
+		} else {
+			stream.printf (" transfer-ownership=\"none\"");
 		}
 		stream.printf (">\n");
 		indent++;
@@ -514,7 +581,17 @@
 			stream.printf ("<type name=\"none\"/>\n");
 		} else {
 			write_indent ();
-			stream.printf ("<type name=\"%s\"/>\n", type.to_string ());
+			/*TODO: translate vala names to gir names*/
+			string type_name = type.to_string();
+			switch(type_name) {
+				case "string":
+					type_name = "utf8";
+				break;
+				case "string?":
+					type_name = "utf8?";
+				break;
+			}
+			stream.printf ("<type name=\"%s\"/>\n", type_name);
 		}
 	}
 
