diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-03-27 21:08:38 -0400 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-03-27 21:08:38 -0400 |
| commit | 097c3cc9826acc75b78c9b4bb602f257738329c9 (patch) | |
| tree | 9b03821666ece71778175a44a220a7ece37d8f3a /sigencore | |
| parent | 78ce199b896f08e94327ae95627d6b705faadeec (diff) | |
| download | sigen-097c3cc9826acc75b78c9b4bb602f257738329c9.tar.gz sigen-097c3cc9826acc75b78c9b4bb602f257738329c9.tar.xz sigen-097c3cc9826acc75b78c9b4bb602f257738329c9.zip | |
Add the start of QGSScene
Diffstat (limited to 'sigencore')
| -rw-r--r-- | sigencore/plugins/canvases/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | sigencore/plugins/canvases/qgraphicsscene/QGSCanvas.cpp | 73 | ||||
| -rw-r--r-- | sigencore/plugins/canvases/qgraphicsscene/QGSCanvas.h | 54 |
3 files changed, 128 insertions, 0 deletions
diff --git a/sigencore/plugins/canvases/CMakeLists.txt b/sigencore/plugins/canvases/CMakeLists.txt index f8fe96ec..ad635aaf 100644 --- a/sigencore/plugins/canvases/CMakeLists.txt +++ b/sigencore/plugins/canvases/CMakeLists.txt @@ -2,6 +2,7 @@ project(sigencanvases) set(sigencanvases_SRCS SigenCanvases.cpp + qgraphicsscene/QGSCanvas.cpp ) set(sigencanvases_SERVICES sigen_canvases.desktop diff --git a/sigencore/plugins/canvases/qgraphicsscene/QGSCanvas.cpp b/sigencore/plugins/canvases/qgraphicsscene/QGSCanvas.cpp new file mode 100644 index 00000000..364bbf6b --- /dev/null +++ b/sigencore/plugins/canvases/qgraphicsscene/QGSCanvas.cpp @@ -0,0 +1,73 @@ +/* + * Copyright 2009 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +// Header include +#include "QGSCanvas.h" + +// KDE includes +#include <KIcon> + +using namespace Sigscript; + +QGSCanvas::QGSCanvas(GameWrapper* game, Config* parent) : + Canvas(parent), + m_game(game) +{ +} + +QGSCanvas::~QGSCanvas() +{ +} + +QString QGSCanvas::name() +{ + return "QGraphicsScene canvas"; +} + +QString QGSCanvas::description() +{ + return "A canvas using QGraphicsScene"; +} + +QIcon QGSCanvas::icon() +{ + return KIcon(); +} + +void QGSCanvas::runScript(const QString& name, const QVariantList& parameters) +{ +} + +void QGSCanvas::addSprite(const QString& name, const QString& sprite, const int x, const int y, const bool collidable) +{ +} + +void QGSCanvas::removeSprite(const QString& name) +{ +} + +void QGSCanvas::transform(const QString& transform, const QString& object, const QVariantList& parameters) +{ +} + +int QGSCanvas::type() const +{ +} + +QWidget* QGSCanvas::widget() +{ +} diff --git a/sigencore/plugins/canvases/qgraphicsscene/QGSCanvas.h b/sigencore/plugins/canvases/qgraphicsscene/QGSCanvas.h new file mode 100644 index 00000000..0aa68fe6 --- /dev/null +++ b/sigencore/plugins/canvases/qgraphicsscene/QGSCanvas.h @@ -0,0 +1,54 @@ +/* + * Copyright 2009 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef SIGENCANVASES_QGSCANVAS +#define SIGENCANVASES_QGSCANVAS + +// Sigencore includes +#include <sigencore/Canvas.h> + +// Forward declarations +namespace Sigscript +{ +class GameWrapper; +} + +class QGSCanvas : public Sigencore::Canvas +{ + Q_OBJECT + + public: + QGSCanvas(Sigscript::GameWrapper* game, Sigscript::Config* parent); + ~QGSCanvas(); + + static QString name(); + static QString description(); + static QIcon icon(); + + Q_SCRIPTABLE void runScript(const QString& name, const QVariantList& parameters); + Q_SCRIPTABLE void addSprite(const QString& name, const QString& sprite, const int x, const int y, const bool collidable); + Q_SCRIPTABLE void removeSprite(const QString& name); + Q_SCRIPTABLE void transform(const QString& transform, const QString& object, const QVariantList& parameters); + + int type() const; + + QWidget* widget(); + private: + Sigscript::GameWrapper* m_game; +}; + +#endif |
