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

namespace GtkSource {

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

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

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_source_language_manager_new();
		static d_gtk_source_language_manager_new gtk_source_language_manager_new = FuncLoader.LoadFunction<d_gtk_source_language_manager_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_language_manager_new"));

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

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_source_language_manager_set_search_path(IntPtr raw, IntPtr dirs);
		static d_gtk_source_language_manager_set_search_path gtk_source_language_manager_set_search_path = FuncLoader.LoadFunction<d_gtk_source_language_manager_set_search_path>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_language_manager_set_search_path"));

		[GLib.Property ("search-path")]
		public string SearchPath {
			get  {
				IntPtr raw_ret = gtk_source_language_manager_get_search_path(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
			set  {
				gtk_source_language_manager_set_search_path(Handle, GLib.Marshaller.StringToPtrGStrdup(value));
			}
		}

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

		[GLib.Property ("language-ids")]
		public string[] LanguageIds {
			get  {
				IntPtr raw_ret = gtk_source_language_manager_get_language_ids(Handle);
				string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, true);
				return ret;
			}
		}


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

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_source_language_manager_get_default();
		static d_gtk_source_language_manager_get_default gtk_source_language_manager_get_default = FuncLoader.LoadFunction<d_gtk_source_language_manager_get_default>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_language_manager_get_default"));

		public static GtkSource.LanguageManager Default { 
			get {
				IntPtr raw_ret = gtk_source_language_manager_get_default();
				GtkSource.LanguageManager ret = GLib.Object.GetObject(raw_ret) as GtkSource.LanguageManager;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_source_language_manager_get_language(IntPtr raw, IntPtr id);
		static d_gtk_source_language_manager_get_language gtk_source_language_manager_get_language = FuncLoader.LoadFunction<d_gtk_source_language_manager_get_language>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_language_manager_get_language"));

		public GtkSource.Language GetLanguage(string id) {
			IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup (id);
			IntPtr raw_ret = gtk_source_language_manager_get_language(Handle, native_id);
			GtkSource.Language ret = GLib.Object.GetObject(raw_ret) as GtkSource.Language;
			GLib.Marshaller.Free (native_id);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_source_language_manager_get_type();
		static d_gtk_source_language_manager_get_type gtk_source_language_manager_get_type = FuncLoader.LoadFunction<d_gtk_source_language_manager_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_language_manager_get_type"));

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_source_language_manager_guess_language(IntPtr raw, IntPtr filename, IntPtr content_type);
		static d_gtk_source_language_manager_guess_language gtk_source_language_manager_guess_language = FuncLoader.LoadFunction<d_gtk_source_language_manager_guess_language>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_language_manager_guess_language"));

		public GtkSource.Language GuessLanguage(string filename, string content_type) {
			IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup (filename);
			IntPtr native_content_type = GLib.Marshaller.StringToPtrGStrdup (content_type);
			IntPtr raw_ret = gtk_source_language_manager_guess_language(Handle, native_filename, native_content_type);
			GtkSource.Language ret = GLib.Object.GetObject(raw_ret) as GtkSource.Language;
			GLib.Marshaller.Free (native_filename);
			GLib.Marshaller.Free (native_content_type);
			return ret;
		}


		static LanguageManager ()
		{
			GtkSharp.GtkSourceSharp.ObjectManager.Initialize ();
		}

		// 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
	}
}
