GtkSharp/generator/ClassGen.cs
Mike Kestner 3ff827ed69 2003-07-10 Mike Kestner <mkestner@speakeasy.net>
* api/*-api.xml : regenerated
	* gdk/Threads.cs : killed since the methods are now gen'd
	* generator/ClassGen.cs : new, static class generatable
	* generator/Parameters.cs : mangle new and byte as param names
	* generator/Parser.cs : parse new <class> elements
	* generator/SymbolTable.cs : add GC SimpleGen
	* parser/gapi2xml.pl : static class element fixes
	* parser/GAPI/Metadata.pm : add class element
	* sources/Art.metadata: new, rename Affine.ToString method
	* sources/Atk.metadata: rename State class
	* sources/Gdk.metadata: hide Pixbuf static class for now. rename
	Event and Pango static classes to avoid collisions.
	* sources/Gnome.metadata: rename Gtk and Gdk static classes to
	avoid collisions.
	* sources/GnomeDb.metadata: rename Stock static class to
	avoid collisions.
	* sources/Gtk.metadata: rename Stock static class to
	avoid collisions. Hide Idle class.

svn path=/trunk/gtk-sharp/; revision=16115
2003-07-11 02:00:13 +00:00

51 lines
1.1 KiB
C#

// GtkSharp.Generation.ObjectGen.cs - The Object Generatable.
//
// Author: Mike Kestner <mkestner@speakeasy.net>
//
// (c) 2001-2003 Mike Kestner
namespace GtkSharp.Generation {
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Xml;
public class ClassGen : ClassBase, IGeneratable {
private ArrayList strings = new ArrayList();
private static Hashtable namespaces = new Hashtable ();
public ClassGen (XmlElement ns, XmlElement elem) : base (ns, elem) {}
public void Generate ()
{
if (!DoGenerate)
return;
StreamWriter sw = CreateWriter ();
sw.WriteLine ("\tusing System.Runtime.InteropServices;");
sw.WriteLine ();
SymbolTable table = SymbolTable.Table;
sw.WriteLine ("#region Autogenerated code");
sw.Write ("\tpublic class " + Name);
sw.WriteLine (" {");
sw.WriteLine ();
GenProperties (sw);
GenMethods (sw, null, null, false);
sw.WriteLine ("#endregion");
AppendCustom(sw);
sw.WriteLine ("\t}");
CloseWriter (sw);
}
}
}