2003-01-05 Duncan Mak <duncan@ximian.com>

* generator/GenBase.cs (AppendCustom): Add #region to code from
	.custom files.

	* generator/*Gen.cs: Add #region markers.

svn path=/trunk/gtk-sharp/; revision=10188
This commit is contained in:
Duncan Mak 2003-01-05 23:51:37 +00:00
parent 20160aa0fd
commit fb60c23e4a
8 changed files with 29 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2003-01-05 Duncan Mak <duncan@ximian.com>
* generator/GenBase.cs (AppendCustom): Add #region to code from
.custom files.
* generator/*Gen.cs: Add #region markers.
2003-01-05 Duncan Mak <duncan@ximian.com>
* sources/Gtk.metadata (TextIter.ForwardSearch): Add out param

View file

@ -71,7 +71,8 @@ namespace GtkSharp.Generation {
sw.WriteLine ();
sw.WriteLine ("\tusing System;");
sw.WriteLine ();
sw.WriteLine ("#region Autogenerated code");
string import_sig;
if (parms != null)
{
@ -152,7 +153,8 @@ namespace GtkSharp.Generation {
sw.WriteLine ("\t\t}");
sw.WriteLine ("\t}");
sw.WriteLine ("#endregion");
CloseWriter (sw);
}

View file

@ -60,6 +60,8 @@ namespace GtkSharp.Generation {
if (Elem.GetAttribute("type") == "flags")
sw.WriteLine ("\t[Flags]");
sw.WriteLine ("#region Autogenerated code");
sw.WriteLine ("\tpublic enum " + Name + " {");
sw.WriteLine ();
@ -82,8 +84,9 @@ namespace GtkSharp.Generation {
sw.WriteLine (",");
}
}
sw.WriteLine ("\t}");
sw.WriteLine ("#endregion");
CloseWriter (sw);
Statistics.EnumCount++;
}

View file

@ -99,9 +99,11 @@ namespace GtkSharp.Generation {
char sep = Path.DirectorySeparatorChar;
string custom = ".." + sep + NS.ToLower() + sep + Name + ".custom";
if (File.Exists(custom)) {
sw.WriteLine ("#region Customized extensions");
FileStream custstream = new FileStream(custom, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(custstream);
sw.WriteLine (sr.ReadToEnd ());
sw.WriteLine ("#endregion");
sr.Close ();
}
}

View file

@ -28,6 +28,7 @@ namespace GtkSharp.Generation {
sw.WriteLine("\t\t/// <remarks>");
sw.WriteLine("\t\t/// </remarks>");
sw.WriteLine ("#region Autogenerated code");
sw.WriteLine ("\tpublic interface " + Name + " : GLib.IWrapper {");
sw.WriteLine ();
@ -47,6 +48,7 @@ namespace GtkSharp.Generation {
AppendCustom (sw);
sw.WriteLine ("\t}");
sw.WriteLine ("#endregion");
CloseWriter (sw);
Statistics.IFaceCount++;
}

View file

@ -66,6 +66,8 @@ namespace GtkSharp.Generation {
sw.WriteLine("\t\t/// <summary> " + Name + " Class</summary>");
sw.WriteLine("\t\t/// <remarks>");
sw.WriteLine("\t\t/// </remarks>");
sw.WriteLine ("#region Autogenerated code");
sw.Write ("\tpublic class " + Name);
string cs_parent = SymbolTable.GetCSType(Elem.GetAttribute("parent"));
if (cs_parent != "")
@ -128,7 +130,8 @@ namespace GtkSharp.Generation {
sw.Write ("\t\tpublic static string " + str.GetAttribute ("name"));
sw.WriteLine (" {\n\t\t\t get { return \"" + str.GetAttribute ("value") + "\"; }\n\t\t}");
}
sw.WriteLine ("#endregion");
AppendCustom(sw);
sw.WriteLine ("\t}");
@ -267,7 +270,6 @@ namespace GtkSharp.Generation {
sw.WriteLine ("\t}");
sw.WriteLine ("}");
sw.WriteLine ("}");
sw.Flush ();
sw.Close ();
}

View file

@ -42,12 +42,15 @@ namespace GtkSharp.Generation {
sw.WriteLine("\t\t/// <summary> " + Name + " Opaque Struct</summary>");
sw.WriteLine("\t\t/// <remarks>");
sw.WriteLine("\t\t/// </remarks>");
sw.WriteLine ("#region Autogenerated code");
sw.Write ("\tpublic class {0} : GLib.Opaque", Name);
sw.WriteLine (" {");
sw.WriteLine ();
GenMethods (sw, null, null, true);
GenCtors (sw);
sw.WriteLine ("#endregion");
AppendCustom(sw);

View file

@ -219,6 +219,7 @@ namespace GtkSharp.Generation {
sw.WriteLine("\t\t/// <remarks>");
sw.WriteLine("\t\t/// </remarks>");
sw.WriteLine ("#region Autogenerated code");
sw.WriteLine ("\t[StructLayout(LayoutKind.Sequential)]");
sw.WriteLine ("\tpublic struct " + Name + " {");
sw.WriteLine ();
@ -227,6 +228,8 @@ namespace GtkSharp.Generation {
sw.WriteLine ();
GenCtors (sw);
GenMethods (sw, null, null, true);
sw.WriteLine ("#endregion");
AppendCustom(sw);
sw.WriteLine ("\t}");