// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gtk {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;
	using static GLib.AbiStructExtension;

#region Autogenerated code
	public partial class EntryBuffer : GLib.Object {

		public EntryBuffer (IntPtr raw) : base(raw) {}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_entry_buffer_new(IntPtr initial_chars, int n_initial_chars);
		static d_gtk_entry_buffer_new gtk_entry_buffer_new = FuncLoader.LoadFunction<d_gtk_entry_buffer_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_new"));

		public EntryBuffer (string initial_chars, int n_initial_chars) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (EntryBuffer)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			IntPtr native_initial_chars = GLib.Marshaller.StringToPtrGStrdup (initial_chars);
			Raw = gtk_entry_buffer_new(native_initial_chars, n_initial_chars);
			GLib.Marshaller.Free (native_initial_chars);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_entry_buffer_get_text(IntPtr raw);
		static d_gtk_entry_buffer_get_text gtk_entry_buffer_get_text = FuncLoader.LoadFunction<d_gtk_entry_buffer_get_text>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_get_text"));

		[GLib.Property ("text")]
		public string Text {
			get  {
				IntPtr raw_ret = gtk_entry_buffer_get_text(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("text", val);
				val.Dispose ();
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate uint d_gtk_entry_buffer_get_length(IntPtr raw);
		static d_gtk_entry_buffer_get_length gtk_entry_buffer_get_length = FuncLoader.LoadFunction<d_gtk_entry_buffer_get_length>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_get_length"));

		[GLib.Property ("length")]
		public uint Length {
			get  {
				uint raw_ret = gtk_entry_buffer_get_length(Handle);
				uint ret = raw_ret;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int d_gtk_entry_buffer_get_max_length(IntPtr raw);
		static d_gtk_entry_buffer_get_max_length gtk_entry_buffer_get_max_length = FuncLoader.LoadFunction<d_gtk_entry_buffer_get_max_length>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_get_max_length"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_entry_buffer_set_max_length(IntPtr raw, int max_length);
		static d_gtk_entry_buffer_set_max_length gtk_entry_buffer_set_max_length = FuncLoader.LoadFunction<d_gtk_entry_buffer_set_max_length>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_set_max_length"));

		[GLib.Property ("max-length")]
		public int MaxLength {
			get  {
				int raw_ret = gtk_entry_buffer_get_max_length(Handle);
				int ret = raw_ret;
				return ret;
			}
			set  {
				gtk_entry_buffer_set_max_length(Handle, value);
			}
		}

		[GLib.Signal("deleted-text")]
		public event Gtk.DeletedTextHandler DeletedText {
			add {
				this.AddSignalHandler ("deleted-text", value, typeof (Gtk.DeletedTextArgs));
			}
			remove {
				this.RemoveSignalHandler ("deleted-text", value);
			}
		}

		[GLib.Signal("inserted-text")]
		public event Gtk.InsertedTextHandler InsertedText {
			add {
				this.AddSignalHandler ("inserted-text", value, typeof (Gtk.InsertedTextArgs));
			}
			remove {
				this.RemoveSignalHandler ("inserted-text", value);
			}
		}

		static InsertedTextNativeDelegate InsertedText_cb_delegate;
		static InsertedTextNativeDelegate InsertedTextVMCallback {
			get {
				if (InsertedText_cb_delegate == null)
					InsertedText_cb_delegate = new InsertedTextNativeDelegate (InsertedText_cb);
				return InsertedText_cb_delegate;
			}
		}

		static void OverrideInsertedText (GLib.GType gtype)
		{
			OverrideInsertedText (gtype, InsertedTextVMCallback);
		}

		static void OverrideInsertedText (GLib.GType gtype, InsertedTextNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("inserted_text"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void InsertedTextNativeDelegate (IntPtr inst, uint position, IntPtr chars, uint n_chars);

		static void InsertedText_cb (IntPtr inst, uint position, IntPtr chars, uint n_chars)
		{
			try {
				EntryBuffer __obj = GLib.Object.GetObject (inst, false) as EntryBuffer;
				__obj.OnInsertedText (position, GLib.Marshaller.Utf8PtrToString (chars), n_chars);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.EntryBuffer), ConnectionMethod="OverrideInsertedText")]
		protected virtual void OnInsertedText (uint position, string chars, uint n_chars)
		{
			InternalInsertedText (position, chars, n_chars);
		}

		private void InternalInsertedText (uint position, string chars, uint n_chars)
		{
			InsertedTextNativeDelegate unmanaged = class_abi.BaseOverride<InsertedTextNativeDelegate>(this.LookupGType(), "inserted_text");
			if (unmanaged == null) return;

			IntPtr native_chars = GLib.Marshaller.StringToPtrGStrdup (chars);
			unmanaged (this.Handle, position, native_chars, n_chars);
			GLib.Marshaller.Free (native_chars);
		}

		static DeletedTextNativeDelegate DeletedText_cb_delegate;
		static DeletedTextNativeDelegate DeletedTextVMCallback {
			get {
				if (DeletedText_cb_delegate == null)
					DeletedText_cb_delegate = new DeletedTextNativeDelegate (DeletedText_cb);
				return DeletedText_cb_delegate;
			}
		}

		static void OverrideDeletedText (GLib.GType gtype)
		{
			OverrideDeletedText (gtype, DeletedTextVMCallback);
		}

		static void OverrideDeletedText (GLib.GType gtype, DeletedTextNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("deleted_text"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void DeletedTextNativeDelegate (IntPtr inst, uint position, uint n_chars);

		static void DeletedText_cb (IntPtr inst, uint position, uint n_chars)
		{
			try {
				EntryBuffer __obj = GLib.Object.GetObject (inst, false) as EntryBuffer;
				__obj.OnDeletedText (position, n_chars);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.EntryBuffer), ConnectionMethod="OverrideDeletedText")]
		protected virtual void OnDeletedText (uint position, uint n_chars)
		{
			InternalDeletedText (position, n_chars);
		}

		private void InternalDeletedText (uint position, uint n_chars)
		{
			DeletedTextNativeDelegate unmanaged = class_abi.BaseOverride<DeletedTextNativeDelegate>(this.LookupGType(), "deleted_text");
			if (unmanaged == null) return;

			unmanaged (this.Handle, position, n_chars);
		}

		static GetTextNativeDelegate GetText_cb_delegate;
		static GetTextNativeDelegate GetTextVMCallback {
			get {
				if (GetText_cb_delegate == null)
					GetText_cb_delegate = new GetTextNativeDelegate (GetText_cb);
				return GetText_cb_delegate;
			}
		}

		static void OverrideGetText (GLib.GType gtype)
		{
			OverrideGetText (gtype, GetTextVMCallback);
		}

		static void OverrideGetText (GLib.GType gtype, GetTextNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_text"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr GetTextNativeDelegate (IntPtr inst, out UIntPtr n_bytes);

		static IntPtr GetText_cb (IntPtr inst, out UIntPtr n_bytes)
		{
			try {
				EntryBuffer __obj = GLib.Object.GetObject (inst, false) as EntryBuffer;
				string __result;
				ulong myn_bytes;
				__result = __obj.OnGetText (out myn_bytes);
				n_bytes = new UIntPtr (myn_bytes);
				return GLib.Marshaller.StringToPtrGStrdup(__result);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.EntryBuffer), ConnectionMethod="OverrideGetText")]
		protected virtual string OnGetText (out ulong n_bytes)
		{
			return InternalGetText (out n_bytes);
		}

		private string InternalGetText (out ulong n_bytes)
		{
			GetTextNativeDelegate unmanaged = class_abi.BaseOverride<GetTextNativeDelegate>(this.LookupGType(), "get_text");
			if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");

			UIntPtr native_n_bytes;
			IntPtr __result = unmanaged (this.Handle, out native_n_bytes);
			n_bytes = (ulong) native_n_bytes;
			return GLib.Marshaller.PtrToStringGFree(__result);
		}

		static GetLengthNativeDelegate GetLength_cb_delegate;
		static GetLengthNativeDelegate GetLengthVMCallback {
			get {
				if (GetLength_cb_delegate == null)
					GetLength_cb_delegate = new GetLengthNativeDelegate (GetLength_cb);
				return GetLength_cb_delegate;
			}
		}

		static void OverrideGetLength (GLib.GType gtype)
		{
			OverrideGetLength (gtype, GetLengthVMCallback);
		}

		static void OverrideGetLength (GLib.GType gtype, GetLengthNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_length"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate uint GetLengthNativeDelegate (IntPtr inst);

		static uint GetLength_cb (IntPtr inst)
		{
			try {
				EntryBuffer __obj = GLib.Object.GetObject (inst, false) as EntryBuffer;
				uint __result;
				__result = __obj.OnGetLength ();
				return __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.EntryBuffer), ConnectionMethod="OverrideGetLength")]
		protected virtual uint OnGetLength ()
		{
			return InternalGetLength ();
		}

		private uint InternalGetLength ()
		{
			GetLengthNativeDelegate unmanaged = class_abi.BaseOverride<GetLengthNativeDelegate>(this.LookupGType(), "get_length");
			if (unmanaged == null) return 0;

			uint __result = unmanaged (this.Handle);
			return __result;
		}

		static InsertTextNativeDelegate InsertText_cb_delegate;
		static InsertTextNativeDelegate InsertTextVMCallback {
			get {
				if (InsertText_cb_delegate == null)
					InsertText_cb_delegate = new InsertTextNativeDelegate (InsertText_cb);
				return InsertText_cb_delegate;
			}
		}

		static void OverrideInsertText (GLib.GType gtype)
		{
			OverrideInsertText (gtype, InsertTextVMCallback);
		}

		static void OverrideInsertText (GLib.GType gtype, InsertTextNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("insert_text"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate uint InsertTextNativeDelegate (IntPtr inst, uint position, IntPtr chars, uint n_chars);

		static uint InsertText_cb (IntPtr inst, uint position, IntPtr chars, uint n_chars)
		{
			try {
				EntryBuffer __obj = GLib.Object.GetObject (inst, false) as EntryBuffer;
				uint __result;
				__result = __obj.OnInsertText (position, GLib.Marshaller.Utf8PtrToString (chars), n_chars);
				return __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.EntryBuffer), ConnectionMethod="OverrideInsertText")]
		protected virtual uint OnInsertText (uint position, string chars, uint n_chars)
		{
			return InternalInsertText (position, chars, n_chars);
		}

		private uint InternalInsertText (uint position, string chars, uint n_chars)
		{
			InsertTextNativeDelegate unmanaged = class_abi.BaseOverride<InsertTextNativeDelegate>(this.LookupGType(), "insert_text");
			if (unmanaged == null) return 0;

			IntPtr native_chars = GLib.Marshaller.StringToPtrGStrdup (chars);
			uint __result = unmanaged (this.Handle, position, native_chars, n_chars);
			GLib.Marshaller.Free (native_chars);
			return __result;
		}

		static DeleteTextNativeDelegate DeleteText_cb_delegate;
		static DeleteTextNativeDelegate DeleteTextVMCallback {
			get {
				if (DeleteText_cb_delegate == null)
					DeleteText_cb_delegate = new DeleteTextNativeDelegate (DeleteText_cb);
				return DeleteText_cb_delegate;
			}
		}

		static void OverrideDeleteText (GLib.GType gtype)
		{
			OverrideDeleteText (gtype, DeleteTextVMCallback);
		}

		static void OverrideDeleteText (GLib.GType gtype, DeleteTextNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("delete_text"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate uint DeleteTextNativeDelegate (IntPtr inst, uint position, uint n_chars);

		static uint DeleteText_cb (IntPtr inst, uint position, uint n_chars)
		{
			try {
				EntryBuffer __obj = GLib.Object.GetObject (inst, false) as EntryBuffer;
				uint __result;
				__result = __obj.OnDeleteText (position, n_chars);
				return __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.EntryBuffer), ConnectionMethod="OverrideDeleteText")]
		protected virtual uint OnDeleteText (uint position, uint n_chars)
		{
			return InternalDeleteText (position, n_chars);
		}

		private uint InternalDeleteText (uint position, uint n_chars)
		{
			DeleteTextNativeDelegate unmanaged = class_abi.BaseOverride<DeleteTextNativeDelegate>(this.LookupGType(), "delete_text");
			if (unmanaged == null) return 0;

			uint __result = unmanaged (this.Handle, position, n_chars);
			return __result;
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public unsafe new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("inserted_text"
							, GLib.Object.class_abi.Fields
							, (uint) sizeof( IntPtr ) // inserted_text
							, null
							, "deleted_text"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("deleted_text"
							, -1
							, (uint) sizeof( IntPtr ) // deleted_text
							, "inserted_text"
							, "get_text"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("get_text"
							, -1
							, (uint) sizeof( IntPtr ) // get_text
							, "deleted_text"
							, "get_length"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("get_length"
							, -1
							, (uint) sizeof( IntPtr ) // get_length
							, "get_text"
							, "insert_text"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("insert_text"
							, -1
							, (uint) sizeof( IntPtr ) // insert_text
							, "get_length"
							, "delete_text"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("delete_text"
							, -1
							, (uint) sizeof( IntPtr ) // delete_text
							, "insert_text"
							, "_gtk_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved1
							, "delete_text"
							, "_gtk_reserved2"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved2"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved2
							, "_gtk_reserved1"
							, "_gtk_reserved3"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved3"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved3
							, "_gtk_reserved2"
							, "_gtk_reserved4"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved4"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved4
							, "_gtk_reserved3"
							, "_gtk_reserved5"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved5"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved5
							, "_gtk_reserved4"
							, "_gtk_reserved6"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved6"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved6
							, "_gtk_reserved5"
							, "_gtk_reserved7"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved7"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved7
							, "_gtk_reserved6"
							, "_gtk_reserved8"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved8"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved8
							, "_gtk_reserved7"
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate uint d_gtk_entry_buffer_delete_text(IntPtr raw, uint position, int n_chars);
		static d_gtk_entry_buffer_delete_text gtk_entry_buffer_delete_text = FuncLoader.LoadFunction<d_gtk_entry_buffer_delete_text>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_delete_text"));

		public uint DeleteText(uint position, int n_chars) {
			uint raw_ret = gtk_entry_buffer_delete_text(Handle, position, n_chars);
			uint ret = raw_ret;
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_entry_buffer_emit_deleted_text(IntPtr raw, uint position, uint n_chars);
		static d_gtk_entry_buffer_emit_deleted_text gtk_entry_buffer_emit_deleted_text = FuncLoader.LoadFunction<d_gtk_entry_buffer_emit_deleted_text>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_emit_deleted_text"));

		public void EmitDeletedText(uint position, uint n_chars) {
			gtk_entry_buffer_emit_deleted_text(Handle, position, n_chars);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_entry_buffer_emit_inserted_text(IntPtr raw, uint position, IntPtr chars, uint n_chars);
		static d_gtk_entry_buffer_emit_inserted_text gtk_entry_buffer_emit_inserted_text = FuncLoader.LoadFunction<d_gtk_entry_buffer_emit_inserted_text>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_emit_inserted_text"));

		public void EmitInsertedText(uint position, string chars, uint n_chars) {
			IntPtr native_chars = GLib.Marshaller.StringToPtrGStrdup (chars);
			gtk_entry_buffer_emit_inserted_text(Handle, position, native_chars, n_chars);
			GLib.Marshaller.Free (native_chars);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate UIntPtr d_gtk_entry_buffer_get_bytes(IntPtr raw);
		static d_gtk_entry_buffer_get_bytes gtk_entry_buffer_get_bytes = FuncLoader.LoadFunction<d_gtk_entry_buffer_get_bytes>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_get_bytes"));

		public ulong Bytes { 
			get {
				UIntPtr raw_ret = gtk_entry_buffer_get_bytes(Handle);
				ulong ret = (ulong) raw_ret;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_entry_buffer_get_type();
		static d_gtk_entry_buffer_get_type gtk_entry_buffer_get_type = FuncLoader.LoadFunction<d_gtk_entry_buffer_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_get_type"));

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = gtk_entry_buffer_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate uint d_gtk_entry_buffer_insert_text(IntPtr raw, uint position, IntPtr chars, int n_chars);
		static d_gtk_entry_buffer_insert_text gtk_entry_buffer_insert_text = FuncLoader.LoadFunction<d_gtk_entry_buffer_insert_text>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_insert_text"));

		public uint InsertText(uint position, string chars, int n_chars) {
			IntPtr native_chars = GLib.Marshaller.StringToPtrGStrdup (chars);
			uint raw_ret = gtk_entry_buffer_insert_text(Handle, position, native_chars, n_chars);
			uint ret = raw_ret;
			GLib.Marshaller.Free (native_chars);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_entry_buffer_set_text(IntPtr raw, IntPtr chars, int n_chars);
		static d_gtk_entry_buffer_set_text gtk_entry_buffer_set_text = FuncLoader.LoadFunction<d_gtk_entry_buffer_set_text>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_entry_buffer_set_text"));

		public void SetText(string chars, int n_chars) {
			IntPtr native_chars = GLib.Marshaller.StringToPtrGStrdup (chars);
			gtk_entry_buffer_set_text(Handle, native_chars, n_chars);
			GLib.Marshaller.Free (native_chars);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public unsafe new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("priv"
							, GLib.Object.abi_info.Fields
							, (uint) sizeof( IntPtr ) // priv
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
