Esempio n. 1
0
 static void OverrideGetChildPosition(GLib.GType gtype, GetChildPositionNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("get_child_position"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Esempio n. 2
0
        private bool InternalGetChildPosition(Gtk.Widget widget, Gdk.Rectangle allocation)
        {
            GetChildPositionNativeDelegate unmanaged = class_abi.BaseOverride <GetChildPositionNativeDelegate>(this.LookupGType(), "get_child_position");

            if (unmanaged == null)
            {
                return(false);
            }

            IntPtr native_allocation = GLib.Marshaller.StructureToPtrAlloc(allocation);
            bool   __result          = unmanaged(this.Handle, widget == null ? IntPtr.Zero : widget.Handle, native_allocation);

            Marshal.FreeHGlobal(native_allocation);
            return(__result);
        }
Esempio n. 3
0
        private bool InternalGetChildPosition(Gtk.Widget widget, Gdk.Rectangle allocation)
        {
            GetChildPositionNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("get_child_position"));
                unmanaged = (GetChildPositionNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetChildPositionNativeDelegate));
            }
            if (unmanaged == null)
            {
                return(false);
            }

            IntPtr native_allocation = GLib.Marshaller.StructureToPtrAlloc(allocation);
            bool   __result          = unmanaged(this.Handle, widget == null ? IntPtr.Zero : widget.Handle, native_allocation);

            Marshal.FreeHGlobal(native_allocation);
            return(__result);
        }