mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-02-28 08:16:56 +00:00
* generator/Parameters.cs:
* generator/StructBase.cs: * generator/SymbolTable.cs: Fixed the keyword base was not mangled, also did a little refactoring. svn path=/trunk/gtk-sharp/; revision=17702
This commit is contained in:
parent
1272d759e0
commit
f7ba4e2866
|
@ -4,6 +4,10 @@
|
||||||
proper copyright header.
|
proper copyright header.
|
||||||
* sources/Gtk.metadata: Fixed new_flag rules, they did not
|
* sources/Gtk.metadata: Fixed new_flag rules, they did not
|
||||||
get applied to the gtk-api.xml.
|
get applied to the gtk-api.xml.
|
||||||
|
* generator/Parameters.cs:
|
||||||
|
* generator/StructBase.cs:
|
||||||
|
* generator/SymbolTable.cs: Fixed the keyword base was not
|
||||||
|
mangled, also did a little refactoring.
|
||||||
|
|
||||||
2003-08-28 Alp Toker <alp@atoker.com>
|
2003-08-28 Alp Toker <alp@atoker.com>
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace GtkSharp.Generation {
|
||||||
|
|
||||||
public string Name {
|
public string Name {
|
||||||
get {
|
get {
|
||||||
return MangleName (elem.GetAttribute("name"));
|
return SymbolTable.Table.MangleName (elem.GetAttribute("name"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,37 +91,6 @@ namespace GtkSharp.Generation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string MangleName(string name)
|
|
||||||
{
|
|
||||||
switch (name) {
|
|
||||||
case "string":
|
|
||||||
return "str1ng";
|
|
||||||
case "event":
|
|
||||||
return "evnt";
|
|
||||||
case "null":
|
|
||||||
return "is_null";
|
|
||||||
case "object":
|
|
||||||
return "objekt";
|
|
||||||
case "params":
|
|
||||||
return "parms";
|
|
||||||
case "ref":
|
|
||||||
return "reference";
|
|
||||||
case "in":
|
|
||||||
return "in_param";
|
|
||||||
case "out":
|
|
||||||
return "out_param";
|
|
||||||
case "fixed":
|
|
||||||
return "mfixed";
|
|
||||||
case "byte":
|
|
||||||
return "_byte";
|
|
||||||
case "new":
|
|
||||||
return "_new";
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public string StudlyName {
|
public string StudlyName {
|
||||||
get {
|
get {
|
||||||
string name = elem.GetAttribute("name");
|
string name = elem.GetAttribute("name");
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace GtkSharp.Generation {
|
||||||
if (IsBit (field))
|
if (IsBit (field))
|
||||||
name = String.Format ("_bitfield{0}", bitfields++);
|
name = String.Format ("_bitfield{0}", bitfields++);
|
||||||
else
|
else
|
||||||
name += MangleName (field.GetAttribute ("cname"));
|
name += SymbolTable.Table.MangleName (field.GetAttribute ("cname"));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -151,14 +151,14 @@ namespace GtkSharp.Generation {
|
||||||
string c_type, type, name;
|
string c_type, type, name;
|
||||||
if (!GetFieldInfo (field, out c_type, out type, out name))
|
if (!GetFieldInfo (field, out c_type, out type, out name))
|
||||||
return false;
|
return false;
|
||||||
sw.WriteLine ("\t\tpublic {0} {1};", type, name);
|
sw.WriteLine ("\t\tpublic {0} {1};", type, SymbolTable.Table.MangleName (name));
|
||||||
|
|
||||||
if (field.HasAttribute("array_len"))
|
if (field.HasAttribute("array_len"))
|
||||||
Console.WriteLine ("warning: array field {0}.{1} probably incorrectly generated", QualifiedName, name);
|
Console.WriteLine ("warning: array field {0}.{1} probably incorrectly generated", QualifiedName, name);
|
||||||
SymbolTable table = SymbolTable.Table;
|
SymbolTable table = SymbolTable.Table;
|
||||||
|
|
||||||
string wrapped = table.GetCSType (c_type);
|
string wrapped = table.GetCSType (c_type);
|
||||||
string wrapped_name = MangleName (field.GetAttribute ("cname"));
|
string wrapped_name = SymbolTable.Table.MangleName (field.GetAttribute ("cname"));
|
||||||
if (table.IsObject (c_type)) {
|
if (table.IsObject (c_type)) {
|
||||||
sw.WriteLine ();
|
sw.WriteLine ();
|
||||||
sw.WriteLine ("\t\tpublic " + wrapped + " " + wrapped_name + " {");
|
sw.WriteLine ("\t\tpublic " + wrapped + " " + wrapped_name + " {");
|
||||||
|
@ -190,29 +190,6 @@ namespace GtkSharp.Generation {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String MangleName(String name)
|
|
||||||
{
|
|
||||||
if (name == "string") {
|
|
||||||
return "str1ng";
|
|
||||||
} else if (name == "event") {
|
|
||||||
return "evnt";
|
|
||||||
} else if (name == "null") {
|
|
||||||
return "is_null";
|
|
||||||
} else if (name == "object") {
|
|
||||||
return "objekt";
|
|
||||||
} else if (name == "ref") {
|
|
||||||
return "reference";
|
|
||||||
} else if (name == "params") {
|
|
||||||
return "parms";
|
|
||||||
} else if (name == "fixed") {
|
|
||||||
return "mfixed";
|
|
||||||
} else if (name == "in") {
|
|
||||||
return "inn";
|
|
||||||
} else {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Generate ()
|
public virtual void Generate ()
|
||||||
{
|
{
|
||||||
StreamWriter sw = CreateWriter ();
|
StreamWriter sw = CreateWriter ();
|
||||||
|
|
|
@ -292,6 +292,38 @@ namespace GtkSharp.Generation {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public string MangleName(string name)
|
||||||
|
{
|
||||||
|
switch (name) {
|
||||||
|
case "string":
|
||||||
|
return "str1ng";
|
||||||
|
case "event":
|
||||||
|
return "evnt";
|
||||||
|
case "null":
|
||||||
|
return "is_null";
|
||||||
|
case "object":
|
||||||
|
return "objekt";
|
||||||
|
case "params":
|
||||||
|
return "parms";
|
||||||
|
case "ref":
|
||||||
|
return "reference";
|
||||||
|
case "in":
|
||||||
|
return "in_param";
|
||||||
|
case "out":
|
||||||
|
return "out_param";
|
||||||
|
case "fixed":
|
||||||
|
return "mfixed";
|
||||||
|
case "byte":
|
||||||
|
return "_byte";
|
||||||
|
case "new":
|
||||||
|
return "_new";
|
||||||
|
case "base":
|
||||||
|
return "_base";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue