// 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.Runtime.InteropServices;
	
	public static class Extensions
	{
		struct GTypeQuery
		{
			public IntPtr type;
			public IntPtr type_name;
			public uint class_size;
			public uint instance_size;
		}
		
		[DllImport ("libgobject-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_type_class_peek (IntPtr gtype);

		[DllImport ("libgobject-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_type_class_ref (IntPtr gtype);
		
		[DllImport("libgobject-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern void g_type_query (IntPtr type, out GTypeQuery query);
		
		public static IntPtr GetClassPtr (this GLib.GType type)
		{
			IntPtr klass = g_type_class_peek (type.Val);
			if (klass == IntPtr.Zero)
				klass = g_type_class_ref (type.Val);
			return klass;
		}
		
		public static uint GetClassSize (this GLib.GType type)
		{
			GTypeQuery query;
			g_type_query (type.Val, out query);
			return query.class_size;
		}
	}

#region Autogenerated code
	public partial class MountOperation : GLib.MountOperation {

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

		[DllImport("libgtk-x11-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_mount_operation_new(IntPtr parent);

		public MountOperation (Gtk.Window parent) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (MountOperation)) {
				ArrayList vals = new ArrayList();
				ArrayList names = new ArrayList();
				if (parent != null) {
					names.Add ("parent");
					vals.Add (new GLib.Value (parent));
				}
				CreateNativeObject ((string[])names.ToArray (typeof (string)), (GLib.Value[])vals.ToArray (typeof (GLib.Value)));
				return;
			}
			Raw = gtk_mount_operation_new(parent == null ? IntPtr.Zero : parent.Handle);
		}

		[DllImport("libgtk-x11-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_mount_operation_get_parent(IntPtr raw);

		[DllImport("libgtk-x11-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern void gtk_mount_operation_set_parent(IntPtr raw, IntPtr parent);

		[GLib.Property ("parent")]
		public Gtk.Window Parent {
			get  {
				IntPtr raw_ret = gtk_mount_operation_get_parent(Handle);
				Gtk.Window ret = GLib.Object.GetObject(raw_ret) as Gtk.Window;
				return ret;
			}
			set  {
				gtk_mount_operation_set_parent(Handle, value == null ? IntPtr.Zero : value.Handle);
			}
		}

		[DllImport("libgtk-x11-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_mount_operation_get_screen(IntPtr raw);

		[DllImport("libgtk-x11-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern void gtk_mount_operation_set_screen(IntPtr raw, IntPtr screen);

		[GLib.Property ("screen")]
		public Gdk.Screen Screen {
			get  {
				IntPtr raw_ret = gtk_mount_operation_get_screen(Handle);
				Gdk.Screen ret = GLib.Object.GetObject(raw_ret) as Gdk.Screen;
				return ret;
			}
			set  {
				gtk_mount_operation_set_screen(Handle, value == null ? IntPtr.Zero : value.Handle);
			}
		}

		[DllImport("libgtk-x11-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gtk_mount_operation_is_showing(IntPtr raw);

		[GLib.Property ("is-showing")]
		public bool IsShowing {
			get  {
				bool raw_ret = gtk_mount_operation_is_showing(Handle);
				bool ret = raw_ret;
				return ret;
			}
		}
/*
		[StructLayout (LayoutKind.Sequential)]
		struct GtkMountOperationClass {
			IntPtr GtkReserved1;
			IntPtr GtkReserved2;
			IntPtr GtkReserved3;
			IntPtr GtkReserved4;
		}

		static uint class_offset = ((GLib.GType) typeof (GLib.MountOperation)).GetClassSize ();
		static Hashtable class_structs;

		static GtkMountOperationClass GetClassStruct (GLib.GType gtype, bool use_cache)
		{
			if (class_structs == null)
				class_structs = new Hashtable ();

			if (use_cache && class_structs.Contains (gtype))
				return (GtkMountOperationClass) class_structs [gtype];
			else {
				IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
				GtkMountOperationClass class_struct = (GtkMountOperationClass) Marshal.PtrToStructure (class_ptr, typeof (GtkMountOperationClass));
				if (use_cache)
					class_structs.Add (gtype, class_struct);
				return class_struct;
			}
		}

		static void OverrideClassStruct (GLib.GType gtype, GtkMountOperationClass class_struct)
		{
			IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
			Marshal.StructureToPtr (class_struct, class_ptr, false);
		}
		*/

		[DllImport("libgtk-x11-2.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_mount_operation_get_type();

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

#endregion
	}
}
