2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 14:09:21 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
Add macOS touch bar support
Introduce a generic Utils::TouchBar that implements a touch bar for
macOS based on QAction. Touch bars can be nested, and one is set to be
the application's top level touch bar.
Also add an ActionContainer for the touch bar. That allows us to manage
the layout of the touch bar the same way we do with menus.
Since the touch bar is an input device with very limited space, a
command in the touch bar needs to be specifically styled for the touch
bar by setting either touchBarText or touchBarIcon (or both).
Touch bars can be nested by nesting the ActionContainers. A nested touch
bar ActionContainer needs to specify an icon and/or text to show in the
touch bar button that opens that sub-bar.
Commands are only shown in the touch bar if they are valid within the
current context.
Implementation-wise we cannot use the standard NSPopoverTouchBarItem for
nesting touch bar levels. We cannot hide items in the touch bar, because
hidden items still take up space in the touch bar. So we need to rebuild
the touch bar regularly. Since the items we show are very dynamic, every
time the items in the toplevel bar change because of a context change,
any opened sub-level touch bar closes. That is why we maintain a stack of
touch bar levels ourselves, replacing the main touch bar with the current
level, and managing opening and closing the levels manually.
This patch adds buttons for Help, Bookmarks, Header/Source, Follow
(Symbol), Decl/Def, and a sub-bar for the debugger actions.
Fixes: QTCREATORBUG-21263
Change-Id: Ib63e610f21a993f1d324fe23c83a7f2224f434ac
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-10-05 13:52:57 +02:00
|
|
|
#include <qglobal.h>
|
2016-10-17 12:17:51 +02:00
|
|
|
#include "reaper_p.h"
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <extensionsystem/iplugin.h>
|
|
|
|
|
|
2015-08-03 12:44:48 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QMenu;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
|
|
|
|
class PathChooser;
|
|
|
|
|
}
|
2014-11-14 09:53:44 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Core {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class EditMode;
|
|
|
|
|
class MainWindow;
|
2014-01-10 18:02:20 +01:00
|
|
|
class Locator;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
class CorePlugin : public ExtensionSystem::IPlugin
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2012-02-21 16:52:28 +01:00
|
|
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Core.json")
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CorePlugin();
|
2018-05-07 15:00:03 +02:00
|
|
|
~CorePlugin() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2018-08-31 16:00:32 +02:00
|
|
|
static CorePlugin *instance();
|
|
|
|
|
|
2018-05-07 17:34:42 +02:00
|
|
|
bool initialize(const QStringList &arguments, QString *errorMessage = nullptr) override;
|
2018-05-07 15:00:03 +02:00
|
|
|
void extensionsInitialized() override;
|
|
|
|
|
bool delayedInitialize() override;
|
|
|
|
|
ShutdownFlag aboutToShutdown() override;
|
2015-03-09 10:59:58 +02:00
|
|
|
QObject *remoteCommand(const QStringList & /* options */,
|
|
|
|
|
const QString &workingDirectory,
|
2018-05-07 15:00:03 +02:00
|
|
|
const QStringList &args) override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
public slots:
|
2009-12-14 18:01:39 +01:00
|
|
|
void fileOpenRequest(const QString&);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-12-06 13:38:36 +01:00
|
|
|
#if defined(WITH_TESTS)
|
2017-03-18 23:23:45 +02:00
|
|
|
private slots:
|
2013-12-06 13:38:36 +01:00
|
|
|
void testVcsManager_data();
|
|
|
|
|
void testVcsManager();
|
2015-12-11 12:07:52 +01:00
|
|
|
void testSplitLineAndColumnNumber();
|
|
|
|
|
void testSplitLineAndColumnNumber_data();
|
2014-02-14 16:30:21 +01:00
|
|
|
// Locator:
|
|
|
|
|
void test_basefilefilter();
|
|
|
|
|
void test_basefilefilter_data();
|
2020-03-19 16:00:37 +01:00
|
|
|
|
|
|
|
|
void testOutputFormatter();
|
2013-12-06 13:38:36 +01:00
|
|
|
#endif
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2015-08-03 12:44:48 +02:00
|
|
|
static void addToPathChooserContextMenu(Utils::PathChooser *pathChooser, QMenu *menu);
|
2019-07-08 17:38:28 +02:00
|
|
|
void checkSettings();
|
2009-11-25 18:44:54 +01:00
|
|
|
|
2018-07-21 21:11:46 +02:00
|
|
|
MainWindow *m_mainWindow = nullptr;
|
|
|
|
|
EditMode *m_editMode = nullptr;
|
|
|
|
|
Locator *m_locator = nullptr;
|
2020-09-11 12:08:49 +02:00
|
|
|
ProcessReapers m_reaper;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Core
|