forked from qt-creator/qt-creator
Macros: Remove export macros and move code into Internal namespace
Change-Id: I2f5aa2b15235dfa7f3f002703771dd902d67199e Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
This commit is contained in:
@@ -222,7 +222,7 @@ void FindMacroHandler::changeEditor(Core::IEditor *editor)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindMacroHandler::startRecording(Macros::Macro* macro)
|
void FindMacroHandler::startRecording(Macro* macro)
|
||||||
{
|
{
|
||||||
IMacroHandler::startRecording(macro);
|
IMacroHandler::startRecording(macro);
|
||||||
Core::IEditor *current = Core::EditorManager::currentEditor();
|
Core::IEditor *current = Core::EditorManager::currentEditor();
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ class FindMacroHandler : public IMacroHandler
|
|||||||
public:
|
public:
|
||||||
FindMacroHandler();
|
FindMacroHandler();
|
||||||
|
|
||||||
void startRecording(Macros::Macro* macro);
|
void startRecording(Macro* macro);
|
||||||
|
|
||||||
bool canExecuteEvent(const Macros::MacroEvent ¯oEvent);
|
bool canExecuteEvent(const MacroEvent ¯oEvent);
|
||||||
bool executeEvent(const Macros::MacroEvent ¯oEvent);
|
bool executeEvent(const MacroEvent ¯oEvent);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void findIncremental(const QString &txt, Find::FindFlags findFlags);
|
void findIncremental(const QString &txt, Find::FindFlags findFlags);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
|
|
||||||
using namespace Macros;
|
using namespace Macros::Internal;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Macro::IEventHandler
|
\class Macro::IEventHandler
|
||||||
|
|||||||
@@ -30,16 +30,16 @@
|
|||||||
#ifndef MACROSPLUGIN_IMACROHANDLER_H
|
#ifndef MACROSPLUGIN_IMACROHANDLER_H
|
||||||
#define MACROSPLUGIN_IMACROHANDLER_H
|
#define MACROSPLUGIN_IMACROHANDLER_H
|
||||||
|
|
||||||
#include "macros_global.h"
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
namespace Macros {
|
namespace Macros {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
class Macro;
|
class Macro;
|
||||||
class MacroEvent;
|
class MacroEvent;
|
||||||
class MacroManager;
|
class MacroManager;
|
||||||
|
|
||||||
class MACROS_EXPORT IMacroHandler: public QObject
|
class IMacroHandler: public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IMacroHandler();
|
IMacroHandler();
|
||||||
@@ -65,6 +65,7 @@ private:
|
|||||||
IMacroHandlerPrivate *d;
|
IMacroHandlerPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
} // namespace Macros
|
} // namespace Macros
|
||||||
|
|
||||||
#endif // MACROSPLUGIN_IMACROHANDLER_H
|
#endif // MACROSPLUGIN_IMACROHANDLER_H
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
|
|
||||||
using namespace Macros;
|
using namespace Macros::Internal;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Macros::Macro
|
\class Macros::Macro
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
#ifndef MACROSPLUGIN_MACRO_H
|
#ifndef MACROSPLUGIN_MACRO_H
|
||||||
#define MACROSPLUGIN_MACRO_H
|
#define MACROSPLUGIN_MACRO_H
|
||||||
|
|
||||||
#include "macros_global.h"
|
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
@@ -40,10 +38,11 @@ class QWidget;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Macros {
|
namespace Macros {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
class MacroEvent;
|
class MacroEvent;
|
||||||
|
|
||||||
class MACROS_EXPORT Macro
|
class Macro
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Macro();
|
Macro();
|
||||||
@@ -72,6 +71,7 @@ private:
|
|||||||
MacroPrivate* d;
|
MacroPrivate* d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
} // namespace Macros
|
} // namespace Macros
|
||||||
|
|
||||||
#endif // MACROSPLUGIN_MACRO_H
|
#endif // MACROSPLUGIN_MACRO_H
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
|
|
||||||
using namespace Macros;
|
using namespace Macros::Internal;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Macros::MacroEvent
|
\class Macros::MacroEvent
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
#ifndef MACROSPLUGIN_MACROEVENT_H
|
#ifndef MACROSPLUGIN_MACROEVENT_H
|
||||||
#define MACROSPLUGIN_MACROEVENT_H
|
#define MACROSPLUGIN_MACROEVENT_H
|
||||||
|
|
||||||
#include "macros_global.h"
|
|
||||||
|
|
||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
@@ -43,8 +41,9 @@ class QDataStream;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Macros {
|
namespace Macros {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
class MACROS_EXPORT MacroEvent
|
class MacroEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MacroEvent();
|
MacroEvent();
|
||||||
@@ -66,6 +65,7 @@ private:
|
|||||||
MacroEventPrivate* d;
|
MacroEventPrivate* d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
} // namespace Macros
|
} // namespace Macros
|
||||||
|
|
||||||
#endif // MACROSPLUGIN_MACROEVENT_H
|
#endif // MACROSPLUGIN_MACROEVENT_H
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
using namespace Macros;
|
|
||||||
using namespace Macros::Internal;
|
using namespace Macros::Internal;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -94,7 +93,7 @@ using namespace Macros::Internal;
|
|||||||
the action id passed to the ActionManager.
|
the action id passed to the ActionManager.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Macros::MacroManager::MacroManagerPrivate
|
class MacroManager::MacroManagerPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MacroManagerPrivate(MacroManager *qq);
|
MacroManagerPrivate(MacroManager *qq);
|
||||||
@@ -157,7 +156,7 @@ void MacroManager::MacroManagerPrivate::initialize()
|
|||||||
|
|
||||||
static Core::Id makeId(const QString &name)
|
static Core::Id makeId(const QString &name)
|
||||||
{
|
{
|
||||||
return Core::Id(Constants::PREFIX_MACRO).withSuffix(name);
|
return Core::Id(Macros::Constants::PREFIX_MACRO).withSuffix(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroManager::MacroManagerPrivate::addMacro(Macro *macro)
|
void MacroManager::MacroManagerPrivate::addMacro(Macro *macro)
|
||||||
@@ -386,13 +385,13 @@ void MacroManager::changeMacro(const QString &name, const QString &description)
|
|||||||
d->changeMacroDescription(macro, description);
|
d->changeMacroDescription(macro, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Macros::MacroManager::saveLastMacro()
|
void MacroManager::saveLastMacro()
|
||||||
{
|
{
|
||||||
if (d->currentMacro->events().count())
|
if (d->currentMacro->events().count())
|
||||||
d->showSaveDialog();
|
d->showSaveDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Macros::MacroManager::macrosDirectory()
|
QString MacroManager::macrosDirectory()
|
||||||
{
|
{
|
||||||
const QString &path =
|
const QString &path =
|
||||||
Core::ICore::userResourcePath() + QLatin1String("/macros");
|
Core::ICore::userResourcePath() + QLatin1String("/macros");
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
#ifndef MACROSPLUGIN_MACROMANAGER_H
|
#ifndef MACROSPLUGIN_MACROMANAGER_H
|
||||||
#define MACROSPLUGIN_MACROMANAGER_H
|
#define MACROSPLUGIN_MACROMANAGER_H
|
||||||
|
|
||||||
#include "macros_global.h"
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
@@ -40,16 +38,14 @@ class QAction;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Macros {
|
namespace Macros {
|
||||||
|
|
||||||
class Macro;
|
|
||||||
class IMacroHandler;
|
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class IMacroHandler;
|
||||||
|
class Macro;
|
||||||
class MacroOptionsWidget;
|
class MacroOptionsWidget;
|
||||||
class MacrosPlugin;
|
class MacrosPlugin;
|
||||||
}
|
|
||||||
|
|
||||||
class MACROS_EXPORT MacroManager : public QObject
|
class MacroManager : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@@ -86,6 +82,7 @@ private:
|
|||||||
friend class Internal::MacrosPlugin;
|
friend class Internal::MacrosPlugin;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
} // namespace Macros
|
} // namespace Macros
|
||||||
|
|
||||||
#endif // MACROSPLUGIN_MACROMANAGER_H
|
#endif // MACROSPLUGIN_MACROMANAGER_H
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
#ifndef MACROSPLUGIN_MACROOPTIONSPAGE_H
|
#ifndef MACROSPLUGIN_MACROOPTIONSPAGE_H
|
||||||
#define MACROSPLUGIN_MACROOPTIONSPAGE_H
|
#define MACROSPLUGIN_MACROOPTIONSPAGE_H
|
||||||
|
|
||||||
#include "macros_global.h"
|
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
namespace Macros {
|
namespace Macros {
|
||||||
@@ -39,7 +37,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class MacroOptionsWidget;
|
class MacroOptionsWidget;
|
||||||
|
|
||||||
class MACROS_EXPORT MacroOptionsPage : public Core::IOptionsPage
|
class MacroOptionsPage : public Core::IOptionsPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ DEFINES += MACROS_LIBRARY
|
|||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
|
|
||||||
HEADERS += macrosplugin.h \
|
HEADERS += macrosplugin.h \
|
||||||
macros_global.h \
|
|
||||||
macrosconstants.h \
|
macrosconstants.h \
|
||||||
macro.h \
|
macro.h \
|
||||||
macroevent.h \
|
macroevent.h \
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ QtcPlugin {
|
|||||||
"macrooptionswidget.h",
|
"macrooptionswidget.h",
|
||||||
"macrooptionswidget.ui",
|
"macrooptionswidget.ui",
|
||||||
"macros.qrc",
|
"macros.qrc",
|
||||||
"macros_global.h",
|
|
||||||
"macrosconstants.h",
|
"macrosconstants.h",
|
||||||
"macrosplugin.cpp",
|
"macrosplugin.cpp",
|
||||||
"macrosplugin.h",
|
"macrosplugin.h",
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (c) 2013 Nicolas Arnaud-Cormos
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** 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
|
|
||||||
** a written agreement between you and Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef MACROSPLUGIN_MACROS_GLOBAL_H
|
|
||||||
#define MACROSPLUGIN_MACROS_GLOBAL_H
|
|
||||||
|
|
||||||
#include <qglobal.h>
|
|
||||||
|
|
||||||
#if defined(MACROS_LIBRARY)
|
|
||||||
# define MACROS_EXPORT Q_DECL_EXPORT
|
|
||||||
#else
|
|
||||||
# define MACROS_EXPORT Q_DECL_IMPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // MACROSPLUGIN_MACROS_GLOBAL_H
|
|
||||||
@@ -50,7 +50,6 @@
|
|||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
using namespace Macros;
|
|
||||||
using namespace Macros::Internal;
|
using namespace Macros::Internal;
|
||||||
|
|
||||||
MacrosPlugin::MacrosPlugin()
|
MacrosPlugin::MacrosPlugin()
|
||||||
|
|||||||
@@ -33,11 +33,10 @@
|
|||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
namespace Macros {
|
namespace Macros {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
class MacroManager;
|
class MacroManager;
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class MacrosPlugin : public ExtensionSystem::IPlugin
|
class MacrosPlugin : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ TextEditorMacroHandler::TextEditorMacroHandler():
|
|||||||
this, SLOT(closeEditor(Core::IEditor*)));
|
this, SLOT(closeEditor(Core::IEditor*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorMacroHandler::startRecording(Macros::Macro *macro)
|
void TextEditorMacroHandler::startRecording(Macro *macro)
|
||||||
{
|
{
|
||||||
IMacroHandler::startRecording(macro);
|
IMacroHandler::startRecording(macro);
|
||||||
if (isRecording() && m_currentEditor && m_currentEditor->widget())
|
if (isRecording() && m_currentEditor && m_currentEditor->widget())
|
||||||
@@ -78,7 +78,7 @@ void TextEditorMacroHandler::startRecording(Macros::Macro *macro)
|
|||||||
Core::ActionManager::command(TextEditor::Constants::COMPLETE_THIS)->shortcut()->blockSignals(true);
|
Core::ActionManager::command(TextEditor::Constants::COMPLETE_THIS)->shortcut()->blockSignals(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorMacroHandler::endRecordingMacro(Macros::Macro *macro)
|
void TextEditorMacroHandler::endRecordingMacro(Macro *macro)
|
||||||
{
|
{
|
||||||
if (m_currentEditor && m_currentEditor->widget())
|
if (m_currentEditor && m_currentEditor->widget())
|
||||||
m_currentEditor->widget()->removeEventFilter(this);
|
m_currentEditor->widget()->removeEventFilter(this);
|
||||||
|
|||||||
@@ -43,18 +43,18 @@ class ITextEditor;
|
|||||||
namespace Macros {
|
namespace Macros {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class TextEditorMacroHandler : public Macros::IMacroHandler
|
class TextEditorMacroHandler : public IMacroHandler
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TextEditorMacroHandler();
|
TextEditorMacroHandler();
|
||||||
|
|
||||||
void startRecording(Macros::Macro *macro);
|
void startRecording(Macro *macro);
|
||||||
void endRecordingMacro(Macros::Macro *macro);
|
void endRecordingMacro(Macro *macro);
|
||||||
|
|
||||||
bool canExecuteEvent(const Macros::MacroEvent ¯oEvent);
|
bool canExecuteEvent(const MacroEvent ¯oEvent);
|
||||||
bool executeEvent(const Macros::MacroEvent ¯oEvent);
|
bool executeEvent(const MacroEvent ¯oEvent);
|
||||||
|
|
||||||
bool eventFilter(QObject *watched, QEvent *event);
|
bool eventFilter(QObject *watched, QEvent *event);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user