X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fgraphicalui.h;h=42b5785287bd82db7c359bcf4bc20cf2ac234886;hp=11248d944b7bf63e4dbf8de2c048fd810e6fd4b8;hb=158443f71d48215eea8b47b836b61afd77654b78;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/uisupport/graphicalui.h b/src/uisupport/graphicalui.h index 11248d94..42b57852 100644 --- a/src/uisupport/graphicalui.h +++ b/src/uisupport/graphicalui.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 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 * @@ -15,31 +15,33 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 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; class ToolBarActionProvider; class UiStyle; -#ifdef Q_WS_WIN +#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_WS_WIN +#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