diff --git a/Makefile.include b/Makefile.include index 61b93ab69..eb97d9133 100644 --- a/Makefile.include +++ b/Makefile.include @@ -17,7 +17,7 @@ DISTCLEANFILES = $(ASSEMBLY).config POLICY_ASSEMBLIES = $(addsuffix .$(ASSEMBLY), $(addprefix policy., $(POLICY_VERSIONS))) POLICY_CONFIGS = $(addsuffix .config, $(addprefix policy., $(POLICY_VERSIONS))) -EXTRA_DIST = $(RAW_API) $(SYMBOLS) $(ASSEMBLY).config.in $(METADATA) $(customs) $(sources) $(add_dist) +EXTRA_DIST = $(RAW_API) $(SYMBOLS) $(ASSEMBLY).config.in $(METADATA) $(sources) $(add_dist) build_symbols = $(addprefix --symbols=$(srcdir)/, $(SYMBOLS)) @@ -29,14 +29,13 @@ $(API): $(METADATA) $(RAW_API) $(SYMBOLS) $(top_builddir)/parser/gapi-fixup.exe $(RUNTIME) $(top_builddir)/parser/gapi-fixup.exe --api=$(API) --metadata=$(srcdir)/$(METADATA) $(build_symbols); \ fi -build_customs = $(addprefix $(srcdir)/, $(customs)) api_includes = $(addprefix -I:, $(INCLUDE_API)) -generated-stamp: $(API) $(INCLUDE_API) $(top_builddir)/generator/gapi_codegen.exe $(build_customs) +generated-stamp: $(API) $(INCLUDE_API) $(top_builddir)/generator/gapi_codegen.exe rm -f generated/* && \ $(RUNTIME) $(top_builddir)/generator/gapi_codegen.exe --generate $(API) \ $(api_includes) \ - --outdir=generated --customdir=$(srcdir) --assembly-name=$(ASSEMBLY_NAME) \ + --outdir=generated --assembly-name=$(ASSEMBLY_NAME) \ --gluelib-name=$(pkg)sharpglue-3 --glue-filename=glue/generated.c \ --glue-includes=$(glue_includes) \ && touch generated-stamp diff --git a/generator/BoxedGen.cs b/generator/BoxedGen.cs index 28656f23f..a0a3e38e3 100644 --- a/generator/BoxedGen.cs +++ b/generator/BoxedGen.cs @@ -72,9 +72,8 @@ namespace GtkSharp.Generation { } sw.WriteLine ("#endregion"); - AppendCustom(sw, gen_info.CustomDir); - sw.WriteLine ("\t}"); - sw.WriteLine ("}"); + sw.WriteLine ("\t}"); + sw.WriteLine ("}"); sw.Close (); gen_info.Writer = null; Statistics.BoxedCount++; diff --git a/generator/ClassGen.cs b/generator/ClassGen.cs index 299393cf0..69841f6d4 100644 --- a/generator/ClassGen.cs +++ b/generator/ClassGen.cs @@ -81,7 +81,6 @@ namespace GtkSharp.Generation { GenMethods (gen_info, null, null); sw.WriteLine ("#endregion"); - AppendCustom(sw, gen_info.CustomDir); sw.WriteLine ("\t}"); sw.WriteLine ("}"); diff --git a/generator/CodeGenerator.cs b/generator/CodeGenerator.cs index f45c7a0ef..3be4ce273 100644 --- a/generator/CodeGenerator.cs +++ b/generator/CodeGenerator.cs @@ -37,7 +37,6 @@ namespace GtkSharp.Generation { bool generate = false; string dir = ""; - string custom_dir = ""; string assembly_name = ""; string glue_filename = ""; string glue_includes = ""; @@ -46,6 +45,10 @@ namespace GtkSharp.Generation { SymbolTable table = SymbolTable.Table; ArrayList gens = new ArrayList (); foreach (string arg in args) { + if (arg.StartsWith ("--customdir=")) { + Console.WriteLine ("Using .custom files is not supported anymore, use partial classes instead."); + return 0; + } string filename = arg; if (arg == "--generate") { generate = true; @@ -60,10 +63,6 @@ namespace GtkSharp.Generation { generate = false; dir = arg.Substring (9); continue; - } else if (arg.StartsWith ("--customdir=")) { - generate = false; - custom_dir = arg.Substring (12); - continue; } else if (arg.StartsWith ("--assembly-name=")) { generate = false; assembly_name = arg.Substring (16); @@ -101,7 +100,7 @@ namespace GtkSharp.Generation { GenerationInfo gen_info = null; if (dir != "" || assembly_name != "" || glue_filename != "" || glue_includes != "" || gluelib_name != "") - gen_info = new GenerationInfo (dir, custom_dir, assembly_name, glue_filename, glue_includes, gluelib_name); + gen_info = new GenerationInfo (dir, assembly_name, glue_filename, glue_includes, gluelib_name); foreach (IGeneratable gen in gens) { if (gen_info == null) diff --git a/generator/GObjectVM.cs b/generator/GObjectVM.cs index a5e4555fd..8aac614d8 100644 --- a/generator/GObjectVM.cs +++ b/generator/GObjectVM.cs @@ -190,7 +190,7 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t\t\t{0}Internal{1} ({2});", retval.IsVoid ? "" : "return ", this.Name, Signature.GetCallString (false)); sw.WriteLine ("\t\t}"); sw.WriteLine (); - // This method is to be invoked from existing VM implementations in the .customs + // This method is to be invoked from existing VM implementations in the custom code sw.WriteLine ("\t\tprivate {0} Internal{1} ({2})", retval.CSType, this.Name, Signature.ToString ()); sw.WriteLine ("\t\t{"); } diff --git a/generator/GenBase.cs b/generator/GenBase.cs index 1e4011ce0..378e3c845 100644 --- a/generator/GenBase.cs +++ b/generator/GenBase.cs @@ -94,26 +94,6 @@ namespace GtkSharp.Generation { } } - 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; - string custom = custom_dir + sep + type_name + ".custom"; - if (File.Exists(custom)) { - sw.WriteLine ("#region Customized extensions"); - sw.WriteLine ("#line 1 \"" + type_name + ".custom\""); - FileStream custstream = new FileStream(custom, FileMode.Open, FileAccess.Read); - StreamReader sr = new StreamReader(custstream); - sw.WriteLine (sr.ReadToEnd ()); - sw.WriteLine ("#endregion"); - sr.Close (); - } - } - public abstract string CallByName (string var); public abstract string FromNative (string var); diff --git a/generator/GenerationInfo.cs b/generator/GenerationInfo.cs index a7fc74ee3..3535a62c8 100644 --- a/generator/GenerationInfo.cs +++ b/generator/GenerationInfo.cs @@ -29,7 +29,6 @@ namespace GtkSharp.Generation { public class GenerationInfo { string dir; - string custom_dir; string assembly_name; string gluelib_name; bool glue_enabled; @@ -41,16 +40,14 @@ namespace GtkSharp.Generation { string ns_name = ns.GetAttribute ("name"); char sep = Path.DirectorySeparatorChar; dir = ".." + sep + ns_name.ToLower () + sep + "generated"; - custom_dir = ".." + sep + ns_name.ToLower (); assembly_name = ns_name.ToLower () + "-sharp"; } - public GenerationInfo (string dir, string assembly_name) : this (dir, dir, assembly_name, "", "", "") {} + public GenerationInfo (string dir, string assembly_name) : this (dir, assembly_name, "", "", "") {} - public GenerationInfo (string dir, string custom_dir, string assembly_name, string glue_filename, string glue_includes, string gluelib_name) + public GenerationInfo (string dir, string assembly_name, string glue_filename, string glue_includes, string gluelib_name) { this.dir = dir; - this.custom_dir = custom_dir; this.assembly_name = assembly_name; this.gluelib_name = gluelib_name; InitializeGlue (glue_filename, glue_includes, gluelib_name); @@ -90,12 +87,6 @@ namespace GtkSharp.Generation { } } - public string CustomDir { - get { - return custom_dir; - } - } - public string Dir { get { return dir; diff --git a/generator/InterfaceGen.cs b/generator/InterfaceGen.cs index 6bf34d95c..9978c7ae4 100644 --- a/generator/InterfaceGen.cs +++ b/generator/InterfaceGen.cs @@ -270,8 +270,6 @@ namespace GtkSharp.Generation { sw.WriteLine ("#endregion"); - AppendCustom (sw, gen_info.CustomDir, Name + "Adapter"); - sw.WriteLine ("\t}"); sw.WriteLine ("}"); sw.Close (); @@ -320,7 +318,6 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t\t[GLib.Property (\"" + prop.CName + "\")]"); prop.GenerateDecl (sw, "\t\t"); } - AppendCustom (sw, gen_info.CustomDir, Name + "Implementor"); sw.WriteLine ("\t}"); } @@ -353,8 +350,6 @@ namespace GtkSharp.Generation { foreach (Property prop in props.Values) prop.GenerateDecl (sw, "\t\t"); - AppendCustom (sw, gen_info.CustomDir); - sw.WriteLine ("\t}"); GenerateImplementorIface (gen_info); sw.WriteLine ("#endregion"); diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index 8fe27b6f3..e7ef13d57 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -239,7 +239,6 @@ namespace GtkSharp.Generation { } sw.WriteLine ("#endregion"); - AppendCustom (sw, gen_info.CustomDir); sw.WriteLine ("\t}"); sw.WriteLine ("}"); diff --git a/generator/OpaqueGen.cs b/generator/OpaqueGen.cs index eb56c945c..89b175c3f 100644 --- a/generator/OpaqueGen.cs +++ b/generator/OpaqueGen.cs @@ -183,8 +183,6 @@ namespace GtkSharp.Generation { } #endif sw.WriteLine ("#endregion"); - - AppendCustom(sw, gen_info.CustomDir); sw.WriteLine ("\t}"); sw.WriteLine ("}"); diff --git a/generator/StructBase.cs b/generator/StructBase.cs index 591a06e1a..9a0b380c7 100644 --- a/generator/StructBase.cs +++ b/generator/StructBase.cs @@ -224,8 +224,7 @@ namespace GtkSharp.Generation { return; sw.WriteLine ("#endregion"); - AppendCustom(sw, gen_info.CustomDir); - + sw.WriteLine ("\t}"); sw.WriteLine ("}"); sw.Close (); diff --git a/generator/StructGen.cs b/generator/StructGen.cs index be38c14fb..e3da30392 100644 --- a/generator/StructGen.cs +++ b/generator/StructGen.cs @@ -41,7 +41,6 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t\t}"); } sw.WriteLine ("#endregion"); - AppendCustom (sw, gen_info.CustomDir); sw.WriteLine ("\t}"); sw.WriteLine ("}"); sw.Close ();