1
// GtkSharp.Generation.StructGen.cs - The Structure Generatable.
3
// Author: Mike Kestner <mkestner@speakeasy.net>
5
// Copyright (c) 2001 Mike Kestner
7
// This program is free software; you can redistribute it and/or
8
// modify it under the terms of version 2 of the GNU General Public
9
// License as published by the Free Software Foundation.
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
// General Public License for more details.
16
// You should have received a copy of the GNU General Public
17
// License along with this program; if not, write to the
18
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
// Boston, MA 02111-1307, USA.
22
namespace GtkSharp.Generation {
28
public class StructGen : StructBase {
30
public StructGen (XmlElement ns, XmlElement elem) : base (ns, elem) {}
32
public override void Generate (GenerationInfo gen_info)
34
gen_info.CurrentType = Name;
36
StreamWriter sw = gen_info.Writer = gen_info.OpenStream (Name);
37
base.Generate (gen_info);
38
if (GetMethod ("GetType") == null && GetMethod ("GetGType") == null) {
39
sw.WriteLine ("\t\tprivate static GLib.GType GType {");
40
sw.WriteLine ("\t\t\tget { return GLib.GType.Pointer; }");
41
sw.WriteLine ("\t\t}");
43
sw.WriteLine ("#endregion");
44
AppendCustom (sw, gen_info.CustomDir);
48
gen_info.Writer = null;
49
Statistics.StructCount++;