Commit 56e2970a authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

support custom cname for classes, based on patch by Andrea Del Signore

2007-09-26  Juerg Billeter  <j@bitron.ch>

	* vala/valaclass.vala, vala/valainterfacewriter.vala: support custom
	  cname for classes, based on patch by Andrea Del Signore

svn path=/trunk/; revision=628
parent 1f88b5ea
2007-09-26 Jürg Billeter <j@bitron.ch>
* vala/valaclass.vala, vala/valainterfacewriter.vala: support custom
cname for classes, based on patch by Andrea Del Signore
2007-09-21 Jürg Billeter <j@bitron.ch>
* gobject/valaccodegeneratorclass.vala: prepare support for classes
......
......@@ -342,11 +342,20 @@ public class Vala.Class : DataType {
}
if (cname == null) {
cname = "%s%s".printf (parent_symbol.get_cprefix (), name);
cname = get_default_cname ();
}
return cname;
}
/**
* Returns the default name of this class as it is used in C code.
*
* @return the name to be used in C code by default
*/
public string! get_default_cname () {
return "%s%s".printf (parent_symbol.get_cprefix (), name);
}
/**
* Sets the name of this class as it is used in C code.
*
......
......@@ -123,6 +123,10 @@ public class Vala.InterfaceWriter : CodeVisitor {
}
}
if (cl.get_cname () != cl.get_default_cname ()) {
write_string ("cname = \"%s\", ".printf (cl.get_cname ()));
}
write_string ("cheader_filename = \"%s\")]".printf (cheaders));
write_newline ();
......
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