Changed: #1206 Update core and example plugin.
parent
8665899abf
commit
9937f56978
@ -0,0 +1,66 @@
|
||||
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||
// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "core.h"
|
||||
#include "imenu_manager.h"
|
||||
#include "main_window.h"
|
||||
|
||||
static Core::CoreImpl *m_coreInstance = 0;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
|
||||
ICore *ICore::instance()
|
||||
{
|
||||
return m_coreInstance;
|
||||
}
|
||||
|
||||
CoreImpl::CoreImpl(MainWindow *mainWindow)
|
||||
{
|
||||
m_mainWindow = mainWindow;
|
||||
m_coreInstance = this;
|
||||
}
|
||||
|
||||
CoreImpl::~CoreImpl()
|
||||
{
|
||||
m_coreInstance = 0;
|
||||
}
|
||||
|
||||
bool CoreImpl::showOptionsDialog(const QString &group,
|
||||
const QString &page,
|
||||
QWidget *parent)
|
||||
{
|
||||
return m_mainWindow->showOptionsDialog(group, page, parent);
|
||||
}
|
||||
|
||||
IMenuManager *CoreImpl::menuManager() const
|
||||
{
|
||||
return m_mainWindow->menuManager();
|
||||
}
|
||||
|
||||
QSettings *CoreImpl::settings() const
|
||||
{
|
||||
return m_mainWindow->settings();
|
||||
}
|
||||
|
||||
QMainWindow *CoreImpl::mainWindow() const
|
||||
{
|
||||
return m_mainWindow;
|
||||
}
|
||||
|
||||
} // namespace Core
|
@ -0,0 +1,52 @@
|
||||
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||
// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef CORE_H
|
||||
#define CORE_H
|
||||
|
||||
#include "icore.h"
|
||||
|
||||
namespace Core
|
||||
{
|
||||
class MainWindow;
|
||||
|
||||
class CoreImpl : public ICore
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CoreImpl(MainWindow *mainWindow);
|
||||
virtual ~CoreImpl();
|
||||
|
||||
virtual bool showOptionsDialog(const QString &group = QString(),
|
||||
const QString &page = QString(),
|
||||
QWidget *parent = 0);
|
||||
|
||||
virtual IMenuManager *menuManager() const;
|
||||
|
||||
virtual QSettings *settings() const;
|
||||
virtual QMainWindow *mainWindow() const;
|
||||
|
||||
private:
|
||||
MainWindow *m_mainWindow;
|
||||
friend class MainWindow;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
#endif // CORE_H
|
@ -0,0 +1,60 @@
|
||||
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||
// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef ICORE_H
|
||||
#define ICORE_H
|
||||
|
||||
#include "core_global.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QMainWindow;
|
||||
class QSettings;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core
|
||||
{
|
||||
class IMenuManager;
|
||||
|
||||
class CORE_EXPORT ICore : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ICore() {}
|
||||
virtual ~ICore() {}
|
||||
|
||||
static ICore *instance();
|
||||
|
||||
virtual bool showOptionsDialog(const QString &group = QString(),
|
||||
const QString &page = QString(),
|
||||
QWidget *parent = 0) = 0;
|
||||
|
||||
virtual IMenuManager *menuManager() const = 0;
|
||||
|
||||
virtual QSettings *settings() const = 0;
|
||||
virtual QMainWindow *mainWindow() const = 0;
|
||||
|
||||
Q_SIGNALS:
|
||||
void closeMainWindow();
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
#endif // ICORE_H
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue