From a6ae35ba912465cc39b058e86446f244710bbc40 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 8 May 2021 20:59:55 +0000 Subject: [PATCH] Issue #1751 -- Remove cocoa support code from /dom --- dom/gamepad/cocoa/CocoaGamepad.cpp | 590 ------------------ dom/gamepad/moz.build | 4 - dom/geolocation/moz.build | 4 - dom/media/standalone/moz.build | 3 - .../systemservices/OSXRunLoopSingleton.cpp | 44 -- .../systemservices/OSXRunLoopSingleton.h | 25 - dom/media/systemservices/moz.build | 4 - .../cocoa/OSXSpeechSynthesizerModule.cpp | 56 -- .../synth/cocoa/OSXSpeechSynthesizerService.h | 43 -- .../cocoa/OSXSpeechSynthesizerService.mm | 498 --------------- dom/media/webspeech/synth/cocoa/moz.build | 11 - dom/media/webspeech/synth/moz.build | 3 - dom/moz.build | 2 +- dom/plugins/base/moz.build | 6 - dom/plugins/base/nsPluginsDirDarwin.cpp | 572 ----------------- dom/system/mac/CoreLocationLocationProvider.h | 59 -- .../mac/CoreLocationLocationProvider.mm | 268 -------- dom/system/mac/moz.build | 14 - dom/system/moz.build | 2 - dom/xbl/builtin/mac/jar.mn | 6 - dom/xbl/builtin/mac/moz.build | 6 - dom/xbl/builtin/mac/platformHTMLBindings.xml | 72 --- dom/xbl/builtin/moz.build | 2 - 23 files changed, 1 insertion(+), 2293 deletions(-) delete mode 100644 dom/gamepad/cocoa/CocoaGamepad.cpp delete mode 100644 dom/media/systemservices/OSXRunLoopSingleton.cpp delete mode 100644 dom/media/systemservices/OSXRunLoopSingleton.h delete mode 100644 dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerModule.cpp delete mode 100644 dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.h delete mode 100644 dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm delete mode 100644 dom/media/webspeech/synth/cocoa/moz.build delete mode 100644 dom/plugins/base/nsPluginsDirDarwin.cpp delete mode 100644 dom/system/mac/CoreLocationLocationProvider.h delete mode 100644 dom/system/mac/CoreLocationLocationProvider.mm delete mode 100644 dom/system/mac/moz.build delete mode 100644 dom/xbl/builtin/mac/jar.mn delete mode 100644 dom/xbl/builtin/mac/moz.build delete mode 100644 dom/xbl/builtin/mac/platformHTMLBindings.xml diff --git a/dom/gamepad/cocoa/CocoaGamepad.cpp b/dom/gamepad/cocoa/CocoaGamepad.cpp deleted file mode 100644 index eb6eda9a17..0000000000 --- a/dom/gamepad/cocoa/CocoaGamepad.cpp +++ /dev/null @@ -1,590 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// mostly derived from the Allegro source code at: -// http://alleg.svn.sourceforge.net/viewvc/alleg/allegro/branches/4.9/src/macosx/hidjoy.m?revision=13760&view=markup - -#include "mozilla/dom/Gamepad.h" -#include "mozilla/dom/GamepadPlatformService.h" -#include "mozilla/ArrayUtils.h" -#include "mozilla/Unused.h" -#include "nsThreadUtils.h" -#include -#include -#include -#include - -#include -#include - -namespace { - -using namespace mozilla; -using namespace mozilla::dom; -using std::vector; - -struct Button { - int id; - bool analog; - IOHIDElementRef element; - CFIndex min; - CFIndex max; - - Button(int aId, IOHIDElementRef aElement, CFIndex aMin, CFIndex aMax) : - id(aId), - analog((aMax - aMin) > 1), - element(aElement), - min(aMin), - max(aMax) {} -}; - -struct Axis { - int id; - IOHIDElementRef element; - uint32_t usagePage; - uint32_t usage; - CFIndex min; - CFIndex max; -}; - -typedef bool dpad_buttons[4]; - -// These values can be found in the USB HID Usage Tables: -// http://www.usb.org/developers/hidpage -const unsigned kDesktopUsagePage = 0x01; -const unsigned kSimUsagePage = 0x02; -const unsigned kAcceleratorUsage = 0xC4; -const unsigned kBrakeUsage = 0xC5; -const unsigned kJoystickUsage = 0x04; -const unsigned kGamepadUsage = 0x05; -const unsigned kAxisUsageMin = 0x30; -const unsigned kAxisUsageMax = 0x35; -const unsigned kDpadUsage = 0x39; -const unsigned kButtonUsagePage = 0x09; -const unsigned kConsumerPage = 0x0C; -const unsigned kHomeUsage = 0x223; -const unsigned kBackUsage = 0x224; - - -class Gamepad { - private: - IOHIDDeviceRef mDevice; - nsTArray