mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-03-01 01:27:01 +00:00
2009-07-13 Gabriel Burt <gabriel.burt@gmail.com>
* generator/GenBase.cs: Add AppendCustom override that you can pass the type name in, used to include .custom for Name + Adapter and Name + Implementor .custom files for interface gen. * generator/InterfaceGen.cs: Use the new AppendCustom override for the Name + Adapter.custom file, and add support for including custom file for the Name + Implementor interface; necessary to manually implement an interface method. svn path=/trunk/gtk-sharp/; revision=137809
This commit is contained in:
parent
c339d40680
commit
1cd652998e
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2009-07-13 Gabriel Burt <gabriel.burt@gmail.com>
|
||||||
|
|
||||||
|
* generator/GenBase.cs: Add AppendCustom override that you can pass the
|
||||||
|
type name in, used to include .custom for Name + Adapter and Name +
|
||||||
|
Implementor .custom files for interface gen.
|
||||||
|
|
||||||
|
* generator/InterfaceGen.cs: Use the new AppendCustom override for the
|
||||||
|
Name + Adapter.custom file, and add support for including custom file for
|
||||||
|
the Name + Implementor interface; necessary to manually implement an
|
||||||
|
interface method.
|
||||||
|
|
||||||
2009-07-12 Mike Kestner <mkestner@novell.com>
|
2009-07-12 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* glib/GType.cs: add ResolveType event and TypeResolutionHandler delegate
|
* glib/GType.cs: add ResolveType event and TypeResolutionHandler delegate
|
||||||
|
|
|
@ -105,14 +105,19 @@ namespace GtkSharp.Generation {
|
||||||
return MarshalType;
|
return MarshalType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void AppendCustom (StreamWriter sw, string custom_dir)
|
protected void AppendCustom (StreamWriter sw, string custom_dir)
|
||||||
|
{
|
||||||
|
AppendCustom (sw, custom_dir, Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void AppendCustom (StreamWriter sw, string custom_dir, string type_name)
|
||||||
{
|
{
|
||||||
char sep = Path.DirectorySeparatorChar;
|
char sep = Path.DirectorySeparatorChar;
|
||||||
string custom = custom_dir + sep + Name + ".custom";
|
string custom = custom_dir + sep + type_name + ".custom";
|
||||||
if (File.Exists(custom)) {
|
if (File.Exists(custom)) {
|
||||||
sw.WriteLine ("#region Customized extensions");
|
sw.WriteLine ("#region Customized extensions");
|
||||||
sw.WriteLine ("#line 1 \"" + Name + ".custom\"");
|
sw.WriteLine ("#line 1 \"" + type_name + ".custom\"");
|
||||||
FileStream custstream = new FileStream(custom, FileMode.Open, FileAccess.Read);
|
FileStream custstream = new FileStream(custom, FileMode.Open, FileAccess.Read);
|
||||||
StreamReader sr = new StreamReader(custstream);
|
StreamReader sr = new StreamReader(custstream);
|
||||||
sw.WriteLine (sr.ReadToEnd ());
|
sw.WriteLine (sr.ReadToEnd ());
|
||||||
|
|
|
@ -252,15 +252,7 @@ namespace GtkSharp.Generation {
|
||||||
|
|
||||||
sw.WriteLine ("#endregion");
|
sw.WriteLine ("#endregion");
|
||||||
|
|
||||||
string custom = Path.Combine (gen_info.CustomDir, Name + "Adapter.custom");
|
AppendCustom (sw, gen_info.CustomDir, Name + "Adapter");
|
||||||
if (File.Exists (custom)) {
|
|
||||||
sw.WriteLine ("#region Customized extensions");
|
|
||||||
sw.WriteLine ("#line 1 \"" + Name + "Adapter.custom\"");
|
|
||||||
using (StreamReader sr = new StreamReader(new FileStream (custom, FileMode.Open, FileAccess.Read)))
|
|
||||||
sw.WriteLine (sr.ReadToEnd ());
|
|
||||||
|
|
||||||
sw.WriteLine ("#endregion");
|
|
||||||
}
|
|
||||||
|
|
||||||
sw.WriteLine ("\t}");
|
sw.WriteLine ("\t}");
|
||||||
sw.WriteLine ("}");
|
sw.WriteLine ("}");
|
||||||
|
@ -268,8 +260,9 @@ namespace GtkSharp.Generation {
|
||||||
gen_info.Writer = null;
|
gen_info.Writer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenerateImplementorIface (StreamWriter sw)
|
void GenerateImplementorIface (GenerationInfo gen_info)
|
||||||
{
|
{
|
||||||
|
var sw = gen_info.Writer;
|
||||||
if (IsConsumeOnly)
|
if (IsConsumeOnly)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -305,6 +298,9 @@ namespace GtkSharp.Generation {
|
||||||
vm_table.Remove (vm.Name);
|
vm_table.Remove (vm.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AppendCustom (sw, gen_info.CustomDir, Name + "Implementor");
|
||||||
|
|
||||||
sw.WriteLine ("\t}");
|
sw.WriteLine ("\t}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +335,7 @@ namespace GtkSharp.Generation {
|
||||||
AppendCustom (sw, gen_info.CustomDir);
|
AppendCustom (sw, gen_info.CustomDir);
|
||||||
|
|
||||||
sw.WriteLine ("\t}");
|
sw.WriteLine ("\t}");
|
||||||
GenerateImplementorIface (sw);
|
GenerateImplementorIface (gen_info);
|
||||||
sw.WriteLine ("#endregion");
|
sw.WriteLine ("#endregion");
|
||||||
sw.WriteLine ("}");
|
sw.WriteLine ("}");
|
||||||
sw.Close ();
|
sw.Close ();
|
||||||
|
|
Loading…
Reference in a new issue