2008-09-30 Stephane Delcroix <sdelcroix@novell.com>
* generator/CallbackGen.cs: * generator/ClassGen.cs: * generator/EnumGen.cs: * generator/GenBase.cs: * generator/InterfaceGen.cs: * generator/Method.cs: * generator/OpaqueGen.cs: * generator/StructBase.cs: * generator/ObjectGen: check for the internal attribute * generator/Method.cs: check for the accessibility attribute; svn path=/trunk/gtk-sharp/; revision=114497
This commit is contained in:
parent
2247739bd6
commit
a1f8ed79de
10 changed files with 42 additions and 7 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2008-09-30 Stephane Delcroix <sdelcroix@novell.com>
|
||||
|
||||
* generator/CallbackGen.cs:
|
||||
* generator/ClassGen.cs:
|
||||
* generator/EnumGen.cs:
|
||||
* generator/GenBase.cs:
|
||||
* generator/InterfaceGen.cs:
|
||||
* generator/Method.cs:
|
||||
* generator/OpaqueGen.cs:
|
||||
* generator/StructBase.cs:
|
||||
* generator/ObjectGen: check for the internal attribute
|
||||
* generator/Method.cs: check for the accessibility attribute;
|
||||
|
||||
2008-09-24 Mike Gorse <mgorse@novell.com>
|
||||
|
||||
* atk/Atk.metadata: Mark rect in GetRangeExtents as out.
|
||||
|
|
|
@ -291,7 +291,7 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ();
|
||||
sw.WriteLine ("\tusing System;");
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("\tpublic delegate " + retval.CSType + " " + Name + "(" + sig.ToString() + ");");
|
||||
sw.WriteLine ("\t{0} delegate " + retval.CSType + " " + Name + "(" + sig.ToString() + ");", IsInternal ? "internal" : "public");
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("}");
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ("#region Autogenerated code");
|
||||
if (IsDeprecated)
|
||||
sw.WriteLine ("\t[Obsolete]");
|
||||
sw.Write ("\tpublic class " + Name);
|
||||
sw.Write ("\t{0} class " + Name, IsInternal ? "internal" : "public");
|
||||
sw.WriteLine (" {");
|
||||
sw.WriteLine ();
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace GtkSharp.Generation {
|
|||
if (Elem.HasAttribute("gtype"))
|
||||
sw.WriteLine ("\t[GLib.GType (typeof (" + NS + "." + Name + "GType))]");
|
||||
|
||||
sw.WriteLine ("\tpublic enum " + Name + enum_type + " {");
|
||||
sw.WriteLine ("\t{0} enum " + Name + enum_type + " {", IsInternal ? "internal" : "public");
|
||||
sw.WriteLine ();
|
||||
|
||||
foreach (string member in members)
|
||||
|
|
|
@ -49,6 +49,16 @@ namespace GtkSharp.Generation {
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsInternal {
|
||||
get {
|
||||
if (elem.HasAttribute ("internal")) {
|
||||
string attr = elem.GetAttribute ("internal");
|
||||
return attr == "1" || attr == "true";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public string LibraryName {
|
||||
get {
|
||||
return ns.GetAttribute ("library");
|
||||
|
|
|
@ -302,7 +302,7 @@ namespace GtkSharp.Generation {
|
|||
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("\t[GLib.GInterface (typeof (" + Name + "Adapter))]");
|
||||
sw.WriteLine ("\tpublic interface " + Name + "Implementor : GLib.IWrapper {");
|
||||
sw.WriteLine ("\t{0} interface " + Name + "Implementor : GLib.IWrapper {", IsInternal ? "internal" : "public");
|
||||
sw.WriteLine ();
|
||||
Hashtable vm_table = new Hashtable ();
|
||||
foreach (VirtualMethod vm in vms)
|
||||
|
|
|
@ -44,6 +44,18 @@ namespace GtkSharp.Generation {
|
|||
string attr = elem.GetAttribute ("deprecated");
|
||||
deprecated = attr == "1" || attr == "true";
|
||||
}
|
||||
if (elem.HasAttribute ("accessibility")) {
|
||||
string attr = elem.GetAttribute ("accessibility");
|
||||
switch (attr) {
|
||||
case "public":
|
||||
case "protected":
|
||||
case "internal":
|
||||
case "private":
|
||||
case "protected internal":
|
||||
protection = attr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Name == "GetType")
|
||||
Name = "GetGType";
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ("\t[Obsolete]");
|
||||
foreach (string attr in custom_attrs)
|
||||
sw.WriteLine ("\t" + attr);
|
||||
sw.Write ("\tpublic {0}class " + Name, IsAbstract ? "abstract " : "");
|
||||
sw.Write ("\t{0} {1}class " + Name, IsInternal ? "internal" : "public", IsAbstract ? "abstract " : "");
|
||||
string cs_parent = table.GetCSType(Elem.GetAttribute("parent"));
|
||||
if (cs_parent != "") {
|
||||
di.objects.Add (CName, QualifiedName);
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace GtkSharp.Generation {
|
|||
|
||||
if (IsDeprecated)
|
||||
sw.WriteLine ("\t[Obsolete]");
|
||||
sw.Write ("\tpublic class " + Name);
|
||||
sw.Write ("\t{0} class " + Name, IsInternal ? "internal" : "public");
|
||||
string cs_parent = table.GetCSType(Elem.GetAttribute("parent"));
|
||||
if (cs_parent != "")
|
||||
sw.Write (" : " + cs_parent);
|
||||
|
|
|
@ -159,7 +159,7 @@ namespace GtkSharp.Generation {
|
|||
if (IsDeprecated)
|
||||
sw.WriteLine ("\t[Obsolete]");
|
||||
sw.WriteLine ("\t[StructLayout(LayoutKind.Sequential)]");
|
||||
sw.WriteLine ("\tpublic struct " + Name + " {");
|
||||
sw.WriteLine ("\t{0} struct " + Name + " {", IsInternal ? "internal" : "public");
|
||||
sw.WriteLine ();
|
||||
|
||||
need_read_native = false;
|
||||
|
|
Loading…
Reference in a new issue