Changeset 285786 in webkit
- Timestamp:
- Nov 13, 2021, 9:05:59 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
- 1 copied
-
ChangeLog (modified) (1 diff)
-
PAL/ChangeLog (modified) (1 diff)
-
PAL/PAL.xcodeproj/project.pbxproj (modified) (4 diffs)
-
PAL/pal/spi/cocoa/IOKitSPI.h (modified) (1 diff)
-
PAL/pal/spi/ios/IOKitSPIIOS.h (copied) (copied from trunk/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h ) (2 diffs)
-
PAL/pal/spi/mac/IOKitSPIMac.h (modified) (2 diffs)
-
platform/gamepad/cocoa/GameControllerGamepadProvider.mm (modified) (1 diff)
-
platform/gamepad/mac/HIDGamepadProvider.h (modified) (1 diff)
-
platform/gamepad/mac/HIDGamepadProvider.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285785 r285786 1 2021-11-13 Tim Horton <timothy_horton@apple.com> 2 3 Clean up IOKit SPI headers 4 https://bugs.webkit.org/show_bug.cgi?id=233093 5 6 Reviewed by Simon Fraser. 7 8 * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: 9 * platform/gamepad/mac/HIDGamepadProvider.h: 10 * platform/gamepad/mac/HIDGamepadProvider.mm: 11 1 12 2021-11-13 Said Abou-Hallawa <said@apple.com> 2 13 -
trunk/Source/WebCore/PAL/ChangeLog
r285744 r285786 1 2021-11-13 Tim Horton <timothy_horton@apple.com> 2 3 Clean up IOKit SPI headers 4 https://bugs.webkit.org/show_bug.cgi?id=233093 5 6 Reviewed by Simon Fraser. 7 8 * PAL.xcodeproj/project.pbxproj: 9 * pal/spi/cg/CoreGraphicsSPI.h: 10 * pal/spi/cocoa/IOKitSPI.h: 11 * pal/spi/ios/IOKitSPIIOS.h: Added. 12 * pal/spi/mac/IOKitSPIMac.h: 13 IOKit vends a much different set of public API on iOS vs. macOS, 14 so we have separate SPI headers to reduce the confusion. 15 16 Unfortunately, the SPI header for iOS was not explicitly named as such, 17 and started being used in some macOS code. For a while, this didn't lead 18 to any trouble because the aforementioned macOS code didn't ALSO have 19 the public SDK headers included, but a future patch from Simon will 20 use IOKitSPI.h in a place where the macOS IOKit public headers are included, 21 and thus we must make the split more explicit. 22 23 Rename IOKitSPI.h to IOKitSPIIOS.h; make IOKitSPI choose the right one. 24 Add some SPI defintions to IOKitSPIMac.h that were missing (which the 25 dependent code was getting via the iOS header on macOS). 26 1 27 2021-11-12 Wenson Hsieh <wenson_hsieh@apple.com> 2 28 -
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
r285429 r285786 253 253 29CDEBA62548D57F007C07B7 /* AXSpeechManagerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CDEB9E2548D055007C07B7 /* AXSpeechManagerSPI.h */; }; 254 254 2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */; }; 255 2D68D6582740B15B005EBB2E /* IOKitSPIIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D68D6572740B15B005EBB2E /* IOKitSPIIOS.h */; }; 255 256 2E1342CC215AA10A007199D2 /* UIKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */; }; 256 257 2E1342CD215AA10A007199D2 /* UIKitSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */; }; … … 605 606 29CDEB9E2548D055007C07B7 /* AXSpeechManagerSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXSpeechManagerSPI.h; sourceTree = "<group>"; }; 606 607 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSPI.h; sourceTree = "<group>"; }; 608 2D68D6572740B15B005EBB2E /* IOKitSPIIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitSPIIOS.h; sourceTree = "<group>"; }; 607 609 2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitSoftLink.h; sourceTree = "<group>"; }; 608 610 2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIKitSoftLink.mm; sourceTree = "<group>"; }; … … 850 852 0C5AF9101F43A4C7002EAC02 /* DataDetectorsUISPI.h */, 851 853 0C5AF9111F43A4C7002EAC02 /* GraphicsServicesSPI.h */, 854 2D68D6572740B15B005EBB2E /* IOKitSPIIOS.h */, 852 855 5C7C787523AC3E850065F47E /* ManagedConfigurationSPI.h */, 853 856 0C5AF9131F43A4C7002EAC02 /* MediaPlayerSPI.h */, … … 1322 1325 0C2DA11F1F3BE9E000DBC317 /* ImageIOSPI.h in Headers */, 1323 1326 CE5673872151A7B9002F92D7 /* IOKitSPI.h in Headers */, 1327 2D68D6582740B15B005EBB2E /* IOKitSPIIOS.h in Headers */, 1324 1328 517E03F924B7C0070054895A /* IOKitSPIMac.h in Headers */, 1325 1329 0C2DA1421F3BEB4900DBC317 /* IOPMLibSPI.h in Headers */, -
trunk/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h
r249108 r285786 26 26 #pragma once 27 27 28 #if USE(APPLE_INTERNAL_SDK) 29 30 #import <IOKit/hid/IOHIDDevice.h> 31 #import <IOKit/hid/IOHIDEvent.h> 32 #import <IOKit/hid/IOHIDEventData.h> 33 #import <IOKit/hid/IOHIDEventSystemClient.h> 34 #import <IOKit/hid/IOHIDManager.h> 35 #import <IOKit/hid/IOHIDUsageTables.h> 36 28 #if PLATFORM(MAC) 29 #import <pal/spi/mac/IOKitSPIMac.h> 37 30 #else 38 39 WTF_EXTERN_C_BEGIN 40 41 typedef double IOHIDFloat; 42 43 enum { 44 kIOHIDEventOptionNone = 0, 45 }; 46 47 typedef UInt32 IOOptionBits; 48 typedef uint32_t IOHIDEventOptionBits; 49 typedef uint32_t IOHIDEventField; 50 51 typedef struct __IOHIDEventSystemClient * IOHIDEventSystemClientRef; 52 typedef struct __IOHIDEvent * IOHIDEventRef; 53 54 #define IOHIDEventFieldBase(type) (type << 16) 55 56 enum { 57 kHIDPage_KeyboardOrKeypad = 0x07, 58 kHIDPage_VendorDefinedStart = 0xFF00 59 }; 60 61 enum { 62 kIOHIDDigitizerEventRange = 1<<0, 63 kIOHIDDigitizerEventTouch = 1<<1, 64 kIOHIDDigitizerEventPosition = 1<<2, 65 kIOHIDDigitizerEventIdentity = 1<<5, 66 kIOHIDDigitizerEventAttribute = 1<<6, 67 kIOHIDDigitizerEventCancel = 1<<7, 68 kIOHIDDigitizerEventStart = 1<<8, 69 kIOHIDDigitizerEventEstimatedAltitude = 1<<28, 70 kIOHIDDigitizerEventEstimatedAzimuth = 1<<29, 71 kIOHIDDigitizerEventEstimatedPressure = 1<<30 72 }; 73 typedef uint32_t IOHIDDigitizerEventMask; 74 75 enum { 76 kIOHIDDigitizerEventUpdateAltitudeMask = 1<<28, 77 kIOHIDDigitizerEventUpdateAzimuthMask = 1<<29, 78 kIOHIDDigitizerEventUpdatePressureMask = 1<<30 79 }; 80 81 enum { 82 kIOHIDEventTypeNULL, 83 kIOHIDEventTypeVendorDefined, 84 kIOHIDEventTypeKeyboard = 3, 85 kIOHIDEventTypeRotation = 5, 86 kIOHIDEventTypeScroll = 6, 87 kIOHIDEventTypeZoom = 8, 88 kIOHIDEventTypeDigitizer = 11, 89 kIOHIDEventTypeNavigationSwipe = 16, 90 kIOHIDEventTypeForce = 32, 91 92 }; 93 typedef uint32_t IOHIDEventType; 94 95 enum { 96 kIOHIDEventFieldVendorDefinedUsagePage = IOHIDEventFieldBase(kIOHIDEventTypeVendorDefined), 97 kIOHIDEventFieldVendorDefinedReserved, 98 kIOHIDEventFieldVendorDefinedReserved1, 99 kIOHIDEventFieldVendorDefinedDataLength, 100 kIOHIDEventFieldVendorDefinedData 101 }; 102 103 enum { 104 kIOHIDEventFieldDigitizerX = IOHIDEventFieldBase(kIOHIDEventTypeDigitizer), 105 kIOHIDEventFieldDigitizerY, 106 kIOHIDEventFieldDigitizerMajorRadius = kIOHIDEventFieldDigitizerX + 20, 107 kIOHIDEventFieldDigitizerMinorRadius, 108 kIOHIDEventFieldDigitizerIsDisplayIntegrated = kIOHIDEventFieldDigitizerMajorRadius + 5, 109 }; 110 111 enum { 112 kIOHIDTransducerRange = 0x00010000, 113 kIOHIDTransducerTouch = 0x00020000, 114 kIOHIDTransducerInvert = 0x00040000, 115 kIOHIDTransducerDisplayIntegrated = 0x00080000 116 }; 117 118 enum { 119 kIOHIDDigitizerTransducerTypeStylus = 0, 120 kIOHIDDigitizerTransducerTypeFinger = 2, 121 kIOHIDDigitizerTransducerTypeHand = 3 122 }; 123 typedef uint32_t IOHIDDigitizerTransducerType; 124 125 enum { 126 kIOHIDEventFieldDigitizerWillUpdateMask = 720924, 127 kIOHIDEventFieldDigitizerDidUpdateMask = 720925 128 }; 129 130 IOHIDEventRef IOHIDEventCreateDigitizerEvent(CFAllocatorRef, uint64_t, IOHIDDigitizerTransducerType, uint32_t, uint32_t, IOHIDDigitizerEventMask, uint32_t, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, boolean_t, boolean_t, IOOptionBits); 131 132 IOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, IOHIDDigitizerEventMask, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, boolean_t, boolean_t, IOHIDEventOptionBits); 133 134 IOHIDEventRef IOHIDEventCreateForceEvent(CFAllocatorRef, uint64_t, uint32_t, IOHIDFloat, uint32_t, IOHIDFloat, IOHIDEventOptionBits); 135 136 IOHIDEventRef IOHIDEventCreateKeyboardEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, boolean_t, IOOptionBits); 137 138 IOHIDEventRef IOHIDEventCreateVendorDefinedEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, uint32_t, uint8_t*, CFIndex, IOHIDEventOptionBits); 139 140 IOHIDEventRef IOHIDEventCreateDigitizerStylusEventWithPolarOrientation(CFAllocatorRef, uint64_t, uint32_t, uint32_t, IOHIDDigitizerEventMask, uint32_t, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, boolean_t, boolean_t, IOHIDEventOptionBits); 141 142 IOHIDEventType IOHIDEventGetType(IOHIDEventRef); 143 144 void IOHIDEventSetFloatValue(IOHIDEventRef, IOHIDEventField, IOHIDFloat); 145 146 CFIndex IOHIDEventGetIntegerValue(IOHIDEventRef, IOHIDEventField); 147 void IOHIDEventSetIntegerValue(IOHIDEventRef, IOHIDEventField, CFIndex); 148 149 void IOHIDEventAppendEvent(IOHIDEventRef, IOHIDEventRef, IOOptionBits); 150 151 IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef); 152 153 #define kGSEventPathInfoInRange (1 << 0) 154 #define kGSEventPathInfoInTouch (1 << 1) 155 156 enum { 157 kHIDUsage_KeyboardA = 0x04, 158 kHIDUsage_Keyboard1 = 0x1E, 159 kHIDUsage_Keyboard2 = 0x1F, 160 kHIDUsage_Keyboard3 = 0x20, 161 kHIDUsage_Keyboard4 = 0x21, 162 kHIDUsage_Keyboard5 = 0x22, 163 kHIDUsage_Keyboard6 = 0x23, 164 kHIDUsage_Keyboard7 = 0x24, 165 kHIDUsage_Keyboard8 = 0x25, 166 kHIDUsage_Keyboard9 = 0x26, 167 kHIDUsage_Keyboard0 = 0x27, 168 kHIDUsage_KeyboardReturnOrEnter = 0x28, 169 kHIDUsage_KeyboardEscape = 0x29, 170 kHIDUsage_KeyboardDeleteOrBackspace = 0x2A, 171 kHIDUsage_KeyboardTab = 0x2B, 172 kHIDUsage_KeyboardSpacebar = 0x2C, 173 kHIDUsage_KeyboardHyphen = 0x2D, 174 kHIDUsage_KeyboardEqualSign = 0x2E, 175 kHIDUsage_KeyboardOpenBracket = 0x2F, 176 kHIDUsage_KeyboardCloseBracket = 0x30, 177 kHIDUsage_KeyboardBackslash = 0x31, 178 kHIDUsage_KeyboardSemicolon = 0x33, 179 kHIDUsage_KeyboardQuote = 0x34, 180 kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, 181 kHIDUsage_KeyboardComma = 0x36, 182 kHIDUsage_KeyboardPeriod = 0x37, 183 kHIDUsage_KeyboardSlash = 0x38, 184 kHIDUsage_KeyboardCapsLock = 0x39, 185 kHIDUsage_KeyboardF1 = 0x3A, 186 kHIDUsage_KeyboardF12 = 0x45, 187 kHIDUsage_KeyboardPrintScreen = 0x46, 188 kHIDUsage_KeyboardInsert = 0x49, 189 kHIDUsage_KeyboardHome = 0x4A, 190 kHIDUsage_KeyboardPageUp = 0x4B, 191 kHIDUsage_KeyboardDeleteForward = 0x4C, 192 kHIDUsage_KeyboardEnd = 0x4D, 193 kHIDUsage_KeyboardPageDown = 0x4E, 194 kHIDUsage_KeyboardRightArrow = 0x4F, 195 kHIDUsage_KeyboardLeftArrow = 0x50, 196 kHIDUsage_KeyboardDownArrow = 0x51, 197 kHIDUsage_KeyboardUpArrow = 0x52, 198 kHIDUsage_KeypadNumLock = 0x53, 199 kHIDUsage_KeyboardF13 = 0x68, 200 kHIDUsage_KeyboardF24 = 0x73, 201 kHIDUsage_KeyboardMenu = 0x76, 202 kHIDUsage_KeypadComma = 0x85, 203 kHIDUsage_KeyboardLeftControl = 0xE0, 204 kHIDUsage_KeyboardLeftShift = 0xE1, 205 kHIDUsage_KeyboardLeftAlt = 0xE2, 206 kHIDUsage_KeyboardLeftGUI = 0xE3, 207 kHIDUsage_KeyboardRightControl = 0xE4, 208 kHIDUsage_KeyboardRightShift = 0xE5, 209 kHIDUsage_KeyboardRightAlt = 0xE6, 210 kHIDUsage_KeyboardRightGUI = 0xE7, 211 }; 212 213 typedef struct CF_BRIDGED_TYPE(id) __IOHIDDevice * IOHIDDeviceRef; 214 215 typedef kern_return_t IOReturn; 216 217 enum IOHIDReportType { 218 kIOHIDReportTypeInput = 0, 219 kIOHIDReportTypeOutput, 220 }; 221 222 enum { 223 kIOHIDOptionsTypeNone = 0x00, 224 }; 225 typedef uint32_t IOHIDOptionsType; 226 227 typedef UInt32 IOOptionBits; 228 229 typedef void (*IOHIDReportCallback) (void*, IOReturn, void*, IOHIDReportType, uint32_t, uint8_t*, CFIndex); 230 231 IOReturn IOHIDDeviceOpen(IOHIDDeviceRef, IOOptionBits); 232 void IOHIDDeviceScheduleWithRunLoop(IOHIDDeviceRef, CFRunLoopRef, CFStringRef); 233 void IOHIDDeviceRegisterInputReportCallback(IOHIDDeviceRef, uint8_t*, CFIndex, IOHIDReportCallback, void*); 234 void IOHIDDeviceUnscheduleFromRunLoop(IOHIDDeviceRef, CFRunLoopRef, CFStringRef); 235 IOReturn IOHIDDeviceClose(IOHIDDeviceRef, IOOptionBits); 236 IOReturn IOHIDDeviceSetReport(IOHIDDeviceRef, IOHIDReportType, CFIndex, const uint8_t*, CFIndex); 237 238 typedef struct CF_BRIDGED_TYPE(id) __IOHIDManager * IOHIDManagerRef; 239 240 #define kIOHIDPrimaryUsagePageKey "PrimaryUsagePage" 241 #define kIOHIDPrimaryUsageKey "PrimaryUsage" 242 243 typedef void (*IOHIDDeviceCallback) (void*, IOReturn, void*, IOHIDDeviceRef); 244 245 IOHIDManagerRef IOHIDManagerCreate(CFAllocatorRef, IOOptionBits); 246 void IOHIDManagerSetDeviceMatching(IOHIDManagerRef, CFDictionaryRef); 247 void IOHIDManagerRegisterDeviceMatchingCallback(IOHIDManagerRef, IOHIDDeviceCallback, void*); 248 void IOHIDManagerRegisterDeviceRemovalCallback(IOHIDManagerRef, IOHIDDeviceCallback, void*); 249 void IOHIDManagerUnscheduleFromRunLoop(IOHIDManagerRef, CFRunLoopRef, CFStringRef); 250 IOReturn IOHIDManagerClose(IOHIDManagerRef, IOOptionBits); 251 void IOHIDManagerScheduleWithRunLoop(IOHIDManagerRef, CFRunLoopRef, CFStringRef); 252 IOReturn IOHIDManagerOpen(IOHIDManagerRef, IOOptionBits); 253 254 WTF_EXTERN_C_END 255 256 #endif // USE(APPLE_INTERNAL_SDK) 31 #import <pal/spi/ios/IOKitSPIIOS.h> 32 #endif -
trunk/Source/WebCore/PAL/pal/spi/ios/IOKitSPIIOS.h
r285785 r285786 25 25 26 26 #pragma once 27 28 #if PLATFORM(IOS_FAMILY) 27 29 28 30 #if USE(APPLE_INTERNAL_SDK) … … 255 257 256 258 #endif // USE(APPLE_INTERNAL_SDK) 259 260 #endif // PLATFORM(IOS_FAMILY) -
trunk/Source/WebCore/PAL/pal/spi/mac/IOKitSPIMac.h
r264888 r285786 27 27 28 28 #if PLATFORM(MAC) 29 30 #import <IOKit/hid/IOHIDDevice.h> 31 #import <IOKit/hid/IOHIDManager.h> 32 #import <IOKit/hid/IOHIDUsageTables.h> 33 29 34 #if USE(APPLE_INTERNAL_SDK) 30 35 36 #import <IOKit/hid/IOHIDEvent.h> 37 #import <IOKit/hid/IOHIDEventData.h> 31 38 #import <IOKit/hid/IOHIDEventSystemClient.h> 32 39 … … 61 68 CFTypeRef IOHIDServiceClientCopyProperty(IOHIDServiceClientRef service, CFStringRef key); 62 69 70 enum { 71 kIOHIDEventTypeNULL, 72 kIOHIDEventTypeVendorDefined, 73 kIOHIDEventTypeKeyboard = 3, 74 kIOHIDEventTypeRotation = 5, 75 kIOHIDEventTypeScroll = 6, 76 kIOHIDEventTypeZoom = 8, 77 kIOHIDEventTypeDigitizer = 11, 78 kIOHIDEventTypeNavigationSwipe = 16, 79 kIOHIDEventTypeForce = 32, 80 81 }; 82 typedef uint32_t IOHIDEventType; 83 63 84 WTF_EXTERN_C_END 64 85 -
trunk/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm
r279480 r285786 34 34 #import "Logging.h" 35 35 #import <GameController/GameController.h> 36 #import <pal/spi/ mac/IOKitSPIMac.h>36 #import <pal/spi/cocoa/IOKitSPI.h> 37 37 #import <wtf/NeverDestroyed.h> 38 38 -
trunk/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.h
r264874 r285786 32 32 #include "Timer.h" 33 33 #include <IOKit/hid/IOHIDManager.h> 34 #include <pal/spi/ mac/IOKitSPIMac.h>34 #include <pal/spi/cocoa/IOKitSPI.h> 35 35 #include <wtf/Deque.h> 36 36 #include <wtf/HashMap.h> -
trunk/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm
r280416 r285786 33 33 #import "Logging.h" 34 34 #import "PlatformGamepad.h" 35 #import <pal/spi/mac/IOKitSPIMac.h>36 35 #import <wtf/NeverDestroyed.h> 37 36
Note:
See TracChangeset
for help on using the changeset viewer.