X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fgraphicalui.h;h=42b5785287bd82db7c359bcf4bc20cf2ac234886;hp=e35b3cec2a3ad95c288c1d87a8257e5e4d5c38b2;hb=158443f71d48215eea8b47b836b61afd77654b78;hpb=e50ae7a06fc4e5d3a911c361d30953410deab609 diff --git a/src/uisupport/graphicalui.h b/src/uisupport/graphicalui.h index e35b3cec..42b57852 100644 --- a/src/uisupport/graphicalui.h +++ b/src/uisupport/graphicalui.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,10 +18,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef GRAPHICALUI_H_ -#define GRAPHICALUI_H_ +#pragma once + +#include "uisupport-export.h" #include "abstractui.h" +#include "singleton.h" class ActionCollection; class ContextMenuActionProvider; @@ -31,15 +33,15 @@ class UiStyle; #ifdef Q_OS_WIN # include #endif +#ifdef Q_OS_MAC +#include +#endif -class GraphicalUi : public AbstractUi +class UISUPPORT_EXPORT GraphicalUi : public AbstractUi, protected Singleton { Q_OBJECT public: - GraphicalUi(QObject *parent = 0); - virtual void init(); - //! Access global ActionCollections. /** These ActionCollections are associated with the main window, i.e. they contain global * actions (and thus, shortcuts). Widgets providing application-wide shortcuts should @@ -75,6 +77,9 @@ public: static bool isMainWidgetVisible(); protected: + GraphicalUi(QObject *parent = nullptr); + void init() override; + //! This is the widget we associate global actions with, typically the main window void setMainWidget(QWidget *); @@ -100,35 +105,31 @@ protected: void setToolBarActionProvider(ToolBarActionProvider *); void setUiStyle(UiStyle *); - virtual bool eventFilter(QObject *obj, QEvent *event); + bool eventFilter(QObject *obj, QEvent *event) override; protected slots: - virtual void disconnectedFromCore(); + void disconnectedFromCore() override; private: - static inline GraphicalUi *instance(); - - static GraphicalUi *_instance; static QWidget *_mainWidget; static QHash _actionCollections; static ContextMenuActionProvider *_contextMenuActionProvider; static ToolBarActionProvider *_toolBarActionProvider; static UiStyle *_uiStyle; - static bool _onAllDesktops; #ifdef Q_OS_WIN DWORD _dwTickCount; #endif +#ifdef Q_OS_MAC + ProcessSerialNumber _procNum; +#endif }; // inlines -GraphicalUi *GraphicalUi::instance() { return _instance; } ContextMenuActionProvider *GraphicalUi::contextMenuActionProvider() { return _contextMenuActionProvider; } ToolBarActionProvider *GraphicalUi::toolBarActionProvider() { return _toolBarActionProvider; } UiStyle *GraphicalUi::uiStyle() { return _uiStyle; } QWidget *GraphicalUi::mainWidget() { return _mainWidget; } bool GraphicalUi::isHidingMainWidgetAllowed() const { return false; } - -#endif