internal static extern CFDictionaryRef CFDictionaryCreate(
     CFAllocatorRef allocator,
     CFStringRef[] keys,
     CFNumberRef[] values,
     CFIndex numValues,
     ref CFDictionary.CFDictionaryKeyCallBacks keyCallBacks,
     ref CFDictionary.CFDictionaryValueCallBacks valueCallBacks
     );
 internal static extern IntPtr CFUUIDGetConstantUUIDWithBytes(
     CFAllocatorRef alloc,
     UInt8 byte0,
     UInt8 byte1,
     UInt8 byte2,
     UInt8 byte3,
     UInt8 byte4,
     UInt8 byte5,
     UInt8 byte6,
     UInt8 byte7,
     UInt8 byte8,
     UInt8 byte9,
     UInt8 byte10,
     UInt8 byte11,
     UInt8 byte12,
     UInt8 byte13,
     UInt8 byte14,
     UInt8 byte15
     );
		internal static extern CFNumberRef CFNumberCreate (CFAllocatorRef allocator,CFNumberType theType,IntPtr valuePtr);
		internal unsafe static extern CFNumberRef CFNumberCreate (CFAllocatorRef allocator,CFNumberType theType,int* valuePtr);
		internal static extern CFDictionaryRef CFDictionaryCreate (
			CFAllocatorRef allocator,
			CFStringRef[] keys,
			CFNumberRef[] values,
			CFIndex numValues,
			ref CFDictionary.CFDictionaryKeyCallBacks keyCallBacks,
			ref CFDictionary.CFDictionaryValueCallBacks valueCallBacks
			);
		internal static extern IntPtr CFUUIDGetConstantUUIDWithBytes (
			CFAllocatorRef alloc,
			UInt8 byte0,
			UInt8 byte1,
			UInt8 byte2,
			UInt8 byte3,
			UInt8 byte4,
			UInt8 byte5,
			UInt8 byte6,
			UInt8 byte7,
			UInt8 byte8,
			UInt8 byte9,
			UInt8 byte10,
			UInt8 byte11,
			UInt8 byte12,
			UInt8 byte13,
			UInt8 byte14,
			UInt8 byte15
			);
 //extern static IntPtr CFArrayCreate (IntPtr allocator, IntPtr values, CFIndex numValues, IntPtr callbacks);
 internal static extern IntPtr CFArrayCreate(CFAllocatorRef allocator, IntPtr[] values, CFIndex numValues, CFArrayCallBacks callbacks);
Exemple #8
0
        void AddJoystick(CFAllocatorRef sender, CFAllocatorRef device)
        {
            Debug.Print("Joystick device {0:x} discovered, sender is {1:x}", device, sender);
            JoystickData joy = CreateJoystick(sender, device);
            if (joy != null)
            {
                // Add a device->joy lookup entry for this device.
                if (!JoystickDevices.ContainsKey(device))
                {
                    // First time we've seen this device.
                    JoystickDevices.Add(device, joy);
                }
                else
                {
                    // This is an old device that is replugged.
                    // This branch does not appear to be executed, ever.
                    JoystickDevices[device] = joy;
                }

                // Add an index->device lookup entry for this device.
                // Use the first free (i.e. disconnected) index.
                // If all indices are connected, append a new one.
                int i;
                for (i = 0; i < JoystickIndexToDevice.Count; i++)
                {
                    IntPtr candidate = JoystickIndexToDevice[i];
                    if (!JoystickDevices[candidate].State.IsConnected)
                    {
                        break;
                    }
                }

                if (i == JoystickDevices.Count)
                {
                    // All indices connected, append a new one.
                    JoystickIndexToDevice.Add(JoystickDevices.Count, device);
                }
                else
                {
                    // Replace joystick at that index
                    JoystickIndexToDevice[i] = device;
                }
            }
        }
Exemple #9
0
 void AddKeyboard(CFAllocatorRef sender, CFAllocatorRef device)
 {
     if (!KeyboardDevices.ContainsKey(device))
     {
         Debug.Print("Keyboard device {0:x} discovered, sender is {1:x}", device, sender);
         KeyboardIndexToDevice.Add(KeyboardDevices.Count, device);
         KeyboardDevices.Add(device, new KeyboardData());
     }
     else
     {
         Debug.Print("Keyboard device {0:x} reconnected, sender is {1:x}", device, sender);
     }
     KeyboardDevices[device].State.SetIsConnected(true);
 }
 internal static extern CFRunLoopSourceRef MachPortCreateRunLoopSource(
     CFAllocatorRef allocator,
     CFMachPortRef port,
     CFIndex order);
Exemple #11
0
		public static extern AERemoteProcessResolverRef AECreateRemoteProcessResolver (CFAllocatorRef allocator,
			CFURLRef url);
 internal static extern CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, IntPtr valuePtr);
 internal unsafe static extern CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, int *valuePtr);
Exemple #14
0
 public static extern IOHIDManagerRef IOHIDManagerCreate(
     CFAllocatorRef allocator, IOOptionBits options) ;
Exemple #15
0
 internal static extern CFRunLoopSourceRef MachPortCreateRunLoopSource(
     CFAllocatorRef allocator,
     CFMachPortRef port,
     CFIndex order);
Exemple #16
0
 void AddMouse(CFAllocatorRef sender, CFAllocatorRef device)
 {
     if (!MouseDevices.ContainsKey(device))
     {
         Debug.Print("Mouse device {0:x} discovered, sender is {1:x}", device, sender);
         MouseIndexToDevice.Add(MouseDevices.Count, device);
         MouseDevices.Add(device, new MouseData());
     }
     else
     {
         Debug.Print("Mouse device {0:x} reconnected, sender is {1:x}", device, sender);
     }
     MouseDevices[device].State.SetIsConnected(true);
 }
Exemple #17
0
 public static extern IOHIDManagerRef IOHIDManagerCreate(
     CFAllocatorRef allocator, IOOptionBits options);
Exemple #18
0
 void RemoveKeyboard(CFAllocatorRef sender, CFAllocatorRef device)
 {
     Debug.Print("Keyboard device {0:x} disconnected, sender is {1:x}", device, sender);
     // Keep the device in case it comes back later on
     KeyboardDevices[device].State.SetIsConnected(false);
 }
		//extern static IntPtr CFArrayCreate (IntPtr allocator, IntPtr values, CFIndex numValues, IntPtr callbacks);
		internal static extern IntPtr CFArrayCreate (CFAllocatorRef allocator, IntPtr[] values, CFIndex numValues, CFArrayCallBacks callbacks);
Exemple #20
0
 void RemoveJoystick(CFAllocatorRef sender, CFAllocatorRef device)
 {
     Debug.Print("Joystick device {0:x} disconnected, sender is {1:x}", device, sender);
     // Keep the device in case it comes back later on
     JoystickDevices[device].State = new JoystickState();
     JoystickDevices[device].Capabilities = new JoystickCapabilities();
 }
Exemple #21
0
 public static extern AERemoteProcessResolverRef AECreateRemoteProcessResolver(CFAllocatorRef allocator,
                                                                               CFURLRef url);