Example #1
0
 static void OverrideDeviceAdded(GLib.GType gtype, DeviceAddedNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("device_added"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Example #2
0
		private void InternalDeviceAdded (Gdk.Device device)
		{
			DeviceAddedNativeDelegate unmanaged = class_abi.BaseOverride<DeviceAddedNativeDelegate>(this.LookupGType(), "device_added");
			if (unmanaged == null) return;

			unmanaged (this.Handle, device == null ? IntPtr.Zero : device.Handle);
		}
Example #3
0
        private void InternalDeviceAdded(Gdk.Device device)
        {
            DeviceAddedNativeDelegate unmanaged = null;

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

            unmanaged(this.Handle, device == null ? IntPtr.Zero : device.Handle);
        }
Example #4
0
		static void OverrideDeviceAdded (GLib.GType gtype, DeviceAddedNativeDelegate callback)
		{
			GdkDeviceManagerClass class_iface = GetClassStruct (gtype, false);
			class_iface.DeviceAdded = callback;
			OverrideClassStruct (gtype, class_iface);
		}