mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/gamepad: refactoring
This commit is contained in:
parent
628418d88e
commit
f4371991fe
@ -20,23 +20,25 @@ import (
|
|||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
)
|
)
|
||||||
|
|
||||||
type _CFIndex int64
|
type (
|
||||||
type _CFAllocatorRef uintptr
|
_CFIndex int64
|
||||||
type _CFArrayRef uintptr
|
_CFAllocatorRef uintptr
|
||||||
type _CFDictionaryRef uintptr
|
_CFArrayRef uintptr
|
||||||
type _CFNumberRef uintptr
|
_CFDictionaryRef uintptr
|
||||||
type _CFTypeRef uintptr
|
_CFNumberRef uintptr
|
||||||
type _CFRunLoopRef uintptr
|
_CFTypeRef uintptr
|
||||||
type _CFNumberType uintptr
|
_CFRunLoopRef uintptr
|
||||||
type _CFStringRef uintptr
|
_CFNumberType uintptr
|
||||||
type _CFArrayCallBacks struct{}
|
_CFStringRef uintptr
|
||||||
type _CFDictionaryKeyCallBacks struct{}
|
_CFArrayCallBacks struct{}
|
||||||
type _CFDictionaryValueCallBacks struct{}
|
_CFDictionaryKeyCallBacks struct{}
|
||||||
type _CFRunLoopRunResult int32
|
_CFDictionaryValueCallBacks struct{}
|
||||||
type _CFRunLoopMode = _CFStringRef
|
_CFRunLoopRunResult int32
|
||||||
type _CFTimeInterval float64
|
_CFRunLoopMode = _CFStringRef
|
||||||
type _CFTypeID uint64
|
_CFTimeInterval float64
|
||||||
type _CFStringEncoding uint32
|
_CFTypeID uint64
|
||||||
|
_CFStringEncoding uint32
|
||||||
|
)
|
||||||
|
|
||||||
var kCFAllocatorDefault _CFAllocatorRef = 0
|
var kCFAllocatorDefault _CFAllocatorRef = 0
|
||||||
|
|
||||||
@ -73,26 +75,17 @@ func init() {
|
|||||||
purego.RegisterLibFunc(&_CFStringCreateWithCString, corefoundation, "CFStringCreateWithCString")
|
purego.RegisterLibFunc(&_CFStringCreateWithCString, corefoundation, "CFStringCreateWithCString")
|
||||||
}
|
}
|
||||||
|
|
||||||
var _CFNumberCreate func(allocator _CFAllocatorRef, theType _CFNumberType, valuePtr unsafe.Pointer) _CFNumberRef
|
var (
|
||||||
|
_CFNumberCreate func(allocator _CFAllocatorRef, theType _CFNumberType, valuePtr unsafe.Pointer) _CFNumberRef
|
||||||
var _CFNumberGetValue func(number _CFNumberRef, theType _CFNumberType, valuePtr unsafe.Pointer) bool
|
_CFNumberGetValue func(number _CFNumberRef, theType _CFNumberType, valuePtr unsafe.Pointer) bool
|
||||||
|
_CFArrayCreate func(allocator _CFAllocatorRef, values *unsafe.Pointer, numValues _CFIndex, callbacks *_CFArrayCallBacks) _CFArrayRef
|
||||||
var _CFArrayCreate func(allocator _CFAllocatorRef, values *unsafe.Pointer, numValues _CFIndex, callbacks *_CFArrayCallBacks) _CFArrayRef
|
_CFArrayGetValueAtIndex func(array _CFArrayRef, index _CFIndex) uintptr
|
||||||
|
_CFArrayGetCount func(array _CFArrayRef) _CFIndex
|
||||||
var _CFArrayGetValueAtIndex func(array _CFArrayRef, index _CFIndex) uintptr
|
_CFDictionaryCreate func(allocator _CFAllocatorRef, keys *unsafe.Pointer, values *unsafe.Pointer, numValues _CFIndex, keyCallBacks *_CFDictionaryKeyCallBacks, valueCallBacks *_CFDictionaryValueCallBacks) _CFDictionaryRef
|
||||||
|
_CFRelease func(cf _CFTypeRef)
|
||||||
var _CFArrayGetCount func(array _CFArrayRef) _CFIndex
|
_CFRunLoopGetMain func() _CFRunLoopRef
|
||||||
|
_CFRunLoopRunInMode func(mode _CFRunLoopMode, seconds _CFTimeInterval, returnAfterSourceHandled bool) _CFRunLoopRunResult
|
||||||
var _CFDictionaryCreate func(allocator _CFAllocatorRef, keys *unsafe.Pointer, values *unsafe.Pointer, numValues _CFIndex, keyCallBacks *_CFDictionaryKeyCallBacks, valueCallBacks *_CFDictionaryValueCallBacks) _CFDictionaryRef
|
_CFGetTypeID func(cf _CFTypeRef) _CFTypeID
|
||||||
|
_CFStringGetCString func(theString _CFStringRef, buffer []byte, encoding _CFStringEncoding) bool
|
||||||
var _CFRelease func(cf _CFTypeRef)
|
_CFStringCreateWithCString func(alloc _CFAllocatorRef, cstr []byte, encoding _CFStringEncoding) _CFStringRef
|
||||||
|
)
|
||||||
var _CFRunLoopGetMain func() _CFRunLoopRef
|
|
||||||
|
|
||||||
var _CFRunLoopRunInMode func(mode _CFRunLoopMode, seconds _CFTimeInterval, returnAfterSourceHandled bool) _CFRunLoopRunResult
|
|
||||||
|
|
||||||
var _CFGetTypeID func(cf _CFTypeRef) _CFTypeID
|
|
||||||
|
|
||||||
var _CFStringGetCString func(theString _CFStringRef, buffer []byte, encoding _CFStringEncoding) bool
|
|
||||||
|
|
||||||
var _CFStringCreateWithCString func(alloc _CFAllocatorRef, cstr []byte, encoding _CFStringEncoding) _CFStringRef
|
|
||||||
|
@ -74,13 +74,15 @@ var (
|
|||||||
kIOHIDDeviceUsageKey = []byte("DeviceUsage\x00")
|
kIOHIDDeviceUsageKey = []byte("DeviceUsage\x00")
|
||||||
)
|
)
|
||||||
|
|
||||||
type _IOOptionBits uint32
|
type (
|
||||||
type _IOHIDManagerRef uintptr
|
_IOOptionBits uint32
|
||||||
type _IOHIDDeviceRef uintptr
|
_IOHIDManagerRef uintptr
|
||||||
type _IOHIDElementRef uintptr
|
_IOHIDDeviceRef uintptr
|
||||||
type _IOHIDValueRef uintptr
|
_IOHIDElementRef uintptr
|
||||||
type _IOReturn int32
|
_IOHIDValueRef uintptr
|
||||||
type _IOHIDElementType uint32
|
_IOReturn int32
|
||||||
|
_IOHIDElementType uint32
|
||||||
|
)
|
||||||
|
|
||||||
type _IOHIDDeviceCallback func(context unsafe.Pointer, result _IOReturn, sender unsafe.Pointer, device _IOHIDDeviceRef)
|
type _IOHIDDeviceCallback func(context unsafe.Pointer, result _IOReturn, sender unsafe.Pointer, device _IOHIDDeviceRef)
|
||||||
|
|
||||||
@ -105,34 +107,21 @@ func init() {
|
|||||||
purego.RegisterLibFunc(&_IOHIDDeviceCopyMatchingElements, iokit, "IOHIDDeviceCopyMatchingElements")
|
purego.RegisterLibFunc(&_IOHIDDeviceCopyMatchingElements, iokit, "IOHIDDeviceCopyMatchingElements")
|
||||||
}
|
}
|
||||||
|
|
||||||
var _IOHIDElementGetTypeID func() _CFTypeID
|
var (
|
||||||
|
_IOHIDElementGetTypeID func() _CFTypeID
|
||||||
var _IOHIDManagerCreate func(allocator _CFAllocatorRef, options _IOOptionBits) _IOHIDManagerRef
|
_IOHIDManagerCreate func(allocator _CFAllocatorRef, options _IOOptionBits) _IOHIDManagerRef
|
||||||
|
_IOHIDDeviceGetProperty func(device _IOHIDDeviceRef, key _CFStringRef) _CFTypeRef
|
||||||
var _IOHIDDeviceGetProperty func(device _IOHIDDeviceRef, key _CFStringRef) _CFTypeRef
|
_IOHIDManagerOpen func(manager _IOHIDManagerRef, options _IOOptionBits) _IOReturn
|
||||||
|
_IOHIDManagerSetDeviceMatchingMultiple func(manager _IOHIDManagerRef, multiple _CFArrayRef)
|
||||||
var _IOHIDManagerOpen func(manager _IOHIDManagerRef, options _IOOptionBits) _IOReturn
|
_IOHIDManagerRegisterDeviceMatchingCallback func(manager _IOHIDManagerRef, callback _IOHIDDeviceCallback, context unsafe.Pointer)
|
||||||
|
_IOHIDManagerRegisterDeviceRemovalCallback func(manager _IOHIDManagerRef, callback _IOHIDDeviceCallback, context unsafe.Pointer)
|
||||||
var _IOHIDManagerSetDeviceMatchingMultiple func(manager _IOHIDManagerRef, multiple _CFArrayRef)
|
_IOHIDManagerScheduleWithRunLoop func(manager _IOHIDManagerRef, runLoop _CFRunLoopRef, runLoopMode _CFStringRef)
|
||||||
|
_IOHIDElementGetType func(element _IOHIDElementRef) _IOHIDElementType
|
||||||
var _IOHIDManagerRegisterDeviceMatchingCallback func(manager _IOHIDManagerRef, callback _IOHIDDeviceCallback, context unsafe.Pointer)
|
_IOHIDElementGetUsage func(element _IOHIDElementRef) uint32
|
||||||
|
_IOHIDElementGetUsagePage func(element _IOHIDElementRef) uint32
|
||||||
var _IOHIDManagerRegisterDeviceRemovalCallback func(manager _IOHIDManagerRef, callback _IOHIDDeviceCallback, context unsafe.Pointer)
|
_IOHIDElementGetLogicalMin func(element _IOHIDElementRef) _CFIndex
|
||||||
|
_IOHIDElementGetLogicalMax func(element _IOHIDElementRef) _CFIndex
|
||||||
var _IOHIDManagerScheduleWithRunLoop func(manager _IOHIDManagerRef, runLoop _CFRunLoopRef, runLoopMode _CFStringRef)
|
_IOHIDDeviceGetValue func(device _IOHIDDeviceRef, element _IOHIDElementRef, pValue *_IOHIDValueRef) _IOReturn
|
||||||
|
_IOHIDValueGetIntegerValue func(value _IOHIDValueRef) _CFIndex
|
||||||
var _IOHIDElementGetType func(element _IOHIDElementRef) _IOHIDElementType
|
_IOHIDDeviceCopyMatchingElements func(device _IOHIDDeviceRef, matching _CFDictionaryRef, options _IOOptionBits) _CFArrayRef
|
||||||
|
)
|
||||||
var _IOHIDElementGetUsage func(element _IOHIDElementRef) uint32
|
|
||||||
|
|
||||||
var _IOHIDElementGetUsagePage func(element _IOHIDElementRef) uint32
|
|
||||||
|
|
||||||
var _IOHIDElementGetLogicalMin func(element _IOHIDElementRef) _CFIndex
|
|
||||||
|
|
||||||
var _IOHIDElementGetLogicalMax func(element _IOHIDElementRef) _CFIndex
|
|
||||||
|
|
||||||
var _IOHIDDeviceGetValue func(device _IOHIDDeviceRef, element _IOHIDElementRef, pValue *_IOHIDValueRef) _IOReturn
|
|
||||||
|
|
||||||
var _IOHIDValueGetIntegerValue func(value _IOHIDValueRef) _CFIndex
|
|
||||||
|
|
||||||
var _IOHIDDeviceCopyMatchingElements func(device _IOHIDDeviceRef, matching _CFDictionaryRef, options _IOOptionBits) _CFArrayRef
|
|
||||||
|
Loading…
Reference in New Issue
Block a user