diff --git a/OpenBoard.pro b/OpenBoard.pro index d3346436..7674b5de 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -161,6 +161,8 @@ win32 { } macx { + DEFINES += Q_WS_MACX + LIBS += -framework Foundation LIBS += -framework Cocoa LIBS += -framework Carbon @@ -169,11 +171,23 @@ macx { LIBS += -lcrypto LIBS += -L/usr/local/opt/openssl/lib - LIBS += -L/usr/local/opt/quazip/lib -lquazip + + # quazip depends on QT. Current is 5.14, so if you wish to build + # OB using a previous QT version, you have to build your own quazip, + # otherwise it won't link. + equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 14) { + LIBS += "-L../OpenBoard-ThirdParty/quazip/lib/macx" "-lquazip" + } else { + LIBS += -L/usr/local/opt/quazip/lib -lquazip + } LIBS += -L/usr/local/opt/ffmpeg/lib INCLUDEPATH += /usr/local/opt/openssl/include INCLUDEPATH += /usr/local/opt/ffmpeg/include - INCLUDEPATH += /usr/local/opt/quazip/include/quazip + equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 14) { + INCLUDEPATH += ../OpenBoard-ThirdParty/quazip/quazip-0.7.1 + } else { + INCLUDEPATH += /usr/local/opt/quazip/include/quazip + } LIBS += -L/usr/local/opt/poppler/lib -lpoppler INCLUDEPATH += /usr/local/opt/poppler/include diff --git a/src/api/UBLibraryAPI.h b/src/api/UBLibraryAPI.h index 0c0f0d1d..b11c07ef 100644 --- a/src/api/UBLibraryAPI.h +++ b/src/api/UBLibraryAPI.h @@ -31,7 +31,6 @@ #define UBLIBRARYAPI_H_ #include -#include #include class UBLibraryAPI : public QObject diff --git a/src/api/UBW3CWidgetAPI.cpp b/src/api/UBW3CWidgetAPI.cpp index 6228f511..cf858628 100644 --- a/src/api/UBW3CWidgetAPI.cpp +++ b/src/api/UBW3CWidgetAPI.cpp @@ -30,7 +30,6 @@ #include "UBW3CWidgetAPI.h" #include -#include #include "core/UBApplication.h" #include "core/UBApplicationController.h" diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 8c172fe0..a301017d 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -30,7 +30,6 @@ #include "UBBoardController.h" #include -#include #include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBPlatformUtils.h" diff --git a/src/board/UBBoardPaletteManager.h b/src/board/UBBoardPaletteManager.h index 74f07a31..d5a54707 100644 --- a/src/board/UBBoardPaletteManager.h +++ b/src/board/UBBoardPaletteManager.h @@ -31,7 +31,6 @@ #define UBBOARDPALETTEMANAGER_H_ #include -#include #include "gui/UBLeftPalette.h" #include "gui/UBRightPalette.h" diff --git a/src/core/UB.h b/src/core/UB.h index 4ad8701b..86f9691a 100644 --- a/src/core/UB.h +++ b/src/core/UB.h @@ -35,6 +35,10 @@ #define UB_MAX_ZOOM 9 +#if defined(Q_OS_LINUX) || (defined(Q_OS_OSX) && (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))) +#define UB_REQUIRES_MASK_UPDATE 1 +#endif + struct UBMimeType { enum Enum diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 709aa678..b189c3b8 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -30,7 +30,6 @@ #include "UBApplication.h" #include -#include #include #include #include diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 0f991c13..6588f645 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -84,18 +84,9 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); #ifdef Q_OS_OSX mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); - /* https://bugreports.qt.io/browse/QTBUG-81456 */ - if (QOperatingSystemVersion::current().minorVersion() > 12) /* > Sierra */ - { - mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnBottomHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint); - } - else - { - mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint); - } -#else +#endif //Q_OS_OSX + mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint); -#endif mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone); mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height()); @@ -121,7 +112,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); -#ifdef Q_OS_LINUX +#ifdef UB_REQUIRES_MASK_UPDATE connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(refreshMask())); connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask())); @@ -176,7 +167,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB connect(&mHoldTimerMarker, SIGNAL(timeout()), this, SLOT(markerActionReleased())); connect(&mHoldTimerEraser, SIGNAL(timeout()), this, SLOT(eraserActionReleased())); -#ifdef Q_OS_LINUX +#ifdef UB_REQUIRES_MASK_UPDATE connect(mDesktopPalette, SIGNAL(moving()), this, SLOT(refreshMask())); connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask())); connect(UBApplication::boardController->paletteManager()->addItemPalette(), SIGNAL(closed()), this, SLOT(refreshMask())); @@ -356,9 +347,9 @@ void UBDesktopAnnotationController::showWindow() mDesktopPalette->appear(); -#ifdef Q_OS_LINUX +#ifdef UB_REQUIRES_MASK_UPDATE updateMask(true); -#endif +#endif // UB_REQUIRES_MASK_UPDATE } @@ -401,9 +392,9 @@ void UBDesktopAnnotationController::updateBackground() || UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Selector) { newBrush = QBrush(Qt::transparent); -#ifdef Q_OS_LINUX +#ifdef UB_REQUIRES_MASK_UPDATE updateMask(true); -#endif +#endif //UB_REQUIRES_MASK_UPDATE } else { @@ -412,9 +403,9 @@ void UBDesktopAnnotationController::updateBackground() #else newBrush = QBrush(QColor(127, 127, 127, 1)); #endif -#ifdef Q_OS_LINUX +#ifdef UB_REQUIRES_MASK_UPDATE updateMask(false); -#endif +#endif //UB_REQUIRES_MASK_UPDATE } if (mTransparentDrawingScene && mTransparentDrawingScene->backgroundBrush() != newBrush) @@ -920,7 +911,6 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) p.drawRect(tabsPalette); } -#ifdef Q_OS_LINUX //Rquiered only for compiz wm //TODO. Window manager detection screen @@ -928,7 +918,6 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) p.drawRect(UBApplication::boardController->paletteManager()->addItemPalette()->geometry()); } -#endif p.end(); diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index 5fa9c1cf..2346e4ac 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -173,7 +173,7 @@ void UBDesktopPalette::minimizeMe(eMinimizedLocation location) adjustSizeAndPosition(); -#ifdef Q_OS_LINUX +#ifdef UB_REQUIRES_MASK_UPDATE emit refreshMask(); #endif } @@ -203,7 +203,7 @@ void UBDesktopPalette::maximizeMe() // Notify that the maximization has been done emit maximized(); -#ifdef Q_OS_LINUX +#ifdef UB_REQUIRES_MASK_UPDATE emit refreshMask(); #endif } diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 4dd7725a..a2a654a5 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -30,7 +30,6 @@ #include "UBGraphicsScene.h" #include -#include #include #include #include @@ -2805,6 +2804,8 @@ void UBGraphicsScene::simplifyCurrentStroke() } + + void UBGraphicsScene::setDocumentUpdated() { if (document()) diff --git a/src/domain/UBGraphicsWidgetItem.h b/src/domain/UBGraphicsWidgetItem.h index 68336a89..34eef785 100644 --- a/src/domain/UBGraphicsWidgetItem.h +++ b/src/domain/UBGraphicsWidgetItem.h @@ -31,7 +31,6 @@ #define UBGRAPHICSWIDGETITEM_H #include -#include #include #include diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index f39fccad..9129f724 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -88,6 +88,7 @@ void UBPlatformUtils::setDesktopMode(bool desktop) { @try { +#if defined(Q_OS_OSX) && (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) // temporarily disabled due to bug: when switching to desktop mode (and calling this), // openboard switches right back to the board mode. clicking again on desktop mode works. if (desktop) { @@ -95,6 +96,9 @@ void UBPlatformUtils::setDesktopMode(bool desktop) } else [NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock]; +#else // QT_VERSION_CHECK(5, 10, 0) + [NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock]; +#endif // QT_VERSION_CHECK(5, 10, 0) } @catch(NSException * exception) { @@ -526,6 +530,7 @@ QString UBPlatformUtils::urlFromClipboard() void UBPlatformUtils::toggleFinder(const bool on) { +#if defined(Q_OS_OSX) && (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) if (on) { [NSApp setPresentationOptions:NSApplicationPresentationDefault]; @@ -534,6 +539,9 @@ void UBPlatformUtils::toggleFinder(const bool on) { [NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock]; } +#else // QT_VERSION_CHECK(5, 10, 0) + Q_UNUSED(on); +#endif //QT_VERSION_CHECK(5, 10, 0) } diff --git a/src/gui/UBFeaturesWidget.h b/src/gui/UBFeaturesWidget.h index 473e0113..e2ca1186 100644 --- a/src/gui/UBFeaturesWidget.h +++ b/src/gui/UBFeaturesWidget.h @@ -54,7 +54,6 @@ #include "api/UBWidgetUniboardAPI.h" #include "UBFeaturesActionBar.h" #include "UBRubberBand.h" -#include #include #include diff --git a/src/gui/UBMainWindow.h b/src/gui/UBMainWindow.h index 6cd1fc55..0c69973e 100644 --- a/src/gui/UBMainWindow.h +++ b/src/gui/UBMainWindow.h @@ -32,7 +32,6 @@ #include #include -#include #include #include "UBDownloadWidget.h" diff --git a/src/network/UBCookieJar.cpp b/src/network/UBCookieJar.cpp index d9dc3d62..8fb2f79d 100644 --- a/src/network/UBCookieJar.cpp +++ b/src/network/UBCookieJar.cpp @@ -75,8 +75,7 @@ #include "core/UBSettings.h" #include -#include - +#include #include "core/memcheck.h" static const unsigned int JAR_VERSION = 23; diff --git a/src/pdf/XPDFRenderer.h b/src/pdf/XPDFRenderer.h index c62839a5..d1760e74 100644 --- a/src/pdf/XPDFRenderer.h +++ b/src/pdf/XPDFRenderer.h @@ -94,6 +94,7 @@ class XPDFRenderer : public PDFRenderer void init(); struct PdfZoomCacheData { + PdfZoomCacheData() : splashBitmap(nullptr), cachedPageNumber(-1), splash(nullptr), ratio(1.0), hasToBeProcessed(false) {}; PdfZoomCacheData(double const a_ratio) : splashBitmap(nullptr), cachedPageNumber(-1), splash(nullptr), ratio(a_ratio), hasToBeProcessed(false) {}; ~PdfZoomCacheData() {}; SplashBitmap* splashBitmap; diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index c7fd00f0..f47bac80 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "frameworks/UBPlatformUtils.h" diff --git a/src/web/UBWebController.h b/src/web/UBWebController.h index 0f6f305d..edb8554c 100644 --- a/src/web/UBWebController.h +++ b/src/web/UBWebController.h @@ -31,7 +31,6 @@ #define UBWEBCONTROLLER_H_ #include -#include #include #include "UBOEmbedParser.h" diff --git a/src/web/UBWebKitUtils.h b/src/web/UBWebKitUtils.h index 85c7900b..d6683b13 100644 --- a/src/web/UBWebKitUtils.h +++ b/src/web/UBWebKitUtils.h @@ -30,7 +30,8 @@ #ifndef UBWEBKITUTILS_H_ #define UBWEBKITUTILS_H_ -#include +// Forward declarations. +class QWebFrame; class UBWebKitUtils { diff --git a/src/web/browser/WBBrowserWindow.cpp b/src/web/browser/WBBrowserWindow.cpp index 252ab9da..6b7ca6b9 100644 --- a/src/web/browser/WBBrowserWindow.cpp +++ b/src/web/browser/WBBrowserWindow.cpp @@ -71,7 +71,7 @@ #include "WBBrowserWindow.h" #include -#include +#include #include #include "core/UBSettings.h" diff --git a/src/web/browser/WBBrowserWindow.h b/src/web/browser/WBBrowserWindow.h index 6e60bca9..80926e3b 100644 --- a/src/web/browser/WBBrowserWindow.h +++ b/src/web/browser/WBBrowserWindow.h @@ -72,7 +72,6 @@ #define WBBROWSERMAINWINDOW_H #include -#include class WBChaseWidget; class WBTabWidget; diff --git a/src/web/browser/WBDownloadManager.cpp b/src/web/browser/WBDownloadManager.cpp index 7036325b..869283db 100644 --- a/src/web/browser/WBDownloadManager.cpp +++ b/src/web/browser/WBDownloadManager.cpp @@ -71,8 +71,8 @@ #include "WBDownloadManager.h" #include -#include #include +#include #include "network/UBAutoSaver.h" #include "network/UBNetworkAccessManager.h" diff --git a/src/web/browser/WBHistory.cpp b/src/web/browser/WBHistory.cpp index 7d8cf80f..3412aa36 100644 --- a/src/web/browser/WBHistory.cpp +++ b/src/web/browser/WBHistory.cpp @@ -73,7 +73,7 @@ #include "WBBrowserWindow.h" #include -#include +#include #include "core/UBSettings.h" #include "network/UBAutoSaver.h" diff --git a/src/web/browser/WBHistory.h b/src/web/browser/WBHistory.h index ffa566ee..e6626963 100644 --- a/src/web/browser/WBHistory.h +++ b/src/web/browser/WBHistory.h @@ -74,7 +74,7 @@ #include "WBModelMenu.h" #include -#include +#include class WBHistoryItem { diff --git a/src/web/browser/WBTabWidget.h b/src/web/browser/WBTabWidget.h index 2f7baf57..9738fa35 100644 --- a/src/web/browser/WBTabWidget.h +++ b/src/web/browser/WBTabWidget.h @@ -118,8 +118,6 @@ class WBTabBar : public QTabBar QPoint mDragStartPos; }; -#include - class WBWebView; /*! diff --git a/src/web/browser/WBToolBarSearch.cpp b/src/web/browser/WBToolBarSearch.cpp index 5e0c1061..941f7d95 100644 --- a/src/web/browser/WBToolBarSearch.cpp +++ b/src/web/browser/WBToolBarSearch.cpp @@ -71,7 +71,6 @@ #include "WBToolBarSearch.h" #include -#include #include #include diff --git a/src/web/browser/WBWebTrapWebView.cpp b/src/web/browser/WBWebTrapWebView.cpp index 7f4070c5..8df0d4ca 100644 --- a/src/web/browser/WBWebTrapWebView.cpp +++ b/src/web/browser/WBWebTrapWebView.cpp @@ -30,7 +30,7 @@ #include "WBWebTrapWebView.h" #include -#include +#include #include #include diff --git a/src/web/browser/WBWebTrapWebView.h b/src/web/browser/WBWebTrapWebView.h index 70568309..035f4c8b 100644 --- a/src/web/browser/WBWebTrapWebView.h +++ b/src/web/browser/WBWebTrapWebView.h @@ -31,10 +31,8 @@ #define WBWEBTRAPWEBVIEW_H_ #include -#include #include - class WBWebTrapWebView : public QWebView { Q_OBJECT; diff --git a/src/web/browser/WBWebView.cpp b/src/web/browser/WBWebView.cpp index 79db33dd..e413f7e8 100644 --- a/src/web/browser/WBWebView.cpp +++ b/src/web/browser/WBWebView.cpp @@ -82,7 +82,6 @@ #include "network/UBCookieJar.h" #include -#include #include #include #include diff --git a/src/web/browser/WBWebView.h b/src/web/browser/WBWebView.h index 480bbf8d..cca64fa3 100644 --- a/src/web/browser/WBWebView.h +++ b/src/web/browser/WBWebView.h @@ -72,7 +72,6 @@ #define WBWEBVIEW_H #include -#include #include "WBWebTrapWebView.h" #include "web/UBWebPage.h"