2008-09-16 Jeffrey Stedfast <fejj@novell.com>

* generator/Property.cs (IsDeprecated): Allow "1" or "true".

	* generator/Method.cs (.ctor): Allow "1" or "true".

	* generator/ClassBase.cs: Allow a value of "true" to work the same
	as "1" for the deprecated and abstract attributes.


svn path=/trunk/gtk-sharp/; revision=113238
This commit is contained in:
Jeffrey Stedfast 2008-09-16 23:21:50 +00:00
parent 2afce85920
commit ccb3ac6a13
3 changed files with 17 additions and 7 deletions

View File

@ -68,10 +68,15 @@ namespace GtkSharp.Generation {
protected ClassBase (XmlElement ns, XmlElement elem) : base (ns, elem) {
if (elem.HasAttribute ("deprecated"))
deprecated = elem.GetAttribute ("deprecated") == "1";
if (elem.HasAttribute ("abstract"))
isabstract = elem.GetAttribute ("abstract") == "1";
if (elem.HasAttribute ("deprecated")) {
string attr = elem.GetAttribute ("deprecated");
deprecated = attr == "1" || attr == "true";
}
if (elem.HasAttribute ("abstract")) {
string attr = elem.GetAttribute ("abstract");
isabstract = attr == "1" || attr == "true";
}
foreach (XmlNode node in elem.ChildNodes) {
if (!(node is XmlElement)) continue;

View File

@ -39,8 +39,12 @@ namespace GtkSharp.Generation {
public Method (XmlElement elem, ClassBase container_type) : base (elem, container_type)
{
this.retval = new ReturnValue (elem["return-type"]);
if (!container_type.IsDeprecated && elem.HasAttribute ("deprecated"))
deprecated = elem.GetAttribute ("deprecated") == "1";
if (!container_type.IsDeprecated && elem.HasAttribute ("deprecated")) {
string attr = elem.GetAttribute ("deprecated");
deprecated = attr == "1" || attr == "true";
}
if (Name == "GetType")
Name = "GetGType";
}

View File

@ -58,7 +58,8 @@ namespace GtkSharp.Generation {
bool IsDeprecated {
get {
return !container_type.IsDeprecated &&
elem.GetAttribute ("deprecated") == "1";
(elem.GetAttribute ("deprecated") == "1" ||
elem.GetAttribute ("deprecated") == "true");
}
}