2003-10-05 00:20:17 +00:00
|
|
|
// GtkSharp.Generation.ClassGen.cs - The Class Generatable.
|
2003-07-11 02:00:13 +00:00
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
2004-06-25 16:35:15 +00:00
|
|
|
// Copyright (c) 2001-2003 Mike Kestner
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of version 2 of the GNU General Public
|
|
|
|
// License as published by the Free Software Foundation.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public
|
|
|
|
// License along with this program; if not, write to the
|
|
|
|
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
// Boston, MA 02111-1307, USA.
|
|
|
|
|
2003-07-11 02:00:13 +00:00
|
|
|
|
|
|
|
namespace GtkSharp.Generation {
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.IO;
|
|
|
|
using System.Text;
|
|
|
|
using System.Xml;
|
|
|
|
|
2004-12-26 19:33:34 +00:00
|
|
|
public class ClassGen : ClassBase {
|
2003-07-11 02:00:13 +00:00
|
|
|
|
|
|
|
public ClassGen (XmlElement ns, XmlElement elem) : base (ns, elem) {}
|
|
|
|
|
2005-07-02 15:23:27 +00:00
|
|
|
public override string AssignToName {
|
|
|
|
get {
|
|
|
|
return String.Empty;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string MarshalType {
|
|
|
|
get {
|
|
|
|
return String.Empty;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string CallByName ()
|
|
|
|
{
|
|
|
|
return String.Empty;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string CallByName (string var)
|
|
|
|
{
|
|
|
|
return String.Empty;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string FromNative (string var)
|
|
|
|
{
|
|
|
|
return String.Empty;
|
|
|
|
}
|
|
|
|
|
2004-12-26 19:33:34 +00:00
|
|
|
public override void Generate (GenerationInfo gen_info)
|
2003-10-05 00:20:17 +00:00
|
|
|
{
|
2011-02-20 18:11:08 +00:00
|
|
|
gen_info.CurrentType = QualifiedName;
|
2005-04-04 16:27:08 +00:00
|
|
|
|
2003-10-05 00:20:17 +00:00
|
|
|
StreamWriter sw = gen_info.Writer = gen_info.OpenStream(Name);
|
2003-07-11 02:00:13 +00:00
|
|
|
|
2003-10-05 00:20:17 +00:00
|
|
|
sw.WriteLine ("namespace " + NS + " {");
|
|
|
|
sw.WriteLine ();
|
|
|
|
sw.WriteLine ("\tusing System;");
|
2003-07-11 02:00:13 +00:00
|
|
|
sw.WriteLine ("\tusing System.Runtime.InteropServices;");
|
|
|
|
sw.WriteLine ();
|
|
|
|
|
2004-11-15 13:56:34 +00:00
|
|
|
sw.WriteLine ("#region Autogenerated code");
|
|
|
|
if (IsDeprecated)
|
2004-10-29 20:33:07 +00:00
|
|
|
sw.WriteLine ("\t[Obsolete]");
|
2009-08-19 16:13:17 +00:00
|
|
|
sw.Write ("\t{0} partial class " + Name, IsInternal ? "internal" : "public");
|
2003-07-11 02:00:13 +00:00
|
|
|
sw.WriteLine (" {");
|
|
|
|
sw.WriteLine ();
|
|
|
|
|
2005-07-22 18:35:37 +00:00
|
|
|
GenProperties (gen_info, null);
|
2003-10-05 00:20:17 +00:00
|
|
|
GenMethods (gen_info, null, null);
|
2003-07-11 02:00:13 +00:00
|
|
|
|
|
|
|
sw.WriteLine ("#endregion");
|
|
|
|
|
|
|
|
sw.WriteLine ("\t}");
|
2003-10-05 00:20:17 +00:00
|
|
|
sw.WriteLine ("}");
|
2003-07-11 02:00:13 +00:00
|
|
|
|
2003-10-05 00:20:17 +00:00
|
|
|
sw.Close ();
|
|
|
|
gen_info.Writer = null;
|
2003-07-11 02:00:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|