// 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 PopoverMenu : Gtk.Popover {

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

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

		public PopoverMenu () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (PopoverMenu)) {
				CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
				return;
			}
			Raw = gtk_popover_menu_new();
		}

		[GLib.Property ("visible-submenu")]
		public string VisibleSubmenu {
			get {
				GLib.Value val = GetProperty ("visible-submenu");
				string ret = (string) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("visible-submenu", val);
				val.Dispose ();
			}
		}

		public class PopoverMenuChild : Gtk.Container.ContainerChild {
			protected internal PopoverMenuChild (Gtk.Container parent, Gtk.Widget child) : base (parent, child) {}

			[Gtk.ChildProperty ("submenu")]
			public string Submenu {
				get {
					GLib.Value val = parent.ChildGetProperty (child, "submenu");
					string ret = (string) val;
					val.Dispose ();
					return ret;
				}
				set {
					GLib.Value val = new GLib.Value(value);
					parent.ChildSetProperty(child, "submenu", val);
					val.Dispose ();
				}
			}

			[Gtk.ChildProperty ("position")]
			public new int Position {
				get {
					GLib.Value val = parent.ChildGetProperty (child, "position");
					int ret = (int) val;
					val.Dispose ();
					return ret;
				}
				set {
					GLib.Value val = new GLib.Value(value);
					parent.ChildSetProperty(child, "position", val);
					val.Dispose ();
				}
			}

		}

		public override Gtk.Container.ContainerChild this [Gtk.Widget child] {
			get {
				return new PopoverMenuChild (this, child);
			}
		}


		// 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("reserved"
							, Gtk.Popover.class_abi.Fields
							, (uint) sizeof( IntPtr ) * 10 // reserved
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

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

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

		public void OpenSubmenu(string name) {
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			gtk_popover_menu_open_submenu(Handle, native_name);
			GLib.Marshaller.Free (native_name);
		}


		// 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 (Gtk.Popover.abi_info.Fields);

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
