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);
|
||||
Core::IEditor *current = Core::EditorManager::currentEditor();
|
||||
|
||||
@@ -48,10 +48,10 @@ class FindMacroHandler : public IMacroHandler
|
||||
public:
|
||||
FindMacroHandler();
|
||||
|
||||
void startRecording(Macros::Macro* macro);
|
||||
void startRecording(Macro* macro);
|
||||
|
||||
bool canExecuteEvent(const Macros::MacroEvent ¯oEvent);
|
||||
bool executeEvent(const Macros::MacroEvent ¯oEvent);
|
||||
bool canExecuteEvent(const MacroEvent ¯oEvent);
|
||||
bool executeEvent(const MacroEvent ¯oEvent);
|
||||
|
||||
public slots:
|
||||
void findIncremental(const QString &txt, Find::FindFlags findFlags);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
using namespace Macros;
|
||||
using namespace Macros::Internal;
|
||||
|
||||
/*!
|
||||
\class Macro::IEventHandler
|
||||
|
||||
@@ -30,16 +30,16 @@
|
||||
#ifndef MACROSPLUGIN_IMACROHANDLER_H
|
||||
#define MACROSPLUGIN_IMACROHANDLER_H
|
||||
|
||||
#include "macros_global.h"
|
||||
#include <QObject>
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
|
||||
class Macro;
|
||||
class MacroEvent;
|
||||
class MacroManager;
|
||||
|
||||
class MACROS_EXPORT IMacroHandler: public QObject
|
||||
class IMacroHandler: public QObject
|
||||
{
|
||||
public:
|
||||
IMacroHandler();
|
||||
@@ -65,6 +65,7 @@ private:
|
||||
IMacroHandlerPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
|
||||
#endif // MACROSPLUGIN_IMACROHANDLER_H
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QDataStream>
|
||||
|
||||
using namespace Macros;
|
||||
using namespace Macros::Internal;
|
||||
|
||||
/*!
|
||||
\class Macros::Macro
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#ifndef MACROSPLUGIN_MACRO_H
|
||||
#define MACROSPLUGIN_MACRO_H
|
||||
|
||||
#include "macros_global.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
@@ -40,10 +38,11 @@ class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
|
||||
class MacroEvent;
|
||||
|
||||
class MACROS_EXPORT Macro
|
||||
class Macro
|
||||
{
|
||||
public:
|
||||
Macro();
|
||||
@@ -72,6 +71,7 @@ private:
|
||||
MacroPrivate* d;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
|
||||
#endif // MACROSPLUGIN_MACRO_H
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <QVariant>
|
||||
#include <QDataStream>
|
||||
|
||||
using namespace Macros;
|
||||
using namespace Macros::Internal;
|
||||
|
||||
/*!
|
||||
\class Macros::MacroEvent
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#ifndef MACROSPLUGIN_MACROEVENT_H
|
||||
#define MACROSPLUGIN_MACROEVENT_H
|
||||
|
||||
#include "macros_global.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
|
||||
#include <QMap>
|
||||
@@ -43,8 +41,9 @@ class QDataStream;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
|
||||
class MACROS_EXPORT MacroEvent
|
||||
class MacroEvent
|
||||
{
|
||||
public:
|
||||
MacroEvent();
|
||||
@@ -66,6 +65,7 @@ private:
|
||||
MacroEventPrivate* d;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
|
||||
#endif // MACROSPLUGIN_MACROEVENT_H
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
using namespace Macros;
|
||||
using namespace Macros::Internal;
|
||||
|
||||
/*!
|
||||
@@ -94,7 +93,7 @@ using namespace Macros::Internal;
|
||||
the action id passed to the ActionManager.
|
||||
*/
|
||||
|
||||
class Macros::MacroManager::MacroManagerPrivate
|
||||
class MacroManager::MacroManagerPrivate
|
||||
{
|
||||
public:
|
||||
MacroManagerPrivate(MacroManager *qq);
|
||||
@@ -157,7 +156,7 @@ void MacroManager::MacroManagerPrivate::initialize()
|
||||
|
||||
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)
|
||||
@@ -386,13 +385,13 @@ void MacroManager::changeMacro(const QString &name, const QString &description)
|
||||
d->changeMacroDescription(macro, description);
|
||||
}
|
||||
|
||||
void Macros::MacroManager::saveLastMacro()
|
||||
void MacroManager::saveLastMacro()
|
||||
{
|
||||
if (d->currentMacro->events().count())
|
||||
d->showSaveDialog();
|
||||
}
|
||||
|
||||
QString Macros::MacroManager::macrosDirectory()
|
||||
QString MacroManager::macrosDirectory()
|
||||
{
|
||||
const QString &path =
|
||||
Core::ICore::userResourcePath() + QLatin1String("/macros");
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#ifndef MACROSPLUGIN_MACROMANAGER_H
|
||||
#define MACROSPLUGIN_MACROMANAGER_H
|
||||
|
||||
#include "macros_global.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QMap>
|
||||
|
||||
@@ -40,16 +38,14 @@ class QAction;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Macros {
|
||||
|
||||
class Macro;
|
||||
class IMacroHandler;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class IMacroHandler;
|
||||
class Macro;
|
||||
class MacroOptionsWidget;
|
||||
class MacrosPlugin;
|
||||
}
|
||||
|
||||
class MACROS_EXPORT MacroManager : public QObject
|
||||
class MacroManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -86,6 +82,7 @@ private:
|
||||
friend class Internal::MacrosPlugin;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
|
||||
#endif // MACROSPLUGIN_MACROMANAGER_H
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#ifndef MACROSPLUGIN_MACROOPTIONSPAGE_H
|
||||
#define MACROSPLUGIN_MACROOPTIONSPAGE_H
|
||||
|
||||
#include "macros_global.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
namespace Macros {
|
||||
@@ -39,7 +37,7 @@ namespace Internal {
|
||||
|
||||
class MacroOptionsWidget;
|
||||
|
||||
class MACROS_EXPORT MacroOptionsPage : public Core::IOptionsPage
|
||||
class MacroOptionsPage : public Core::IOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ DEFINES += MACROS_LIBRARY
|
||||
include(../../qtcreatorplugin.pri)
|
||||
|
||||
HEADERS += macrosplugin.h \
|
||||
macros_global.h \
|
||||
macrosconstants.h \
|
||||
macro.h \
|
||||
macroevent.h \
|
||||
|
||||
@@ -33,7 +33,6 @@ QtcPlugin {
|
||||
"macrooptionswidget.h",
|
||||
"macrooptionswidget.ui",
|
||||
"macros.qrc",
|
||||
"macros_global.h",
|
||||
"macrosconstants.h",
|
||||
"macrosplugin.cpp",
|
||||
"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 <QMenu>
|
||||
|
||||
using namespace Macros;
|
||||
using namespace Macros::Internal;
|
||||
|
||||
MacrosPlugin::MacrosPlugin()
|
||||
|
||||
@@ -33,11 +33,10 @@
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
|
||||
class MacroManager;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class MacrosPlugin : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -68,7 +68,7 @@ TextEditorMacroHandler::TextEditorMacroHandler():
|
||||
this, SLOT(closeEditor(Core::IEditor*)));
|
||||
}
|
||||
|
||||
void TextEditorMacroHandler::startRecording(Macros::Macro *macro)
|
||||
void TextEditorMacroHandler::startRecording(Macro *macro)
|
||||
{
|
||||
IMacroHandler::startRecording(macro);
|
||||
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);
|
||||
}
|
||||
|
||||
void TextEditorMacroHandler::endRecordingMacro(Macros::Macro *macro)
|
||||
void TextEditorMacroHandler::endRecordingMacro(Macro *macro)
|
||||
{
|
||||
if (m_currentEditor && m_currentEditor->widget())
|
||||
m_currentEditor->widget()->removeEventFilter(this);
|
||||
|
||||
@@ -43,18 +43,18 @@ class ITextEditor;
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
|
||||
class TextEditorMacroHandler : public Macros::IMacroHandler
|
||||
class TextEditorMacroHandler : public IMacroHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TextEditorMacroHandler();
|
||||
|
||||
void startRecording(Macros::Macro *macro);
|
||||
void endRecordingMacro(Macros::Macro *macro);
|
||||
void startRecording(Macro *macro);
|
||||
void endRecordingMacro(Macro *macro);
|
||||
|
||||
bool canExecuteEvent(const Macros::MacroEvent ¯oEvent);
|
||||
bool executeEvent(const Macros::MacroEvent ¯oEvent);
|
||||
bool canExecuteEvent(const MacroEvent ¯oEvent);
|
||||
bool executeEvent(const MacroEvent ¯oEvent);
|
||||
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user