Commit e3fb02ce authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

support interfaces in header cycles add get_interfaces method

2006-11-08  Jürg Billeter  <j@bitron.ch>

	* vala/valacodegenerator.vala: support interfaces in header cycles
	* vala/valanamespace.vala: add get_interfaces method

svn path=/trunk/; revision=170
parent d05a6510
2006-11-08 Jürg Billeter <j@bitron.ch>
* vala/valacodegenerator.vala: support interfaces in header cycles
* vala/valanamespace.vala: add get_interfaces method
2006-11-06 Jürg Billeter <j@bitron.ch> 2006-11-06 Jürg Billeter <j@bitron.ch>
* vala/parser.y: support unary ~ operator * vala/parser.y: support unary ~ operator
......
...@@ -251,6 +251,11 @@ public class Vala.CodeGenerator : CodeVisitor { ...@@ -251,6 +251,11 @@ public class Vala.CodeGenerator : CodeVisitor {
header_type_declaration.append (new CCodeTypeDefinition ("struct _%s".printf (cl.get_cname ()), new CCodeVariableDeclarator (cl.get_cname ()))); header_type_declaration.append (new CCodeTypeDefinition ("struct _%s".printf (cl.get_cname ()), new CCodeVariableDeclarator (cl.get_cname ())));
header_type_declaration.append (new CCodeTypeDefinition ("struct _%sClass".printf (cl.get_cname ()), new CCodeVariableDeclarator ("%sClass".printf (cl.get_cname ())))); header_type_declaration.append (new CCodeTypeDefinition ("struct _%sClass".printf (cl.get_cname ()), new CCodeVariableDeclarator ("%sClass".printf (cl.get_cname ()))));
} }
var ifaces = ns.get_interfaces ();
foreach (Interface iface in ifaces) {
header_type_declaration.append (new CCodeTypeDefinition ("struct _%s".printf (iface.get_cname ()), new CCodeVariableDeclarator (iface.get_cname ())));
header_type_declaration.append (new CCodeTypeDefinition ("struct _%s".printf (iface.get_type_cname ()), new CCodeVariableDeclarator (iface.get_type_cname ())));
}
} }
} }
} }
......
...@@ -136,6 +136,15 @@ public class Vala.Namespace : CodeNode { ...@@ -136,6 +136,15 @@ public class Vala.Namespace : CodeNode {
return classes.copy (); return classes.copy ();
} }
/**
* Returns a copy of the list of interfaces.
*
* @return interface list
*/
public ref List<weak Interface> get_interfaces () {
return interfaces.copy ();
}
/** /**
* Adds the specified constant to this namespace. * Adds the specified constant to this namespace.
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment