mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 18:15:35 +00:00
fb60c23e4a
* generator/GenBase.cs (AppendCustom): Add #region to code from .custom files. * generator/*Gen.cs: Add #region markers. svn path=/trunk/gtk-sharp/; revision=10188
58 lines
1.3 KiB
C#
58 lines
1.3 KiB
C#
// GtkSharp.Generation.InterfaceGen.cs - The Interface Generatable.
|
|
//
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
//
|
|
// (c) 2001-2002 Mike Kestner
|
|
|
|
namespace GtkSharp.Generation {
|
|
|
|
using System;
|
|
using System.IO;
|
|
using System.Xml;
|
|
|
|
public class InterfaceGen : ClassBase, IGeneratable {
|
|
|
|
public InterfaceGen (XmlElement ns, XmlElement elem) : base (ns, elem) {}
|
|
|
|
public void Generate ()
|
|
{
|
|
if (!DoGenerate)
|
|
return;
|
|
|
|
StreamWriter sw = CreateWriter ();
|
|
|
|
sw.WriteLine ("\tusing System;");
|
|
sw.WriteLine ();
|
|
|
|
sw.WriteLine("\t\t/// <summary> " + Name + " Interface</summary>");
|
|
sw.WriteLine("\t\t/// <remarks>");
|
|
sw.WriteLine("\t\t/// </remarks>");
|
|
|
|
sw.WriteLine ("#region Autogenerated code");
|
|
sw.WriteLine ("\tpublic interface " + Name + " : GLib.IWrapper {");
|
|
sw.WriteLine ();
|
|
|
|
foreach (Signal sig in sigs.Values) {
|
|
if (sig.Validate ())
|
|
sig.GenerateDecl (sw);
|
|
}
|
|
|
|
foreach (Method method in methods.Values) {
|
|
if (IgnoreMethod (method))
|
|
continue;
|
|
|
|
if (method.Validate ())
|
|
method.GenerateDecl (sw);
|
|
}
|
|
|
|
AppendCustom (sw);
|
|
|
|
sw.WriteLine ("\t}");
|
|
sw.WriteLine ("#endregion");
|
|
CloseWriter (sw);
|
|
Statistics.IFaceCount++;
|
|
}
|
|
}
|
|
}
|
|
|