mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 13:55:36 +08:00
Change the operating system name from OSX to MacOS everywhere
Summary: - Changed the name in all build artifacts - Everywhere in C++ Reviewers: #swift_pilot_client, kbasan Reviewed By: #swift_pilot_client, kbasan Subscribers: jenkins Maniphest Tasks: T205 Differential Revision: https://dev.swift-project.org/D69
This commit is contained in:
@@ -22,7 +22,7 @@ win32 {
|
|||||||
QT5_LIBRARY_DIR = $$[QT_INSTALL_BINS]
|
QT5_LIBRARY_DIR = $$[QT_INSTALL_BINS]
|
||||||
}
|
}
|
||||||
else:macx {
|
else:macx {
|
||||||
# OSX workaround using rsync. Otherwise all headers are also copied.
|
# MacOS workaround using rsync. Otherwise all headers are also copied.
|
||||||
qt5_target.path = $${PREFIX}/lib/QtCore.framework
|
qt5_target.path = $${PREFIX}/lib/QtCore.framework
|
||||||
qt5_target.extra += rsync -avzl --exclude \'Headers*\' --exclude \'*debug*\' $$[QT_INSTALL_LIBS]/QtCore.framework/ $${PREFIX}/lib/QtCore.framework/ &&
|
qt5_target.extra += rsync -avzl --exclude \'Headers*\' --exclude \'*debug*\' $$[QT_INSTALL_LIBS]/QtCore.framework/ $${PREFIX}/lib/QtCore.framework/ &&
|
||||||
qt5_target.extra += rsync -avzl --exclude \'Headers*\' --exclude \'*debug*\' $$[QT_INSTALL_LIBS]/QtGui.framework/ $${PREFIX}/lib/QtGui.framework/ &&
|
qt5_target.extra += rsync -avzl --exclude \'Headers*\' --exclude \'*debug*\' $$[QT_INSTALL_LIBS]/QtGui.framework/ $${PREFIX}/lib/QtGui.framework/ &&
|
||||||
@@ -211,13 +211,13 @@ bitrock_builder_bin = $$(BITROCK_BUILDER)
|
|||||||
WINDOWS64BITMODE = 0
|
WINDOWS64BITMODE = 0
|
||||||
win32 {
|
win32 {
|
||||||
INSTALLER_PLATFORM = windows
|
INSTALLER_PLATFORM = windows
|
||||||
INSTALLER_BASENAME = swift-installer-win-$${WORD_SIZE}-$${BLACK_VERSION}
|
INSTALLER_BASENAME = swift-installer-windows-$${WORD_SIZE}-$${BLACK_VERSION}
|
||||||
INSTALLER_EXT = exe
|
INSTALLER_EXT = exe
|
||||||
equals(WORD_SIZE,64): WINDOWS64BITMODE = 1
|
equals(WORD_SIZE,64): WINDOWS64BITMODE = 1
|
||||||
}
|
}
|
||||||
else:macx {
|
else:macx {
|
||||||
INSTALLER_PLATFORM = osx
|
INSTALLER_PLATFORM = osx
|
||||||
INSTALLER_BASENAME = swift-installer-osx-$${WORD_SIZE}-$${BLACK_VERSION}
|
INSTALLER_BASENAME = swift-installer-macos-$${WORD_SIZE}-$${BLACK_VERSION}
|
||||||
INSTALLER_EXT = app
|
INSTALLER_EXT = app
|
||||||
}
|
}
|
||||||
else:unix {
|
else:unix {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<folder>
|
<folder>
|
||||||
<description>/</description>
|
<description>/</description>
|
||||||
<destination>${installdir}</destination>
|
<destination>${installdir}</destination>
|
||||||
<name>autoupdaterosx</name>
|
<name>autoupdatermacos</name>
|
||||||
<platforms>osx</platforms>
|
<platforms>osx</platforms>
|
||||||
<distributionFileList>
|
<distributionFileList>
|
||||||
<distributionFile>
|
<distributionFile>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</setInstallerVariable>
|
</setInstallerVariable>
|
||||||
<setInstallerVariableFromRegEx>
|
<setInstallerVariableFromRegEx>
|
||||||
<name>installerBasename</name>
|
<name>installerBasename</name>
|
||||||
<pattern>(swift-installer-osx-\d+-\d.\d.\d).app</pattern>
|
<pattern>(swift-installer-macos-\d+-\d.\d.\d).app</pattern>
|
||||||
<substitution>\1</substitution>
|
<substitution>\1</substitution>
|
||||||
<text>${project.installerFilename}</text>
|
<text>${project.installerFilename}</text>
|
||||||
</setInstallerVariableFromRegEx>
|
</setInstallerVariableFromRegEx>
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
<allowComponentSelection>1</allowComponentSelection>
|
<allowComponentSelection>1</allowComponentSelection>
|
||||||
<compressionAlgorithm>lzma</compressionAlgorithm>
|
<compressionAlgorithm>lzma</compressionAlgorithm>
|
||||||
|
|
||||||
<!-- Generate a DMG for OSX Installer -->
|
<!-- Generate a DMG for MacOS Installer -->
|
||||||
<createOsxBundleDmg>0</createOsxBundleDmg>
|
<createOsxBundleDmg>0</createOsxBundleDmg>
|
||||||
|
|
||||||
<!-- <allowedLanguages>en fr es it de ja nl ru zh_CN no pt_BR</allowedLanguages> -->
|
<!-- <allowedLanguages>en fr es it de ja nl ru zh_CN no pt_BR</allowedLanguages> -->
|
||||||
|
|||||||
@@ -110,7 +110,7 @@
|
|||||||
<folder>
|
<folder>
|
||||||
<description>lib</description>
|
<description>lib</description>
|
||||||
<destination>${installdir}/lib</destination>
|
<destination>${installdir}/lib</destination>
|
||||||
<name>lib_osx</name>
|
<name>lib_macos</name>
|
||||||
<platforms>osx</platforms>
|
<platforms>osx</platforms>
|
||||||
<distributionFileList>
|
<distributionFileList>
|
||||||
<distributionFile>
|
<distributionFile>
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
<folder>
|
<folder>
|
||||||
<description>bin</description>
|
<description>bin</description>
|
||||||
<destination>${installdir}/bin</destination>
|
<destination>${installdir}/bin</destination>
|
||||||
<name>bin_osx</name>
|
<name>bin_macos</name>
|
||||||
<platforms>osx</platforms>
|
<platforms>osx</platforms>
|
||||||
<distributionFileList>
|
<distributionFileList>
|
||||||
<distributionFile>
|
<distributionFile>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ equals (TEMPLATE, app) {
|
|||||||
include(copyfiles.pri)
|
include(copyfiles.pri)
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# Allow "empty" projects on OSX
|
# Allow "empty" projects on MacOS
|
||||||
################################
|
################################
|
||||||
|
|
||||||
macx:staticlib:isEmpty(SOURCES) {
|
macx:staticlib:isEmpty(SOURCES) {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class Builder:
|
|||||||
|
|
||||||
def publish(self):
|
def publish(self):
|
||||||
if self._should_publish():
|
if self._should_publish():
|
||||||
os_map = {'Linux': 'linux', 'Darwin': 'osx', 'Windows': 'win'}
|
os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'}
|
||||||
extension_map = {'Linux': 'run', 'Darwin': 'dmg', 'Windows': 'exe'}
|
extension_map = {'Linux': 'run', 'Darwin': 'dmg', 'Windows': 'exe'}
|
||||||
version_segments = self.version.split('.')
|
version_segments = self.version.split('.')
|
||||||
lastSegment = version_segments.pop()
|
lastSegment = version_segments.pop()
|
||||||
@@ -111,7 +111,8 @@ class Builder:
|
|||||||
print('Packaging xswiftbus ...')
|
print('Packaging xswiftbus ...')
|
||||||
build_path = self._get_swift_build_path()
|
build_path = self._get_swift_build_path()
|
||||||
os.chdir(build_path)
|
os.chdir(build_path)
|
||||||
archive_name = '-'.join(['xswiftbus', platform.system(), self.word_size, self.version]) + '.7z'
|
os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'}
|
||||||
|
archive_name = '-'.join(['xswiftbus', os_map[platform.system()], self.word_size, self.version]) + '.7z'
|
||||||
archive_path = path.abspath(path.join(os.pardir, archive_name))
|
archive_path = path.abspath(path.join(os.pardir, archive_name))
|
||||||
content_path = path.abspath(path.join(os.curdir, 'dist', 'xswiftbus'))
|
content_path = path.abspath(path.join(os.curdir, 'dist', 'xswiftbus'))
|
||||||
subprocess.check_call(['7z', 'a', '-mx=9', archive_path, content_path], env=dict(os.environ))
|
subprocess.check_call(['7z', 'a', '-mx=9', archive_path, content_path], env=dict(os.environ))
|
||||||
@@ -130,7 +131,8 @@ class Builder:
|
|||||||
dumper = symbolstore.get_platform_specific_dumper(dump_syms=self.dump_syms, symbol_path=symbol_path)
|
dumper = symbolstore.get_platform_specific_dumper(dump_syms=self.dump_syms, symbol_path=symbol_path)
|
||||||
dumper.process(binary_path)
|
dumper.process(binary_path)
|
||||||
dumper.finish()
|
dumper.finish()
|
||||||
tar_filename = '-'.join(['swift', 'symbols', platform.system(), self.word_size, self.version]) + '.tar.gz'
|
os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'}
|
||||||
|
tar_filename = '-'.join(['swift', 'symbols', os_map[platform.system()], self.word_size, self.version]) + '.tar.gz'
|
||||||
tar_path = path.abspath(path.join(self._get_swift_source_path(), tar_filename))
|
tar_path = path.abspath(path.join(self._get_swift_source_path(), tar_filename))
|
||||||
dumper.pack(tar_path)
|
dumper.pack(tar_path)
|
||||||
if upload_symbols:
|
if upload_symbols:
|
||||||
|
|||||||
@@ -79,9 +79,9 @@ namespace BlackConfig
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBuildConfig::isRunningOnMacOSXPlatform()
|
bool CBuildConfig::isRunningOnMacOSPlatform()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_OSX
|
#ifdef Q_OS_MACOS
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
@@ -99,7 +99,7 @@ namespace BlackConfig
|
|||||||
|
|
||||||
bool CBuildConfig::isRunningOnUnixPlatform()
|
bool CBuildConfig::isRunningOnUnixPlatform()
|
||||||
{
|
{
|
||||||
return isRunningOnMacOSXPlatform() || isRunningOnLinuxPlatform();
|
return isRunningOnMacOSPlatform() || isRunningOnLinuxPlatform();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBuildConfig::isDebugBuild()
|
bool CBuildConfig::isDebugBuild()
|
||||||
@@ -269,7 +269,7 @@ namespace BlackConfig
|
|||||||
{
|
{
|
||||||
p = "win-" + ws;
|
p = "win-" + ws;
|
||||||
}
|
}
|
||||||
else if (BlackConfig::CBuildConfig::isRunningOnMacOSXPlatform()) { p = "macos-64"; }
|
else if (BlackConfig::CBuildConfig::isRunningOnMacOSPlatform()) { p = "macos-64"; }
|
||||||
else if (BlackConfig::CBuildConfig::isRunningOnLinuxPlatform()) { p = "linux-64"; }
|
else if (BlackConfig::CBuildConfig::isRunningOnLinuxPlatform()) { p = "linux-64"; }
|
||||||
|
|
||||||
if (!p.isEmpty() && BlackConfig::CBuildConfig::isVatsimVersion()) { p += "-vatsim"; }
|
if (!p.isEmpty() && BlackConfig::CBuildConfig::isVatsimVersion()) { p += "-vatsim"; }
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ namespace BlackConfig
|
|||||||
//! Windows 10
|
//! Windows 10
|
||||||
static bool isRunningOnWindows10();
|
static bool isRunningOnWindows10();
|
||||||
|
|
||||||
//! Running on Mac OS X platform?
|
//! Running on MacOS platform?
|
||||||
static bool isRunningOnMacOSXPlatform();
|
static bool isRunningOnMacOSPlatform();
|
||||||
|
|
||||||
//! Running on Linux platform?
|
//! Running on Linux platform?
|
||||||
static bool isRunningOnLinuxPlatform();
|
static bool isRunningOnLinuxPlatform();
|
||||||
|
|||||||
@@ -532,8 +532,8 @@ namespace BlackCore
|
|||||||
QLatin1String(" Unix: ") %
|
QLatin1String(" Unix: ") %
|
||||||
boolToYesNo(CBuildConfig::isRunningOnUnixPlatform()) %
|
boolToYesNo(CBuildConfig::isRunningOnUnixPlatform()) %
|
||||||
separator %
|
separator %
|
||||||
QLatin1String("MacOSX: ") %
|
QLatin1String("MacOS: ") %
|
||||||
boolToYesNo(CBuildConfig::isRunningOnMacOSXPlatform());
|
boolToYesNo(CBuildConfig::isRunningOnMacOSPlatform());
|
||||||
|
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#if defined(Q_CC_MSVC) || defined(Q_OS_OSX) // Crashpad only supported on MSVC and MacOS/X
|
#if defined(Q_CC_MSVC) || defined(Q_OS_MACOS) // Crashpad only supported on MSVC and MacOS/X
|
||||||
#define BLACK_USE_CRASHPAD
|
#define BLACK_USE_CRASHPAD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace BlackGui
|
|||||||
// Use datarefs Sim/operation/windows/system window via xswiftbus to grab the OS's native window handle
|
// Use datarefs Sim/operation/windows/system window via xswiftbus to grab the OS's native window handle
|
||||||
// http://www.xsquawkbox.net/xpsdk/mediawiki/sim%252Foperation%252Fwindows%252Fsystem_window
|
// http://www.xsquawkbox.net/xpsdk/mediawiki/sim%252Foperation%252Fwindows%252Fsystem_window
|
||||||
// For the time being, use IWindowFinder.
|
// For the time being, use IWindowFinder.
|
||||||
// The if condition is to prevent a crash on Linux/OSX.
|
// The if condition is to prevent a crash on Linux/MacOS.
|
||||||
if (!m_windowFinder.isNull()) simulatorWindow = m_windowFinder->findForeignWindow("X-System", "");
|
if (!m_windowFinder.isNull()) simulatorWindow = m_windowFinder->findForeignWindow("X-System", "");
|
||||||
|
|
||||||
return simulatorWindow;
|
return simulatorWindow;
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
specific = fn + ".win" + qss;
|
specific = fn + ".win" + qss;
|
||||||
}
|
}
|
||||||
else if (CBuildConfig::isRunningOnMacOSXPlatform())
|
else if (CBuildConfig::isRunningOnMacOSPlatform())
|
||||||
{
|
{
|
||||||
specific = fn + ".mac" + qss;
|
specific = fn + ".mac" + qss;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
#include "win/windowfinderwindows.h"
|
#include "win/windowfinderwindows.h"
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
#else
|
#else
|
||||||
#error "Platform is not supported!"
|
#error "Platform is not supported!"
|
||||||
#endif
|
#endif
|
||||||
@@ -28,7 +28,7 @@ namespace BlackGui
|
|||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
finder = new CWindowFinderWindows();
|
finder = new CWindowFinderWindows();
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return finder;
|
return finder;
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ unix:!macx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
macx {
|
macx {
|
||||||
HEADERS += $$PWD/osx/*.h
|
HEADERS += $$PWD/macos/*.h
|
||||||
SOURCES += $$PWD/osx/*.cpp
|
SOURCES += $$PWD/macos/*.cpp
|
||||||
OBJECTIVE_SOURCES += $$PWD/osx/*.mm
|
OBJECTIVE_SOURCES += $$PWD/macos/*.mm
|
||||||
LIBS += -framework CoreFoundation -framework ApplicationServices -framework Foundation -framework AppKit
|
LIBS += -framework CoreFoundation -framework ApplicationServices -framework Foundation -framework AppKit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
#include "win/joystickwindows.h"
|
#include "win/joystickwindows.h"
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
#include "linux/joysticklinux.h"
|
#include "linux/joysticklinux.h"
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
#include "osx/joystickmac.h"
|
#include "macos/joystickmacos.h"
|
||||||
#else
|
#else
|
||||||
#error "Platform is not supported!"
|
#error "Platform is not supported!"
|
||||||
#endif
|
#endif
|
||||||
@@ -33,8 +33,8 @@ namespace BlackInput
|
|||||||
std::unique_ptr<IJoystick> ptr(new CJoystickWindows(parent));
|
std::unique_ptr<IJoystick> ptr(new CJoystickWindows(parent));
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
std::unique_ptr<IJoystick> ptr(new CJoystickLinux(parent));
|
std::unique_ptr<IJoystick> ptr(new CJoystickLinux(parent));
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
std::unique_ptr<IJoystick> ptr(new CJoystickMac(parent));
|
std::unique_ptr<IJoystick> ptr(new CJoystickMacOS(parent));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
#include "win/keyboardwindows.h"
|
#include "win/keyboardwindows.h"
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
#include "linux/keyboardlinux.h"
|
#include "linux/keyboardlinux.h"
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
#include "osx/keyboardmac.h"
|
#include "macos/keyboardmacos.h"
|
||||||
#else
|
#else
|
||||||
#error "Platform is not supported!"
|
#error "Platform is not supported!"
|
||||||
#endif
|
#endif
|
||||||
@@ -29,8 +29,8 @@ namespace BlackInput
|
|||||||
std::unique_ptr<IKeyboard> ptr(new CKeyboardWindows(parent));
|
std::unique_ptr<IKeyboard> ptr(new CKeyboardWindows(parent));
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
std::unique_ptr<IKeyboard> ptr(new CKeyboardLinux(parent));
|
std::unique_ptr<IKeyboard> ptr(new CKeyboardLinux(parent));
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
std::unique_ptr<IKeyboard> ptr(new CKeyboardMac(parent));
|
std::unique_ptr<IKeyboard> ptr(new CKeyboardMacOS(parent));
|
||||||
#endif
|
#endif
|
||||||
ptr->init();
|
ptr->init();
|
||||||
return ptr;
|
return ptr;
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "joystickmac.h"
|
#include "joystickmacos.h"
|
||||||
|
|
||||||
using namespace BlackMisc::Input;
|
using namespace BlackMisc::Input;
|
||||||
|
|
||||||
namespace BlackInput
|
namespace BlackInput
|
||||||
{
|
{
|
||||||
CJoystickMac::CJoystickMac(QObject *parent) :
|
CJoystickMacOS::CJoystickMacOS(QObject *parent) :
|
||||||
IJoystick(parent)
|
IJoystick(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CJoystickMac::~CJoystickMac()
|
CJoystickMacOS::~CJoystickMacOS()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BLACKINPUT_JOYSTICKMAC_H
|
#ifndef BLACKINPUT_JOYSTICKMACOS_H
|
||||||
#define BLACKINPUT_JOYSTICKMAC_H
|
#define BLACKINPUT_JOYSTICKMACOS_H
|
||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
@@ -18,30 +18,30 @@
|
|||||||
|
|
||||||
namespace BlackInput
|
namespace BlackInput
|
||||||
{
|
{
|
||||||
//! OSX implemenation of IJoystick
|
//! MacOS implemenation of IJoystick
|
||||||
//! \todo Not implmeneted yet
|
//! \todo Not implmeneted yet
|
||||||
class CJoystickMac : public IJoystick
|
class CJoystickMacOS : public IJoystick
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Copy Constructor
|
//! Copy Constructor
|
||||||
CJoystickMac(CJoystickMac const &) = delete;
|
CJoystickMacOS(CJoystickMacOS const &) = delete;
|
||||||
|
|
||||||
//! Assignment operator
|
//! Assignment operator
|
||||||
CJoystickMac &operator=(CJoystickMac const &) = delete;
|
CJoystickMacOS &operator=(CJoystickMacOS const &) = delete;
|
||||||
|
|
||||||
//! \brief Destructor
|
//! \brief Destructor
|
||||||
virtual ~CJoystickMac();
|
virtual ~CJoystickMacOS();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class IJoystick;
|
friend class IJoystick;
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
CJoystickMac(QObject *parent = nullptr);
|
CJoystickMacOS(QObject *parent = nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace BlackInput
|
} // namespace BlackInput
|
||||||
|
|
||||||
#endif // BLACKINPUT_JOYSTICKMAC_H
|
#endif // BLACKINPUT_JOYSTICKMACOS_H
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKINPUT_KEYBOARD_MAC_H
|
#ifndef BLACKINPUT_KEYBOARDMACOS_H
|
||||||
#define BLACKINPUT_KEYBOARD_MAC_H
|
#define BLACKINPUT_KEYBOARDMACOS_H
|
||||||
|
|
||||||
#include "blackinput/keyboard.h"
|
#include "blackinput/keyboard.h"
|
||||||
#include "blackmisc/input/hotkeycombination.h"
|
#include "blackmisc/input/hotkeycombination.h"
|
||||||
@@ -19,20 +19,20 @@
|
|||||||
|
|
||||||
namespace BlackInput
|
namespace BlackInput
|
||||||
{
|
{
|
||||||
//! Mac OSX implemenation of IKeyboard using hook procedure
|
//! MacOS implemenation of IKeyboard using hook procedure
|
||||||
class CKeyboardMac : public IKeyboard
|
class CKeyboardMacOS : public IKeyboard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//! Copy Constructor
|
//! Copy Constructor
|
||||||
CKeyboardMac(CKeyboardMac const&) = delete;
|
CKeyboardMacOS(CKeyboardMacOS const&) = delete;
|
||||||
|
|
||||||
//! Assignment operator
|
//! Assignment operator
|
||||||
CKeyboardMac &operator=(CKeyboardMac const&) = delete;
|
CKeyboardMacOS &operator=(CKeyboardMacOS const&) = delete;
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CKeyboardMac();
|
virtual ~CKeyboardMacOS();
|
||||||
|
|
||||||
//! Process key event
|
//! Process key event
|
||||||
virtual void processKeyEvent(CGEventType type, CGEventRef event);
|
virtual void processKeyEvent(CGEventType type, CGEventRef event);
|
||||||
@@ -47,7 +47,7 @@ namespace BlackInput
|
|||||||
friend class IKeyboard;
|
friend class IKeyboard;
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CKeyboardMac(QObject *parent = nullptr);
|
CKeyboardMacOS(QObject *parent = nullptr);
|
||||||
BlackMisc::Input::KeyCode convertToKey(int keyCode);
|
BlackMisc::Input::KeyCode convertToKey(int keyCode);
|
||||||
|
|
||||||
static CGEventRef myCGEventCallback(CGEventTapProxy proxy,
|
static CGEventRef myCGEventCallback(CGEventTapProxy proxy,
|
||||||
@@ -60,4 +60,4 @@ namespace BlackInput
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BLACKINPUT_KEYBOARD_MAC_H
|
#endif // BLACKINPUT_KEYBOARDMACOS_H
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "keyboardmac.h"
|
#include "keyboardmacos.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
@@ -63,16 +63,16 @@ namespace BlackInput
|
|||||||
{ kVK_ANSI_Z, Key_Z },
|
{ kVK_ANSI_Z, Key_Z },
|
||||||
};
|
};
|
||||||
|
|
||||||
CKeyboardMac::CKeyboardMac(QObject *parent) :
|
CKeyboardMacOS::CKeyboardMacOS(QObject *parent) :
|
||||||
IKeyboard(parent)
|
IKeyboard(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CKeyboardMac::~CKeyboardMac()
|
CKeyboardMacOS::~CKeyboardMacOS()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CKeyboardMac::init()
|
bool CKeyboardMacOS::init()
|
||||||
{
|
{
|
||||||
// 10.9 and later
|
// 10.9 and later
|
||||||
const void *keys[] = { kAXTrustedCheckOptionPrompt };
|
const void *keys[] = { kAXTrustedCheckOptionPrompt };
|
||||||
@@ -114,7 +114,7 @@ namespace BlackInput
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CKeyboardMac::processKeyEvent(CGEventType type,
|
void CKeyboardMacOS::processKeyEvent(CGEventType type,
|
||||||
CGEventRef event)
|
CGEventRef event)
|
||||||
{
|
{
|
||||||
BlackMisc::Input::CHotkeyCombination oldCombination(m_keyCombination);
|
BlackMisc::Input::CHotkeyCombination oldCombination(m_keyCombination);
|
||||||
@@ -191,21 +191,21 @@ namespace BlackInput
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyCode CKeyboardMac::convertToKey(int keyCode)
|
KeyCode CKeyboardMacOS::convertToKey(int keyCode)
|
||||||
{
|
{
|
||||||
return keyMapping.value(keyCode, Key_Unknown);
|
return keyMapping.value(keyCode, Key_Unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGEventRef CKeyboardMac::myCGEventCallback(CGEventTapProxy,
|
CGEventRef CKeyboardMacOS::myCGEventCallback(CGEventTapProxy,
|
||||||
CGEventType type,
|
CGEventType type,
|
||||||
CGEventRef event,
|
CGEventRef event,
|
||||||
void *refcon)
|
void *refcon)
|
||||||
{
|
{
|
||||||
|
|
||||||
CKeyboardMac *keyboardMac = static_cast<CKeyboardMac*>(refcon);
|
CKeyboardMacOS *keyboardMac = static_cast<CKeyboardMacOS*>(refcon);
|
||||||
if (type == kCGEventTapDisabledByTimeout)
|
if (type == kCGEventTapDisabledByTimeout)
|
||||||
{
|
{
|
||||||
BlackMisc::CLogMessage(static_cast<CKeyboardMac *>(nullptr)).warning("Event tap got disabled by timeout. Enable it again.");
|
BlackMisc::CLogMessage(static_cast<CKeyboardMacOS *>(nullptr)).warning("Event tap got disabled by timeout. Enable it again.");
|
||||||
CGEventTapEnable(keyboardMac->m_eventTap, true);
|
CGEventTapEnable(keyboardMac->m_eventTap, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -59,9 +59,14 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (!p.contains("linux", Qt::CaseInsensitive)) continue;
|
if (!p.contains("linux", Qt::CaseInsensitive)) continue;
|
||||||
}
|
}
|
||||||
else if (CBuildConfig::isRunningOnMacOSXPlatform())
|
else if (CBuildConfig::isRunningOnMacOSPlatform())
|
||||||
{
|
{
|
||||||
if (!(p.contains("mac", Qt::CaseInsensitive) || p.contains("osx", Qt::CaseInsensitive))) continue;
|
if (!(p.contains("mac", Qt::CaseInsensitive) ||
|
||||||
|
p.contains("macos", Qt::CaseInsensitive) ||
|
||||||
|
p.contains("osx", Qt::CaseInsensitive)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
reduced << p;
|
reduced << p;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ namespace BlackMisc
|
|||||||
Q_ASSERT_X(CBuildConfig::isKnownExecutableName(executable), Q_FUNC_INFO, "Unknown exectuable");
|
Q_ASSERT_X(CBuildConfig::isKnownExecutableName(executable), Q_FUNC_INFO, "Unknown exectuable");
|
||||||
|
|
||||||
QString s = CFileUtils::appendFilePaths(CDirectoryUtils::binDirectory(), executable);
|
QString s = CFileUtils::appendFilePaths(CDirectoryUtils::binDirectory(), executable);
|
||||||
if (CBuildConfig::isRunningOnMacOSXPlatform())
|
if (CBuildConfig::isRunningOnMacOSPlatform())
|
||||||
{
|
{
|
||||||
// Mac OSX bundle may or may not be a bundle
|
// MacOS bundle may or may not be a bundle
|
||||||
const QDir dir(s + QLatin1String(".app/Contents/MacOS"));
|
const QDir dir(s + QLatin1String(".app/Contents/MacOS"));
|
||||||
if (dir.exists())
|
if (dir.exists())
|
||||||
{
|
{
|
||||||
@@ -82,9 +82,9 @@ namespace BlackMisc
|
|||||||
return appDir;
|
return appDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDirectoryUtils::isMacOSXAppBundle()
|
bool CDirectoryUtils::isMacOSAppBundle()
|
||||||
{
|
{
|
||||||
static const bool appBundle = CBuildConfig::isRunningOnMacOSXPlatform() &&
|
static const bool appBundle = CBuildConfig::isRunningOnMacOSPlatform() &&
|
||||||
qApp->applicationDirPath().contains("Contents/MacOS", Qt::CaseInsensitive);
|
qApp->applicationDirPath().contains("Contents/MacOS", Qt::CaseInsensitive);
|
||||||
return appBundle;
|
return appBundle;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ namespace BlackMisc
|
|||||||
//! swift application data sub directories
|
//! swift application data sub directories
|
||||||
static QStringList applicationDataDirectoryList(bool withoutCurrent = false, bool beautify = false);
|
static QStringList applicationDataDirectoryList(bool withoutCurrent = false, bool beautify = false);
|
||||||
|
|
||||||
//! Is MacOSX application bundle?
|
//! Is MacOS application bundle?
|
||||||
//! \remark: Means the currently running executable is a MacOSX bundle, but not all our executables are bundles on MacOSX
|
//! \remark: Means the currently running executable is a MacOS bundle, but not all our executables are bundles on MacOS
|
||||||
static bool isMacOSXAppBundle();
|
static bool isMacOSAppBundle();
|
||||||
|
|
||||||
//! swift application data directory for one specific installation (a version)
|
//! swift application data directory for one specific installation (a version)
|
||||||
static const QString &normalizedApplicationDataDirectory();
|
static const QString &normalizedApplicationDataDirectory();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#if defined(Q_OS_OSX)
|
#if defined(Q_OS_MACOS)
|
||||||
#include <libproc.h>
|
#include <libproc.h>
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@@ -33,7 +33,7 @@ namespace BlackMisc
|
|||||||
QString path = QFileInfo(QString("/proc/%1/exe").arg(pid)).symLinkTarget();
|
QString path = QFileInfo(QString("/proc/%1/exe").arg(pid)).symLinkTarget();
|
||||||
return QFileInfo(path).fileName();
|
return QFileInfo(path).fileName();
|
||||||
}
|
}
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
QString CProcessInfo::processNameFromId(qint64 pid)
|
QString CProcessInfo::processNameFromId(qint64 pid)
|
||||||
{
|
{
|
||||||
char name[1024];
|
char name[1024];
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
// Change QSharedPointer<QCoreApplication> to QSharedPointer<QApplication> below
|
// Change QSharedPointer<QCoreApplication> to QSharedPointer<QApplication> below
|
||||||
// in case you want to have Qt Gui components inside a X-Plane plugin. The current
|
// in case you want to have Qt Gui components inside a X-Plane plugin. The current
|
||||||
// default was used since QApplication causes an infinite loop in X-Plane on OSX
|
// default was used since QApplication causes an infinite loop in X-Plane on MacOS
|
||||||
// platforms. X-Plane is allocating an NSApplication but never calling run(), rather
|
// platforms. X-Plane is allocating an NSApplication but never calling run(), rather
|
||||||
// it controls the main loop itself and pumps the event Q as needed. This causes
|
// it controls the main loop itself and pumps the event Q as needed. This causes
|
||||||
// unusual start conditions for QCocoaEventDispatcher and ends up in the infinite
|
// unusual start conditions for QCocoaEventDispatcher and ends up in the infinite
|
||||||
|
|||||||
Reference in New Issue
Block a user