Diff
Modified: branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog (286710 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog 2021-12-08 21:19:38 UTC (rev 286710)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog 2021-12-08 21:25:05 UTC (rev 286711)
@@ -1,3 +1,53 @@
+2021-12-01 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r285786. rdar://problem/85928816
+
+ Clean up IOKit SPI headers
+ https://bugs.webkit.org/show_bug.cgi?id=233093
+
+ Reviewed by Simon Fraser.
+
+ Source/WebCore:
+
+ * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
+ * platform/gamepad/mac/HIDGamepadProvider.h:
+ * platform/gamepad/mac/HIDGamepadProvider.mm:
+
+ Source/WebCore/PAL:
+
+ * PAL.xcodeproj/project.pbxproj:
+ * pal/spi/cg/CoreGraphicsSPI.h:
+ * pal/spi/cocoa/IOKitSPI.h:
+ * pal/spi/ios/IOKitSPIIOS.h: Added.
+ * pal/spi/mac/IOKitSPIMac.h:
+ IOKit vends a much different set of public API on iOS vs. macOS,
+ so we have separate SPI headers to reduce the confusion.
+
+ Unfortunately, the SPI header for iOS was not explicitly named as such,
+ and started being used in some macOS code. For a while, this didn't lead
+ to any trouble because the aforementioned macOS code didn't ALSO have
+ the public SDK headers included, but a future patch from Simon will
+ use IOKitSPI.h in a place where the macOS IOKit public headers are included,
+ and thus we must make the split more explicit.
+
+ Rename IOKitSPI.h to IOKitSPIIOS.h; make IOKitSPI choose the right one.
+ Add some SPI defintions to IOKitSPIMac.h that were missing (which the
+ dependent code was getting via the iOS header on macOS).
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-11-13 Tim Horton <timothy_hor...@apple.com>
+
+ Clean up IOKit SPI headers
+ https://bugs.webkit.org/show_bug.cgi?id=233093
+
+ Reviewed by Simon Fraser.
+
+ * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
+ * platform/gamepad/mac/HIDGamepadProvider.h:
+ * platform/gamepad/mac/HIDGamepadProvider.mm:
+
2021-12-02 Alan Coon <alanc...@apple.com>
Revert r286394. rdar://problem/83070565
Modified: branches/safari-612.4.2.1-branch/Source/WebCore/PAL/ChangeLog (286710 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/PAL/ChangeLog 2021-12-08 21:19:38 UTC (rev 286710)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/PAL/ChangeLog 2021-12-08 21:25:05 UTC (rev 286711)
@@ -1,3 +1,68 @@
+2021-12-01 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r285786. rdar://problem/85928816
+
+ Clean up IOKit SPI headers
+ https://bugs.webkit.org/show_bug.cgi?id=233093
+
+ Reviewed by Simon Fraser.
+
+ Source/WebCore:
+
+ * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
+ * platform/gamepad/mac/HIDGamepadProvider.h:
+ * platform/gamepad/mac/HIDGamepadProvider.mm:
+
+ Source/WebCore/PAL:
+
+ * PAL.xcodeproj/project.pbxproj:
+ * pal/spi/cg/CoreGraphicsSPI.h:
+ * pal/spi/cocoa/IOKitSPI.h:
+ * pal/spi/ios/IOKitSPIIOS.h: Added.
+ * pal/spi/mac/IOKitSPIMac.h:
+ IOKit vends a much different set of public API on iOS vs. macOS,
+ so we have separate SPI headers to reduce the confusion.
+
+ Unfortunately, the SPI header for iOS was not explicitly named as such,
+ and started being used in some macOS code. For a while, this didn't lead
+ to any trouble because the aforementioned macOS code didn't ALSO have
+ the public SDK headers included, but a future patch from Simon will
+ use IOKitSPI.h in a place where the macOS IOKit public headers are included,
+ and thus we must make the split more explicit.
+
+ Rename IOKitSPI.h to IOKitSPIIOS.h; make IOKitSPI choose the right one.
+ Add some SPI defintions to IOKitSPIMac.h that were missing (which the
+ dependent code was getting via the iOS header on macOS).
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-11-13 Tim Horton <timothy_hor...@apple.com>
+
+ Clean up IOKit SPI headers
+ https://bugs.webkit.org/show_bug.cgi?id=233093
+
+ Reviewed by Simon Fraser.
+
+ * PAL.xcodeproj/project.pbxproj:
+ * pal/spi/cg/CoreGraphicsSPI.h:
+ * pal/spi/cocoa/IOKitSPI.h:
+ * pal/spi/ios/IOKitSPIIOS.h: Added.
+ * pal/spi/mac/IOKitSPIMac.h:
+ IOKit vends a much different set of public API on iOS vs. macOS,
+ so we have separate SPI headers to reduce the confusion.
+
+ Unfortunately, the SPI header for iOS was not explicitly named as such,
+ and started being used in some macOS code. For a while, this didn't lead
+ to any trouble because the aforementioned macOS code didn't ALSO have
+ the public SDK headers included, but a future patch from Simon will
+ use IOKitSPI.h in a place where the macOS IOKit public headers are included,
+ and thus we must make the split more explicit.
+
+ Rename IOKitSPI.h to IOKitSPIIOS.h; make IOKitSPI choose the right one.
+ Add some SPI defintions to IOKitSPIMac.h that were missing (which the
+ dependent code was getting via the iOS header on macOS).
+
2021-11-09 Alan Coon <alanc...@apple.com>
Cherry-pick r285318. rdar://problem/85168068
Modified: branches/safari-612.4.2.1-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (286710 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2021-12-08 21:19:38 UTC (rev 286710)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2021-12-08 21:25:05 UTC (rev 286711)
@@ -122,6 +122,7 @@
29C15F4825D75FDF001CE31C /* MediaAccessibilitySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 29C15F4725D75F63001CE31C /* MediaAccessibilitySPI.h */; };
29CDEBA62548D57F007C07B7 /* AXSpeechManagerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CDEB9E2548D055007C07B7 /* AXSpeechManagerSPI.h */; };
2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */; };
+ 2D68D6582740B15B005EBB2E /* IOKitSPIIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D68D6572740B15B005EBB2E /* IOKitSPIIOS.h */; };
2E1342CC215AA10A007199D2 /* UIKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */; };
2E1342CD215AA10A007199D2 /* UIKitSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */; };
31308B1420A21705003FB929 /* SystemPreviewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31308B1320A21705003FB929 /* SystemPreviewSPI.h */; };
@@ -344,6 +345,7 @@
29C15F4725D75F63001CE31C /* MediaAccessibilitySPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaAccessibilitySPI.h; sourceTree = "<group>"; };
29CDEB9E2548D055007C07B7 /* AXSpeechManagerSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXSpeechManagerSPI.h; sourceTree = "<group>"; };
2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSPI.h; sourceTree = "<group>"; };
+ 2D68D6572740B15B005EBB2E /* IOKitSPIIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitSPIIOS.h; sourceTree = "<group>"; };
2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitSoftLink.h; sourceTree = "<group>"; };
2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIKitSoftLink.mm; sourceTree = "<group>"; };
31308B1320A21705003FB929 /* SystemPreviewSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SystemPreviewSPI.h; sourceTree = "<group>"; };
@@ -589,6 +591,7 @@
0C5AF90F1F43A4C7002EAC02 /* CoreUISPI.h */,
0C5AF9101F43A4C7002EAC02 /* DataDetectorsUISPI.h */,
0C5AF9111F43A4C7002EAC02 /* GraphicsServicesSPI.h */,
+ 2D68D6572740B15B005EBB2E /* IOKitSPIIOS.h */,
5C7C787523AC3E850065F47E /* ManagedConfigurationSPI.h */,
0C5AF9131F43A4C7002EAC02 /* MediaPlayerSPI.h */,
0C5AF9141F43A4C7002EAC02 /* MobileGestaltSPI.h */,
@@ -915,6 +918,7 @@
A39DE74E1F7C443D007BCB00 /* HysteresisActivity.h in Headers */,
0C2DA11F1F3BE9E000DBC317 /* ImageIOSPI.h in Headers */,
CE5673872151A7B9002F92D7 /* IOKitSPI.h in Headers */,
+ 2D68D6582740B15B005EBB2E /* IOKitSPIIOS.h in Headers */,
517E03F924B7C0070054895A /* IOKitSPIMac.h in Headers */,
0C2DA1421F3BEB4900DBC317 /* IOPMLibSPI.h in Headers */,
0C2DA1431F3BEB4900DBC317 /* IOPSLibSPI.h in Headers */,
Modified: branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h (286710 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h 2021-12-08 21:19:38 UTC (rev 286710)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h 2021-12-08 21:25:05 UTC (rev 286711)
@@ -25,232 +25,8 @@
#pragma once
-#if USE(APPLE_INTERNAL_SDK)
-
-#import <IOKit/hid/IOHIDDevice.h>
-#import <IOKit/hid/IOHIDEvent.h>
-#import <IOKit/hid/IOHIDEventData.h>
-#import <IOKit/hid/IOHIDEventSystemClient.h>
-#import <IOKit/hid/IOHIDManager.h>
-#import <IOKit/hid/IOHIDUsageTables.h>
-
+#if PLATFORM(MAC)
+#import <pal/spi/mac/IOKitSPIMac.h>
#else
-
-WTF_EXTERN_C_BEGIN
-
-typedef double IOHIDFloat;
-
-enum {
- kIOHIDEventOptionNone = 0,
-};
-
-typedef UInt32 IOOptionBits;
-typedef uint32_t IOHIDEventOptionBits;
-typedef uint32_t IOHIDEventField;
-
-typedef struct __IOHIDEventSystemClient * IOHIDEventSystemClientRef;
-typedef struct __IOHIDEvent * IOHIDEventRef;
-
-#define IOHIDEventFieldBase(type) (type << 16)
-
-enum {
- kHIDPage_KeyboardOrKeypad = 0x07,
- kHIDPage_VendorDefinedStart = 0xFF00
-};
-
-enum {
- kIOHIDDigitizerEventRange = 1<<0,
- kIOHIDDigitizerEventTouch = 1<<1,
- kIOHIDDigitizerEventPosition = 1<<2,
- kIOHIDDigitizerEventIdentity = 1<<5,
- kIOHIDDigitizerEventAttribute = 1<<6,
- kIOHIDDigitizerEventCancel = 1<<7,
- kIOHIDDigitizerEventStart = 1<<8,
- kIOHIDDigitizerEventEstimatedAltitude = 1<<28,
- kIOHIDDigitizerEventEstimatedAzimuth = 1<<29,
- kIOHIDDigitizerEventEstimatedPressure = 1<<30
-};
-typedef uint32_t IOHIDDigitizerEventMask;
-
-enum {
- kIOHIDDigitizerEventUpdateAltitudeMask = 1<<28,
- kIOHIDDigitizerEventUpdateAzimuthMask = 1<<29,
- kIOHIDDigitizerEventUpdatePressureMask = 1<<30
-};
-
-enum {
- kIOHIDEventTypeNULL,
- kIOHIDEventTypeVendorDefined,
- kIOHIDEventTypeKeyboard = 3,
- kIOHIDEventTypeRotation = 5,
- kIOHIDEventTypeScroll = 6,
- kIOHIDEventTypeZoom = 8,
- kIOHIDEventTypeDigitizer = 11,
- kIOHIDEventTypeNavigationSwipe = 16,
- kIOHIDEventTypeForce = 32,
-
-};
-typedef uint32_t IOHIDEventType;
-
-enum {
- kIOHIDEventFieldVendorDefinedUsagePage = IOHIDEventFieldBase(kIOHIDEventTypeVendorDefined),
- kIOHIDEventFieldVendorDefinedReserved,
- kIOHIDEventFieldVendorDefinedReserved1,
- kIOHIDEventFieldVendorDefinedDataLength,
- kIOHIDEventFieldVendorDefinedData
-};
-
-enum {
- kIOHIDEventFieldDigitizerX = IOHIDEventFieldBase(kIOHIDEventTypeDigitizer),
- kIOHIDEventFieldDigitizerY,
- kIOHIDEventFieldDigitizerMajorRadius = kIOHIDEventFieldDigitizerX + 20,
- kIOHIDEventFieldDigitizerMinorRadius,
- kIOHIDEventFieldDigitizerIsDisplayIntegrated = kIOHIDEventFieldDigitizerMajorRadius + 5,
-};
-
-enum {
- kIOHIDTransducerRange = 0x00010000,
- kIOHIDTransducerTouch = 0x00020000,
- kIOHIDTransducerInvert = 0x00040000,
- kIOHIDTransducerDisplayIntegrated = 0x00080000
-};
-
-enum {
- kIOHIDDigitizerTransducerTypeStylus = 0,
- kIOHIDDigitizerTransducerTypeFinger = 2,
- kIOHIDDigitizerTransducerTypeHand = 3
-};
-typedef uint32_t IOHIDDigitizerTransducerType;
-
-enum {
- kIOHIDEventFieldDigitizerWillUpdateMask = 720924,
- kIOHIDEventFieldDigitizerDidUpdateMask = 720925
-};
-
-IOHIDEventRef IOHIDEventCreateDigitizerEvent(CFAllocatorRef, uint64_t, IOHIDDigitizerTransducerType, uint32_t, uint32_t, IOHIDDigitizerEventMask, uint32_t, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, boolean_t, boolean_t, IOOptionBits);
-
-IOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, IOHIDDigitizerEventMask, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, boolean_t, boolean_t, IOHIDEventOptionBits);
-
-IOHIDEventRef IOHIDEventCreateForceEvent(CFAllocatorRef, uint64_t, uint32_t, IOHIDFloat, uint32_t, IOHIDFloat, IOHIDEventOptionBits);
-
-IOHIDEventRef IOHIDEventCreateKeyboardEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, boolean_t, IOOptionBits);
-
-IOHIDEventRef IOHIDEventCreateVendorDefinedEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, uint32_t, uint8_t*, CFIndex, IOHIDEventOptionBits);
-
-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);
-
-IOHIDEventType IOHIDEventGetType(IOHIDEventRef);
-
-void IOHIDEventSetFloatValue(IOHIDEventRef, IOHIDEventField, IOHIDFloat);
-
-CFIndex IOHIDEventGetIntegerValue(IOHIDEventRef, IOHIDEventField);
-void IOHIDEventSetIntegerValue(IOHIDEventRef, IOHIDEventField, CFIndex);
-
-void IOHIDEventAppendEvent(IOHIDEventRef, IOHIDEventRef, IOOptionBits);
-
-IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef);
-
-#define kGSEventPathInfoInRange (1 << 0)
-#define kGSEventPathInfoInTouch (1 << 1)
-
-enum {
- kHIDUsage_KeyboardA = 0x04,
- kHIDUsage_Keyboard1 = 0x1E,
- kHIDUsage_Keyboard2 = 0x1F,
- kHIDUsage_Keyboard3 = 0x20,
- kHIDUsage_Keyboard4 = 0x21,
- kHIDUsage_Keyboard5 = 0x22,
- kHIDUsage_Keyboard6 = 0x23,
- kHIDUsage_Keyboard7 = 0x24,
- kHIDUsage_Keyboard8 = 0x25,
- kHIDUsage_Keyboard9 = 0x26,
- kHIDUsage_Keyboard0 = 0x27,
- kHIDUsage_KeyboardReturnOrEnter = 0x28,
- kHIDUsage_KeyboardEscape = 0x29,
- kHIDUsage_KeyboardDeleteOrBackspace = 0x2A,
- kHIDUsage_KeyboardTab = 0x2B,
- kHIDUsage_KeyboardSpacebar = 0x2C,
- kHIDUsage_KeyboardHyphen = 0x2D,
- kHIDUsage_KeyboardEqualSign = 0x2E,
- kHIDUsage_KeyboardOpenBracket = 0x2F,
- kHIDUsage_KeyboardCloseBracket = 0x30,
- kHIDUsage_KeyboardBackslash = 0x31,
- kHIDUsage_KeyboardSemicolon = 0x33,
- kHIDUsage_KeyboardQuote = 0x34,
- kHIDUsage_KeyboardGraveAccentAndTilde = 0x35,
- kHIDUsage_KeyboardComma = 0x36,
- kHIDUsage_KeyboardPeriod = 0x37,
- kHIDUsage_KeyboardSlash = 0x38,
- kHIDUsage_KeyboardCapsLock = 0x39,
- kHIDUsage_KeyboardF1 = 0x3A,
- kHIDUsage_KeyboardF12 = 0x45,
- kHIDUsage_KeyboardPrintScreen = 0x46,
- kHIDUsage_KeyboardInsert = 0x49,
- kHIDUsage_KeyboardHome = 0x4A,
- kHIDUsage_KeyboardPageUp = 0x4B,
- kHIDUsage_KeyboardDeleteForward = 0x4C,
- kHIDUsage_KeyboardEnd = 0x4D,
- kHIDUsage_KeyboardPageDown = 0x4E,
- kHIDUsage_KeyboardRightArrow = 0x4F,
- kHIDUsage_KeyboardLeftArrow = 0x50,
- kHIDUsage_KeyboardDownArrow = 0x51,
- kHIDUsage_KeyboardUpArrow = 0x52,
- kHIDUsage_KeypadNumLock = 0x53,
- kHIDUsage_KeyboardF13 = 0x68,
- kHIDUsage_KeyboardF24 = 0x73,
- kHIDUsage_KeyboardMenu = 0x76,
- kHIDUsage_KeypadComma = 0x85,
- kHIDUsage_KeyboardLeftControl = 0xE0,
- kHIDUsage_KeyboardLeftShift = 0xE1,
- kHIDUsage_KeyboardLeftAlt = 0xE2,
- kHIDUsage_KeyboardLeftGUI = 0xE3,
- kHIDUsage_KeyboardRightControl = 0xE4,
- kHIDUsage_KeyboardRightShift = 0xE5,
- kHIDUsage_KeyboardRightAlt = 0xE6,
- kHIDUsage_KeyboardRightGUI = 0xE7,
-};
-
-typedef struct CF_BRIDGED_TYPE(id) __IOHIDDevice * IOHIDDeviceRef;
-
-typedef kern_return_t IOReturn;
-
-enum IOHIDReportType {
- kIOHIDReportTypeInput = 0,
- kIOHIDReportTypeOutput,
-};
-
-enum {
- kIOHIDOptionsTypeNone = 0x00,
-};
-typedef uint32_t IOHIDOptionsType;
-
-typedef UInt32 IOOptionBits;
-
-typedef void (*IOHIDReportCallback) (void*, IOReturn, void*, IOHIDReportType, uint32_t, uint8_t*, CFIndex);
-
-IOReturn IOHIDDeviceOpen(IOHIDDeviceRef, IOOptionBits);
-void IOHIDDeviceScheduleWithRunLoop(IOHIDDeviceRef, CFRunLoopRef, CFStringRef);
-void IOHIDDeviceRegisterInputReportCallback(IOHIDDeviceRef, uint8_t*, CFIndex, IOHIDReportCallback, void*);
-void IOHIDDeviceUnscheduleFromRunLoop(IOHIDDeviceRef, CFRunLoopRef, CFStringRef);
-IOReturn IOHIDDeviceClose(IOHIDDeviceRef, IOOptionBits);
-IOReturn IOHIDDeviceSetReport(IOHIDDeviceRef, IOHIDReportType, CFIndex, const uint8_t*, CFIndex);
-
-typedef struct CF_BRIDGED_TYPE(id) __IOHIDManager * IOHIDManagerRef;
-
-#define kIOHIDPrimaryUsagePageKey "PrimaryUsagePage"
-#define kIOHIDPrimaryUsageKey "PrimaryUsage"
-
-typedef void (*IOHIDDeviceCallback) (void*, IOReturn, void*, IOHIDDeviceRef);
-
-IOHIDManagerRef IOHIDManagerCreate(CFAllocatorRef, IOOptionBits);
-void IOHIDManagerSetDeviceMatching(IOHIDManagerRef, CFDictionaryRef);
-void IOHIDManagerRegisterDeviceMatchingCallback(IOHIDManagerRef, IOHIDDeviceCallback, void*);
-void IOHIDManagerRegisterDeviceRemovalCallback(IOHIDManagerRef, IOHIDDeviceCallback, void*);
-void IOHIDManagerUnscheduleFromRunLoop(IOHIDManagerRef, CFRunLoopRef, CFStringRef);
-IOReturn IOHIDManagerClose(IOHIDManagerRef, IOOptionBits);
-void IOHIDManagerScheduleWithRunLoop(IOHIDManagerRef, CFRunLoopRef, CFStringRef);
-IOReturn IOHIDManagerOpen(IOHIDManagerRef, IOOptionBits);
-
-WTF_EXTERN_C_END
-
-#endif // USE(APPLE_INTERNAL_SDK)
+#import <pal/spi/ios/IOKitSPIIOS.h>
+#endif
Copied: branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/ios/IOKitSPIIOS.h (from rev 286702, branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h) (0 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/ios/IOKitSPIIOS.h (rev 0)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/ios/IOKitSPIIOS.h 2021-12-08 21:25:05 UTC (rev 286711)
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if PLATFORM(IOS_FAMILY)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <IOKit/hid/IOHIDDevice.h>
+#import <IOKit/hid/IOHIDEvent.h>
+#import <IOKit/hid/IOHIDEventData.h>
+#import <IOKit/hid/IOHIDEventSystemClient.h>
+#import <IOKit/hid/IOHIDManager.h>
+#import <IOKit/hid/IOHIDUsageTables.h>
+
+#else
+
+WTF_EXTERN_C_BEGIN
+
+typedef double IOHIDFloat;
+
+enum {
+ kIOHIDEventOptionNone = 0,
+};
+
+typedef UInt32 IOOptionBits;
+typedef uint32_t IOHIDEventOptionBits;
+typedef uint32_t IOHIDEventField;
+
+typedef struct __IOHIDEventSystemClient * IOHIDEventSystemClientRef;
+typedef struct __IOHIDEvent * IOHIDEventRef;
+
+#define IOHIDEventFieldBase(type) (type << 16)
+
+enum {
+ kHIDPage_KeyboardOrKeypad = 0x07,
+ kHIDPage_VendorDefinedStart = 0xFF00
+};
+
+enum {
+ kIOHIDDigitizerEventRange = 1<<0,
+ kIOHIDDigitizerEventTouch = 1<<1,
+ kIOHIDDigitizerEventPosition = 1<<2,
+ kIOHIDDigitizerEventIdentity = 1<<5,
+ kIOHIDDigitizerEventAttribute = 1<<6,
+ kIOHIDDigitizerEventCancel = 1<<7,
+ kIOHIDDigitizerEventStart = 1<<8,
+ kIOHIDDigitizerEventEstimatedAltitude = 1<<28,
+ kIOHIDDigitizerEventEstimatedAzimuth = 1<<29,
+ kIOHIDDigitizerEventEstimatedPressure = 1<<30
+};
+typedef uint32_t IOHIDDigitizerEventMask;
+
+enum {
+ kIOHIDDigitizerEventUpdateAltitudeMask = 1<<28,
+ kIOHIDDigitizerEventUpdateAzimuthMask = 1<<29,
+ kIOHIDDigitizerEventUpdatePressureMask = 1<<30
+};
+
+enum {
+ kIOHIDEventTypeNULL,
+ kIOHIDEventTypeVendorDefined,
+ kIOHIDEventTypeKeyboard = 3,
+ kIOHIDEventTypeRotation = 5,
+ kIOHIDEventTypeScroll = 6,
+ kIOHIDEventTypeZoom = 8,
+ kIOHIDEventTypeDigitizer = 11,
+ kIOHIDEventTypeNavigationSwipe = 16,
+ kIOHIDEventTypeForce = 32,
+
+};
+typedef uint32_t IOHIDEventType;
+
+enum {
+ kIOHIDEventFieldVendorDefinedUsagePage = IOHIDEventFieldBase(kIOHIDEventTypeVendorDefined),
+ kIOHIDEventFieldVendorDefinedReserved,
+ kIOHIDEventFieldVendorDefinedReserved1,
+ kIOHIDEventFieldVendorDefinedDataLength,
+ kIOHIDEventFieldVendorDefinedData
+};
+
+enum {
+ kIOHIDEventFieldDigitizerX = IOHIDEventFieldBase(kIOHIDEventTypeDigitizer),
+ kIOHIDEventFieldDigitizerY,
+ kIOHIDEventFieldDigitizerMajorRadius = kIOHIDEventFieldDigitizerX + 20,
+ kIOHIDEventFieldDigitizerMinorRadius,
+ kIOHIDEventFieldDigitizerIsDisplayIntegrated = kIOHIDEventFieldDigitizerMajorRadius + 5,
+};
+
+enum {
+ kIOHIDTransducerRange = 0x00010000,
+ kIOHIDTransducerTouch = 0x00020000,
+ kIOHIDTransducerInvert = 0x00040000,
+ kIOHIDTransducerDisplayIntegrated = 0x00080000
+};
+
+enum {
+ kIOHIDDigitizerTransducerTypeStylus = 0,
+ kIOHIDDigitizerTransducerTypeFinger = 2,
+ kIOHIDDigitizerTransducerTypeHand = 3
+};
+typedef uint32_t IOHIDDigitizerTransducerType;
+
+enum {
+ kIOHIDEventFieldDigitizerWillUpdateMask = 720924,
+ kIOHIDEventFieldDigitizerDidUpdateMask = 720925
+};
+
+IOHIDEventRef IOHIDEventCreateDigitizerEvent(CFAllocatorRef, uint64_t, IOHIDDigitizerTransducerType, uint32_t, uint32_t, IOHIDDigitizerEventMask, uint32_t, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, boolean_t, boolean_t, IOOptionBits);
+
+IOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, IOHIDDigitizerEventMask, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, IOHIDFloat, boolean_t, boolean_t, IOHIDEventOptionBits);
+
+IOHIDEventRef IOHIDEventCreateForceEvent(CFAllocatorRef, uint64_t, uint32_t, IOHIDFloat, uint32_t, IOHIDFloat, IOHIDEventOptionBits);
+
+IOHIDEventRef IOHIDEventCreateKeyboardEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, boolean_t, IOOptionBits);
+
+IOHIDEventRef IOHIDEventCreateVendorDefinedEvent(CFAllocatorRef, uint64_t, uint32_t, uint32_t, uint32_t, uint8_t*, CFIndex, IOHIDEventOptionBits);
+
+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);
+
+IOHIDEventType IOHIDEventGetType(IOHIDEventRef);
+
+void IOHIDEventSetFloatValue(IOHIDEventRef, IOHIDEventField, IOHIDFloat);
+
+CFIndex IOHIDEventGetIntegerValue(IOHIDEventRef, IOHIDEventField);
+void IOHIDEventSetIntegerValue(IOHIDEventRef, IOHIDEventField, CFIndex);
+
+void IOHIDEventAppendEvent(IOHIDEventRef, IOHIDEventRef, IOOptionBits);
+
+IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef);
+
+#define kGSEventPathInfoInRange (1 << 0)
+#define kGSEventPathInfoInTouch (1 << 1)
+
+enum {
+ kHIDUsage_KeyboardA = 0x04,
+ kHIDUsage_Keyboard1 = 0x1E,
+ kHIDUsage_Keyboard2 = 0x1F,
+ kHIDUsage_Keyboard3 = 0x20,
+ kHIDUsage_Keyboard4 = 0x21,
+ kHIDUsage_Keyboard5 = 0x22,
+ kHIDUsage_Keyboard6 = 0x23,
+ kHIDUsage_Keyboard7 = 0x24,
+ kHIDUsage_Keyboard8 = 0x25,
+ kHIDUsage_Keyboard9 = 0x26,
+ kHIDUsage_Keyboard0 = 0x27,
+ kHIDUsage_KeyboardReturnOrEnter = 0x28,
+ kHIDUsage_KeyboardEscape = 0x29,
+ kHIDUsage_KeyboardDeleteOrBackspace = 0x2A,
+ kHIDUsage_KeyboardTab = 0x2B,
+ kHIDUsage_KeyboardSpacebar = 0x2C,
+ kHIDUsage_KeyboardHyphen = 0x2D,
+ kHIDUsage_KeyboardEqualSign = 0x2E,
+ kHIDUsage_KeyboardOpenBracket = 0x2F,
+ kHIDUsage_KeyboardCloseBracket = 0x30,
+ kHIDUsage_KeyboardBackslash = 0x31,
+ kHIDUsage_KeyboardSemicolon = 0x33,
+ kHIDUsage_KeyboardQuote = 0x34,
+ kHIDUsage_KeyboardGraveAccentAndTilde = 0x35,
+ kHIDUsage_KeyboardComma = 0x36,
+ kHIDUsage_KeyboardPeriod = 0x37,
+ kHIDUsage_KeyboardSlash = 0x38,
+ kHIDUsage_KeyboardCapsLock = 0x39,
+ kHIDUsage_KeyboardF1 = 0x3A,
+ kHIDUsage_KeyboardF12 = 0x45,
+ kHIDUsage_KeyboardPrintScreen = 0x46,
+ kHIDUsage_KeyboardInsert = 0x49,
+ kHIDUsage_KeyboardHome = 0x4A,
+ kHIDUsage_KeyboardPageUp = 0x4B,
+ kHIDUsage_KeyboardDeleteForward = 0x4C,
+ kHIDUsage_KeyboardEnd = 0x4D,
+ kHIDUsage_KeyboardPageDown = 0x4E,
+ kHIDUsage_KeyboardRightArrow = 0x4F,
+ kHIDUsage_KeyboardLeftArrow = 0x50,
+ kHIDUsage_KeyboardDownArrow = 0x51,
+ kHIDUsage_KeyboardUpArrow = 0x52,
+ kHIDUsage_KeypadNumLock = 0x53,
+ kHIDUsage_KeyboardF13 = 0x68,
+ kHIDUsage_KeyboardF24 = 0x73,
+ kHIDUsage_KeyboardMenu = 0x76,
+ kHIDUsage_KeypadComma = 0x85,
+ kHIDUsage_KeyboardLeftControl = 0xE0,
+ kHIDUsage_KeyboardLeftShift = 0xE1,
+ kHIDUsage_KeyboardLeftAlt = 0xE2,
+ kHIDUsage_KeyboardLeftGUI = 0xE3,
+ kHIDUsage_KeyboardRightControl = 0xE4,
+ kHIDUsage_KeyboardRightShift = 0xE5,
+ kHIDUsage_KeyboardRightAlt = 0xE6,
+ kHIDUsage_KeyboardRightGUI = 0xE7,
+};
+
+typedef struct CF_BRIDGED_TYPE(id) __IOHIDDevice * IOHIDDeviceRef;
+
+typedef kern_return_t IOReturn;
+
+enum IOHIDReportType {
+ kIOHIDReportTypeInput = 0,
+ kIOHIDReportTypeOutput,
+};
+
+enum {
+ kIOHIDOptionsTypeNone = 0x00,
+};
+typedef uint32_t IOHIDOptionsType;
+
+typedef UInt32 IOOptionBits;
+
+typedef void (*IOHIDReportCallback) (void*, IOReturn, void*, IOHIDReportType, uint32_t, uint8_t*, CFIndex);
+
+IOReturn IOHIDDeviceOpen(IOHIDDeviceRef, IOOptionBits);
+void IOHIDDeviceScheduleWithRunLoop(IOHIDDeviceRef, CFRunLoopRef, CFStringRef);
+void IOHIDDeviceRegisterInputReportCallback(IOHIDDeviceRef, uint8_t*, CFIndex, IOHIDReportCallback, void*);
+void IOHIDDeviceUnscheduleFromRunLoop(IOHIDDeviceRef, CFRunLoopRef, CFStringRef);
+IOReturn IOHIDDeviceClose(IOHIDDeviceRef, IOOptionBits);
+IOReturn IOHIDDeviceSetReport(IOHIDDeviceRef, IOHIDReportType, CFIndex, const uint8_t*, CFIndex);
+
+typedef struct CF_BRIDGED_TYPE(id) __IOHIDManager * IOHIDManagerRef;
+
+#define kIOHIDPrimaryUsagePageKey "PrimaryUsagePage"
+#define kIOHIDPrimaryUsageKey "PrimaryUsage"
+
+typedef void (*IOHIDDeviceCallback) (void*, IOReturn, void*, IOHIDDeviceRef);
+
+IOHIDManagerRef IOHIDManagerCreate(CFAllocatorRef, IOOptionBits);
+void IOHIDManagerSetDeviceMatching(IOHIDManagerRef, CFDictionaryRef);
+void IOHIDManagerRegisterDeviceMatchingCallback(IOHIDManagerRef, IOHIDDeviceCallback, void*);
+void IOHIDManagerRegisterDeviceRemovalCallback(IOHIDManagerRef, IOHIDDeviceCallback, void*);
+void IOHIDManagerUnscheduleFromRunLoop(IOHIDManagerRef, CFRunLoopRef, CFStringRef);
+IOReturn IOHIDManagerClose(IOHIDManagerRef, IOOptionBits);
+void IOHIDManagerScheduleWithRunLoop(IOHIDManagerRef, CFRunLoopRef, CFStringRef);
+IOReturn IOHIDManagerOpen(IOHIDManagerRef, IOOptionBits);
+
+WTF_EXTERN_C_END
+
+#endif // USE(APPLE_INTERNAL_SDK)
+
+#endif // PLATFORM(IOS_FAMILY)
Modified: branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/mac/IOKitSPIMac.h (286710 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/mac/IOKitSPIMac.h 2021-12-08 21:19:38 UTC (rev 286710)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/mac/IOKitSPIMac.h 2021-12-08 21:25:05 UTC (rev 286711)
@@ -26,8 +26,15 @@
#pragma once
#if PLATFORM(MAC)
+
+#import <IOKit/hid/IOHIDDevice.h>
+#import <IOKit/hid/IOHIDManager.h>
+#import <IOKit/hid/IOHIDUsageTables.h>
+
#if USE(APPLE_INTERNAL_SDK)
+#import <IOKit/hid/IOHIDEvent.h>
+#import <IOKit/hid/IOHIDEventData.h>
#import <IOKit/hid/IOHIDEventSystemClient.h>
#else
@@ -60,6 +67,20 @@
CFTypeRef IOHIDServiceClientCopyProperty(IOHIDServiceClientRef service, CFStringRef key);
+enum {
+ kIOHIDEventTypeNULL,
+ kIOHIDEventTypeVendorDefined,
+ kIOHIDEventTypeKeyboard = 3,
+ kIOHIDEventTypeRotation = 5,
+ kIOHIDEventTypeScroll = 6,
+ kIOHIDEventTypeZoom = 8,
+ kIOHIDEventTypeDigitizer = 11,
+ kIOHIDEventTypeNavigationSwipe = 16,
+ kIOHIDEventTypeForce = 32,
+
+};
+typedef uint32_t IOHIDEventType;
+
WTF_EXTERN_C_END
#endif // USE(APPLE_INTERNAL_SDK)
Modified: branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm (286710 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm 2021-12-08 21:19:38 UTC (rev 286710)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm 2021-12-08 21:25:05 UTC (rev 286711)
@@ -33,7 +33,7 @@
#import "KnownGamepads.h"
#import "Logging.h"
#import <GameController/GameController.h>
-#import <pal/spi/mac/IOKitSPIMac.h>
+#import <pal/spi/cocoa/IOKitSPI.h>
#import <wtf/NeverDestroyed.h>
#import "GameControllerSoftLink.h"
Modified: branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.h (286710 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.h 2021-12-08 21:19:38 UTC (rev 286710)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.h 2021-12-08 21:25:05 UTC (rev 286711)
@@ -31,7 +31,7 @@
#include "HIDGamepad.h"
#include "Timer.h"
#include <IOKit/hid/IOHIDManager.h>
-#include <pal/spi/mac/IOKitSPIMac.h>
+#include <pal/spi/cocoa/IOKitSPI.h>
#include <wtf/Deque.h>
#include <wtf/HashMap.h>
#include <wtf/RetainPtr.h>
Modified: branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm (286710 => 286711)
--- branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm 2021-12-08 21:19:38 UTC (rev 286710)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm 2021-12-08 21:25:05 UTC (rev 286711)
@@ -32,7 +32,6 @@
#import "GamepadProviderClient.h"
#import "Logging.h"
#import "PlatformGamepad.h"
-#import <pal/spi/mac/IOKitSPIMac.h>
#import <wtf/NeverDestroyed.h>
#if HAVE(GCCONTROLLER_HID_DEVICE_CHECK)