Commit b88d3168 authored by Adam Celarek's avatar Adam Celarek

add a template for new docker plugins. it contains only the "plugin

starter" and dockerwidget class

svn path=/branches/work/koffice-essen/; revision=1176553
parent 70a17b05
set(KRITA_PRESETDOCKER_PART_SRCS presetdocker.cpp presetdocker_dock.cpp )
kde4_add_plugin(kritapresetdocker ${KRITA_PRESETDOCKER_PART_SRCS})
target_link_libraries(kritapresetdocker kritaui)
install(TARGETS kritapresetdocker DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
install( FILES krita_presetdocker.desktop DESTINATION ${SERVICES_INSTALL_DIR})
[Desktop Entry]
Name=Preset Docker
Comment=Docker for selecting presets
X-KDE-ServiceTypes=Krita/Dock
Type=Service
X-KDE-Library=kritapresetdocker
X-Krita-Version=3
/*
* Copyright (c) 2009 Cyrille Berger <cberger@cberger.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* 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 Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "presetdocker.h"
#include <stdlib.h>
#include <QTimer>
#include <kactioncollection.h>
#include <kcomponentdata.h>
#include <kis_debug.h>
#include <kpluginfactory.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <KoDockFactoryBase.h>
#include "kis_config.h"
#include "kis_cursor.h"
#include "kis_global.h"
#include "kis_types.h"
#include "kis_view2.h"
#include "presetdocker_dock.h"
#include <KoDockRegistry.h>
K_PLUGIN_FACTORY(PresetDockerPluginFactory, registerPlugin<PresetDockerPlugin>();)
K_EXPORT_PLUGIN(PresetDockerPluginFactory( "krita" ) )
class PresetDockerDockFactory : public KoDockFactoryBase {
public:
PresetDockerDockFactory()
{
}
virtual QString id() const
{
return QString( "PresetDocker" );
}
virtual Qt::DockWidgetArea defaultDockWidgetArea() const
{
return Qt::RightDockWidgetArea;
}
virtual QDockWidget* createDockWidget()
{
PresetDockerDock * dockWidget = new PresetDockerDock();
dockWidget->setObjectName(id());
return dockWidget;
}
DockPosition defaultDockPosition() const
{
return DockMinimized;
}
private:
};
PresetDockerPlugin::PresetDockerPlugin(QObject *parent, const QVariantList &)
: QObject(parent)
{
KoDockRegistry::instance()->add(new PresetDockerDockFactory());
}
PresetDockerPlugin::~PresetDockerPlugin()
{
m_view = 0;
}
#include "presetdocker.moc"
/*
* Copyright (c) 2009 Cyrille Berger <cberger@cberger.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* 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 Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _DIGITALMIXER_H_
#define _DIGITALMIXER_H_
#include <QObject>
#include <QVariant>
class KisView2;
/**
* Template of view plugin
*/
class PresetDockerPlugin : public QObject
{
Q_OBJECT
public:
PresetDockerPlugin(QObject *parent, const QVariantList &);
virtual ~PresetDockerPlugin();
private:
KisView2* m_view;
};
#endif
/*
* Copyright (c) 2009 Cyrille Berger <cberger@cberger.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* 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 Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "presetdocker_dock.h"
#include <QGridLayout>
#include <klocale.h>
#include <KoResourceManager.h>
#include <KoCanvasBase.h>
PresetDockerDock::PresetDockerDock( ) : QDockWidget(i18n("Preset docker")), m_canvas(0)
{
setWidget(new QWidget(this));
}
void PresetDockerDock::setCanvas(KoCanvasBase * canvas)
{
m_canvas = canvas;
connect(m_canvas->resourceManager(), SIGNAL(resourceChanged(int, const QVariant&)),
this, SLOT(resourceChanged(int, const QVariant&)));
}
void PresetDockerDock::resourceChanged(int key, const QVariant& v)
{
}
#include "presetdocker_dock.moc"
/*
* Copyright (c) 2009 Cyrille Berger <cberger@cberger.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* 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 Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _DIGITALMIXER_DOCK_H_
#define _DIGITALMIXER_DOCK_H_
#include <QDockWidget>
#include <KoColor.h>
#include <KoCanvasObserverBase.h>
class KoColorPopupAction;
class KoColorSlider;
class KoColorPatch;
class KisView2;
class PresetDockerDock : public QDockWidget, public KoCanvasObserverBase {
Q_OBJECT
public:
PresetDockerDock( );
virtual void setCanvas(KoCanvasBase *canvas);
public slots:
void resourceChanged(int, const QVariant&);
private slots:
private:
KoCanvasBase* m_canvas;
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment