Exemplo n.º 1
0
 static void OverrideGetText(GLib.GType gtype, GetTextNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("get_text"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Exemplo n.º 2
0
        private string InternalGetText(out ulong n_bytes)
        {
            GetTextNativeDelegate unmanaged = class_abi.BaseOverride <GetTextNativeDelegate>(this.LookupGType(), "get_text");

            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            UIntPtr native_n_bytes;
            IntPtr  __result = unmanaged(this.Handle, out native_n_bytes);

            n_bytes = (ulong)native_n_bytes;
            return(GLib.Marshaller.PtrToStringGFree(__result));
        }
Exemplo n.º 3
0
        private string InternalGetText(out ulong n_bytes)
        {
            GetTextNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("get_text"));
                unmanaged = (GetTextNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetTextNativeDelegate));
            }
            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            UIntPtr native_n_bytes;
            IntPtr  __result = unmanaged(this.Handle, out native_n_bytes);

            n_bytes = (ulong)native_n_bytes;
            return(GLib.Marshaller.PtrToStringGFree(__result));
        }
Exemplo n.º 4
0
		static void OverrideGetText (GLib.GType gtype, GetTextNativeDelegate callback)
		{
			GtkEntryBufferClass class_iface = GetClassStruct (gtype, false);
			class_iface.GetText = callback;
			OverrideClassStruct (gtype, class_iface);
		}