Commit 6997a8e8 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Use Q_OS_OSX instead of Q_OS_MAC

Waiting for the moment when Q_OS_OSX gets deprecated for Q_OS_MACOS...
parent 48f37a3b
......@@ -49,7 +49,7 @@ macro (KRITA_ADD_BENCHMARK _test_NAME)
# .bat because of rpath handling
set(_executable "${loc}.bat")
else()
if (Q_WS_MAC AND NOT _nogui)
if (Q_OS_OSX AND NOT _nogui)
set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}.app/Contents/MacOS/${_test_NAME})
else ()
# .shell because of rpath handling
......
......@@ -35,7 +35,7 @@
#include "kis_global.h"
#include <cmath>
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
#include <errno.h>
#endif
......@@ -318,7 +318,7 @@ void KisImageConfig::setLazyFrameCreationEnabled(bool value)
#include <sys/sysctl.h>
#elif defined Q_OS_WIN
#include <windows.h>
#elif defined Q_OS_MAC
#elif defined Q_OS_OSX
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
......@@ -364,7 +364,7 @@ int KisImageConfig::totalRAM()
# if defined ENV32BIT
totalMemory = qMin(totalMemory, 2000);
# endif
#elif defined Q_OS_MAC
#elif defined Q_OS_OSX
int mib[2] = { CTL_HW, HW_MEMSIZE };
u_int namelen = sizeof(mib) / sizeof(mib[0]);
uint64_t size;
......
......@@ -44,7 +44,7 @@ KoJsonTrader::KoJsonTrader()
QDir appDir(qApp->applicationDirPath());
appDir.cdUp();
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
// Help Krita run without deployment
QDir d(appDir);
d.cd("../../../");
......@@ -58,7 +58,7 @@ KoJsonTrader::KoJsonTrader()
Q_FOREACH (const QDir& dir, searchDirs) {
Q_FOREACH (QString entry, dir.entryList()) {
QFileInfo info(dir, entry);
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
if (info.isDir() && info.fileName().contains("PlugIns")) {
m_pluginPath = info.absoluteFilePath();
break;
......
......@@ -321,7 +321,7 @@ void KisApplication::loadPlugins()
bool KisApplication::start(const KisApplicationArguments &args)
{
#if defined(Q_OS_WIN) || defined (Q_OS_MAC)
#if defined(Q_OS_WIN) || defined (Q_OS_OSX)
#ifdef ENV32BIT
KisConfig cfg;
if (isWow64() && !cfg.readEntry("WarnedAbout32Bits", false)) {
......
......@@ -282,7 +282,7 @@ KisMainWindow::KisMainWindow()
qApp->setStartDragDistance(25); // 25 px is a distance that works well for Tablet and Mouse events
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
setUnifiedTitleAndToolBarOnMac(true);
#endif
......@@ -1892,7 +1892,7 @@ QDockWidget* KisMainWindow::createDockWidget(KoDockFactoryBase* factory)
dockWidget = d->dockWidgetsMap[factory->id()];
}
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
dockWidget->setAttribute(Qt::WA_MacSmallSize, true);
#endif
dockWidget->setFont(KoDockRegistry::dockFont());
......@@ -2162,7 +2162,7 @@ QPointer<KisView>KisMainWindow::activeKisView()
void KisMainWindow::newOptionWidgets(const QList<QPointer<QWidget> > &optionWidgetList)
{
Q_FOREACH (QWidget *w, optionWidgetList) {
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
w->setAttribute(Qt::WA_MacSmallSize, true);
#endif
w->setFont(KoDockRegistry::dockFont());
......
......@@ -79,7 +79,7 @@ KisQPainterCanvas::KisQPainterCanvas(KisCanvas2 *canvas, KisCoordinatesConverter
setAttribute(Qt::WA_InputMethodEnabled, true);
setAttribute(Qt::WA_StaticContents);
setAttribute(Qt::WA_OpaquePaintEvent);
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
setAttribute(Qt::WA_AcceptTouchEvents, false);
#else
setAttribute(Qt::WA_AcceptTouchEvents, true);
......
......@@ -347,7 +347,7 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
* Ignore delta 0 events on OSX, since they are triggered by tablet
* proximity when using Wacom devices.
*/
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
if(wheelEvent->delta() == 0) {
retval = true;
break;
......@@ -420,7 +420,7 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
stop_ignore_cursor_events();
break;
case QEvent::TabletRelease: {
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
stop_ignore_cursor_events();
#endif
// break_if_touch_blocked_press_events();
......@@ -485,7 +485,7 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
break;
case QEvent::TouchUpdate: {
QTouchEvent *tevent = static_cast<QTouchEvent*>(event);
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
int count = 0;
Q_FOREACH (const QTouchEvent::TouchPoint &point, tevent->touchPoints()) {
if (point.state() != Qt::TouchPointReleased) {
......@@ -504,7 +504,7 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
touch_start_block_press_events();
KisAbstractInputAction::setInputManager(this);
retval = d->matcher.touchUpdateEvent(tevent);
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
}
#endif
event->accept();
......
......@@ -91,7 +91,7 @@ bool KisInputManager::Private::EventEater::eventFilter(QObject* target, QEvent*
(hungry
// On Mac, we need mouse events when the tablet is in proximity, but not pressed down
// since tablet move events are not generated until after tablet press.
#ifndef Q_OS_MAC
#ifndef Q_OS_OSX
|| (eatSyntheticEvents && static_cast<QMouseEvent*>(event)->source() != Qt::MouseEventNotSynthesized)
#endif
)) {
......@@ -321,7 +321,7 @@ bool KisInputManager::Private::ProximityNotifier::eventFilter(QObject* object, Q
// Qt sends fake mouse events instead of hover events, so not very useful.
// Don't block mouse events on tablet since tablet move events are not generated until
// after tablet press.
#ifndef Q_OS_MAC
#ifndef Q_OS_OSX
d->blockMouseEvents();
#else
// Notify input manager that tablet proximity is entered for Genius tablets.
......@@ -331,7 +331,7 @@ bool KisInputManager::Private::ProximityNotifier::eventFilter(QObject* object, Q
case QEvent::TabletLeaveProximity:
d->debugEvent<QEvent, false>(event);
d->allowMouseEvents();
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
d->setTabletActive(false);
#endif
break;
......
......@@ -39,7 +39,7 @@
struct QTabletDeviceData
{
#ifndef Q_WS_MAC
#ifndef Q_OS_OSX
int minPressure;
int maxPressure;
int minTanPressure;
......@@ -54,7 +54,7 @@ struct QTabletDeviceData
int outOriginY, int outExtentY) const;
#endif
#if defined(HAVE_X11) || (defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA))
#if defined(HAVE_X11) || (defined(Q_OS_OSX) && !defined(QT_MAC_USE_COCOA))
QPointer<QWidget> widgetToGetPress;
#endif
......@@ -74,7 +74,7 @@ struct QTabletDeviceData
int xinput_button_release;
int xinput_proximity_in;
int xinput_proximity_out;
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_OSX)
quint64 tabletUniqueID;
int tabletDeviceType;
int tabletPointerType;
......@@ -82,7 +82,7 @@ struct QTabletDeviceData
#endif
// Added by Krita
#if defined(Q_OS_MAC) || defined(Q_OS_WIN32)
#if defined(Q_OS_OSX) || defined(Q_OS_WIN32)
QMap<quint8, quint8> buttonsMap;
qint64 llId;
int currentPointerType;
......@@ -195,7 +195,7 @@ static inline int sign(int x)
return x >= 0 ? 1 : -1;
}
#ifndef Q_WS_MAC
#ifndef Q_OS_OSX
inline QPointF QTabletDeviceData::scaleCoord(int coordX, int coordY,
int outOriginX, int outExtentX,
int outOriginY, int outExtentY) const
......
......@@ -185,7 +185,7 @@ bool KisOpenGL::needsPixmapCacheWorkaround()
void KisOpenGL::setDefaultFormat()
{
QSurfaceFormat format;
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
format.setVersion(3, 2);
format.setProfile(QSurfaceFormat::CoreProfile);
#else
......
......@@ -148,7 +148,7 @@ KisOpenGLCanvas2::KisOpenGLCanvas2(KisCanvas2 *canvas,
setFocusPolicy(Qt::StrongFocus);
setAttribute(Qt::WA_NoSystemBackground, true);
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
setAttribute(Qt::WA_AcceptTouchEvents, false);
#else
setAttribute(Qt::WA_AcceptTouchEvents, true);
......@@ -768,7 +768,7 @@ QRect KisOpenGLCanvas2::updateCanvasProjection(KisUpdateInfoSP info)
d->openGLImageTextures->recalculateCache(info);
}
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
/**
* There is a bug on OSX: if we issue frame redraw before the tiles finished
* uploading, the tiles will become corrupted. Depending on the GPU/driver
......
......@@ -76,7 +76,7 @@ namespace Sync {
#endif
k_glClientWaitSync = (kis_glClientWaitSync)ctx->getProcAddress("glClientWaitSync");
}
#elif defined Q_OS_LINUX || defined Q_OS_MAC
#elif defined Q_OS_LINUX || defined Q_OS_OSX
if (KisOpenGL::supportsFenceSync()) {
k_glFenceSync = (kis_glFenceSync)ctx->getProcAddress("glFenceSync");
k_glGetSynciv = (kis_glGetSynciv)ctx->getProcAddress("glGetSynciv");
......
......@@ -60,7 +60,7 @@ KisShaderProgram *KisOpenGLShaderLoader::loadShader(QString vertPath, QString fr
QByteArray vertSource;
// XXX Check can be removed and set to the MAC version after we move to Qt5.7
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
vertSource.append(KisOpenGL::hasOpenGL3() ? "#version 150 core\n" : "#version 120\n");
#else
vertSource.append(KisOpenGL::supportsLoD() ? "#version 130\n" : "#version 120\n");
......@@ -78,7 +78,7 @@ KisShaderProgram *KisOpenGLShaderLoader::loadShader(QString vertPath, QString fr
QByteArray fragSource;
// XXX Check can be removed and set to the MAC version after we move to Qt5.7
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
fragSource.append(KisOpenGL::hasOpenGL3() ? "#version 150 core\n" : "#version 120\n");
#else
fragSource.append(KisOpenGL::supportsLoD() ? "#version 130\n" : "#version 120\n");
......
......@@ -188,7 +188,7 @@ void ThemeManager::slotChangePalette()
//qDebug() << ">>>>>>>>>>>>>>>>>> going to set palette on app" << theme;
qApp->setPalette(palette);
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
if (theme == "Krita bright" || theme.isEmpty()) {
qApp->setStyle("Macintosh");
qApp->style()->polish(qApp);
......
......@@ -44,7 +44,7 @@ class KoZoomInput::Private
KoZoomInput::KoZoomInput(QWidget* parent)
: QStackedWidget(parent), d(new Private)
{
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
setAttribute(Qt::WA_MacMiniSize, true);
#endif
......
......@@ -80,14 +80,14 @@ static const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
static const Qt::CaseSensitivity cs = Qt::CaseSensitive;
#endif
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
#include <ApplicationServices/ApplicationServices.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
#endif
QString getInstallationPrefix() {
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
QString appPath = qApp->applicationDirPath();
debugWidgetUtils << "1" << appPath;
......@@ -343,7 +343,7 @@ QStringList KoResourcePaths::findDirsInternal(const QString &type)
QStandardPaths::locateAll(d->mapTypeToQStandardPaths(type), alias + '/', QStandardPaths::LocateDirectory);
appendResources(&dirs, aliasDirs, true);
#ifdef Q_OS_MAC
#ifdef Q_OS_OSX
debugWidgetUtils << "MAC:" << getApplicationRoot();
QStringList bundlePaths;
bundlePaths << getApplicationRoot() + "/share/krita/" + alias;
......
......@@ -572,7 +572,7 @@ void KKeySequenceWidgetPrivate::updateShortcutDisplay()
if (modifierKeys & Qt::META) {
s += KKeyServer::modToStringUser(Qt::META) + QLatin1Char('+');
}
#if defined(Q_OS_MAC)
#if defined(Q_OS_OSX)
if (modifierKeys & Qt::ALT) {
s += KKeyServer::modToStringUser(Qt::ALT) + QLatin1Char('+');
}
......
......@@ -1658,7 +1658,7 @@ void TextTool::keyPressEvent(QKeyEvent *event)
} else if (hit(item, KStandardShortcut::ForwardWord)) {
moveOperation = QTextCursor::WordRight;
}
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
// Don't reject "alt" key, it may be used for typing text on Mac OS
else if ((event->modifiers() & Qt::ControlModifier) || event->text().length() == 0) {
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment