示例#1
0
 static void OverrideComputeChildAllocation(GLib.GType gtype, ComputeChildAllocationNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("compute_child_allocation"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
示例#2
0
        private void InternalComputeChildAllocation(Gdk.Rectangle allocation)
        {
            ComputeChildAllocationNativeDelegate unmanaged = class_abi.BaseOverride <ComputeChildAllocationNativeDelegate>(this.LookupGType(), "compute_child_allocation");

            if (unmanaged == null)
            {
                return;
            }

            IntPtr native_allocation = GLib.Marshaller.StructureToPtrAlloc(allocation);

            unmanaged(this.Handle, native_allocation);
            Marshal.FreeHGlobal(native_allocation);
        }
示例#3
0
        private void InternalComputeChildAllocation(Gdk.Rectangle allocation)
        {
            ComputeChildAllocationNativeDelegate unmanaged = null;

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

            IntPtr native_allocation = GLib.Marshaller.StructureToPtrAlloc(allocation);

            unmanaged(this.Handle, native_allocation);
            Marshal.FreeHGlobal(native_allocation);
        }
示例#4
0
		static void OverrideComputeChildAllocation (GLib.GType gtype, ComputeChildAllocationNativeDelegate callback)
		{
			GtkFrameClass class_iface = GetClassStruct (gtype, false);
			class_iface.ComputeChildAllocation = callback;
			OverrideClassStruct (gtype, class_iface);
		}