mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 03:15:26 +00:00
1f4ff5bb86
* glib/EnumWrapper.cs: New class which holds an enum int. * glib/Value.cs: Add support for glib enum types. We needed to use EnumWrapper for this because otherwise the int operator wouldn't know which glib function to use. * generator/BoxedGen.cs, ClassBase.cs, Ctor.cs, EnumGen.cs, InterfaceGen.cs, Method.cs, ObjectGen.cs, Signal.cs, StructGen.cs: Create more doc stubs. * generator/Property.cs: Generate enum values correctly. * generator/Ctor.cs: Refactor generation to honor metadata-specified collision preference. * parser/Gtk.metadata: Added constructor collision preferences to all known clashes. * parse/Gdk.metadata: Added (for Pixbuf clashes). svn path=/trunk/gtk-sharp/; revision=5437
51 lines
1.1 KiB
C#
51 lines
1.1 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 ()
|
|
{
|
|
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 ("\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);
|
|
}
|
|
|
|
sw.WriteLine ("\t}");
|
|
CloseWriter (sw);
|
|
Statistics.IFaceCount++;
|
|
}
|
|
}
|
|
}
|
|
|