File: AttributeHelper.cs

package info (click to toggle)
gtk-sharp2 2.12.40-3.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 26,632 kB
  • sloc: xml: 351,292; cs: 26,444; sh: 4,228; ansic: 2,915; makefile: 1,288; perl: 1,179
file content (22 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.IO;

namespace GtkSharp.Generation
{
	public static class AttributeHelper
	{
		public static void Gen (StreamWriter sw, string name, string libraryName, string pinvoke)
		{
			sw.WriteLine ();
			sw.WriteLine ("\tinternal class " + name + "Attribute : GLib.GTypeTypeAttribute {");
			sw.WriteLine ("\t\t[DllImport (\"" + libraryName + "\", CallingConvention = CallingConvention.Cdecl)]");
			sw.WriteLine ("\t\tstatic extern IntPtr {0} ();", pinvoke);
			sw.WriteLine ();
			sw.WriteLine ("\t\tprivate static GLib.GType _gtype = new GLib.GType ({0} ());", pinvoke);
			sw.WriteLine ("\t\tpublic static GLib.GType GType { get { return _gtype; } }");
			sw.WriteLine ("\t\tpublic override GLib.GType Type { get { return _gtype; } }");
			sw.WriteLine ();
			sw.WriteLine ("\t}");
		}
	}
}