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

namespace GLib {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class DBusArgInfo : GLib.Opaque {

		[DllImport ("giosharpglue-3")]
		extern static uint glibsharp_glib_dbusarginfo_get_ref_count_offset ();

		static uint ref_count_offset = glibsharp_glib_dbusarginfo_get_ref_count_offset ();
		public int RefCount {
			get {
				unsafe {
					int* raw_ptr = (int*)(((byte*)Handle) + ref_count_offset);
					return (*raw_ptr);
				}
			}
			set {
				unsafe {
					int* raw_ptr = (int*)(((byte*)Handle) + ref_count_offset);
					*raw_ptr = value;
				}
			}
		}

		[DllImport ("giosharpglue-3")]
		extern static uint glibsharp_glib_dbusarginfo_get_name_offset ();

		static uint name_offset = glibsharp_glib_dbusarginfo_get_name_offset ();
		public string Name {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + name_offset);
					return GLib.Marshaller.Utf8PtrToString ((*raw_ptr));
				}
			}
			set {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + name_offset);
					*raw_ptr = GLib.Marshaller.StringToPtrGStrdup (value);
				}
			}
		}

		[DllImport ("giosharpglue-3")]
		extern static uint glibsharp_glib_dbusarginfo_get_signature_offset ();

		static uint signature_offset = glibsharp_glib_dbusarginfo_get_signature_offset ();
		public string Signature {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + signature_offset);
					return GLib.Marshaller.Utf8PtrToString ((*raw_ptr));
				}
			}
			set {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + signature_offset);
					*raw_ptr = GLib.Marshaller.StringToPtrGStrdup (value);
				}
			}
		}

		[DllImport ("giosharpglue-3")]
		extern static uint glibsharp_glib_dbusarginfo_get_annotations_offset ();

		static uint annotations_offset = glibsharp_glib_dbusarginfo_get_annotations_offset ();
		public GLib.DBusAnnotationInfo Annotations {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + annotations_offset);
					return (*raw_ptr) == IntPtr.Zero ? null : (GLib.DBusAnnotationInfo) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (GLib.DBusAnnotationInfo), false);
				}
			}
			set {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + annotations_offset);
					*raw_ptr = value == null ? IntPtr.Zero : value.Handle;
				}
			}
		}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_dbus_arg_info_get_type();

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

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

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_dbus_arg_info_ref(IntPtr raw);

		protected override void Ref (IntPtr raw)
		{
			if (!Owned) {
				g_dbus_arg_info_ref (raw);
				Owned = true;
			}
		}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void g_dbus_arg_info_unref(IntPtr raw);

		protected override void Unref (IntPtr raw)
		{
			if (Owned) {
				g_dbus_arg_info_unref (raw);
				Owned = false;
			}
		}

		class FinalizerInfo {
			IntPtr handle;

			public FinalizerInfo (IntPtr handle)
			{
				this.handle = handle;
			}

			public bool Handler ()
			{
				g_dbus_arg_info_unref (handle);
				return false;
			}
		}

		~DBusArgInfo ()
		{
			if (!Owned)
				return;
			FinalizerInfo info = new FinalizerInfo (Handle);
			GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler));
		}

#endregion
	}
}
