context: // This file was generated by the Gtk# code generator.
  // Any changes made will be lost if regenerated.
  
  namespace GES {
  
  	using System;
  	using System.Collections;
  	using System.Collections.Generic;
  	using System.Runtime.InteropServices;
  
  #region Autogenerated code
  	public partial class TrackElement : GES.TimelineElement {
  
  		protected TrackElement (IntPtr raw) : base(raw) {}
  
  		protected TrackElement() : base(IntPtr.Zero)
  		{
  			CreateNativeObject (new string [0], new GLib.Value [0]);
  		}
  
  		[GLib.Property ("active")]
  		public bool Active {
  			get {
  				GLib.Value val = GetProperty ("active");
  				bool ret = (bool) val;
  				val.Dispose ();
  				return ret;
  			}
  			set {
  				GLib.Value val = new GLib.Value(value);
  				SetProperty("active", val);
  				val.Dispose ();
  			}
  		}
  
  		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr ges_track_element_get_track(IntPtr raw);
  
  		[GLib.Property ("track")]
  		public GES.Track Track {
  			get  {
  				IntPtr raw_ret = ges_track_element_get_track(Handle);
  				GES.Track ret = GLib.Object.GetObject(raw_ret) as GES.Track;
  				return ret;
  			}
  		}
  
  		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
  		static extern int ges_track_element_get_track_type(IntPtr raw);
  
  		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
  		static extern void ges_track_element_set_track_type(IntPtr raw, int type);
  
  		[GLib.Property ("track-type")]
  		public GES.TrackType TrackType {
  			get  {
  				int raw_ret = ges_track_element_get_track_type(Handle);
  				GES.TrackType ret = (GES.TrackType) raw_ret;
  				return ret;
  			}
  			set  {
  				ges_track_element_set_track_type(Handle, (int) value);
  			}
  		}
  
  		[GLib.Signal("control-binding-added")]
  		public event GES.ControlBindingAddedHandler ControlBindingAdded {
  			add {
  				this.AddSignalHandler ("control-binding-added", value, typeof (GES.ControlBindingAddedArgs));
  			}
  			remove {
  				this.RemoveSignalHandler ("control-binding-added", value);
  			}
  		}
  
  		[GLib.Signal("control-binding-removed")]
  		public event GES.ControlBindingRemovedHandler ControlBindingRemoved {
  			add {
  				this.AddSignalHandler ("control-binding-removed", value, typeof (GES.ControlBindingRemovedArgs));
  			}
  			remove {
  				this.RemoveSignalHandler ("control-binding-removed", value);
  			}
  		}
  
  		static ControlBindingAddedNativeDelegate ControlBindingAdded_cb_delegate;
  		static ControlBindingAddedNativeDelegate ControlBindingAddedVMCallback {
  			get {
  				if (ControlBindingAdded_cb_delegate == null)
  					ControlBindingAdded_cb_delegate = new ControlBindingAddedNativeDelegate (ControlBindingAdded_cb);
  				return ControlBindingAdded_cb_delegate;
  			}
  		}
  
  		static void OverrideControlBindingAdded (GLib.GType gtype)
  		{
  			OverrideControlBindingAdded (gtype, ControlBindingAddedVMCallback);
  		}
  
  		static void OverrideControlBindingAdded (GLib.GType gtype, ControlBindingAddedNativeDelegate callback)
  		{
  			OverrideVirtualMethod (gtype, "control-binding-added", callback);
  		}
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void ControlBindingAddedNativeDelegate (IntPtr inst, IntPtr control_binding);
  
  		static void ControlBindingAdded_cb (IntPtr inst, IntPtr control_binding)
  		{
  			try {
  				TrackElement __obj = GLib.Object.GetObject (inst, false) as TrackElement;
  				__obj.OnControlBindingAdded (GLib.Object.GetObject(control_binding) as Gst.ControlBinding);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(GES.TrackElement), ConnectionMethod="OverrideControlBindingAdded")]
  		protected virtual void OnControlBindingAdded (Gst.ControlBinding control_binding)
  		{
  			InternalControlBindingAdded (control_binding);
  		}
  
  		private void InternalControlBindingAdded (Gst.ControlBinding control_binding)
  		{
  			GLib.Value ret = GLib.Value.Empty;
  			GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
  			GLib.Value[] vals = new GLib.Value [2];
  			vals [0] = new GLib.Value (this);
  			inst_and_params.Append (vals [0]);
  			vals [1] = new GLib.Value (control_binding);
  			inst_and_params.Append (vals [1]);
  			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
  			foreach (GLib.Value v in vals)
  				v.Dispose ();
  		}
  
  		static ControlBindingRemovedNativeDelegate ControlBindingRemoved_cb_delegate;
  		static ControlBindingRemovedNativeDelegate ControlBindingRemovedVMCallback {
  			get {
  				if (ControlBindingRemoved_cb_delegate == null)
  					ControlBindingRemoved_cb_delegate = new ControlBindingRemovedNativeDelegate (ControlBindingRemoved_cb);
  				return ControlBindingRemoved_cb_delegate;
  			}
  		}
  
  		static void OverrideControlBindingRemoved (GLib.GType gtype)
  		{
  			OverrideControlBindingRemoved (gtype, ControlBindingRemovedVMCallback);
  		}
  
  		static void OverrideControlBindingRemoved (GLib.GType gtype, ControlBindingRemovedNativeDelegate callback)
  		{
  			OverrideVirtualMethod (gtype, "control-binding-removed", callback);
  		}
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void ControlBindingRemovedNativeDelegate (IntPtr inst, IntPtr control_binding);
  
  		static void ControlBindingRemoved_cb (IntPtr inst, IntPtr control_binding)
  		{
  			try {
  				TrackElement __obj = GLib.Object.GetObject (inst, false) as TrackElement;
  				__obj.OnControlBindingRemoved (GLib.Object.GetObject(control_binding) as Gst.ControlBinding);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(GES.TrackElement), ConnectionMethod="OverrideControlBindingRemoved")]
  		protected virtual void OnControlBindingRemoved (Gst.ControlBinding control_binding)
  		{
  			InternalControlBindingRemoved (control_binding);
  		}
  
  		private void InternalControlBindingRemoved (Gst.ControlBinding control_binding)
  		{
  			GLib.Value ret = GLib.Value.Empty;
  			GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
  			GLib.Value[] vals = new GLib.Value [2];
  			vals [0] = new GLib.Value (this);
  			inst_and_params.Append (vals [0]);
  			vals [1] = new GLib.Value (control_binding);
  			inst_and_params.Append (vals [1]);
  			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
  			foreach (GLib.Value v in vals)
  				v.Dispose ();
  		}
  
  		static ActiveChangedNativeDelegate ActiveChanged_cb_delegate;
  		static ActiveChangedNativeDelegate ActiveChangedVMCallback {
  			get {
  				if (ActiveChanged_cb_delegate == null)
  					ActiveChanged_cb_delegate = new ActiveChangedNativeDelegate (ActiveChanged_cb);
  				return ActiveChanged_cb_delegate;
  			}
  		}
  
  		static void OverrideActiveChanged (GLib.GType gtype)
  		{
  			OverrideActiveChanged (gtype, ActiveChangedVMCallback);
  		}
  
  		static void OverrideActiveChanged (GLib.GType gtype, ActiveChangedNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("active_changed"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void ActiveChangedNativeDelegate (IntPtr inst, bool active);
  
  		static void ActiveChanged_cb (IntPtr inst, bool active)
  		{
  			try {
  				TrackElement __obj = GLib.Object.GetObject (inst, false) as TrackElement;
  				__obj.OnActiveChanged (active);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(GES.TrackElement), ConnectionMethod="OverrideActiveChanged")]
  		protected virtual void OnActiveChanged (bool active)
  		{
  			InternalActiveChanged (active);
  		}
  
  		private void InternalActiveChanged (bool active)
  		{
  			ActiveChangedNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("active_changed"));
  				unmanaged = (ActiveChangedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ActiveChangedNativeDelegate));
  			}
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, active);
  		}
  
  		static ChangedNativeDelegate Changed_cb_delegate;
  		static ChangedNativeDelegate ChangedVMCallback {
  			get {
  				if (Changed_cb_delegate == null)
  					Changed_cb_delegate = new ChangedNativeDelegate (Changed_cb);
  				return Changed_cb_delegate;
  			}
  		}
  
  		static void OverrideChanged (GLib.GType gtype)
  		{
  			OverrideChanged (gtype, ChangedVMCallback);
  		}
  
  		static void OverrideChanged (GLib.GType gtype, ChangedNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("changed"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void ChangedNativeDelegate (IntPtr inst);
  
  		static void Changed_cb (IntPtr inst)
  		{
  			try {
  				TrackElement __obj = GLib.Object.GetObject (inst, false) as TrackElement;
  				__obj.OnChanged ();
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(GES.TrackElement), ConnectionMethod="OverrideChanged")]
  		protected virtual void OnChanged ()
  		{
  			InternalChanged ();
  		}
  
  		private void InternalChanged ()
  		{
  			ChangedNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("changed"));
  				unmanaged = (ChangedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ChangedNativeDelegate));
  			}
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle);
  		}
  
  		static LookupChildNativeDelegate LookupChild_cb_delegate;
  		static LookupChildNativeDelegate LookupChildVMCallback {
  			get {
  				if (LookupChild_cb_delegate == null)
  					LookupChild_cb_delegate = new LookupChildNativeDelegate (LookupChild_cb);
  				return LookupChild_cb_delegate;
  			}
  		}
  
  		static void OverrideLookupChild (GLib.GType gtype)
  		{
  			OverrideLookupChild (gtype, LookupChildVMCallback);
  		}
  
  		static void OverrideLookupChild (GLib.GType gtype, LookupChildNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("lookup_child"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate bool LookupChildNativeDelegate (IntPtr inst, IntPtr prop_name, out IntPtr element, out IntPtr pspec);
  
  		static bool LookupChild_cb (IntPtr inst, IntPtr prop_name, out IntPtr element, out IntPtr pspec)
  		{
  			try {
  				TrackElement __obj = GLib.Object.GetObject (inst, false) as TrackElement;
  				bool __result;
  				Gst.Element myelement;
  				__result = __obj.OnLookupChild (GLib.Marshaller.Utf8PtrToString (prop_name), out myelement, out pspec);
  				element = myelement == null ? IntPtr.Zero : myelement.Handle;
  				return __result;
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, true);
  				// NOTREACHED: above call does not return.
  				throw e;
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(GES.TrackElement), ConnectionMethod="OverrideLookupChild")]
  		protected virtual bool OnLookupChild (string prop_name, out Gst.Element element, out IntPtr pspec)
  		{
  			return InternalLookupChild (prop_name, out element, out pspec);
  		}
  
  		private bool InternalLookupChild (string prop_name, out Gst.Element element, out IntPtr pspec)
  		{
  			LookupChildNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("lookup_child"));
  				unmanaged = (LookupChildNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(LookupChildNativeDelegate));
  			}
  			if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
  
  			IntPtr native_prop_name = GLib.Marshaller.StringToPtrGStrdup (prop_name);
  			IntPtr native_element;
  			bool __result = unmanaged (this.Handle, native_prop_name, out native_element, out pspec);
  			GLib.Marshaller.Free (native_prop_name);
  			element = GLib.Object.GetObject(native_element, true) as Gst.Element;
  			return __result;
  		}
  
  
  		// Internal representation of the wrapped structure ABI.
  		static GLib.AbiStruct _class_abi = null;
  		static public new GLib.AbiStruct class_abi {
  			get {
  				if (_class_abi == null)
  					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
  						new GLib.AbiField("nleobject_factorytype"
  							, GES.TimelineElement.class_abi.Fields
  							, (uint) Marshal.SizeOf(typeof(IntPtr)) // nleobject_factorytype
  							, null
  							, "create_gnl_object"
  							, (uint) Marshal.SizeOf(typeof(IntPtr))
  							, 0
  							),
  						new GLib.AbiField("create_gnl_object"
  							, -1
  							, (uint) Marshal.SizeOf(typeof(IntPtr)) // create_gnl_object
  							, "nleobject_factorytype"
  							, "create_element"
  							, (uint) Marshal.SizeOf(typeof(IntPtr))
  							, 0
  							),
  						new GLib.AbiField("create_element"
  							, -1
  							, (uint) Marshal.SizeOf(typeof(IntPtr)) // create_element
  							, "create_gnl_object"
  							, "active_changed"
  							, (uint) Marshal.SizeOf(typeof(IntPtr))
  							, 0
  							),
  						new GLib.AbiField("active_changed"
  							, -1
  							, (uint) Marshal.SizeOf(typeof(IntPtr)) // active_changed
  							, "create_element"
  							, "changed"
  							, (uint) Marshal.SizeOf(typeof(IntPtr))
  							, 0
  							),
  						new GLib.AbiField("changed"
  							, -1
  							, (uint) Marshal.SizeOf(typeof(IntPtr)) // changed
  							, "active_changed"
  							, "list_children_properties"
  							, (uint) Marshal.SizeOf(typeof(IntPtr))
  							, 0
  							),
  						new GLib.AbiField("list_children_properties"
  							, -1
  							, (uint) Marshal.SizeOf(typeof(IntPtr)) // list_children_properties
  							, "changed"
  							, "lookup_child"
  							, (uint) Marshal.SizeOf(typeof(IntPtr))
  							, 0
  							),
  						new GLib.AbiField("lookup_child"
  							, -1
  
gt: 							, (uint) Marshal.SizeOf(typeof(IntPtr)) // lookup_child